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
99fdfd24
Commit
99fdfd24
authored
Jun 08, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Drop non eCPRI packets
parent
bf525bc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
trx_ecpri_dpdk.c
trx_ecpri_dpdk.c
+8
-4
No files found.
trx_ecpri_dpdk.c
View file @
99fdfd24
...
...
@@ -105,6 +105,7 @@ typedef struct {
int
timestamp_frames
;
int
master_timestamp_check_period
;
int
slave_timestamp_check_period
;
int
disable_rx_copy
;
}
TRXEcpriState
;
typedef
struct
{
...
...
@@ -564,6 +565,7 @@ static void *recv_thread(void *p) {
int
nb_rx
=
0
;
int
n
;
int
drop_packet
=
0
;
int
drop_total
=
0
;
#ifdef DPDK
while
(
!
nb_rx
)
...
...
@@ -601,9 +603,10 @@ static void *recv_thread(void *p) {
update_counter
(
&
rx_drop_counter
,
nb_rx
);
}
else
{
int
nc
;
int
nr
;
int
k
=
0
;
int
drop_total
=
0
;
int
nc
;
int
nr
;
int
k
=
0
;
nr
=
nb_rx
;
while
((
nc
=
rbuf_contiguous_copy
(
NULL
,
&
rx_rbuf
,
nr
)))
{
int
drop
=
0
;
if
(
s
->
trace_rx
)
{
if
((
recv_counter
.
counter
+
nc
)
>=
(
rx_rbuf
.
buf_len
+
s
->
trace_offset
))
{
...
...
@@ -617,7 +620,6 @@ static void *recv_thread(void *p) {
buf
=
((
uint8_t
*
)
rx_rbuf
.
buffer
)
+
(
rx_rbuf
.
write_index
*
rx_rbuf
.
len
);
for
(
int
i
=
0
;
i
<
nc
;
i
++
)
{
int
drop
=
0
;
#ifdef DPDK
rtebuf
=
(
uint8_t
*
)
(
pkt
[
i
+
k
])
->
buf_addr
+
(
pkt
[
i
+
k
])
->
data_off
;
if
(
first_seq_id
)
{
...
...
@@ -645,7 +647,7 @@ static void *recv_thread(void *p) {
printf
(
"
\n
"
);
log_error
(
"RECV"
,
"Packet data length (%d) != RX buffer len (%d)"
,
pkt
[
i
+
k
]
->
data_len
,
rx_rbuf
.
len
);
}
if
(
ntohl
(
(
uint32_t
)
rtebuf
+
12
)
!=
0xaefe
)
{
if
(
ntohl
(
*
((
uint32_t
*
)
(
rtebuf
+
12
))
)
!=
0xaefe
)
{
drop
++
;
drop_total
++
;
continue
;
}
...
...
@@ -1399,7 +1401,7 @@ static int trx_ecpri_read(TRXState *s1, trx_timestamp_t *ptimestamp, void **__sa
for
(
int
i
=
0
;
i
<
s
->
rx_n_channel
;
i
++
)
{
uint8_t
*
dst
=
(
uint8_t
*
)
(
_samples
[
i
]
+
offset
);
uint8_t
*
src
=
((
uint8_t
*
)
trxr_rbuf
[
i
].
buffer
)
+
trxr_rbuf
[
0
].
read_index
*
trxr_rbuf
[
0
].
len
*
sizeof
(
Complex
);
if
(
!
s
->
trx_read_null
)
if
(
!
s
->
disable_rx_copy
&&
!
s
->
trx_read_null
)
memcpy
(
dst
,
src
,
len
);
}
trxr_rbuf
[
0
].
read_index
=
(
trxr_rbuf
[
0
].
read_index
+
nc
)
%
trxr_rbuf
[
0
].
buf_len
;
...
...
@@ -1698,6 +1700,8 @@ int trx_driver_init(TRXState *s1)
s
->
statistics_refresh_rate_ns
=
(
int
)
val
;
trx_get_param_double
(
s1
,
&
val
,
"ecpri_period"
);
s
->
ecpri_period
=
(
int
)
val
;
trx_get_param_double
(
s1
,
&
val
,
"disable_rx_copy"
);
s
->
disable_rx_copy
=
(
int
)
val
;
if
(
s
->
ecpri_period
==
0
)
log_exit
(
"TRX_ECPRI"
,
"ecpri_period parameter can't be null
\n
"
);
...
...
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