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 32BD7A0C4C for ; Mon, 12 Jul 2021 15:11:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26BF04069D; Mon, 12 Jul 2021 15:11:05 +0200 (CEST) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mails.dpdk.org (Postfix) with ESMTP id 1BF3F4069D for ; Mon, 12 Jul 2021 15:11:04 +0200 (CEST) Received: by mail-wr1-f54.google.com with SMTP id d2so25605944wrn.0 for ; Mon, 12 Jul 2021 06:11:04 -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=Kl0JXbK2Y/K/E0ywbtMcjKJTQmr0CEQoF+BpyCvizx4=; b=RWzsL6hQ5d6R42xL34+7upwp7uLZef/cUK2Df/CkmOXwoJGH0S98EHTsGZXqBgN2Zp mYFTVgOD3FDKK1u/od1IGtHrp6DgeCrwCN2mU6mgTL28DwB/LnxQTcn4vW1+7434dhmC Khxoo+dfhViE4fCy0ozVfE5R7I3utVqPpll4Jotw8eQ7zuqe+3hW+Ld93E80kqPrneYB YmT4A6OkY9hpID90WzSfy/FETK1tiutZGkA8Zj7kj8UiW+2CG1ZilfS/bH06BKaHgkz+ eow3tJjL1ZuJII4/2Yud/T9bwRIHtnmw3tOf6PB1S1k4nKrSqlFdnHr9WgiGprujiwGv ZEgw== 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=Kl0JXbK2Y/K/E0ywbtMcjKJTQmr0CEQoF+BpyCvizx4=; b=S+M1eLY9JcSx4d+Nmel9oi5FwPPk9E34c1975amAY4lXIZKLBRGVoBSi3Ym1cjYWwG /kMTyzNcyujM5LsxcYSIN0Jn7DVvGPvZe5PEoX98lAnSAPgppnHy1UClkRIQ6eVYW5yu mFR2fvi6RyEu3+bAqhcmT0ThG7bRhuyzcbgcGe33qjR0oTVvo7+CrTy4/a5D1ISVfsIj 6vDq/BSNb/2W73lOUx9ZWW4zMI8X5LWCyyWxo3eAVc06Tkq+L+0wg+ZCWuONARg8Gjmj bLgI3VRtypZv91kweL5Bo2EpO1UD5SBEund4USuNYYM18gcaP2hIdjpV+4+pas24E9XC V1PA== X-Gm-Message-State: AOAM53286IeVaD+lw3HIp2G8RCnYVxwfdGE+H2CizPFl7gtMAMqJS3LC VQcKbFvzSwW+KqYkLtN9B+A= X-Google-Smtp-Source: ABdhPJzgF+lMf8QOv+bLmFMKCnLpvUAp897l6LjXQQmjiNhx84nd6AIe4lk62NnKBXvks51+eUwBvQ== X-Received: by 2002:a5d:504d:: with SMTP id h13mr19111940wrt.46.1626095463907; Mon, 12 Jul 2021 06:11:03 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id r4sm14662025wre.84.2021.07.12.06.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:11:02 -0700 (PDT) From: luca.boccassi@gmail.com To: Qi Zhang Cc: Yixue Wang , dpdk stable Date: Mon, 12 Jul 2021 14:04:16 +0100 Message-Id: <20210712130551.2462159-21-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/ice: fix data path selection in secondary process' 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/744e86e08926c83225e70abb15be69d84d15d361 Thanks. Luca Boccassi --- >From 744e86e08926c83225e70abb15be69d84d15d361 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Mon, 24 May 2021 17:07:59 +0800 Subject: [PATCH] net/ice: fix data path selection in secondary process [ upstream commit f8b3326f3116afb357beac730577fec6ffbf2d83 ] The flag use_avx2 and use_avx512 are defined as local variables, they will not be aware by the secondary process, then wrong data path is selected. Fix the issue by moving them into struct ice_adapter. Fixes: ae60d3c9b227 ("net/ice: support Rx AVX2 vector") Fixes: 2d5f6953d56d ("net/ice: support vector AVX2 in Tx") Fixes: 7f85d5ebcfe1 ("net/ice: add AVX512 vector path") Reported-by: Yixue Wang Signed-off-by: Qi Zhang Tested-by: Yixue Wang --- drivers/net/ice/ice_ethdev.h | 6 ++++++ drivers/net/ice/ice_rxtx.c | 38 ++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index 2b03c59671..6a2bf58560 100644 --- a/drivers/net/ice/ice_ethdev.h +++ b/drivers/net/ice/ice_ethdev.h @@ -479,6 +479,12 @@ struct ice_adapter { struct ice_devargs devargs; enum ice_pkg_type active_pkg_type; /* loaded ddp package type */ uint16_t fdir_ref_cnt; +#ifdef RTE_ARCH_X86 + bool rx_use_avx2; + bool rx_use_avx512; + bool tx_use_avx2; + bool tx_use_avx512; +#endif }; struct ice_vsi_vlan_pvid_info { diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index c98328ce0b..d200d21347 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -3025,10 +3025,10 @@ ice_set_rx_function(struct rte_eth_dev *dev) #ifdef RTE_ARCH_X86 struct ice_rx_queue *rxq; int i; - bool use_avx512 = false; - bool use_avx2 = false; if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + ad->rx_use_avx512 = false; + ad->rx_use_avx2 = false; if (!ice_rx_vec_dev_check(dev) && ad->rx_bulk_alloc_allowed && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { ad->rx_vec_allowed = true; @@ -3044,16 +3044,16 @@ ice_set_rx_function(struct rte_eth_dev *dev) rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 && rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1) #ifdef CC_AVX512_SUPPORT - use_avx512 = true; + ad->rx_use_avx512 = true; #else PMD_DRV_LOG(NOTICE, "AVX512 is not supported in build env"); #endif - if (!use_avx512 && + if (!ad->rx_use_avx512 && (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 || rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256) - use_avx2 = true; + ad->rx_use_avx2 = true; } else { ad->rx_vec_allowed = false; @@ -3062,7 +3062,7 @@ ice_set_rx_function(struct rte_eth_dev *dev) if (ad->rx_vec_allowed) { if (dev->data->scattered_rx) { - if (use_avx512) { + if (ad->rx_use_avx512) { #ifdef CC_AVX512_SUPPORT PMD_DRV_LOG(NOTICE, "Using AVX512 Vector Scattered Rx (port %d).", @@ -3073,14 +3073,14 @@ ice_set_rx_function(struct rte_eth_dev *dev) } else { PMD_DRV_LOG(DEBUG, "Using %sVector Scattered Rx (port %d).", - use_avx2 ? "avx2 " : "", + ad->rx_use_avx2 ? "avx2 " : "", dev->data->port_id); - dev->rx_pkt_burst = use_avx2 ? + dev->rx_pkt_burst = ad->rx_use_avx2 ? ice_recv_scattered_pkts_vec_avx2 : ice_recv_scattered_pkts_vec; } } else { - if (use_avx512) { + if (ad->rx_use_avx512) { #ifdef CC_AVX512_SUPPORT PMD_DRV_LOG(NOTICE, "Using AVX512 Vector Rx (port %d).", @@ -3091,9 +3091,9 @@ ice_set_rx_function(struct rte_eth_dev *dev) } else { PMD_DRV_LOG(DEBUG, "Using %sVector Rx (port %d).", - use_avx2 ? "avx2 " : "", + ad->rx_use_avx2 ? "avx2 " : "", dev->data->port_id); - dev->rx_pkt_burst = use_avx2 ? + dev->rx_pkt_burst = ad->rx_use_avx2 ? ice_recv_pkts_vec_avx2 : ice_recv_pkts_vec; } @@ -3241,10 +3241,10 @@ ice_set_tx_function(struct rte_eth_dev *dev) #ifdef RTE_ARCH_X86 struct ice_tx_queue *txq; int i; - bool use_avx512 = false; - bool use_avx2 = false; if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + ad->tx_use_avx2 = false; + ad->tx_use_avx512 = false; if (!ice_tx_vec_dev_check(dev) && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { ad->tx_vec_allowed = true; @@ -3260,16 +3260,16 @@ ice_set_tx_function(struct rte_eth_dev *dev) rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 && rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1) #ifdef CC_AVX512_SUPPORT - use_avx512 = true; + ad->tx_use_avx512 = true; #else PMD_DRV_LOG(NOTICE, "AVX512 is not supported in build env"); #endif - if (!use_avx512 && + if (!ad->tx_use_avx512 && (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 || rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256) - use_avx2 = true; + ad->tx_use_avx2 = true; } else { ad->tx_vec_allowed = false; @@ -3277,7 +3277,7 @@ ice_set_tx_function(struct rte_eth_dev *dev) } if (ad->tx_vec_allowed) { - if (use_avx512) { + if (ad->tx_use_avx512) { #ifdef CC_AVX512_SUPPORT PMD_DRV_LOG(NOTICE, "Using AVX512 Vector Tx (port %d).", dev->data->port_id); @@ -3285,9 +3285,9 @@ ice_set_tx_function(struct rte_eth_dev *dev) #endif } else { PMD_DRV_LOG(DEBUG, "Using %sVector Tx (port %d).", - use_avx2 ? "avx2 " : "", + ad->tx_use_avx2 ? "avx2 " : "", dev->data->port_id); - dev->tx_pkt_burst = use_avx2 ? + dev->tx_pkt_burst = ad->tx_use_avx2 ? ice_xmit_pkts_vec_avx2 : ice_xmit_pkts_vec; } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:37.909387616 +0100 +++ 0021-net-ice-fix-data-path-selection-in-secondary-process.patch 2021-07-12 13:41:36.246117528 +0100 @@ -1 +1 @@ -From f8b3326f3116afb357beac730577fec6ffbf2d83 Mon Sep 17 00:00:00 2001 +From 744e86e08926c83225e70abb15be69d84d15d361 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f8b3326f3116afb357beac730577fec6ffbf2d83 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -19,3 +20,3 @@ - drivers/net/ice/ice_ethdev.h | 6 +++++ - drivers/net/ice/ice_rxtx.c | 44 ++++++++++++++++++------------------ - 2 files changed, 28 insertions(+), 22 deletions(-) + drivers/net/ice/ice_ethdev.h | 6 ++++++ + drivers/net/ice/ice_rxtx.c | 38 ++++++++++++++++++------------------ + 2 files changed, 25 insertions(+), 19 deletions(-) @@ -24 +25 @@ -index 2a8a8169d5..aebfd1b0b7 100644 +index 2b03c59671..6a2bf58560 100644 @@ -27 +28 @@ -@@ -487,6 +487,12 @@ struct ice_adapter { +@@ -479,6 +479,12 @@ struct ice_adapter { @@ -41 +42 @@ -index 49abcb2f5c..f4f6f48d78 100644 +index c98328ce0b..d200d21347 100644 @@ -44 +45 @@ -@@ -3058,11 +3058,11 @@ ice_set_rx_function(struct rte_eth_dev *dev) +@@ -3025,10 +3025,10 @@ ice_set_rx_function(struct rte_eth_dev *dev) @@ -48 +48,0 @@ -- int rx_check_ret; @@ -51 +50,0 @@ -+ int rx_check_ret = 0; @@ -56,4 +55,4 @@ - rx_check_ret = ice_rx_vec_dev_check(dev); - if (rx_check_ret >= 0 && ad->rx_bulk_alloc_allowed && - rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { -@@ -3079,16 +3079,16 @@ ice_set_rx_function(struct rte_eth_dev *dev) + if (!ice_rx_vec_dev_check(dev) && ad->rx_bulk_alloc_allowed && + rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { + ad->rx_vec_allowed = true; +@@ -3044,16 +3044,16 @@ ice_set_rx_function(struct rte_eth_dev *dev) @@ -79 +78 @@ -@@ -3097,7 +3097,7 @@ ice_set_rx_function(struct rte_eth_dev *dev) +@@ -3062,7 +3062,7 @@ ice_set_rx_function(struct rte_eth_dev *dev) @@ -86,3 +85,3 @@ - if (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH) { - PMD_DRV_LOG(NOTICE, -@@ -3116,14 +3116,14 @@ ice_set_rx_function(struct rte_eth_dev *dev) + PMD_DRV_LOG(NOTICE, + "Using AVX512 Vector Scattered Rx (port %d).", +@@ -3073,14 +3073,14 @@ ice_set_rx_function(struct rte_eth_dev *dev) @@ -104,3 +103,3 @@ - if (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH) { - PMD_DRV_LOG(NOTICE, -@@ -3142,9 +3142,9 @@ ice_set_rx_function(struct rte_eth_dev *dev) + PMD_DRV_LOG(NOTICE, + "Using AVX512 Vector Rx (port %d).", +@@ -3091,9 +3091,9 @@ ice_set_rx_function(struct rte_eth_dev *dev) @@ -118 +117 @@ -@@ -3294,11 +3294,11 @@ ice_set_tx_function(struct rte_eth_dev *dev) +@@ -3241,10 +3241,10 @@ ice_set_tx_function(struct rte_eth_dev *dev) @@ -122 +120,0 @@ -- int tx_check_ret; @@ -125 +122,0 @@ -+ int tx_check_ret = 0; @@ -130,4 +127,4 @@ - tx_check_ret = ice_tx_vec_dev_check(dev); - if (tx_check_ret >= 0 && - rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { -@@ -3308,18 +3308,18 @@ ice_set_tx_function(struct rte_eth_dev *dev) + if (!ice_tx_vec_dev_check(dev) && + rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { + ad->tx_vec_allowed = true; +@@ -3260,16 +3260,16 @@ ice_set_tx_function(struct rte_eth_dev *dev) @@ -143,2 +140,2 @@ -- if (!use_avx512 && tx_check_ret == ICE_VECTOR_PATH && -+ if (!ad->tx_use_avx512 && tx_check_ret == ICE_VECTOR_PATH && +- if (!use_avx512 && ++ if (!ad->tx_use_avx512 && @@ -151,6 +148,3 @@ -- if (!use_avx512 && tx_check_ret == ICE_VECTOR_OFFLOAD_PATH) -+ if (!ad->tx_use_avx512 && tx_check_ret == ICE_VECTOR_OFFLOAD_PATH) - ad->tx_vec_allowed = false; - - if (ad->tx_vec_allowed) { -@@ -3337,7 +3337,7 @@ ice_set_tx_function(struct rte_eth_dev *dev) + } else { + ad->tx_vec_allowed = false; +@@ -3277,7 +3277,7 @@ ice_set_tx_function(struct rte_eth_dev *dev) @@ -163,3 +157,3 @@ - if (tx_check_ret == ICE_VECTOR_OFFLOAD_PATH) { - PMD_DRV_LOG(NOTICE, -@@ -3354,9 +3354,9 @@ ice_set_tx_function(struct rte_eth_dev *dev) + PMD_DRV_LOG(NOTICE, "Using AVX512 Vector Tx (port %d).", + dev->data->port_id); +@@ -3285,9 +3285,9 @@ ice_set_tx_function(struct rte_eth_dev *dev)