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
051a2768
Commit
051a2768
authored
Jan 24, 2025
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: rx_burst
parent
b50e103c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
trx_ecpri.c
trx_ecpri.c
+9
-9
No files found.
trx_ecpri.c
View file @
051a2768
...
...
@@ -369,7 +369,7 @@ static void update_counter(counter_stat_t * c, int64_t v) {
c
->
counter
+=
v
;
}
#define
RX_BURST_SIZE 4000
#define
MAX_RX_BURST 32768
static
void
*
recv_thread
(
void
*
p
)
{
#ifdef DISABLE_RECV
pthread_exit
(
EXIT_SUCCESS
);
...
...
@@ -388,26 +388,26 @@ static void *recv_thread(void *p) {
for
(;;)
{
struct
mmsghdr
msgh
[
RX_BURST_SIZE
];
struct
iovec
msgv
[
RX_BURST_SIZE
];
struct
mmsghdr
msgh
[
MAX_RX_BURST
];
struct
iovec
msgv
[
MAX_RX_BURST
];
memset
(
msgv
,
0
,
sizeof
(
msgv
));
memset
(
msgh
,
0
,
sizeof
(
msgh
));
if
(
rbuf_write_amount
(
&
rx_rbuf
)
<
RX_BURST_SIZE
*
PACKET_SIZE
)
if
(
rbuf_write_amount
(
&
rx_rbuf
)
<
s
->
rx_burst
*
PACKET_SIZE
)
log_error
(
"RECV_THREAD"
,
"Not enough space in RX buffer (%d < %d)
\n
"
,
rbuf_write_amount
(
&
rx_rbuf
),
RX_BURST_SIZE
*
PACKET_SIZE
);
for
(
int
j
=
0
;
j
<
RX_BURST_SIZE
;
j
++
)
{
rbuf_write_amount
(
&
rx_rbuf
),
s
->
rx_burst
*
PACKET_SIZE
);
for
(
int
j
=
0
;
j
<
s
->
rx_burst
;
j
++
)
{
msgv
[
j
].
iov_base
=
rx_rbuf
.
buffer
+
(
rx_rbuf
.
write_index
+
j
*
PACKET_SIZE
)
%
rx_rbuf
.
buf_len
;
msgv
[
j
].
iov_len
=
PACKET_SIZE
;
msgh
[
j
].
msg_hdr
.
msg_iov
=
&
msgv
[
j
];
msgh
[
j
].
msg_hdr
.
msg_iovlen
=
1
;
}
for
(
int
j
=
0
;
j
<
RX_BURST_SIZE
;)
{
for
(
int
j
=
0
;
j
<
s
->
rx_burst
;)
{
uint8_t
*
data
;
int
ret
=
recvmmsg
(
recv_sockfd
,
msgh
+
j
,
RX_BURST_SIZE
-
j
,
0
,
NULL
);
int
ret
=
recvmmsg
(
recv_sockfd
,
msgh
+
j
,
s
->
rx_burst
-
j
,
0
,
NULL
);
if
(
ret
<=
-
1
)
error
(
EXIT_FAILURE
,
errno
,
"recvmmsg error"
);
for
(
int
l
=
0
;
l
<
ret
;
l
++
)
{
...
...
@@ -425,7 +425,7 @@ static void *recv_thread(void *p) {
j
+=
ret
;
update_counter
(
&
recv_counter
,
ret
);
}
rbuf_increment_write
(
&
rx_rbuf
,
RX_BURST_SIZE
*
PACKET_SIZE
);
rbuf_increment_write
(
&
rx_rbuf
,
s
->
rx_burst
*
PACKET_SIZE
);
}
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