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
b6d9bf74
Commit
b6d9bf74
authored
Apr 14, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite tracing, fix bugs, add simple monitoring
parent
e4e825e3
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
151 additions
and
188 deletions
+151
-188
dpdk.c
dpdk.c
+14
-9
trx_ecpri_dpdk.c
trx_ecpri_dpdk.c
+136
-178
utils.c
utils.c
+1
-1
No files found.
dpdk.c
View file @
b6d9bf74
...
...
@@ -4,13 +4,14 @@
#define RTE_TEST_TX_DESC_DEFAULT 1024
static
uint16_t
nb_rxd
=
RTE_TEST_RX_DESC_DEFAULT
;
static
uint16_t
nb_txd
=
RTE_TEST_TX_DESC_DEFAULT
;
struct
rte_mempool
*
mbuf_pool
;
struct
rte_mempool
*
tx_mbuf_pool
;
struct
rte_mempool
*
rx_mbuf_pool
;
struct
rte_ether_addr
s_addr
;
struct
rte_ether_addr
d_addr
;
static
const
struct
rte_eth_conf
port_conf_default
=
{
.
rxmode
=
{
.
max_lro_pkt_size
=
RTE_ETHER_MAX_LEN
}
};
static
inline
int
port_init
(
int
portid
,
struct
rte_mempool
*
mbuf_pool
)
{
static
inline
int
port_init
(
int
portid
,
struct
rte_mempool
*
rx_
mbuf_pool
)
{
struct
rte_eth_conf
port_conf
=
port_conf_default
;
const
uint16_t
rx_rings
=
1
,
tx_rings
=
1
;
int
retval
;
...
...
@@ -23,7 +24,7 @@ static inline int port_init(int portid, struct rte_mempool *mbuf_pool) {
/* Allocate and set up 1 RX queue per Ethernet port. */
for
(
q
=
0
;
q
<
rx_rings
;
q
++
)
{
retval
=
rte_eth_rx_queue_setup
(
portid
,
q
,
nb_rxd
,
rte_eth_dev_socket_id
(
portid
),
NULL
,
mbuf_pool
);
rte_eth_dev_socket_id
(
portid
),
NULL
,
rx_
mbuf_pool
);
if
(
retval
<
0
)
return
retval
;
}
...
...
@@ -55,13 +56,17 @@ static void init_dpdk(int argc, char ** argv) {
argv
+=
ret
;
nb_mbufs
=
RTE_MAX
((
nb_rxd
+
nb_txd
+
BURST_SIZE
+
MEMPOOL_CACHE_SIZE
),
8192U
);
nb_mbufs
=
1024U
*
16
;
nb_mbufs
=
1024U
*
16
-
1
;
mbuf_pool
=
rte_pktmbuf_pool_create
(
"MBUF_POOL"
,
nb_mbufs
,
MEMPOOL_CACHE_SIZE
,
0
,
RTE_MBUF_DEFAULT_BUF_SIZE
,
rte_socket_id
());
if
(
mbuf_pool
==
NULL
)
rte_exit
(
EXIT_FAILURE
,
"Cannot create mbuf pool
\n
"
);
tx_mbuf_pool
=
rte_pktmbuf_pool_create
(
"TX_MBUF_POOL"
,
nb_mbufs
,
MEMPOOL_CACHE_SIZE
,
0
,
RTE_MBUF_DEFAULT_BUF_SIZE
,
SOCKET_ID_ANY
);
if
(
tx_mbuf_pool
==
NULL
)
rte_exit
(
EXIT_FAILURE
,
"Cannot create tx mbuf pool
\n
"
);
rx_mbuf_pool
=
rte_pktmbuf_pool_create
(
"RX_MBUF_POOL"
,
nb_mbufs
,
MEMPOOL_CACHE_SIZE
,
0
,
RTE_MBUF_DEFAULT_BUF_SIZE
,
SOCKET_ID_ANY
);
if
(
rx_mbuf_pool
==
NULL
)
rte_exit
(
EXIT_FAILURE
,
"Cannot create rx mbuf pool
\n
"
);
if
(
port_init
(
0
,
mbuf_pool
)
!=
0
)
if
(
port_init
(
0
,
rx_
mbuf_pool
)
!=
0
)
rte_exit
(
EXIT_FAILURE
,
"Cannot init port %"
PRIu8
"
\n
"
,
0
);
}
trx_ecpri_dpdk.c
View file @
b6d9bf74
This diff is collapsed.
Click to expand it.
utils.c
View file @
b6d9bf74
...
...
@@ -36,7 +36,7 @@ static inline void log_limit(const char * section, const char * msg, ...) {
puts
(
line
);
}
#if
0
#if
1
static
void
log_info
(
const
char
*
section
,
const
char
*
msg
,
...)
{
time_t
t
;
struct
tm
ts
;
...
...
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