DPDK patches and discussions
 help / color / mirror / Atom feed
From: beilei.xing@intel.com
To: jingjing.wu@intel.com
Cc: dev@dpdk.org, qi.z.zhang@intel.com, Beilei Xing <beilei.xing@intel.com>
Subject: [PATCH v2 10/15] common/idpf: add vector flags in vport
Date: Fri,  6 Jan 2023 09:16:22 +0000	[thread overview]
Message-ID: <20230106091627.13530-11-beilei.xing@intel.com> (raw)
In-Reply-To: <20230106091627.13530-1-beilei.xing@intel.com>

From: Beilei Xing <beilei.xing@intel.com>

Add vector flags in idpf_vport structure.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 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 97db8d9f53..78f41554eb 100644
--- a/drivers/common/idpf/idpf_common_device.h
+++ b/drivers/common/idpf/idpf_common_device.h
@@ -100,6 +100,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 0c9c7fee29..f0eff493f8 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)
-- 
2.26.2


  parent reply	other threads:[~2023-01-06  9:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08  7:52 [PATCH 00/15] net/idpf: refactor idpf pmd beilei.xing
2022-12-08  7:52 ` [PATCH 01/15] common/idpf: add adapter structure beilei.xing
2022-12-08  7:52 ` [PATCH 02/15] common/idpf: add vport structure beilei.xing
2022-12-08  7:52 ` [PATCH 03/15] common/idpf: move vc functions to common module beilei.xing
2022-12-08  7:52 ` [PATCH 04/15] common/idpf: introduce adapter init and deinit beilei.xing
2022-12-08  7:52 ` [PATCH 05/15] common/idpf: add vport init/deinit beilei.xing
2022-12-08  7:53 ` [PATCH 06/15] common/idpf: add config RSS beilei.xing
2022-12-08  7:53 ` [PATCH 07/15] common/idpf: add irq map/unmap beilei.xing
2022-12-08  7:53 ` [PATCH 08/15] common/idpf: move ptype table to adapter structure beilei.xing
2022-12-08  7:53 ` [PATCH 09/15] common/idpf: init create vport info beilei.xing
2022-12-08  7:53 ` [PATCH 10/15] common/idpf: add vector flags in vport beilei.xing
2022-12-08  7:53 ` [PATCH 11/15] common/idpf: add rxq and txq struct beilei.xing
2022-12-08  7:53 ` [PATCH 12/15] common/idpf: add help functions for queue setup and release beilei.xing
2022-12-08  7:53 ` [PATCH 13/15] common/idpf: add scalar data path beilei.xing
2022-12-08  7:53 ` [PATCH 14/15] common/idpf: add vec queue setup beilei.xing
2022-12-08  7:53 ` [PATCH 15/15] common/idpf: add avx512 for single queue model beilei.xing
2023-01-06  9:16 ` [PATCH v2 00/15] net/idpf: introduce idpf common modle beilei.xing
2023-01-06  9:16   ` [PATCH v2 01/15] common/idpf: add adapter structure beilei.xing
2023-01-06  9:16   ` [PATCH v2 02/15] common/idpf: add vport structure beilei.xing
2023-01-06  9:16   ` [PATCH v2 03/15] common/idpf: move vc functions to common module beilei.xing
2023-01-06  9:16   ` [PATCH v2 04/15] common/idpf: introduce adapter init and deinit beilei.xing
2023-01-06  9:16   ` [PATCH v2 05/15] common/idpf: add vport init/deinit beilei.xing
2023-01-08 12:10     ` Zhang, Qi Z
2023-01-09  1:34       ` Xing, Beilei
2023-01-06  9:16   ` [PATCH v2 06/15] common/idpf: add config RSS beilei.xing
2023-01-06  9:16   ` [PATCH v2 07/15] common/idpf: add irq map/unmap beilei.xing
2023-01-17  1:14     ` Zhang, Qi Z
2023-01-06  9:16   ` [PATCH v2 08/15] common/idpf: move ptype table to adapter structure beilei.xing
2023-01-06  9:16   ` [PATCH v2 09/15] common/idpf: init create vport info beilei.xing
2023-01-06  9:16   ` beilei.xing [this message]
2023-01-06  9:16   ` [PATCH v2 11/15] common/idpf: add rxq and txq struct beilei.xing
2023-01-06  9:16   ` [PATCH v2 12/15] common/idpf: add help functions for queue setup and release beilei.xing
2023-01-06  9:16   ` [PATCH v2 13/15] common/idpf: add scalar data path beilei.xing
2023-01-06  9:16   ` [PATCH v2 14/15] common/idpf: add vec queue setup beilei.xing
2023-01-06  9:16   ` [PATCH v2 15/15] common/idpf: add avx512 for single queue model beilei.xing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230106091627.13530-11-beilei.xing@intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).