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 4/5] net/nfp: use ctrl to check the mode of features
Date: Wed, 13 Dec 2023 11:24:15 +0800 [thread overview]
Message-ID: <20231213032416.1988817-5-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231213032416.1988817-1-chaoyong.he@corigine.com>
Use the 'ctrl' rather than 'cap' 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 | 10 +++++-----
drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 12 ++++++------
drivers/net/nfp/nfp_net_common.c | 2 +-
drivers/net/nfp/nfp_rxtx.c | 3 +--
4 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
index ff9b10f046..56e57abacb 100644
--- a/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
+++ b/drivers/net/nfp/nfd3/nfp_nfd3_dp.c
@@ -30,7 +30,7 @@ nfp_net_nfd3_tx_tso(struct nfp_net_txq *txq,
uint64_t ol_flags;
struct nfp_net_hw *hw = txq->hw;
- if ((hw->super.cap & NFP_NET_CFG_CTRL_LSO_ANY) == 0)
+ if ((hw->super.ctrl & NFP_NET_CFG_CTRL_LSO_ANY) == 0)
goto clean_txd;
ol_flags = mb->ol_flags;
@@ -69,7 +69,7 @@ nfp_net_nfd3_tx_cksum(struct nfp_net_txq *txq,
uint64_t ol_flags;
struct nfp_net_hw *hw = txq->hw;
- if ((hw->super.cap & NFP_NET_CFG_CTRL_TXCSUM) == 0)
+ if ((hw->super.ctrl & NFP_NET_CFG_CTRL_TXCSUM) == 0)
return;
ol_flags = mb->ol_flags;
@@ -127,8 +127,8 @@ nfp_net_nfd3_tx_vlan(struct nfp_net_txq *txq,
{
struct nfp_net_hw *hw = txq->hw;
- if ((hw->super.cap & NFP_NET_CFG_CTRL_TXVLAN_V2) != 0 ||
- (hw->super.cap & NFP_NET_CFG_CTRL_TXVLAN) == 0)
+ if ((hw->super.ctrl & NFP_NET_CFG_CTRL_TXVLAN_V2) != 0 ||
+ (hw->super.ctrl & NFP_NET_CFG_CTRL_TXVLAN) == 0)
return;
if ((mb->ol_flags & RTE_MBUF_F_TX_VLAN) != 0) {
@@ -278,7 +278,7 @@ nfp_net_nfd3_xmit_pkts_common(void *tx_queue,
}
if (unlikely(pkt->nb_segs > 1 &&
- (hw->super.cap & NFP_NET_CFG_CTRL_GATHER) == 0)) {
+ (hw->super.ctrl & NFP_NET_CFG_CTRL_GATHER) == 0)) {
PMD_TX_LOG(ERR, "Multisegment packet not supported");
goto xmit_end;
}
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index 0141fbcc8f..fbf132347d 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -23,7 +23,7 @@ nfp_net_nfdk_tx_cksum(struct nfp_net_txq *txq,
uint64_t ol_flags;
struct nfp_net_hw *hw = txq->hw;
- if ((hw->super.cap & NFP_NET_CFG_CTRL_TXCSUM) == 0)
+ if ((hw->super.ctrl & NFP_NET_CFG_CTRL_TXCSUM) == 0)
return flags;
ol_flags = mb->ol_flags;
@@ -57,7 +57,7 @@ nfp_net_nfdk_tx_tso(struct nfp_net_txq *txq,
txd.raw = 0;
- if ((hw->super.cap & NFP_NET_CFG_CTRL_LSO_ANY) == 0)
+ if ((hw->super.ctrl & NFP_NET_CFG_CTRL_LSO_ANY) == 0)
return txd.raw;
ol_flags = mb->ol_flags;
@@ -146,7 +146,7 @@ nfp_net_nfdk_tx_maybe_close_block(struct nfp_net_txq *txq,
return -EINVAL;
/* Count TSO descriptor */
- if ((txq->hw->super.cap & NFP_NET_CFG_CTRL_LSO_ANY) != 0 &&
+ if ((txq->hw->super.ctrl & NFP_NET_CFG_CTRL_LSO_ANY) != 0 &&
(pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG) != 0)
n_descs++;
@@ -325,7 +325,7 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,
nfp_net_nfdk_set_meta_data(pkt, txq, &metadata);
if (unlikely(pkt->nb_segs > 1 &&
- (hw->super.cap & NFP_NET_CFG_CTRL_GATHER) == 0)) {
+ (hw->super.ctrl & NFP_NET_CFG_CTRL_GATHER) == 0)) {
PMD_TX_LOG(ERR, "Multisegment packet not supported");
goto xmit_end;
}
@@ -335,7 +335,7 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,
* multisegment packet, but TSO info needs to be in all of them.
*/
dma_len = pkt->data_len;
- if ((hw->super.cap & NFP_NET_CFG_CTRL_LSO_ANY) != 0 &&
+ if ((hw->super.ctrl & NFP_NET_CFG_CTRL_LSO_ANY) != 0 &&
(pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG) != 0) {
type = NFDK_DESC_TX_TYPE_TSO;
} else if (pkt->next == NULL && dma_len <= NFDK_TX_MAX_DATA_PER_HEAD) {
@@ -408,7 +408,7 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,
ktxds->raw = rte_cpu_to_le_64(nfp_net_nfdk_tx_cksum(txq, temp_pkt, metadata));
ktxds++;
- if ((hw->super.cap & NFP_NET_CFG_CTRL_LSO_ANY) != 0 &&
+ if ((hw->super.ctrl & NFP_NET_CFG_CTRL_LSO_ANY) != 0 &&
(temp_pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG) != 0) {
ktxds->raw = rte_cpu_to_le_64(nfp_net_nfdk_tx_tso(txq, temp_pkt));
ktxds++;
diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index 99e2fc54e0..fed36dac53 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -540,7 +540,7 @@ nfp_check_offloads(struct rte_eth_dev *dev)
(tx_offload & RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO) != 0) {
if ((cap & NFP_NET_CFG_CTRL_LSO) != 0)
ctrl |= NFP_NET_CFG_CTRL_LSO;
- else
+ else if ((cap & NFP_NET_CFG_CTRL_LSO2) != 0)
ctrl |= NFP_NET_CFG_CTRL_LSO2;
}
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 3840e2372c..f775f25cb2 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -391,8 +391,7 @@ nfp_net_parse_meta_qinq(const struct nfp_meta_parsed *meta,
{
struct nfp_hw *hw = &rxq->hw->super;
- if ((hw->ctrl & NFP_NET_CFG_CTRL_RXQINQ) == 0 ||
- (hw->cap & NFP_NET_CFG_CTRL_RXQINQ) == 0)
+ if ((hw->ctrl & NFP_NET_CFG_CTRL_RXQINQ) == 0)
return;
if (meta->vlan_layer < NFP_META_MAX_VLANS)
--
2.39.1
next prev 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 ` Chaoyong He [this message]
2023-12-13 3:24 ` [PATCH 5/5] net/nfp: use ctrl extend to check the mode of features Chaoyong He
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-5-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).