Skip to contentSkip to conversation

examples: fix symmetric_mp, set NIC rx_drop_en bit

PATCH Applied Bruce Richardson 2 participants 6 messages Dec 3, 2014 – Dec 5, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples: fix symmetric_mp, set NIC rx_drop_en bit

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.

This setting was missed when converting to use standardised defaults in commit 81f7ecd9.

---
 examples/multi_process/symmetric_mp/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
examples/multi_process/symmetric_mp/main.c +5 -1
index 01faae9..2fc2acf 100644
@@ -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;
Signature · 1 line
1.9.3

A message that is not in the archive (sent off-list or not yet received): 1417625819-3024-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

#2 lore raw

2014-12-03 16:56, Bruce Richardson:

Quoted 10 lines

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.

This setting was missed when converting to use standardised defaults in commit 81f7ecd9.

I don't see rx_drop_en in commit 81f7ecd9.
Why do you say it was missed?

Signature · 1 line
Thomas
#3 lore raw
Quoted 9 lines · Thomas Monjalon

2014-12-03 16:56, Bruce Richardson:

Quoted 8 lines

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.

Quoted 6 lines
Quoted 2 lines

This setting was missed when converting to use standardised defaults in commit 81f7ecd9.

I don't see rx_drop_en in commit 81f7ecd9.
Why do you say it was missed?

This is the one app that needs the drop_en bit set, and the bit is not set in the defaults. Therefore, when this app was converted to use the defaults from the driver, the drop_en bit should have been explicitly set as in this patch. [The fact of there being no drop_en bit in the commit is proof of its absense :-)].

/Bruce

#4 lore raw

2014-12-04 14:03, Bruce Richardson:

Quoted 13 lines · Thomas Monjalon
Quoted 12 lines

2014-12-03 16:56, Bruce Richardson:

Quoted 10 lines

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.

This setting was missed when converting to use standardised defaults in commit 81f7ecd9.

Quoted 7 lines
Quoted 3 lines

I don't see rx_drop_en in commit 81f7ecd9.
Why do you say it was missed?

This is the one app that needs the drop_en bit set, and the bit is not set in the defaults. Therefore, when this app was converted to use the defaults from the driver, the drop_en bit should have been explicitly set as in this patch. [The fact of there being no drop_en bit in the commit is proof of its absense :-)].

So you agree this bit was never been set for this app?
Therefore I should remove the last sentence of your commit log before applying?

Signature · 1 line
Thomas
#5 lore raw
Quoted 17 lines · Thomas Monjalon

2014-12-04 14:03, Bruce Richardson:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

2014-12-03 16:56, Bruce Richardson:

Quoted 10 lines

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.

This setting was missed when converting to use standardised defaults in commit 81f7ecd9.

I don't see rx_drop_en in commit 81f7ecd9.
Why do you say it was missed?

Quoted 9 lines
Quoted 4 lines

This is the one app that needs the drop_en bit set, and the bit is not set in the defaults. Therefore, when this app was converted to use the defaults from the driver, the drop_en bit should have been explicitly set as in this patch. [The fact of there being no drop_en bit in the commit is proof of its absense :-)].

So you agree this bit was never been set for this app?
Therefore I should remove the last sentence of your commit log before applying?

Oh, now I get your point. Looking at 1.7 release, yes, this bit was never set but should really have been set. Therefore, please remove the last line as you suggest.

/Bruce

#6 lore raw
In reply to a message not in the archive

2014-12-03 16:56, Bruce Richardson:

Quoted 8 lines

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.

[snip]

Quoted 1 line

Applied

Thanks

Signature · 1 line
Thomas