From patchwork Mon Feb 6 05:46:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 123108 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4C64041BE7; Mon, 6 Feb 2023 07:14:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0788D42D81; Mon, 6 Feb 2023 07:13:27 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 91B5542D50 for ; Mon, 6 Feb 2023 07:13:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675664004; x=1707200004; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xQJbv/sy1+IFgfuHr2ctRU2jMAohfkhYwRBlLDYK7eA=; b=FFXrOZ8GnW6ynnSq6Ku2sM3YBZK8Oi6DWIQ1tVkVFwOMn+NjrIj0epiF BoY0asA2KyKYWOvoXq1S7YewG+9uSW6s3TVzGTYDcFeEBghKc/gA8r07Z EFL1bNbjDC8VFMv4+614J10yYTdehcgqiq6BHcwxYc59ojJWVoCCK6kHL I3MGB5TI49/VWVb+M7nM85uI6RN0V09eSla/gOcdmsTpFuabGHapWF0Le XROvbTQbMa26TqxYpm6g+1U5yfgRFHHwXm3cIw6XfIlSGkcTQTpAWNSEp cnHi8obYXqNPx7lyMPJms9XBdlDM6vM/cFjEOX9/TCApjrtuF+j8YbXoZ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="308780503" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="308780503" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2023 22:13:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="755142924" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="755142924" Received: from dpdk-beileix-3.sh.intel.com ([10.67.110.253]) by FMSMGA003.fm.intel.com with ESMTP; 05 Feb 2023 22:13:22 -0800 From: beilei.xing@intel.com To: jingjing.wu@intel.com Cc: dev@dpdk.org, qi.z.zhang@intel.com, Beilei Xing Subject: [PATCH v7 10/19] common/idpf: add vector flags in vport Date: Mon, 6 Feb 2023 05:46:09 +0000 Message-Id: <20230206054618.40975-11-beilei.xing@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20230206054618.40975-1-beilei.xing@intel.com> References: <20230203094340.8103-1-beilei.xing@intel.com> <20230206054618.40975-1-beilei.xing@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Beilei Xing Move vector flags from idpf_adapter_ext structure to idpf_vport structure. Signed-off-by: Beilei Xing --- drivers/common/idpf/idpf_common_device.h | 5 +++++ drivers/net/idpf/idpf_ethdev.h | 5 ----- drivers/net/idpf/idpf_rxtx.c | 22 ++++++++++------------ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/drivers/common/idpf/idpf_common_device.h b/drivers/common/idpf/idpf_common_device.h index 2a6e9d6ee4..0ffc653436 100644 --- a/drivers/common/idpf/idpf_common_device.h +++ b/drivers/common/idpf/idpf_common_device.h @@ -103,6 +103,11 @@ struct idpf_vport { uint16_t devarg_id; bool stopped; + + bool rx_vec_allowed; + bool tx_vec_allowed; + bool rx_use_avx512; + bool tx_use_avx512; }; /* Message type read in virtual channel from PF */ diff --git a/drivers/net/idpf/idpf_ethdev.h b/drivers/net/idpf/idpf_ethdev.h index c2a7abb05c..bef6199622 100644 --- a/drivers/net/idpf/idpf_ethdev.h +++ b/drivers/net/idpf/idpf_ethdev.h @@ -81,11 +81,6 @@ struct idpf_adapter_ext { uint16_t used_vecs_num; - bool rx_vec_allowed; - bool tx_vec_allowed; - bool rx_use_avx512; - bool tx_use_avx512; - /* For PTP */ uint64_t time_hw; }; diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c index 0b10e4248b..068eb8000e 100644 --- a/drivers/net/idpf/idpf_rxtx.c +++ b/drivers/net/idpf/idpf_rxtx.c @@ -2221,25 +2221,24 @@ idpf_set_rx_function(struct rte_eth_dev *dev) { struct idpf_vport *vport = dev->data->dev_private; #ifdef RTE_ARCH_X86 - struct idpf_adapter_ext *ad = IDPF_ADAPTER_TO_EXT(vport->adapter); struct idpf_rx_queue *rxq; int i; if (idpf_rx_vec_dev_check_default(dev) == IDPF_VECTOR_PATH && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { - ad->rx_vec_allowed = true; + vport->rx_vec_allowed = true; if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512) #ifdef CC_AVX512_SUPPORT if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 && rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1) - ad->rx_use_avx512 = true; + vport->rx_use_avx512 = true; #else PMD_DRV_LOG(NOTICE, "AVX512 is not supported in build env"); #endif /* CC_AVX512_SUPPORT */ } else { - ad->rx_vec_allowed = false; + vport->rx_vec_allowed = false; } #endif /* RTE_ARCH_X86 */ @@ -2247,13 +2246,13 @@ idpf_set_rx_function(struct rte_eth_dev *dev) if (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) { dev->rx_pkt_burst = idpf_splitq_recv_pkts; } else { - if (ad->rx_vec_allowed) { + if (vport->rx_vec_allowed) { for (i = 0; i < dev->data->nb_tx_queues; i++) { rxq = dev->data->rx_queues[i]; (void)idpf_singleq_rx_vec_setup(rxq); } #ifdef CC_AVX512_SUPPORT - if (ad->rx_use_avx512) { + if (vport->rx_use_avx512) { dev->rx_pkt_burst = idpf_singleq_recv_pkts_avx512; return; } @@ -2275,7 +2274,6 @@ idpf_set_tx_function(struct rte_eth_dev *dev) { struct idpf_vport *vport = dev->data->dev_private; #ifdef RTE_ARCH_X86 - struct idpf_adapter_ext *ad = IDPF_ADAPTER_TO_EXT(vport->adapter); #ifdef CC_AVX512_SUPPORT struct idpf_tx_queue *txq; int i; @@ -2283,18 +2281,18 @@ idpf_set_tx_function(struct rte_eth_dev *dev) if (idpf_rx_vec_dev_check_default(dev) == IDPF_VECTOR_PATH && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { - ad->tx_vec_allowed = true; + vport->tx_vec_allowed = true; if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512) #ifdef CC_AVX512_SUPPORT if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 && rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1) - ad->tx_use_avx512 = true; + vport->tx_use_avx512 = true; #else PMD_DRV_LOG(NOTICE, "AVX512 is not supported in build env"); #endif /* CC_AVX512_SUPPORT */ } else { - ad->tx_vec_allowed = false; + vport->tx_vec_allowed = false; } #endif /* RTE_ARCH_X86 */ @@ -2303,9 +2301,9 @@ idpf_set_tx_function(struct rte_eth_dev *dev) dev->tx_pkt_prepare = idpf_prep_pkts; } else { #ifdef RTE_ARCH_X86 - if (ad->tx_vec_allowed) { + if (vport->tx_vec_allowed) { #ifdef CC_AVX512_SUPPORT - if (ad->tx_use_avx512) { + if (vport->tx_use_avx512) { for (i = 0; i < dev->data->nb_tx_queues; i++) { txq = dev->data->tx_queues[i]; if (txq == NULL)