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 740CCA04DD for ; Wed, 18 Nov 2020 17:38:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF25158C4; Wed, 18 Nov 2020 17:37:53 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 3577358C4 for ; Wed, 18 Nov 2020 17:37:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605717470; 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=xFQ4DugOzhMmKW/1L8tq2ByWe9iwWvWVvhYKfC2B1LA=; b=JBFnfrM1we6vDIwV8L/Q3kK28IuO8pq3eBXO6bkJaNjwLqFuAHkXn08gbPH5g2UiObXAf6 8bVcYLkWSfnXUxuu0q6Ja8kFKZ19IDp8TKoTGQOjY2ks/BgAKPUMTANTDSV+PzDdlHmLm3 zqwPWg4uu7puStKvUzT/quXkGti9/60= 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-277-ph0nlrpgMNucSMV449SiSQ-1; Wed, 18 Nov 2020 11:37:47 -0500 X-MC-Unique: ph0nlrpgMNucSMV449SiSQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7C6F9108E1A2; Wed, 18 Nov 2020 16:37:46 +0000 (UTC) Received: from rh.redhat.com (ovpn-113-249.ams2.redhat.com [10.36.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D5555C1A3; Wed, 18 Nov 2020 16:37:45 +0000 (UTC) From: Kevin Traynor To: Jeff Guo Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= , Qi Zhang , dpdk stable Date: Wed, 18 Nov 2020 16:35:40 +0000 Message-Id: <20201118163558.1101823-54-ktraynor@redhat.com> In-Reply-To: <20201118163558.1101823-1-ktraynor@redhat.com> References: <20201118163558.1101823-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/i40e: fix vector Rx' has been queued to LTS release 18.11.11 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.11 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/24/20. 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/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/f12b0feb97b85829fc2e8f77aafbe63da4925f51 Thanks. Kevin. --- >From f12b0feb97b85829fc2e8f77aafbe63da4925f51 Mon Sep 17 00:00:00 2001 From: Jeff Guo Date: Fri, 16 Oct 2020 17:44:28 +0800 Subject: [PATCH] net/i40e: fix vector Rx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 9e27f00f3a61939e02429d5782ca10bc4cd5e315 ] The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing. Bugzilla ID: 516 Fixes: 5b463eda8d26 ("net/i40e: make vector driver filenames consistent") Fixes: ae0eb310f253 ("net/i40e: implement vector PMD for ARM") Fixes: c3def6a8724c ("net/i40e: implement vector PMD for altivec") Signed-off-by: Jeff Guo Acked-by: Morten Brørup Acked-by: Qi Zhang --- drivers/net/i40e/i40e_rxtx_vec_altivec.c | 59 +++++++++++++++++------- drivers/net/i40e/i40e_rxtx_vec_neon.c | 48 ++++++++++++++----- drivers/net/i40e/i40e_rxtx_vec_sse.c | 48 ++++++++++++++----- 3 files changed, 114 insertions(+), 41 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c index f3fc82672e..3a42636e05 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c +++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c @@ -218,9 +218,11 @@ desc_to_ptype_v(vector unsigned long descs[4], struct rte_mbuf **rx_pkts, } - /* Notice: - * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet - * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST - * numbers of DD bits - */ +/** + * vPMD raw receive routine, only accept(nb_pkts >= RTE_I40E_DESCS_PER_LOOP) + * + * Notice: + * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet + * - floor align nb_pkts to a RTE_I40E_DESCS_PER_LOOP power-of-two + */ static inline uint16_t _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, @@ -244,7 +246,4 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, vector unsigned long dd_check, eop_check; - /* nb_pkts shall be less equal than RTE_I40E_MAX_RX_BURST */ - nb_pkts = RTE_MIN(nb_pkts, RTE_I40E_MAX_RX_BURST); - /* nb_pkts has to be floor-aligned to RTE_I40E_DESCS_PER_LOOP */ nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_I40E_DESCS_PER_LOOP); @@ -489,13 +488,13 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, } - /* vPMD receive routine that reassembles scattered packets - * Notice: - * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet - * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST - * numbers of DD bits - */ -uint16_t -i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, - uint16_t nb_pkts) +/** + * vPMD receive routine that reassembles single burst of 32 scattered packets + * + * Notice: + * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet + */ +static uint16_t +i40e_recv_scattered_burst_vec(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts) { struct i40e_rx_queue *rxq = rx_queue; @@ -530,4 +529,30 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, } +/** + * vPMD receive routine that reassembles scattered packets. + */ +uint16_t +i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts) +{ + uint16_t retval = 0; + + while (nb_pkts > RTE_I40E_VPMD_RX_BURST) { + uint16_t burst; + + burst = i40e_recv_scattered_burst_vec(rx_queue, + rx_pkts + retval, + RTE_I40E_VPMD_RX_BURST); + retval += burst; + nb_pkts -= burst; + if (burst < RTE_I40E_VPMD_RX_BURST) + return retval; + } + + return retval + i40e_recv_scattered_burst_vec(rx_queue, + rx_pkts + retval, + nb_pkts); +} + static inline void vtx1(volatile struct i40e_tx_desc *txdp, diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c index 56fc355ee2..5cac418cf0 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_neon.c +++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c @@ -188,9 +188,10 @@ desc_to_ptype_v(uint64x2_t descs[4], struct rte_mbuf **rx_pkts, } - /* +/** + * vPMD raw receive routine, only accept(nb_pkts >= RTE_I40E_DESCS_PER_LOOP) + * * Notice: * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet - * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST - * numbers of DD bits + * - floor align nb_pkts to a RTE_I40E_DESCS_PER_LOOP power-of-two */ static inline uint16_t @@ -230,7 +231,4 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, }; - /* nb_pkts shall be less equal than RTE_I40E_MAX_RX_BURST */ - nb_pkts = RTE_MIN(nb_pkts, RTE_I40E_MAX_RX_BURST); - /* nb_pkts has to be floor-aligned to RTE_I40E_DESCS_PER_LOOP */ nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_I40E_DESCS_PER_LOOP); @@ -439,13 +437,13 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, } - /* vPMD receive routine that reassembles scattered packets +/** + * vPMD receive routine that reassembles single burst of 32 scattered packets + * * Notice: * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet - * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST - * numbers of DD bits */ -uint16_t -i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, - uint16_t nb_pkts) +static uint16_t +i40e_recv_scattered_burst_vec(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts) { @@ -482,4 +480,30 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, } +/** + * vPMD receive routine that reassembles scattered packets. + */ +uint16_t +i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts) +{ + uint16_t retval = 0; + + while (nb_pkts > RTE_I40E_VPMD_RX_BURST) { + uint16_t burst; + + burst = i40e_recv_scattered_burst_vec(rx_queue, + rx_pkts + retval, + RTE_I40E_VPMD_RX_BURST); + retval += burst; + nb_pkts -= burst; + if (burst < RTE_I40E_VPMD_RX_BURST) + return retval; + } + + return retval + i40e_recv_scattered_burst_vec(rx_queue, + rx_pkts + retval, + nb_pkts); +} + static inline void vtx1(volatile struct i40e_tx_desc *txdp, diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c index 1fc66b781a..f70969335f 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_sse.c +++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c @@ -207,9 +207,10 @@ desc_to_ptype_v(__m128i descs[4], struct rte_mbuf **rx_pkts, } - /* +/** + * vPMD raw receive routine, only accept(nb_pkts >= RTE_I40E_DESCS_PER_LOOP) + * * Notice: * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet - * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST - * numbers of DD bits + * - floor align nb_pkts to a RTE_I40E_DESCS_PER_LOOP power-of-two */ static inline uint16_t @@ -243,7 +244,4 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, __m128i dd_check, eop_check; - /* nb_pkts shall be less equal than RTE_I40E_MAX_RX_BURST */ - nb_pkts = RTE_MIN(nb_pkts, RTE_I40E_MAX_RX_BURST); - /* nb_pkts has to be floor-aligned to RTE_I40E_DESCS_PER_LOOP */ nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_I40E_DESCS_PER_LOOP); @@ -470,13 +468,13 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, } - /* vPMD receive routine that reassembles scattered packets +/** + * vPMD receive routine that reassembles single burst of 32 scattered packets + * * Notice: * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet - * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST - * numbers of DD bits */ -uint16_t -i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, - uint16_t nb_pkts) +static uint16_t +i40e_recv_scattered_burst_vec(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts) { @@ -513,4 +511,30 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, } +/** + * vPMD receive routine that reassembles scattered packets. + */ +uint16_t +i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts) +{ + uint16_t retval = 0; + + while (nb_pkts > RTE_I40E_VPMD_RX_BURST) { + uint16_t burst; + + burst = i40e_recv_scattered_burst_vec(rx_queue, + rx_pkts + retval, + RTE_I40E_VPMD_RX_BURST); + retval += burst; + nb_pkts -= burst; + if (burst < RTE_I40E_VPMD_RX_BURST) + return retval; + } + + return retval + i40e_recv_scattered_burst_vec(rx_queue, + rx_pkts + retval, + nb_pkts); +} + static inline void vtx1(volatile struct i40e_tx_desc *txdp, -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-18 16:33:38.960290711 +0000 +++ 0054-net-i40e-fix-vector-Rx.patch 2020-11-18 16:33:37.979215094 +0000 @@ -1 +1 @@ -From 9e27f00f3a61939e02429d5782ca10bc4cd5e315 Mon Sep 17 00:00:00 2001 +From f12b0feb97b85829fc2e8f77aafbe63da4925f51 Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 9e27f00f3a61939e02429d5782ca10bc4cd5e315 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index 6862a017e1..d3238bfb6a 100644 +index f3fc82672e..3a42636e05 100644 @@ -33 +34 @@ -@@ -189,9 +189,11 @@ desc_to_ptype_v(vector unsigned long descs[4], struct rte_mbuf **rx_pkts, +@@ -218,9 +218,11 @@ desc_to_ptype_v(vector unsigned long descs[4], struct rte_mbuf **rx_pkts, @@ -50 +51 @@ -@@ -215,7 +217,4 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, +@@ -244,7 +246,4 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, @@ -58 +59 @@ -@@ -460,13 +459,13 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -489,13 +488,13 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -81 +82 @@ -@@ -501,4 +500,30 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -530,4 +529,30 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -113 +114 @@ -index 543ecadb07..f094de69ae 100644 +index 56fc355ee2..5cac418cf0 100644 @@ -116 +117 @@ -@@ -188,9 +188,10 @@ desc_to_ptype_v(uint64x2_t descs[4], struct rte_mbuf **__rte_restrict rx_pkts, +@@ -188,9 +188,10 @@ desc_to_ptype_v(uint64x2_t descs[4], struct rte_mbuf **rx_pkts, @@ -130 +131 @@ -@@ -231,7 +232,4 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *__rte_restrict rxq, +@@ -230,7 +231,4 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, @@ -138 +139 @@ -@@ -440,13 +438,13 @@ i40e_recv_pkts_vec(void *__rte_restrict rx_queue, +@@ -439,13 +437,13 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -158 +159 @@ -@@ -483,4 +481,30 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -482,4 +480,30 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -190 +191 @@ -index 240ce478ab..4b2b6a28fc 100644 +index 1fc66b781a..f70969335f 100644 @@ -193 +194 @@ -@@ -343,9 +343,10 @@ desc_to_ptype_v(__m128i descs[4], struct rte_mbuf **rx_pkts, +@@ -207,9 +207,10 @@ desc_to_ptype_v(__m128i descs[4], struct rte_mbuf **rx_pkts, @@ -207 +208 @@ -@@ -379,7 +380,4 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, +@@ -243,7 +244,4 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts, @@ -215 +216 @@ -@@ -606,13 +604,13 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -470,13 +468,13 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -235 +236 @@ -@@ -649,4 +647,30 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, +@@ -513,4 +511,30 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,