summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2014-12-03 16:56:59 +0000
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-12-05 16:55:00 +0100
commit94aa16b45c722156df8c458c4e841b991b072688 (patch)
tree419164a6892db3374da4527066beb37233321ccd
parent58507670cf1a4832eba725eba872d57b81d85491 (diff)
downloaddpdk-94aa16b45c722156df8c458c4e841b991b072688.zip
dpdk-94aa16b45c722156df8c458c4e841b991b072688.tar.gz
dpdk-94aa16b45c722156df8c458c4e841b991b072688.tar.xz
examples/multi_process: fix resilience by enabling Rx drop
The symmetric_mp example app is set up to allow two processes to share a NIC port, with each pulling packets from one queue. In order to have the app continue working when one of the process dies, the drop_en bit should be set in the NIC configuration. Without this bit set, the NIC will stall once any queue fills. With the bit set, once a queue fills, all subsequent packets for that queue are discarded allowing other queues to continue operating as normal. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
-rw-r--r--examples/multi_process/symmetric_mp/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 01faae9..2fc2acf 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -229,6 +229,7 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues)
}
};
const uint16_t rx_rings = num_queues, tx_rings = num_queues;
+ struct rte_eth_dev_info info;
int retval;
uint16_t q;
@@ -241,6 +242,9 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues)
printf("# Initialising port %u... ", (unsigned)port);
fflush(stdout);
+ rte_eth_dev_info_get(port, &info);
+ info.default_rxconf.rx_drop_en = 1;
+
retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
if (retval < 0)
return retval;
@@ -248,7 +252,7 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues)
for (q = 0; q < rx_rings; q ++) {
retval = rte_eth_rx_queue_setup(port, q, RX_RING_SIZE,
rte_eth_dev_socket_id(port),
- NULL,
+ &info.default_rxconf,
mbuf_pool);
if (retval < 0)
return retval;