DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bond: don't drop lacpdu's on slaves tx failure
@ 2017-11-30 23:25 Declan Doherty
  2017-12-07  1:17 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Declan Doherty @ 2017-11-30 23:25 UTC (permalink / raw)
  To: dev; +Cc: klarose, Declan Doherty

In message (http://dpdk.org/ml/archives/dev/2017-November/081557.html)
it was noted that under congestion that the LACPDU's are dropped under
load.

This patch changes the drop logic to re-enqueue the LACPDU to the slaves
control message queue. This will allow resend attempt's to be made in
subsequent tx_burst() calls on the bonded device.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 35 ++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index fe23289..d1d3663 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1258,12 +1258,10 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 	uint8_t distributing_count;
 
 	uint16_t num_tx_slave, num_tx_total = 0, num_tx_fail_total = 0;
-	uint16_t i, j, op_slave_idx;
-	const uint16_t buffs_size = nb_pkts + BOND_MODE_8023AX_SLAVE_TX_PKTS + 1;
+	uint16_t i, op_slave_idx;
 
 	/* Allocate additional packets in case 8023AD mode. */
-	struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][buffs_size];
-	void *slow_pkts[BOND_MODE_8023AX_SLAVE_TX_PKTS] = { NULL };
+	struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_pkts];
 
 	/* Total amount of packets in slave_bufs */
 	uint16_t slave_nb_pkts[RTE_MAX_ETHPORTS] = { 0 };
@@ -1285,14 +1283,6 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 	for (i = 0; i < num_of_slaves; i++) {
 		struct port *port = &mode_8023ad_ports[slaves[i]];
 
-		slave_slow_nb_pkts[i] = rte_ring_dequeue_burst(port->tx_ring,
-				slow_pkts, BOND_MODE_8023AX_SLAVE_TX_PKTS,
-				NULL);
-		slave_nb_pkts[i] = slave_slow_nb_pkts[i];
-
-		for (j = 0; j < slave_slow_nb_pkts[i]; j++)
-			slave_bufs[i][j] = slow_pkts[j];
-
 		if (ACTOR_STATE(port, DISTRIBUTING))
 			distributing_offsets[distributing_count++] = i;
 	}
@@ -1334,6 +1324,27 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 		}
 	}
 
+	/* Check for LACP control packets and send if available */
+	for (i = 0; i < num_of_slaves; i++) {
+		struct port *port = &mode_8023ad_ports[slaves[i]];
+		struct rte_mbuf *ctrl_pkt = NULL;
+
+		int pkt_avail = rte_ring_dequeue(port->tx_ring,
+				(void **)&ctrl_pkt);
+
+		if (unlikely(pkt_avail == 0)) {
+			num_tx_slave = rte_eth_tx_burst(slaves[i],
+					bd_tx_q->queue_id, &ctrl_pkt, 1);
+
+			/*
+			 * re-enqueue LAG control plane packets to buffering
+			 * ring if transmission fails so the packet isn't lost.
+			 */
+			if (num_tx_slave != nb_pkts)
+				rte_ring_enqueue(port->tx_ring,	ctrl_pkt);
+		}
+	}
+
 	return num_tx_total;
 }
 
-- 
2.9.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bond: don't drop lacpdu's on slaves tx failure
  2017-11-30 23:25 [dpdk-dev] [PATCH] net/bond: don't drop lacpdu's on slaves tx failure Declan Doherty
@ 2017-12-07  1:17 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2017-12-07  1:17 UTC (permalink / raw)
  To: Declan Doherty, dev; +Cc: klarose

On 11/30/2017 3:25 PM, Declan Doherty wrote:
> In message (http://dpdk.org/ml/archives/dev/2017-November/081557.html)
> it was noted that under congestion that the LACPDU's are dropped under
> load.
> 
> This patch changes the drop logic to re-enqueue the LACPDU to the slaves
> control message queue. This will allow resend attempt's to be made in
> subsequent tx_burst() calls on the bonded device.
> 
> Signed-off-by: Declan Doherty <declan.doherty@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-07  1:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30 23:25 [dpdk-dev] [PATCH] net/bond: don't drop lacpdu's on slaves tx failure Declan Doherty
2017-12-07  1:17 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).