[dpdk-stable] patch 'net/bonding: fix LACP fast queue Rx handler' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:32:28 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/21/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 3d22936c3913cc408ebfdcfbc2303ed2b0c071a3 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Wed, 10 Apr 2019 14:53:47 +0200
Subject: [PATCH] net/bonding: fix LACP fast queue Rx handler

[ upstream commit 58729b54949598cc43d56e22ef813b620651bb6a ]

Fast queue Rx burst function is missing checks on promisc and the
slave collecting state.
Define an inline wrapper to have a common base.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Chas Williams <chas3 at att.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 75 ++++++++++----------------
 1 file changed, 28 insertions(+), 47 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 9694cfba8b..4de62bcf50 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -31,6 +31,7 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include <stdlib.h>
+#include <stdbool.h>
 #include <netinet/in.h>
 
 #include <rte_mbuf.h>
@@ -282,45 +283,6 @@ bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) {
 	return 0;
 }
 
-static uint16_t
-bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs,
-		uint16_t nb_pkts)
-{
-	struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue;
-	struct bond_dev_private *internals = bd_rx_q->dev_private;
-	uint16_t num_rx_total = 0;	/* Total number of received packets */
-	uint16_t slaves[RTE_MAX_ETHPORTS];
-	uint16_t slave_count;
-	uint16_t active_slave;
-	uint16_t i;
-
-	/* Copy slave list to protect against slave up/down changes during tx
-	 * bursting */
-	slave_count = internals->active_slave_count;
-	active_slave = internals->active_slave;
-	memcpy(slaves, internals->active_slaves,
-			sizeof(internals->active_slaves[0]) * slave_count);
-
-	for (i = 0; i < slave_count && nb_pkts; i++) {
-		uint16_t num_rx_slave;
-
-		/* Read packets from this slave */
-		num_rx_slave = rte_eth_rx_burst(slaves[active_slave],
-						bd_rx_q->queue_id,
-						bufs + num_rx_total, nb_pkts);
-		num_rx_total += num_rx_slave;
-		nb_pkts -= num_rx_slave;
-
-		if (++active_slave == slave_count)
-			active_slave = 0;
-	}
-
-	if (++internals->active_slave >= slave_count)
-		internals->active_slave = 0;
-
-	return num_rx_total;
-}
-
 static uint16_t
 bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs,
 		uint16_t nb_pkts)
@@ -406,10 +368,9 @@ bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs,
 	return num_tx_total;
 }
 
-
-static uint16_t
-bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
-		uint16_t nb_pkts)
+static inline uint16_t
+rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,
+		bool dedicated_rxq)
 {
 	/* Cast to structure, containing bonded device's port id and queue id */
 	struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue;
@@ -467,10 +428,16 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 			hdr = rte_pktmbuf_mtod(bufs[j], struct ether_hdr *);
 			subtype = ((struct slow_protocol_frame *)hdr)->slow_protocol.subtype;
 
-			/* Remove packet from array if it is slow packet or slave is not
-			 * in collecting state or bonding interface is not in promiscuous
-			 * mode and packet address does not match. */
-			if (unlikely(is_lacp_packets(hdr->ether_type, subtype, bufs[j]) ||
+			/* Remove packet from array if:
+			 * - it is slow packet but no dedicated rxq is present,
+			 * - slave is not in collecting state,
+			 * - bonding interface is not in promiscuous mode and
+			 *   packet is not multicast and address does not match,
+			 */
+			if (unlikely(
+				(!dedicated_rxq &&
+				 is_lacp_packets(hdr->ether_type, subtype,
+						 bufs[j])) ||
 				!collecting || (!promisc &&
 					!is_multicast_ether_addr(&hdr->d_addr) &&
 					!is_same_ether_addr(&bond_mac, &hdr->d_addr)))) {
@@ -500,6 +467,20 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 	return num_rx_total;
 }
 
+static uint16_t
+bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
+		uint16_t nb_pkts)
+{
+	return rx_burst_8023ad(queue, bufs, nb_pkts, false);
+}
+
+static uint16_t
+bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs,
+		uint16_t nb_pkts)
+{
+	return rx_burst_8023ad(queue, bufs, nb_pkts, true);
+}
+
 #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1)
 uint32_t burstnumberRX;
 uint32_t burstnumberTX;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:26.394639978 +0000
+++ 0001-net-bonding-fix-LACP-fast-queue-Rx-handler.patch	2019-12-19 14:32:25.377283389 +0000
@@ -1,26 +1,35 @@
-From 58729b54949598cc43d56e22ef813b620651bb6a Mon Sep 17 00:00:00 2001
+From 3d22936c3913cc408ebfdcfbc2303ed2b0c071a3 Mon Sep 17 00:00:00 2001
 From: David Marchand <david.marchand at redhat.com>
 Date: Wed, 10 Apr 2019 14:53:47 +0200
 Subject: [PATCH] net/bonding: fix LACP fast queue Rx handler
 
+[ upstream commit 58729b54949598cc43d56e22ef813b620651bb6a ]
+
 Fast queue Rx burst function is missing checks on promisc and the
 slave collecting state.
 Define an inline wrapper to have a common base.
 
 Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")
-Cc: stable at dpdk.org
 
 Signed-off-by: David Marchand <david.marchand at redhat.com>
 Acked-by: Chas Williams <chas3 at att.com>
 ---
- drivers/net/bonding/rte_eth_bond_pmd.c | 73 ++++++++++----------------
- 1 file changed, 27 insertions(+), 46 deletions(-)
+ drivers/net/bonding/rte_eth_bond_pmd.c | 75 ++++++++++----------------
+ 1 file changed, 28 insertions(+), 47 deletions(-)
 
 diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
-index 6abd9581cc..44af5ade17 100644
+index 9694cfba8b..4de62bcf50 100644
 --- a/drivers/net/bonding/rte_eth_bond_pmd.c
 +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
-@@ -254,48 +254,9 @@ bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) {
+@@ -31,6 +31,7 @@
+  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  */
+ #include <stdlib.h>
++#include <stdbool.h>
+ #include <netinet/in.h>
+ 
+ #include <rte_mbuf.h>
+@@ -282,45 +283,6 @@ bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) {
  	return 0;
  }
  
@@ -63,6 +72,14 @@
 -	return num_rx_total;
 -}
 -
+ static uint16_t
+ bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs,
+ 		uint16_t nb_pkts)
+@@ -406,10 +368,9 @@ bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs,
+ 	return num_tx_total;
+ }
+ 
+-
 -static uint16_t
 -bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
 -		uint16_t nb_pkts)
@@ -72,8 +89,8 @@
  {
  	/* Cast to structure, containing bonded device's port id and queue id */
  	struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue;
-@@ -356,10 +317,16 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
- 			hdr = rte_pktmbuf_mtod(bufs[j], struct rte_ether_hdr *);
+@@ -467,10 +428,16 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
+ 			hdr = rte_pktmbuf_mtod(bufs[j], struct ether_hdr *);
  			subtype = ((struct slow_protocol_frame *)hdr)->slow_protocol.subtype;
  
 -			/* Remove packet from array if it is slow packet or slave is not
@@ -90,10 +107,10 @@
 +				(!dedicated_rxq &&
 +				 is_lacp_packets(hdr->ether_type, subtype,
 +						 bufs[j])) ||
- 				!collecting ||
- 				(!promisc &&
- 				 !rte_is_multicast_ether_addr(&hdr->d_addr) &&
-@@ -391,6 +358,20 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
+ 				!collecting || (!promisc &&
+ 					!is_multicast_ether_addr(&hdr->d_addr) &&
+ 					!is_same_ether_addr(&bond_mac, &hdr->d_addr)))) {
+@@ -500,6 +467,20 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,
  	return num_rx_total;
  }
  


More information about the stable mailing list