DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/5] support queue information get operations
@ 2024-06-19  2:49 Chaoyong He
  2024-06-19  2:49 ` [PATCH 1/5] net/nfp: use offload flag to control RSS configuration Chaoyong He
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Chaoyong He @ 2024-06-19  2:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He

This patch series add the support of queue information get operations
for both Rx and Tx.

Long Wu (5):
  net/nfp: use offload flag to control RSS configuration
  net/nfp: use offload flag to control VXLAN configuration
  net/nfp: use offload flag to control IPsec configuration
  net/nfp: support getting Rx queue information
  net/nfp: support getting Tx queue information

 drivers/net/nfp/nfp_ethdev.c    | 25 ++++++++++++++-------
 drivers/net/nfp/nfp_ethdev_vf.c |  2 +-
 drivers/net/nfp/nfp_rxtx.c      | 39 +++++++++++++++++++++++++++++++++
 drivers/net/nfp/nfp_rxtx.h      |  6 +++++
 4 files changed, 63 insertions(+), 9 deletions(-)

-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/5] net/nfp: use offload flag to control RSS configuration
  2024-06-19  2:49 [PATCH 0/5] support queue information get operations Chaoyong He
@ 2024-06-19  2:49 ` Chaoyong He
  2024-06-19  2:49 ` [PATCH 2/5] net/nfp: use offload flag to control VXLAN configuration Chaoyong He
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Chaoyong He @ 2024-06-19  2:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Long Wu, Chaoyong He

From: Long Wu <long.wu@corigine.com>

Use Rx offloads flag to control RSS offload configuration.

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c    | 2 +-
 drivers/net/nfp/nfp_ethdev_vf.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 52446c530d..3e148b6956 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -353,7 +353,7 @@ nfp_net_start(struct rte_eth_dev *dev)
 	nfp_net_params_setup(net_hw);
 
 	rxmode = &dev->data->dev_conf.rxmode;
-	if ((rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) != 0) {
+	if ((rxmode->offloads & RTE_ETH_RX_OFFLOAD_RSS_HASH) != 0) {
 		nfp_net_rss_config_default(dev);
 		update |= NFP_NET_CFG_UPDATE_RSS;
 		new_ctrl |= nfp_net_cfg_ctrl_rss(hw->cap);
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index bd3745a5c5..a422bcd057 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -75,7 +75,7 @@ nfp_netvf_start(struct rte_eth_dev *dev)
 	dev_conf = &dev->data->dev_conf;
 	rxmode = &dev_conf->rxmode;
 
-	if ((rxmode->mq_mode & RTE_ETH_MQ_RX_RSS) != 0) {
+	if ((rxmode->offloads & RTE_ETH_RX_OFFLOAD_RSS_HASH) != 0) {
 		nfp_net_rss_config_default(dev);
 		update |= NFP_NET_CFG_UPDATE_RSS;
 		new_ctrl |= nfp_net_cfg_ctrl_rss(hw->cap);
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/5] net/nfp: use offload flag to control VXLAN configuration
  2024-06-19  2:49 [PATCH 0/5] support queue information get operations Chaoyong He
  2024-06-19  2:49 ` [PATCH 1/5] net/nfp: use offload flag to control RSS configuration Chaoyong He
@ 2024-06-19  2:49 ` Chaoyong He
  2024-06-19  2:49 ` [PATCH 3/5] net/nfp: use offload flag to control IPsec configuration Chaoyong He
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Chaoyong He @ 2024-06-19  2:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Long Wu, Chaoyong He

From: Long Wu <long.wu@corigine.com>

Use Rx offloads flag to control VXLAN offload configuration.

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 3e148b6956..219265035d 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -283,6 +283,7 @@ nfp_net_start(struct rte_eth_dev *dev)
 	struct nfp_net_hw *net_hw;
 	struct nfp_pf_dev *pf_dev;
 	struct rte_eth_rxmode *rxmode;
+	struct rte_eth_txmode *txmode;
 	struct nfp_net_hw_priv *hw_priv;
 	struct nfp_app_fw_nic *app_fw_nic;
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
@@ -364,10 +365,13 @@ nfp_net_start(struct rte_eth_dev *dev)
 
 	update |= NFP_NET_CFG_UPDATE_GEN | NFP_NET_CFG_UPDATE_RING;
 
+	txmode = &dev->data->dev_conf.txmode;
 	/* Enable vxlan */
-	if ((hw->cap & NFP_NET_CFG_CTRL_VXLAN) != 0) {
-		new_ctrl |= NFP_NET_CFG_CTRL_VXLAN;
-		update |= NFP_NET_CFG_UPDATE_VXLAN;
+	if ((txmode->offloads & RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO) != 0) {
+		if ((hw->cap & NFP_NET_CFG_CTRL_VXLAN) != 0) {
+			new_ctrl |= NFP_NET_CFG_CTRL_VXLAN;
+			update |= NFP_NET_CFG_UPDATE_VXLAN;
+		}
 	}
 
 	if ((hw->cap & NFP_NET_CFG_CTRL_RINGCFG) != 0)
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/5] net/nfp: use offload flag to control IPsec configuration
  2024-06-19  2:49 [PATCH 0/5] support queue information get operations Chaoyong He
  2024-06-19  2:49 ` [PATCH 1/5] net/nfp: use offload flag to control RSS configuration Chaoyong He
  2024-06-19  2:49 ` [PATCH 2/5] net/nfp: use offload flag to control VXLAN configuration Chaoyong He
@ 2024-06-19  2:49 ` Chaoyong He
  2024-06-19  2:49 ` [PATCH 4/5] net/nfp: support getting Rx queue information Chaoyong He
  2024-06-19  2:49 ` [PATCH 5/5] net/nfp: support getting Tx " Chaoyong He
  4 siblings, 0 replies; 6+ messages in thread
From: Chaoyong He @ 2024-06-19  2:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Long Wu, Chaoyong He

From: Long Wu <long.wu@corigine.com>

Use Rx/Tx offloads flag to control IPsec offload configuration.

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 219265035d..53afdc8b18 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -390,10 +390,13 @@ nfp_net_start(struct rte_eth_dev *dev)
 	if ((cap_extend & NFP_NET_CFG_CTRL_PKT_TYPE) != 0)
 		ctrl_extend = NFP_NET_CFG_CTRL_PKT_TYPE;
 
-	if ((cap_extend & NFP_NET_CFG_CTRL_IPSEC) != 0)
-		ctrl_extend |= NFP_NET_CFG_CTRL_IPSEC |
-				NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP |
-				NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP;
+	if ((rxmode->offloads & RTE_ETH_RX_OFFLOAD_SECURITY) != 0 ||
+			(txmode->offloads & RTE_ETH_TX_OFFLOAD_SECURITY) != 0) {
+		if ((cap_extend & NFP_NET_CFG_CTRL_IPSEC) != 0)
+			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)
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/5] net/nfp: support getting Rx queue information
  2024-06-19  2:49 [PATCH 0/5] support queue information get operations Chaoyong He
                   ` (2 preceding siblings ...)
  2024-06-19  2:49 ` [PATCH 3/5] net/nfp: use offload flag to control IPsec configuration Chaoyong He
@ 2024-06-19  2:49 ` Chaoyong He
  2024-06-19  2:49 ` [PATCH 5/5] net/nfp: support getting Tx " Chaoyong He
  4 siblings, 0 replies; 6+ messages in thread
From: Chaoyong He @ 2024-06-19  2:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Long Wu, Chaoyong He

From: Long Wu <long.wu@corigine.com>

Add support for getting Rx queue information on NFP CoreNIC firmware.

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c |  1 +
 drivers/net/nfp/nfp_rxtx.c   | 18 ++++++++++++++++++
 drivers/net/nfp/nfp_rxtx.h   |  3 +++
 3 files changed, 22 insertions(+)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 53afdc8b18..8baf459e18 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -863,6 +863,7 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = {
 	.rss_hash_conf_get      = nfp_net_rss_hash_conf_get,
 	.rx_queue_setup         = nfp_net_rx_queue_setup,
 	.rx_queue_release       = nfp_net_rx_queue_release,
+	.rxq_info_get           = nfp_net_rx_queue_info_get,
 	.tx_queue_setup         = nfp_net_tx_queue_setup,
 	.tx_queue_release       = nfp_net_tx_queue_release,
 	.rx_queue_intr_enable   = nfp_rx_queue_intr_enable,
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 8697c5d711..3e7829ed0c 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -828,3 +828,21 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev,
 		return nfp_net_nfdk_tx_queue_setup(dev, queue_idx,
 				nb_desc, socket_id, tx_conf);
 }
+
+void
+nfp_net_rx_queue_info_get(struct rte_eth_dev *dev,
+		uint16_t queue_id,
+		struct rte_eth_rxq_info *info)
+{
+	struct rte_eth_dev_info dev_info;
+	struct nfp_net_rxq *rxq = dev->data->rx_queues[queue_id];
+
+	info->mp = rxq->mem_pool;
+	info->nb_desc = rxq->rx_count;
+
+	info->conf.rx_free_thresh = rxq->rx_free_thresh;
+
+	nfp_net_infos_get(dev, &dev_info);
+	info->conf.offloads = dev_info.rx_offload_capa &
+			dev->data->dev_conf.rxmode.offloads;
+}
diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h
index 7a89ca1d9e..62b6dab8bc 100644
--- a/drivers/net/nfp/nfp_rxtx.h
+++ b/drivers/net/nfp/nfp_rxtx.h
@@ -235,5 +235,8 @@ int nfp_net_tx_queue_setup(struct rte_eth_dev *dev,
 		unsigned int socket_id,
 		const struct rte_eth_txconf *tx_conf);
 uint32_t nfp_net_tx_free_bufs(struct nfp_net_txq *txq);
+void nfp_net_rx_queue_info_get(struct rte_eth_dev *dev,
+		uint16_t queue_id,
+		struct rte_eth_rxq_info *qinfo);
 
 #endif /* __NFP_RXTX_H__ */
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 5/5] net/nfp: support getting Tx queue information
  2024-06-19  2:49 [PATCH 0/5] support queue information get operations Chaoyong He
                   ` (3 preceding siblings ...)
  2024-06-19  2:49 ` [PATCH 4/5] net/nfp: support getting Rx queue information Chaoyong He
@ 2024-06-19  2:49 ` Chaoyong He
  4 siblings, 0 replies; 6+ messages in thread
From: Chaoyong He @ 2024-06-19  2:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Long Wu, Chaoyong He

From: Long Wu <long.wu@corigine.com>

Add support for getting Tx queue information on NFP CoreNIC firmware.

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c |  1 +
 drivers/net/nfp/nfp_rxtx.c   | 21 +++++++++++++++++++++
 drivers/net/nfp/nfp_rxtx.h   |  3 +++
 3 files changed, 25 insertions(+)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 8baf459e18..004c725ef8 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -866,6 +866,7 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = {
 	.rxq_info_get           = nfp_net_rx_queue_info_get,
 	.tx_queue_setup         = nfp_net_tx_queue_setup,
 	.tx_queue_release       = nfp_net_tx_queue_release,
+	.txq_info_get           = nfp_net_tx_queue_info_get,
 	.rx_queue_intr_enable   = nfp_rx_queue_intr_enable,
 	.rx_queue_intr_disable  = nfp_rx_queue_intr_disable,
 	.udp_tunnel_port_add    = nfp_udp_tunnel_port_add,
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 3e7829ed0c..1db79ad1cd 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -846,3 +846,24 @@ nfp_net_rx_queue_info_get(struct rte_eth_dev *dev,
 	info->conf.offloads = dev_info.rx_offload_capa &
 			dev->data->dev_conf.rxmode.offloads;
 }
+
+void
+nfp_net_tx_queue_info_get(struct rte_eth_dev *dev,
+		uint16_t queue_id,
+		struct rte_eth_txq_info *info)
+{
+	struct rte_eth_dev_info dev_info;
+	struct nfp_net_hw *hw = nfp_net_get_hw(dev);
+	struct nfp_net_txq *txq = dev->data->tx_queues[queue_id];
+
+	if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3)
+		info->nb_desc = txq->tx_count / NFD3_TX_DESC_PER_PKT;
+	else
+		info->nb_desc = txq->tx_count / NFDK_TX_DESC_PER_SIMPLE_PKT;
+
+	info->conf.tx_free_thresh = txq->tx_free_thresh;
+
+	nfp_net_infos_get(dev, &dev_info);
+	info->conf.offloads = dev_info.tx_offload_capa &
+			dev->data->dev_conf.txmode.offloads;
+}
diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h
index 62b6dab8bc..9806384a63 100644
--- a/drivers/net/nfp/nfp_rxtx.h
+++ b/drivers/net/nfp/nfp_rxtx.h
@@ -238,5 +238,8 @@ uint32_t nfp_net_tx_free_bufs(struct nfp_net_txq *txq);
 void nfp_net_rx_queue_info_get(struct rte_eth_dev *dev,
 		uint16_t queue_id,
 		struct rte_eth_rxq_info *qinfo);
+void nfp_net_tx_queue_info_get(struct rte_eth_dev *dev,
+		uint16_t queue_id,
+		struct rte_eth_txq_info *qinfo);
 
 #endif /* __NFP_RXTX_H__ */
-- 
2.39.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-19  2:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-19  2:49 [PATCH 0/5] support queue information get operations Chaoyong He
2024-06-19  2:49 ` [PATCH 1/5] net/nfp: use offload flag to control RSS configuration Chaoyong He
2024-06-19  2:49 ` [PATCH 2/5] net/nfp: use offload flag to control VXLAN configuration Chaoyong He
2024-06-19  2:49 ` [PATCH 3/5] net/nfp: use offload flag to control IPsec configuration Chaoyong He
2024-06-19  2:49 ` [PATCH 4/5] net/nfp: support getting Rx queue information Chaoyong He
2024-06-19  2:49 ` [PATCH 5/5] net/nfp: support getting Tx " Chaoyong He

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).