Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
U
udpdk
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
ywj
udpdk
Commits
8b013930
Commit
8b013930
authored
Oct 02, 2020
by
Leonardo Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fixes
parent
23161034
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
udpdk/udpdk_init.c
udpdk/udpdk_init.c
+2
-7
udpdk/udpdk_poller.c
udpdk/udpdk_poller.c
+1
-2
No files found.
udpdk/udpdk_init.c
View file @
8b013930
...
...
@@ -190,7 +190,6 @@ static int init_shared_memzone(void)
memset
(
mz
->
addr
,
0
,
sizeof
(
*
exch_zone_desc
));
exch_zone_desc
=
mz
->
addr
;
// TODO any field to set to a specific value?
return
0
;
}
...
...
@@ -247,9 +246,7 @@ int udpdk_init(int argc, char *argv[])
// Start the secondary process
poller_pid
=
fork
();
if
(
poller_pid
!=
0
)
{
// application
if
(
poller_pid
!=
0
)
{
// parent -> application
// Initialize EAL (returns how many arguments it consumed)
retval
=
rte_eal_init
(
argc
,
argv
);
if
(
retval
<
0
)
{
...
...
@@ -303,9 +300,7 @@ int udpdk_init(int argc, char *argv[])
RTE_LOG
(
ERR
,
INIT
,
"Cannot initialize exchange slots
\n
"
);
return
-
1
;
}
// TODO initialize shared structures
}
else
{
// child -> packet poller
}
else
{
// child -> packet poller
// TODO the arguments should come from a config rather than being hardcoded
int
poller_argc
=
6
;
char
*
poller_argv
[
6
]
=
{
...
...
udpdk/udpdk_poller.c
View file @
8b013930
...
...
@@ -344,7 +344,7 @@ void poller_body(void)
// Transmit packets to DPDK port 0 (queue 0)
for
(
i
=
0
;
i
<
NUM_SOCKETS_MAX
;
i
++
)
{
if
(
exch_zone_desc
->
slots
[
i
].
used
)
{
tx_sendable
=
rte_ring_dequeue_burst
(
exch_slots
[
i
].
tx_q
,
(
void
**
)
txbuf
,
PKT_
READ
_SIZE
,
NULL
);
tx_sendable
=
rte_ring_dequeue_burst
(
exch_slots
[
i
].
tx_q
,
(
void
**
)
txbuf
,
PKT_
WRITE
_SIZE
,
NULL
);
if
(
likely
(
tx_sendable
>
0
))
{
tx_count
=
rte_eth_tx_burst
(
PORT_TX
,
QUEUE_TX
,
txbuf
,
tx_sendable
);
// TODO should call a send function that accoubts for fragmentation
if
(
unlikely
(
tx_count
<
tx_sendable
))
{
...
...
@@ -360,7 +360,6 @@ void poller_body(void)
rx_count
=
rte_eth_rx_burst
(
PORT_RX
,
QUEUE_RX
,
rxbuf
,
PKT_READ_SIZE
);
if
(
likely
(
rx_count
>
0
))
{
printf
(
"poller rxcount: %d
\n
"
,
rx_count
);
// TODO debug
// Prefetch some packets (to reduce cache misses later)
for
(
j
=
0
;
j
<
PREFETCH_OFFSET
&&
j
<
rx_count
;
j
++
)
{
rte_prefetch0
(
rte_pktmbuf_mtod
(
rxbuf
[
j
],
void
*
));
...
...
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