* [PATCH 0/5] unify the usage of capacity and control
@ 2023-12-13 3:24 Chaoyong He
2023-12-13 3:24 ` [PATCH 1/5] net/nfp: complete the logic of print capacity Chaoyong He
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Chaoyong He @ 2023-12-13 3:24 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Chaoyong He
This patch series aims to unify the usage of capacity and control,
and revise the related logics.
Chaoyong He (5):
net/nfp: complete the logic of print capacity
net/nfp: modify the logic of set promisc mode
net/nfp: modify the logic of set MAC address
net/nfp: use ctrl to check the mode of features
net/nfp: use ctrl extend to check the mode of features
drivers/net/nfp/nfd3/nfp_nfd3_dp.c | 14 +++---
drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 16 +++----
drivers/net/nfp/nfp_ethdev.c | 5 +-
drivers/net/nfp/nfp_net_common.c | 73 ++++++++++++++++++++++--------
drivers/net/nfp/nfp_rxtx.c | 5 +-
5 files changed, 71 insertions(+), 42 deletions(-)
--
2.39.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/5] net/nfp: complete the logic of print capacity
2023-12-13 3:24 [PATCH 0/5] unify the usage of capacity and control Chaoyong He
@ 2023-12-13 3:24 ` Chaoyong He
2023-12-13 3:24 ` [PATCH 2/5] net/nfp: modify the logic of set promisc mode Chaoyong He
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Chaoyong He @ 2023-12-13 3:24 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Chaoyong He, Peng Zhang, Long Wu
Complete the logic of print capacity, print all the capacity and
extend capacity.
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/nfp_net_common.c | 59 ++++++++++++++++++++++----------
1 file changed, 41 insertions(+), 18 deletions(-)
diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index eeb0aaae26..79ce1dd837 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -306,28 +306,51 @@ void
nfp_net_log_device_information(const struct nfp_net_hw *hw)
{
uint32_t cap = hw->super.cap;
+ uint32_t cap_ext = hw->super.cap_ext;
PMD_INIT_LOG(INFO, "VER: %u.%u, Maximum supported MTU: %d",
hw->ver.major, hw->ver.minor, hw->max_mtu);
- PMD_INIT_LOG(INFO, "CAP: %#x, %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", cap,
- cap & NFP_NET_CFG_CTRL_PROMISC ? "PROMISC " : "",
- cap & NFP_NET_CFG_CTRL_L2BC ? "L2BCFILT " : "",
- cap & NFP_NET_CFG_CTRL_L2MC ? "L2MCFILT " : "",
- cap & NFP_NET_CFG_CTRL_RXCSUM ? "RXCSUM " : "",
- cap & NFP_NET_CFG_CTRL_TXCSUM ? "TXCSUM " : "",
- cap & NFP_NET_CFG_CTRL_RXVLAN ? "RXVLAN " : "",
- cap & NFP_NET_CFG_CTRL_TXVLAN ? "TXVLAN " : "",
- cap & NFP_NET_CFG_CTRL_RXVLAN_V2 ? "RXVLANv2 " : "",
- cap & NFP_NET_CFG_CTRL_TXVLAN_V2 ? "TXVLANv2 " : "",
- cap & NFP_NET_CFG_CTRL_RXQINQ ? "RXQINQ " : "",
- cap & NFP_NET_CFG_CTRL_SCATTER ? "SCATTER " : "",
- cap & NFP_NET_CFG_CTRL_GATHER ? "GATHER " : "",
- cap & NFP_NET_CFG_CTRL_LIVE_ADDR ? "LIVE_ADDR " : "",
- cap & NFP_NET_CFG_CTRL_LSO ? "TSO " : "",
- cap & NFP_NET_CFG_CTRL_LSO2 ? "TSOv2 " : "",
- cap & NFP_NET_CFG_CTRL_RSS ? "RSS " : "",
- cap & NFP_NET_CFG_CTRL_RSS2 ? "RSSv2 " : "");
+ PMD_INIT_LOG(INFO, "CAP: %#x", cap);
+ PMD_INIT_LOG(INFO, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+ cap & NFP_NET_CFG_CTRL_ENABLE ? "ENABLE " : "",
+ cap & NFP_NET_CFG_CTRL_PROMISC ? "PROMISC " : "",
+ cap & NFP_NET_CFG_CTRL_L2BC ? "L2BCFILT " : "",
+ cap & NFP_NET_CFG_CTRL_L2MC ? "L2MCFILT " : "",
+ cap & NFP_NET_CFG_CTRL_RXCSUM ? "RXCSUM " : "",
+ cap & NFP_NET_CFG_CTRL_TXCSUM ? "TXCSUM " : "",
+ cap & NFP_NET_CFG_CTRL_RXVLAN ? "RXVLAN " : "",
+ cap & NFP_NET_CFG_CTRL_TXVLAN ? "TXVLAN " : "",
+ cap & NFP_NET_CFG_CTRL_SCATTER ? "SCATTER " : "",
+ cap & NFP_NET_CFG_CTRL_GATHER ? "GATHER " : "",
+ cap & NFP_NET_CFG_CTRL_LSO ? "TSO " : "",
+ cap & NFP_NET_CFG_CTRL_RXQINQ ? "RXQINQ " : "",
+ cap & NFP_NET_CFG_CTRL_RXVLAN_V2 ? "RXVLANv2 " : "",
+ cap & NFP_NET_CFG_CTRL_RINGCFG ? "RINGCFG " : "",
+ cap & NFP_NET_CFG_CTRL_RSS ? "RSS " : "",
+ cap & NFP_NET_CFG_CTRL_IRQMOD ? "IRQMOD " : "",
+ cap & NFP_NET_CFG_CTRL_RINGPRIO ? "RINGPRIO " : "",
+ cap & NFP_NET_CFG_CTRL_MSIXAUTO ? "MSIXAUTO " : "",
+ cap & NFP_NET_CFG_CTRL_TXRWB ? "TXRWB " : "",
+ cap & NFP_NET_CFG_CTRL_L2SWITCH ? "L2SWITCH " : "",
+ cap & NFP_NET_CFG_CTRL_TXVLAN_V2 ? "TXVLANv2 " : "",
+ cap & NFP_NET_CFG_CTRL_VXLAN ? "VXLAN " : "",
+ cap & NFP_NET_CFG_CTRL_NVGRE ? "NVGRE " : "",
+ cap & NFP_NET_CFG_CTRL_MSIX_TX_OFF ? "MSIX_TX_OFF " : "",
+ cap & NFP_NET_CFG_CTRL_LSO2 ? "TSOv2 " : "",
+ cap & NFP_NET_CFG_CTRL_RSS2 ? "RSSv2 " : "",
+ cap & NFP_NET_CFG_CTRL_CSUM_COMPLETE ? "CSUM " : "",
+ cap & NFP_NET_CFG_CTRL_LIVE_ADDR ? "LIVE_ADDR " : "");
+
+ PMD_INIT_LOG(INFO, "CAP_WORD1: %#x", cap_ext);
+ PMD_INIT_LOG(INFO, "%s%s%s%s%s%s%s",
+ cap_ext & NFP_NET_CFG_CTRL_PKT_TYPE ? "PKT_TYPE " : "",
+ cap_ext & NFP_NET_CFG_CTRL_IPSEC ? "IPSEC " : "",
+ cap_ext & NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP ? "IPSEC_SM " : "",
+ cap_ext & NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP ? "IPSEC_LM " : "",
+ cap_ext & NFP_NET_CFG_CTRL_MULTI_PF ? "MULTI_PF " : "",
+ cap_ext & NFP_NET_CFG_CTRL_FLOW_STEER ? "FLOW_STEER " : "",
+ cap_ext & NFP_NET_CFG_CTRL_IN_ORDER ? "VIRTIO_IN_ORDER " : "");
PMD_INIT_LOG(INFO, "max_rx_queues: %u, max_tx_queues: %u",
hw->max_rx_queues, hw->max_tx_queues);
--
2.39.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/5] net/nfp: modify the logic of set promisc mode
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 ` Chaoyong He
2023-12-13 3:24 ` [PATCH 3/5] net/nfp: modify the logic of set MAC address Chaoyong He
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Chaoyong He @ 2023-12-13 3:24 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Chaoyong He, Peng Zhang, Long Wu
Modify the logic of set promisc mode, add the check logic of
capacity.
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/nfp_net_common.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index 79ce1dd837..12b62c1958 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -592,6 +592,11 @@ nfp_net_promisc_disable(struct rte_eth_dev *dev)
net_hw = nfp_net_get_hw(dev);
hw = &net_hw->super;
+ if ((hw->cap & NFP_NET_CFG_CTRL_PROMISC) == 0) {
+ PMD_DRV_LOG(ERR, "Promiscuous mode not supported");
+ return -ENOTSUP;
+ }
+
if ((hw->ctrl & NFP_NET_CFG_CTRL_PROMISC) == 0) {
PMD_DRV_LOG(INFO, "Promiscuous mode already disabled");
return 0;
--
2.39.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/5] net/nfp: modify the logic of set MAC address
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 ` Chaoyong He
2023-12-13 3:24 ` [PATCH 4/5] net/nfp: use ctrl to check the mode of features Chaoyong He
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Chaoyong He @ 2023-12-13 3:24 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Chaoyong He, Peng Zhang, Long Wu
Modify the logic of set MAC address, add the check logic of MAC address.
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/nfp_net_common.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index 12b62c1958..99e2fc54e0 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -417,6 +417,11 @@ nfp_net_set_mac_addr(struct rte_eth_dev *dev,
return -EBUSY;
}
+ if (rte_is_valid_assigned_ether_addr(mac_addr) == 0) {
+ PMD_DRV_LOG(ERR, "Invalid MAC address");
+ return -EINVAL;
+ }
+
/* Writing new MAC to the specific port BAR address */
nfp_write_mac(hw, (uint8_t *)mac_addr);
--
2.39.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/5] net/nfp: use ctrl to check the mode of features
2023-12-13 3:24 [PATCH 0/5] unify the usage of capacity and control Chaoyong He
` (2 preceding siblings ...)
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
2023-12-13 3:24 ` [PATCH 5/5] net/nfp: use ctrl extend " Chaoyong He
2023-12-14 16:08 ` [PATCH 0/5] unify the usage of capacity and control Ferruh Yigit
5 siblings, 0 replies; 7+ messages in thread
From: Chaoyong He @ 2023-12-13 3:24 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Chaoyong He, Peng Zhang, Long Wu
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 5/5] net/nfp: use ctrl extend to check the mode of features
2023-12-13 3:24 [PATCH 0/5] unify the usage of capacity and control Chaoyong He
` (3 preceding siblings ...)
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
2023-12-14 16:08 ` [PATCH 0/5] unify the usage of capacity and control Ferruh Yigit
5 siblings, 0 replies; 7+ messages in thread
From: Chaoyong He @ 2023-12-13 3:24 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Chaoyong He, Peng Zhang, Long Wu
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/5] unify the usage of capacity and control
2023-12-13 3:24 [PATCH 0/5] unify the usage of capacity and control Chaoyong He
` (4 preceding siblings ...)
2023-12-13 3:24 ` [PATCH 5/5] net/nfp: use ctrl extend " Chaoyong He
@ 2023-12-14 16:08 ` Ferruh Yigit
5 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2023-12-14 16:08 UTC (permalink / raw)
To: Chaoyong He, dev; +Cc: oss-drivers
On 12/13/2023 3:24 AM, Chaoyong He wrote:
> This patch series aims to unify the usage of capacity and control,
> and revise the related logics.
>
> Chaoyong He (5):
> net/nfp: complete the logic of print capacity
> net/nfp: modify the logic of set promisc mode
> net/nfp: modify the logic of set MAC address
> net/nfp: use ctrl to check the mode of features
> net/nfp: use ctrl extend to check the mode of features
>
Series applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-12-14 16:08 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 5/5] net/nfp: use ctrl extend " Chaoyong He
2023-12-14 16:08 ` [PATCH 0/5] unify the usage of capacity and control Ferruh Yigit
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).