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
/
distributor
/
main.c
diff --git
a/examples/distributor/main.c
b/examples/distributor/main.c
index
8071f91
..
87603d0
100644
(file)
--- a/
examples/distributor/main.c
+++ b/
examples/distributor/main.c
@@
-43,6
+43,7
@@
#include <rte_debug.h>
#include <rte_prefetch.h>
#include <rte_distributor.h>
#include <rte_debug.h>
#include <rte_prefetch.h>
#include <rte_distributor.h>
+#include <rte_pause.h>
#define RX_RING_SIZE 512
#define TX_RING_SIZE 512
#define RX_RING_SIZE 512
#define TX_RING_SIZE 512
@@
-137,6
+138,8
@@
port_init(uint8_t port, struct rte_mempool *mbuf_pool)
const uint16_t rxRings = 1, txRings = rte_lcore_count() - 1;
int retval;
uint16_t q;
const uint16_t rxRings = 1, txRings = rte_lcore_count() - 1;
int retval;
uint16_t q;
+ uint16_t nb_rxd = RX_RING_SIZE;
+ uint16_t nb_txd = TX_RING_SIZE;
if (port >= rte_eth_dev_count())
return -1;
if (port >= rte_eth_dev_count())
return -1;
@@
-145,8
+148,12
@@
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 < rxRings; q++) {
for (q = 0; q < rxRings; 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)
rte_eth_dev_socket_id(port),
NULL, mbuf_pool);
if (retval < 0)
@@
-154,7
+161,7
@@
port_init(uint8_t port, struct rte_mempool *mbuf_pool)
}
for (q = 0; q < txRings; q++) {
}
for (q = 0; q < txRings; 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)
rte_eth_dev_socket_id(port),
NULL);
if (retval < 0)