Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
trx-ecpri
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
trx-ecpri
Commits
ada02d83
Commit
ada02d83
authored
Mar 07, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiple bugs with amarisoft integration
parent
8c9fa1b5
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
851 additions
and
123 deletions
+851
-123
ecpri-tests/test-dpdk-ecpri.c
ecpri-tests/test-dpdk-ecpri.c
+69
-55
ecpri-tests/test.sh
ecpri-tests/test.sh
+5
-4
enb.cfg
enb.cfg
+620
-0
launch-phc2sys
launch-phc2sys
+5
-1
launch-ptp
launch-ptp
+3
-0
trx_ecpri_dpdk.c
trx_ecpri_dpdk.c
+149
-63
No files found.
ecpri-tests/test-dpdk-ecpri.c
View file @
ada02d83
...
...
@@ -31,12 +31,15 @@
#include <time.h>
#include <unistd.h>
#include "trx_driver.h"
typedef
struct
{
const
char
*
re_mac
;
const
char
*
rec_mac
;
const
char
*
rec_if
;
const
char
*
dpdk_options
;
const
char
*
trace_file
;
const
char
*
stats_file
;
int
recv_affinity
;
int
send_affinity
;
int
prepare_affinity
;
...
...
@@ -47,6 +50,7 @@ typedef struct {
int
sample_rate
;
int
trace_period
;
}
TRXEcpriState
;
static
void
log_error
(
const
char
*
section
,
const
char
*
msg
,
...)
{
time_t
t
;
struct
tm
ts
;
...
...
@@ -79,7 +83,37 @@ static void log_info(const char * section, const char * msg, ...) {
va_end
(
arglist
);
puts
(
line
);
}
int
startdpdk
(
TRXEcpriState
*
s
);
// Timestamps utils
#define NSEC_PER_SEC INT64_C(1000000000)
static
struct
timespec
int_to_ts
(
int64_t
t
)
{
struct
timespec
ts
;
ts
.
tv_sec
=
t
/
NSEC_PER_SEC
;
ts
.
tv_nsec
=
t
-
(
ts
.
tv_sec
*
NSEC_PER_SEC
);
return
ts
;
}
static
int64_t
ts_to_int
(
struct
timespec
ts
)
{
return
ts
.
tv_sec
*
NSEC_PER_SEC
+
ts
.
tv_nsec
;
}
static
void
add_ns
(
struct
timespec
*
t
,
int64_t
ns
)
{
t
->
tv_nsec
+=
ns
;
while
(
t
->
tv_nsec
>=
((
int64_t
)
NSEC_PER_SEC
))
{
t
->
tv_sec
+=
1
;
t
->
tv_nsec
-=
NSEC_PER_SEC
;
}
}
static
int64_t
calcdiff_ns
(
struct
timespec
t1
,
struct
timespec
t2
)
{
int64_t
diff
;
diff
=
NSEC_PER_SEC
*
((
int
)
t1
.
tv_sec
-
(
int
)
t2
.
tv_sec
);
diff
+=
((
int
)
t1
.
tv_nsec
-
(
int
)
t2
.
tv_nsec
);
return
diff
;
}
TRXState
s1
;
float
**
tx_samples
;
float
**
rx_samples
;
void
dummy_enb_init
(
TRXState
*
s1
,
TRXEcpriState
*
s
);
static
void
enb
(
TRXState
*
s1
,
TRXEcpriState
*
s
);
int
main
(
int
argc
,
char
*
argv
[])
{
(
void
)
argc
;
...
...
@@ -95,59 +129,11 @@ int main(int argc, char * argv[]) {
s
=
malloc
(
sizeof
(
TRXEcpriState
));
memset
(
s
,
0
,
sizeof
(
*
s
));
#if 0
// tiogapass-003 MT27710
s->rec_mac = "b8:59:9f:07:7e:2a";
//s->re_mac = "04:09:a5:0f:9f:4c"; // Lille M6424 Switch
s->re_mac = "b8:59:9f:07:86:42"; // tiogapass-004 MT27710
//s->re_mac = "b4:96:91:a7:1c:f4"; // tiogapass-004 XXV710DA2T port0
s->rec_if = "ens9f0";
s->dpdk_options = "-l 10,20 -b 0000:04:00.0 -b 0000:5e:00.1 ";
#endif
#if 0
// tiogapass-003 MT27710 port1
s->rec_mac = "b8:59:9f:07:7e:2b";
s->re_mac = "04:09:a5:0f:9f:4c"; // Lille M6424 Switch
//s->re_mac = "b8:59:9f:07:86:42"; // tiogapass-004 MT27710
//s->re_mac = "b4:96:91:a7:1c:f5"; // tiogapass-004 XXV710DA2T port1
s->rec_if = "ens9f1";
s->dpdk_options = "-l 10,20 -b 0000:04:00.0 -b 0000:5e:00.0 ";
#endif
#if 0
// hfr-tiogapass-001 MT27710
s->rec_mac = "b8:59:9f:07:82:ca";
s->re_mac = "04:09:a5:0f:76:1c"; // HFR M6424 switch
s->rec_if = "ens9f0";
s->dpdk_options = "-l 10,20 -b 0000:04:00.0 -b 0000:18:00.0 -b 0000:18:00.1 -b 0000:5e:00.1 ";
#endif
#if 0
// hfr-tiogapass-001 XXV710DA2T
s->rec_mac = "b4:96:91:a7:1b:28";
s->re_mac = "04:09:a5:0f:76:1c"; // HFR M6424 switch
s->rec_if = "ens1f0";
s->dpdk_options = "-l 10,20 -b 0000:04:00.0 -b 0000:18:00.1 -b 0000:5e:00.0 -b 0000:5e:00.1 ";
#endif
#if 1
// tiogapass-004 MT27710
s
->
rec_mac
=
"b8:59:9f:07:86:42"
;
//s->re_mac = "04:09:a5:0f:9f:4c"; // Lille M6424 Switch
s
->
re_mac
=
"b8:59:9f:07:7e:2a"
;
// tiogapass-003 MT27710
s
->
rec_if
=
"ens9f0"
;
s
->
dpdk_options
=
"-l 10,20 -b 0000:04:00.0 -b 0000:3b:00.0 -b 0000:3b:00.1 -b 0000:5e:00.1 "
;
#endif
#if 0
// tiogapass-004 XXV710DA2T
s
->
rec_mac
=
"b4:96:91:a7:1c:f4"
;
s->re_mac = "04:09:a5:0f:9f:4c";
// Lille M6424 Switch
s->re_mac = "b8:59:9f:07:7e:2a";
// tiogapass-003 MT27710
s
->
re_mac
=
"04:09:a5:0f:9f:4c"
;
s
->
re_mac
=
"b8:59:9f:07:7e:2a"
;
s
->
rec_if
=
"ens5f0"
;
s
->
dpdk_options
=
"-l 10,20 -b 0000:04:00.0 -b 0000:3b:00.1 -b 0000:5e:00.0 -b 0000:5e:00.1 "
;
#endif
s
->
recv_affinity
=
39
;
s
->
send_affinity
=
38
;
...
...
@@ -158,17 +144,45 @@ int main(int argc, char * argv[]) {
s
->
flow_id
=
0
;
s
->
sample_rate
=
122880000
;
s
->
trace_file
=
"/root/ecpri_trace"
;
s
->
trace_file
=
"/root/ecpri-logs/rx.trace"
;
s
->
stats_file
=
"/root/ecpri-logs/ecpri.stats"
;
s
->
trace_period
=
1000000
;
log_info
(
"TEST-DPDK-ECPRI"
,
"Starting test...
\n
"
);
log_info
(
"TEST-DPDK-ECPRI"
,
"rec-mac: %s, re-mac: %s, rec-if: %s"
,
s
->
rec_mac
,
s
->
re_mac
,
s
->
rec_if
);
startdpdk
(
s
);
dummy_enb_init
(
&
s1
,
s
);
enb
(
&
s1
,
s
);
}
for
(;;)
{
sleep
(
1
);
static
void
enb
(
TRXState
*
s1
,
TRXEcpriState
*
s
)
{
struct
timespec
next
;
trx_timestamp_t
ptimestamp
;
int64_t
p
=
1000000
*
100
;
int
m
=
1
;
clock_gettime
(
CLOCK_TAI
,
&
next
);
tx_samples
=
(
float
**
)
malloc
(
sizeof
(
float
*
)
*
4
);
rx_samples
=
(
float
**
)
malloc
(
sizeof
(
float
*
)
*
4
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
tx_samples
[
i
]
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
65536
);
rx_samples
[
i
]
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
65536
);
for
(
int
j
=
0
;
j
<
65536
;
j
++
)
{
tx_samples
[
i
][
j
]
=
i
*
j
;
}
}
for
(
int
i
=
0
;;
i
++
)
{
int64_t
tx_timestamp
=
256
*
(
INT64_C
(
3840000
)
*
((
int64_t
)
p
*
i
+
p
))
/
(
INT64_C
(
1000000000
));
add_ns
(
&
next
,
p
);
s1
->
trx_read_func2
(
s1
,
&
ptimestamp
,
rx_samples
,
256
*
m
,
0
,
NULL
);
s1
->
trx_write_func2
(
s1
,
tx_timestamp
,
tx_samples
,
256
*
m
,
0
,
NULL
);
s1
->
trx_write_func2
(
s1
,
tx_timestamp
+
256
*
m
+
100
,
tx_samples
,
256
*
m
,
0
,
NULL
);
s1
->
trx_write_func2
(
s1
,
tx_timestamp
+
2
*
256
*
m
+
110
,
tx_samples
,
256
*
m
,
0
,
NULL
);
clock_nanosleep
(
CLOCK_TAI
,
TIMER_ABSTIME
,
&
next
,
NULL
);
}
}
ecpri-tests/test.sh
View file @
ada02d83
#!/bin/bash
cd
..
;
make
;
cd
ecpri-tests
;
make all
;
export
LD_LIBRARY_PATH
=
"/root/ecpri-priv:
$LD_LIBRARY_PATH
"
cd
..
&&
make
&&
cd
ecpri-tests
&&
make all
&&
./test-dpdk-ecpri
enb.cfg
0 → 100644
View file @
ada02d83
This diff is collapsed.
Click to expand it.
launch-phc2sys
View file @
ada02d83
chrt -f 97 taskset -c 39 phc2sys -m -c ens5f0 -s CLOCK_REALTIME -O0 -f $HOME/linuxptp/configs/G.8275.1.cfg
# Tiogapass004 test
#chrt -f 97 taskset -c 2 phc2sys -m -c ens9f1 -s CLOCK_REALTIME -O0 -f $HOME/linuxptp/configs/G.8275.1.cfg
#chrt -f 97 taskset -c 2 phc2sys -m -s ens9f1 -c CLOCK_REALTIME -O0 -f $HOME/linuxptp/configs/G.8275.1.cfg
# HFR Switch
chrt -f 97 taskset -c 39 phc2sys -m -c ens9f0 -s CLOCK_REALTIME -O0 -f $HOME/linuxptp/configs/G.8275.1.cfg
launch-ptp
View file @
ada02d83
# Tiogapass003 test
#chrt -f 97 taskset -c 38 ptp4l -H -i ens9f1 -m -f $HOME/linuxptp/configs/G.8275.1.cfg
# HFR Switch
chrt -f 97 taskset -c 38 ptp4l -H -i ens9f0 -m -f $HOME/linuxptp/configs/G.8275.1.cfg
trx_ecpri_dpdk.c
View file @
ada02d83
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment