From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BB632A0C4C for ; Mon, 12 Jul 2021 15:08:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A956A4069D; Mon, 12 Jul 2021 15:08:11 +0200 (CEST) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mails.dpdk.org (Postfix) with ESMTP id 6F4694069D for ; Mon, 12 Jul 2021 15:08:10 +0200 (CEST) Received: by mail-wm1-f53.google.com with SMTP id l6so3085100wmq.0 for ; Mon, 12 Jul 2021 06:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6BQNx2l6u3ZpN7JwzpLkWFIpEBi+zqNI5ZJrfDPvglc=; b=GKA6nZpEfer2Ul7SnadWjUVOcvVW6852lFJTR5llLp2fBJyFQg7pf3icWic8Dufu7t vvpjGj5afw6NNGz4XD/l/08lOuFLIRYfhObzxW7g0aavJYYXKSJMYpvzeQ0odOaOrz24 VSB33rhTMGdfZmvGNJfGzeUpQrx8DdT+16JsK/iW+l7tqSF4Na01kqBko5IVpBF8LPtj VhPM2mR4s2Vppfw1RssJxURwjDs7BofXANv0NOgy5L8Pi4fSlOzmXpCHk+Ks3wiEQFVO A6DeTqL5p1jRa1A5+th4iLddhgieIsAw7IqGwmOsFrFicILQn+2AYHvSqufd5UNC0ut9 TENA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6BQNx2l6u3ZpN7JwzpLkWFIpEBi+zqNI5ZJrfDPvglc=; b=S8NdEEsV/y7kdEClRDzp9cAiToEtM5H+XHFAWIWVmmXQgIMi7x9JrZ6p5PS1PrkrEm ZSELvGe5cRZGCd7f4xHIFWX+661phbWJTDrfEWB6w/T69YuZFqY7qoQQYTqj6ZfCcGP5 P+1ztxU+jVrMzMR9074D51Ph/pLGHLgs8E6/kD0/XmqT/xs0chGOTO8bG2X0sL4DOSK3 b41DPeTT23mSgp+NpEmpG3fXE4xq8/Rv0PJfepHO+KrqhAhbaiPdKUuwF3mvhTCpTAgH ZW7G+37SeFjMM0orBbWzzbbyUDElc59H6rWe6lxtLNpeN2ItmWII08jW2AL9vCcKk9Wg 3koA== X-Gm-Message-State: AOAM533S/IDycYDb0EhOMV56swFj2mUP3/LEi/dVSnyWkFcdx3kIZ50T 7Cv9kTF2zyBBOoJ+NslMnzqmTulIZOQuqQ== X-Google-Smtp-Source: ABdhPJw4XlPvKltAY2I54Obf+Vzz5oco3qtFRAUgOVrNRdwVld0uYwTUzTCJ9xiImyZynfDNAZnY8Q== X-Received: by 2002:a1c:4b0a:: with SMTP id y10mr25747628wma.178.1626095290145; Mon, 12 Jul 2021 06:08:10 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id o3sm13380112wrm.5.2021.07.12.06.08.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:08:09 -0700 (PDT) From: luca.boccassi@gmail.com To: Lance Richardson Cc: Ajit Khaparde , dpdk stable Date: Mon, 12 Jul 2021 14:04:01 +0100 Message-Id: <20210712130551.2462159-6-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/bnxt: fix Rx burst size constraint' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. 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. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/70314ce0288d6967c9b6be1e2df5b51c8e32f480 Thanks. Luca Boccassi --- >From 70314ce0288d6967c9b6be1e2df5b51c8e32f480 Mon Sep 17 00:00:00 2001 From: Lance Richardson Date: Mon, 24 May 2021 14:59:50 -0400 Subject: [PATCH] net/bnxt: fix Rx burst size constraint [ upstream commit 008feb839f4e2829db8510719f5a393da803fc1b ] The burst receive function should return all packets currently present in the receive ring up to the requested burst size, update vector mode receive functions accordingly. Fixes: 398358341419 ("net/bnxt: support NEON") Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode") Signed-off-by: Lance Richardson Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 29 +++++++++++++++++++++------ drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 29 +++++++++++++++++++++------ 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c index 54f47a3fe1..3292852c42 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c @@ -151,9 +151,8 @@ descs_to_mbufs(uint32x4_t mm_rxcmp[4], uint32x4_t mm_rxcmp1[4], vst1q_u32((uint32_t *)&mbuf[3]->rx_descriptor_fields1, tmp); } -uint16_t -bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, - uint16_t nb_pkts) +static uint16_t +recv_burst_vec_neon(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { struct bnxt_rx_queue *rxq = rx_queue; struct bnxt_cp_ring_info *cpr = rxq->cp_ring; @@ -178,9 +177,6 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, if (rxq->rxrearm_nb >= rxq->rx_free_thresh) bnxt_rxq_rearm(rxq, rxr); - /* Return no more than RTE_BNXT_MAX_RX_BURST per call. */ - nb_pkts = RTE_MIN(nb_pkts, RTE_BNXT_MAX_RX_BURST); - cons = raw_cons & (cp_ring_size - 1); mbcons = (raw_cons / 2) & (rx_ring_size - 1); @@ -314,6 +310,27 @@ out: return nb_rx_pkts; } +uint16_t +bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +{ + uint16_t cnt = 0; + + while (nb_pkts > RTE_BNXT_MAX_RX_BURST) { + uint16_t burst; + + burst = recv_burst_vec_neon(rx_queue, rx_pkts + cnt, + RTE_BNXT_MAX_RX_BURST); + + cnt += burst; + nb_pkts -= burst; + + if (burst < RTE_BNXT_MAX_RX_BURST) + return cnt; + } + + return cnt + recv_burst_vec_neon(rx_queue, rx_pkts + cnt, nb_pkts); +} + static void bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq) { diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c index 621f567890..ae73455c63 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c @@ -143,9 +143,8 @@ descs_to_mbufs(__m128i mm_rxcmp[4], __m128i mm_rxcmp1[4], _mm_store_si128((void *)&mbuf[3]->rx_descriptor_fields1, t0); } -uint16_t -bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, - uint16_t nb_pkts) +static uint16_t +recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { struct bnxt_rx_queue *rxq = rx_queue; const __m128i mbuf_init = _mm_set_epi64x(0, rxq->mbuf_initializer); @@ -170,9 +169,6 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, if (rxq->rxrearm_nb >= rxq->rx_free_thresh) bnxt_rxq_rearm(rxq, rxr); - /* Return no more than RTE_BNXT_MAX_RX_BURST per call. */ - nb_pkts = RTE_MIN(nb_pkts, RTE_BNXT_MAX_RX_BURST); - cons = raw_cons & (cp_ring_size - 1); mbcons = (raw_cons / 2) & (rx_ring_size - 1); @@ -296,6 +292,27 @@ out: return nb_rx_pkts; } +uint16_t +bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +{ + uint16_t cnt = 0; + + while (nb_pkts > RTE_BNXT_MAX_RX_BURST) { + uint16_t burst; + + burst = recv_burst_vec_sse(rx_queue, rx_pkts + cnt, + RTE_BNXT_MAX_RX_BURST); + + cnt += burst; + nb_pkts -= burst; + + if (burst < RTE_BNXT_MAX_RX_BURST) + return cnt; + } + + return cnt + recv_burst_vec_sse(rx_queue, rx_pkts + cnt, nb_pkts); +} + static void bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq) { -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:37.202112427 +0100 +++ 0006-net-bnxt-fix-Rx-burst-size-constraint.patch 2021-07-12 13:41:36.158115694 +0100 @@ -1 +1 @@ -From 008feb839f4e2829db8510719f5a393da803fc1b Mon Sep 17 00:00:00 2001 +From 70314ce0288d6967c9b6be1e2df5b51c8e32f480 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 008feb839f4e2829db8510719f5a393da803fc1b ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index a6fbc0b0bf..a6e630ea5e 100644 +index 54f47a3fe1..3292852c42 100644 @@ -25 +26 @@ -@@ -158,9 +158,8 @@ descs_to_mbufs(uint32x4_t mm_rxcmp[4], uint32x4_t mm_rxcmp1[4], +@@ -151,9 +151,8 @@ descs_to_mbufs(uint32x4_t mm_rxcmp[4], uint32x4_t mm_rxcmp1[4], @@ -37 +38 @@ -@@ -185,9 +184,6 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -178,9 +177,6 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -47 +48 @@ -@@ -305,6 +301,27 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -314,6 +310,27 @@ out: @@ -76 +77 @@ -index 6dd18a0077..fe074f82cf 100644 +index 621f567890..ae73455c63 100644 @@ -79 +80 @@ -@@ -149,9 +149,8 @@ descs_to_mbufs(__m128i mm_rxcmp[4], __m128i mm_rxcmp1[4], +@@ -143,9 +143,8 @@ descs_to_mbufs(__m128i mm_rxcmp[4], __m128i mm_rxcmp1[4], @@ -91 +92 @@ -@@ -176,9 +175,6 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -170,9 +169,6 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -101 +102 @@ -@@ -286,6 +282,27 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -296,6 +292,27 @@ out: