From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D1951A0096 for ; Fri, 12 Apr 2019 16:02:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 752FF1B13C; Fri, 12 Apr 2019 16:02:06 +0200 (CEST) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) by dpdk.org (Postfix) with ESMTP id 37E5F1B127; Fri, 12 Apr 2019 16:02:00 +0200 (CEST) Received: by mail-qt1-f196.google.com with SMTP id h39so11334205qte.2; Fri, 12 Apr 2019 07:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0aICY92S+cxsKLdhiSHTMZPMqYlnLXXi//o01KIQc4c=; b=JY3VwYx6bw+vYR0o5NYBbzoMt8WwokqxNqisNG7tJPn1W2tPfUzVrOSawvUTtBcGJS Jm5AI1iKDAmtLOjcrKhBDiZamJ6VIiGuKADyhslu0VWV/gS+XKfsMhn1fWMAfprtJ+w2 o+nZv6YX5kIQTue4Bvl//AqQgfGjynXPeGB2Sd7qy2hsrQEx/6o3eop+YFUf6Yum0lKB t2teCv4lCq7eNpujG6ONJWLIITYRNpN5HoyQjaH168c4/IURIUTUL62RjzAi/OQNO+jZ /sw+y36idSDcnQuY5RaX6l7FgBAv7U/0YhZ7Bp9MotwQGfaR92iKNlIKz2xw5s7QRN5W U65A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0aICY92S+cxsKLdhiSHTMZPMqYlnLXXi//o01KIQc4c=; b=VjRJKjOPvCpEU8afyBTjwCHtJY3uu4DE+DtqONNusDSVf/zMG20+qNeN8F/XD9j93r bQnllQ8uWc4Vp2qDdY30E7+kRw18MpqiKAeaL1z21fNTA9zX0Hv9kYI12eV4V0wow+Dv L7SIVYP5dspmhqf0ZOs69Gg0UcBh7bwrWnmauJpTpEQ40216cKwJDkZB21+ABszYHPoa 5guM0KdGdw7F6IMnTKk163eZgmHgV95yV06a9tTBTsfBdxjvsSm1c9ekQSN6IO6PwFEE cnxfmdeATqt8xA3fBThP6UODe5vLPDadl4nLnzdcBSY9vzKR68ElAj9bHCvh0+lm7r2Y +Z/A== X-Gm-Message-State: APjAAAVLUTCsOITqxTxMfTy9fLEM9x4EpYa0NyPG1y5LIUv71J9HuQVV c1LdDRQjemrSuXFpQXxyMh4YUS5z X-Google-Smtp-Source: APXvYqwZM3qb1unCqr/s4Mfn628O3Ys1RnHzBRm8NFslbS34GNuJUXdv0fRiv7hSVUEMxxOBoPE84g== X-Received: by 2002:a0c:b5d0:: with SMTP id o16mr46029549qvf.187.1555077719268; Fri, 12 Apr 2019 07:01:59 -0700 (PDT) Received: from [192.168.1.10] (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id s12sm24688947qke.36.2019.04.12.07.01.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Apr 2019 07:01:58 -0700 (PDT) To: David Marchand , dev@dpdk.org Cc: p.oltarzewski@gmail.com, stable@dpdk.org References: <1554900829-16180-1-git-send-email-david.marchand@redhat.com> <1554900829-16180-3-git-send-email-david.marchand@redhat.com> From: Chas Williams <3chas3@gmail.com> Message-ID: <9a4fa115-0f92-9686-ae89-0f1427ab6d29@gmail.com> Date: Fri, 12 Apr 2019 10:01:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1554900829-16180-3-git-send-email-david.marchand@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH 2/4] net/bonding: fix LACP fast queue Rx handler 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" I should have some time this weekend to run these patches through our regression system. On 4/10/19 8:53 AM, David Marchand wrote: > 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@dpdk.org > > Signed-off-by: David Marchand > --- > 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/rte_eth_bond_pmd.c > index c193d6d..989be5c 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -256,48 +256,9 @@ > 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_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; > @@ -357,10 +318,16 @@ > 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( The coding style checker doesn't like this: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' > + (!dedicated_rxq && > + is_lacp_packets(hdr->ether_type, subtype, > + bufs[j])) || > !collecting || > (!promisc && > !is_multicast_ether_addr(&hdr->d_addr) && > @@ -392,6 +359,20 @@ > 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; >