DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>,
	Long Wu <long.wu@corigine.com>
Subject: [PATCH 5/5] net/nfp: use ctrl extend to check the mode of features
Date: Wed, 13 Dec 2023 11:24:16 +0800	[thread overview]
Message-ID: <20231213032416.1988817-6-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231213032416.1988817-1-chaoyong.he@corigine.com>

Use the 'ctrl_extend' rather than 'cap_extend' to check the switch mode
of features.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
---
 drivers/net/nfp/nfd3/nfp_nfd3_dp.c | 4 +---
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 4 +---
 drivers/net/nfp/nfp_ethdev.c       | 5 +++--
 drivers/net/nfp/nfp_net_common.c   | 2 +-
 drivers/net/nfp/nfp_rxtx.c         | 2 +-
 5 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
index 56e57abacb..fbc2dbedf4 100644
--- a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
+++ b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
@@ -145,13 +145,11 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
 	char *meta;
 	uint8_t layer = 0;
 	uint32_t meta_info;
-	uint32_t cap_extend;
 	struct nfp_net_hw *hw;
 	uint8_t vlan_layer = 0;
 	uint8_t ipsec_layer = 0;
 
 	hw = txq->hw;
-	cap_extend = hw->super.cap_ext;
 
 	if ((pkt->ol_flags & RTE_MBUF_F_TX_VLAN) != 0 &&
 			(hw->super.ctrl & NFP_NET_CFG_CTRL_TXVLAN_V2) != 0) {
@@ -162,7 +160,7 @@ nfp_net_nfd3_set_meta_data(struct nfp_net_meta_raw *meta_data,
 	}
 
 	if ((pkt->ol_flags & RTE_MBUF_F_TX_SEC_OFFLOAD) != 0 &&
-			(cap_extend & NFP_NET_CFG_CTRL_IPSEC) != 0) {
+			(hw->super.ctrl_ext & NFP_NET_CFG_CTRL_IPSEC) != 0) {
 		uint32_t ipsec_type = NFP_NET_META_IPSEC |
 				NFP_NET_META_IPSEC << NFP_NET_META_FIELD_SIZE |
 				NFP_NET_META_IPSEC << (2 * NFP_NET_META_FIELD_SIZE);
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index fbf132347d..72efbffb42 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -175,7 +175,6 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 	char *meta;
 	uint8_t layer = 0;
 	uint32_t meta_type;
-	uint32_t cap_extend;
 	struct nfp_net_hw *hw;
 	uint32_t header_offset;
 	uint8_t vlan_layer = 0;
@@ -184,7 +183,6 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 
 	memset(&meta_data, 0, sizeof(meta_data));
 	hw = txq->hw;
-	cap_extend = hw->super.cap_ext;
 
 	if ((pkt->ol_flags & RTE_MBUF_F_TX_VLAN) != 0 &&
 			(hw->super.ctrl & NFP_NET_CFG_CTRL_TXVLAN_V2) != 0) {
@@ -195,7 +193,7 @@ nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt,
 	}
 
 	if ((pkt->ol_flags & RTE_MBUF_F_TX_SEC_OFFLOAD) != 0 &&
-			(cap_extend & NFP_NET_CFG_CTRL_IPSEC) != 0) {
+			(hw->super.ctrl_ext & NFP_NET_CFG_CTRL_IPSEC) != 0) {
 		uint32_t ipsec_type = NFP_NET_META_IPSEC |
 				NFP_NET_META_IPSEC << NFP_NET_META_FIELD_SIZE |
 				NFP_NET_META_IPSEC << (2 * NFP_NET_META_FIELD_SIZE);
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 185b570892..886b568d96 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -303,8 +303,9 @@ nfp_net_start(struct rte_eth_dev *dev)
 		ctrl_extend = NFP_NET_CFG_CTRL_PKT_TYPE;
 
 	if ((cap_extend & NFP_NET_CFG_CTRL_IPSEC) != 0)
-		ctrl_extend |= NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP
-				| NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP;
+		ctrl_extend |= NFP_NET_CFG_CTRL_IPSEC |
+				NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP |
+				NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP;
 
 	/* Enable flow steer by extend ctrl word1. */
 	if ((cap_extend & NFP_NET_CFG_CTRL_FLOW_STEER) != 0)
diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index fed36dac53..a438eb5871 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -1371,7 +1371,7 @@ nfp_net_supported_ptypes_get(struct rte_eth_dev *dev)
 		return NULL;
 
 	net_hw = dev->data->dev_private;
-	if ((net_hw->super.cap_ext & NFP_NET_CFG_CTRL_PKT_TYPE) == 0)
+	if ((net_hw->super.ctrl_ext & NFP_NET_CFG_CTRL_PKT_TYPE) == 0)
 		return NULL;
 
 	return ptypes;
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index f775f25cb2..cbcf57d769 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -617,7 +617,7 @@ nfp_net_parse_ptype(struct nfp_net_rxq *rxq,
 	struct nfp_ptype_parsed nfp_ptype;
 	uint16_t rxd_ptype = rxds->rxd.offload_info;
 
-	if ((hw->super.cap_ext & NFP_NET_CFG_CTRL_PKT_TYPE) == 0)
+	if ((hw->super.ctrl_ext & NFP_NET_CFG_CTRL_PKT_TYPE) == 0)
 		return;
 
 	if (rxd_ptype == 0 || (rxds->rxd.flags & PCIE_DESC_RX_VLAN) != 0)
-- 
2.39.1


  parent reply	other threads:[~2023-12-13  3:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  3:24 [PATCH 0/5] unify the usage of capacity and control Chaoyong He
2023-12-13  3:24 ` [PATCH 1/5] net/nfp: complete the logic of print capacity Chaoyong He
2023-12-13  3:24 ` [PATCH 2/5] net/nfp: modify the logic of set promisc mode Chaoyong He
2023-12-13  3:24 ` [PATCH 3/5] net/nfp: modify the logic of set MAC address Chaoyong He
2023-12-13  3:24 ` [PATCH 4/5] net/nfp: use ctrl to check the mode of features Chaoyong He
2023-12-13  3:24 ` Chaoyong He [this message]
2023-12-14 16:08 ` [PATCH 0/5] unify the usage of capacity and control Ferruh Yigit

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=20231213032416.1988817-6-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.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).