Code Review
/
deb_dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
New upstream version 17.08
[deb_dpdk.git]
/
examples
/
rxtx_callbacks
/
main.c
diff --git
a/examples/rxtx_callbacks/main.c
b/examples/rxtx_callbacks/main.c
index
048b23f
..
6699240
100644
(file)
--- a/
examples/rxtx_callbacks/main.c
+++ b/
examples/rxtx_callbacks/main.c
@@
-101,6
+101,8
@@
port_init(uint8_t port, struct rte_mempool *mbuf_pool)
{
struct rte_eth_conf port_conf = port_conf_default;
const uint16_t rx_rings = 1, tx_rings = 1;
{
struct rte_eth_conf port_conf = port_conf_default;
const uint16_t rx_rings = 1, tx_rings = 1;
+ uint16_t nb_rxd = RX_RING_SIZE;
+ uint16_t nb_txd = TX_RING_SIZE;
int retval;
uint16_t q;
int retval;
uint16_t q;
@@
-111,15
+113,19
@@
port_init(uint8_t port, struct rte_mempool *mbuf_pool)
if (retval != 0)
return retval;
if (retval != 0)
return retval;
+ retval = rte_eth_dev_adjust_nb_rx_tx_desc(port, &nb_rxd, &nb_txd);
+ if (retval != 0)
+ return retval;
+
for (q = 0; q < rx_rings; q++) {
for (q = 0; q < rx_rings; q++) {
- retval = rte_eth_rx_queue_setup(port, q,
RX_RING_SIZE
,
+ retval = rte_eth_rx_queue_setup(port, q,
nb_rxd
,
rte_eth_dev_socket_id(port), NULL, mbuf_pool);
if (retval < 0)
return retval;
}
for (q = 0; q < tx_rings; q++) {
rte_eth_dev_socket_id(port), NULL, mbuf_pool);
if (retval < 0)
return retval;
}
for (q = 0; q < tx_rings; q++) {
- retval = rte_eth_tx_queue_setup(port, q,
TX_RING_SIZE
,
+ retval = rte_eth_tx_queue_setup(port, q,
nb_txd
,
rte_eth_dev_socket_id(port), NULL);
if (retval < 0)
return retval;
rte_eth_dev_socket_id(port), NULL);
if (retval < 0)
return retval;