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
bf525bc7
Commit
bf525bc7
authored
Jun 07, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop non eCPRI packets
parent
a40959d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
trx_ecpri_dpdk.c
trx_ecpri_dpdk.c
+14
-4
No files found.
trx_ecpri_dpdk.c
View file @
bf525bc7
...
...
@@ -601,7 +601,7 @@ static void *recv_thread(void *p) {
update_counter
(
&
rx_drop_counter
,
nb_rx
);
}
else
{
int
nc
;
int
nr
;
int
k
=
0
;
int
nc
;
int
nr
;
int
k
=
0
;
int
drop_total
=
0
;
nr
=
nb_rx
;
while
((
nc
=
rbuf_contiguous_copy
(
NULL
,
&
rx_rbuf
,
nr
)))
{
...
...
@@ -617,6 +617,7 @@ 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
)
{
...
...
@@ -637,21 +638,30 @@ static void *recv_thread(void *p) {
}
}
if
((
pkt
[
i
+
k
])
->
data_len
!=
rx_rbuf
.
len
)
if
((
pkt
[
i
+
k
])
->
data_len
!=
rx_rbuf
.
len
)
{
for
(
int
j
=
0
;
j
<
pkt
[
i
+
k
]
->
data_len
;
j
++
)
{
printf
(
"%02x"
,
rtebuf
[
j
]);
}
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
)
{
drop
++
;
drop_total
++
;
continue
;
}
memcpy
(
buf
+
i
*
rx_rbuf
.
len
,
rtebuf
,
rx_rbuf
.
len
);
#else
//memcpy(buf + i * rx_rbuf.len, pkt_frame_full, rx_rbuf.len);
#endif
}
rx_rbuf
.
write_index
=
(
rx_rbuf
.
write_index
+
nc
)
%
rx_rbuf
.
buf_len
;
rx_rbuf
.
write_index
=
(
rx_rbuf
.
write_index
+
nc
-
drop
)
%
rx_rbuf
.
buf_len
;
for
(
int
i
=
0
;
i
<
nc
;
i
++
)
rte_pktmbuf_free
(
pkt
[
i
+
k
]);
nr
-=
nc
;
k
+=
nc
;
}
}
update_counter
(
&
recv_counter
,
nb_rx
);
update_counter
(
&
recv_counter
,
nb_rx
-
drop_total
);
}
pthread_exit
(
EXIT_SUCCESS
);
...
...
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