From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 93432A04C3 for ; Fri, 22 Nov 2019 15:41:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 83FA623D; Fri, 22 Nov 2019 15:41:53 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 0CEF423D for ; Fri, 22 Nov 2019 15:41:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574433711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7m5xOR+szYDopDXjQORI5a8qS8POSHbJmW0MNVnaF/8=; b=KsELhhWqr34Y0xNDCCgMbib2kzWbx3x1KfbFJRTP4MzCsCCI4FkaQfK72iHkgCAW1QppqH X5GkBQ2xKAbz1T/6g4f/quY0GA+oUxWoV38xueMrj0TVcEhH1loyeoo7D1VwXt4rYcpbIM yA1oxoyWs8gqYTlAZtQMYz/fVMRJIO8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-54-qI29_hu9MceI7InUEwRFCg-1; Fri, 22 Nov 2019 09:41:48 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7A78FDB20; Fri, 22 Nov 2019 14:41:47 +0000 (UTC) Received: from rh.redhat.com (unknown [10.36.118.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69E6C6E71B; Fri, 22 Nov 2019 14:41:44 +0000 (UTC) From: Kevin Traynor To: David Marchand Cc: Chas Williams , dpdk stable Date: Fri, 22 Nov 2019 14:40:48 +0000 Message-Id: <20191122144131.21231-2-ktraynor@redhat.com> In-Reply-To: <20191122144131.21231-1-ktraynor@redhat.com> References: <20191122144131.21231-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: qI29_hu9MceI7InUEwRFCg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/bonding: fix LACP fast queue Rx handler' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/29/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 rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/33cd77ef2677973cd2= cdfdacede1d1396b48e7c5 Thanks. Kevin. --- >From 33cd77ef2677973cd2cdfdacede1d1396b48e7c5 Mon Sep 17 00:00:00 2001 From: David Marchand 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 Acked-by: Chas Williams --- drivers/net/bonding/rte_eth_bond_pmd.c | 73 ++++++++++---------------- 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/r= te_eth_bond_pmd.c index 5fd04db17..3f8d3ba87 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -253,46 +253,7 @@ bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_d= ev, uint16_t slave_port) { } =20 -static uint16_t -bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs= , -=09=09uint16_t nb_pkts) -{ -=09struct bond_rx_queue *bd_rx_q =3D (struct bond_rx_queue *)queue; -=09struct bond_dev_private *internals =3D bd_rx_q->dev_private; -=09uint16_t num_rx_total =3D 0;=09/* Total number of received packets */ -=09uint16_t slaves[RTE_MAX_ETHPORTS]; -=09uint16_t slave_count; -=09uint16_t active_slave; -=09uint16_t i; - -=09/* Copy slave list to protect against slave up/down changes during tx -=09 * bursting */ -=09slave_count =3D internals->active_slave_count; -=09active_slave =3D internals->active_slave; -=09memcpy(slaves, internals->active_slaves, -=09=09=09sizeof(internals->active_slaves[0]) * slave_count); - -=09for (i =3D 0; i < slave_count && nb_pkts; i++) { -=09=09uint16_t num_rx_slave; - -=09=09/* Read packets from this slave */ -=09=09num_rx_slave =3D rte_eth_rx_burst(slaves[active_slave], -=09=09=09=09=09=09bd_rx_q->queue_id, -=09=09=09=09=09=09bufs + num_rx_total, nb_pkts); -=09=09num_rx_total +=3D num_rx_slave; -=09=09nb_pkts -=3D num_rx_slave; - -=09=09if (++active_slave =3D=3D slave_count) -=09=09=09active_slave =3D 0; -=09} - -=09if (++internals->active_slave >=3D slave_count) -=09=09internals->active_slave =3D 0; - -=09return num_rx_total; -} - -static uint16_t -bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, -=09=09uint16_t nb_pkts) +static inline uint16_t +rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts, +=09=09bool dedicated_rxq) { =09/* Cast to structure, containing bonded device's port id and queue id *= / @@ -354,8 +315,14 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mb= uf **bufs, =09=09=09subtype =3D ((struct slow_protocol_frame *)hdr)->slow_protocol.su= btype; =20 -=09=09=09/* Remove packet from array if it is slow packet or slave is not -=09=09=09 * in collecting state or bonding interface is not in promiscuous -=09=09=09 * mode and packet address does not match. */ -=09=09=09if (unlikely(is_lacp_packets(hdr->ether_type, subtype, bufs[j]) |= | +=09=09=09/* Remove packet from array if: +=09=09=09 * - it is slow packet but no dedicated rxq is present, +=09=09=09 * - slave is not in collecting state, +=09=09=09 * - bonding interface is not in promiscuous mode and +=09=09=09 * packet is not multicast and address does not match, +=09=09=09 */ +=09=09=09if (unlikely( +=09=09=09=09(!dedicated_rxq && +=09=09=09=09 is_lacp_packets(hdr->ether_type, subtype, +=09=09=09=09=09=09 bufs[j])) || =09=09=09=09!collecting || =09=09=09=09(!promisc && @@ -389,4 +356,18 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mb= uf **bufs, } =20 +static uint16_t +bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, +=09=09uint16_t nb_pkts) +{ +=09return rx_burst_8023ad(queue, bufs, nb_pkts, false); +} + +static uint16_t +bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs= , +=09=09uint16_t nb_pkts) +{ +=09return rx_burst_8023ad(queue, bufs, nb_pkts, true); +} + #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_AL= B_L1) uint32_t burstnumberRX; --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-11-22 14:36:55.327770946 +0000 +++ 0002-net-bonding-fix-LACP-fast-queue-Rx-handler.patch=092019-11-22 14:3= 6:55.109151167 +0000 @@ -1 +1 @@ -From 58729b54949598cc43d56e22ef813b620651bb6a Mon Sep 17 00:00:00 2001 +From 33cd77ef2677973cd2cdfdacede1d1396b48e7c5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 58729b54949598cc43d56e22ef813b620651bb6a ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 6abd9581c..44af5ade1 100644 +index 5fd04db17..3f8d3ba87 100644 @@ -23 +24 @@ -@@ -255,46 +255,7 @@ bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_= dev, uint16_t slave_port) { +@@ -253,46 +253,7 @@ bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_= dev, uint16_t slave_port) { @@ -73 +74 @@ -@@ -357,8 +318,14 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_m= buf **bufs, +@@ -354,8 +315,14 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_m= buf **bufs, @@ -92 +93 @@ -@@ -392,4 +359,18 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_m= buf **bufs, +@@ -389,4 +356,18 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_m= buf **bufs,