Skip to contentSkip to conversation

net/gve: Update Rx/Tx functions for RTE_PROC_SECONDARY

PATCH In review Tathagat Priyadarshi 3 participants 7 messages Jul 18, 2024 – Jul 19, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/gve: Update Rx/Tx functions for RTE_PROC_SECONDARY

From 9fa6f7d425d66a00c3f63c7a3033eb06fd6b1852 Mon Sep 17 00:00:00 2001
From: priyadarshitathagat <[email protected]>
Date: Wed, 17 Jul 2024 18:53:47 +0000
Subject: [PATCH] net/gve: Update Rx/Tx functions for RTE_PROC_SECONDARY

The RSS support for GVE allows multiple CPU cores to handle the rx/tx queues as pollers. This requires initializing the eth_dev_ops and updating the RX/TX functions for these pollers.

---
 drivers/net/gve/gve_ethdev.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +11 -1
index ca92277..2d8ef6f 100644
@@ -1173,8 +1173,18 @@ struct gve_queue_page_list *
  rte_be32_t *db_bar;
  int err;
 
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+ if (gve_is_gqi(priv)) {
+ gve_set_rx_function(eth_dev);
+ gve_set_tx_function(eth_dev);
+ eth_dev->dev_ops = &gve_eth_dev_ops;
+ } else {
+ gve_set_rx_function_dqo(eth_dev);
+ gve_set_tx_function_dqo(eth_dev);
+ eth_dev->dev_ops = &gve_eth_dev_ops_dqo;
+ }
  return 0;
+ }
 
  pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
 

--
1.8.3.1

https://github.com/DPDK/dpdk/pull/86

#2 lore raw

My ack might have been a bit premature. This patch seems to have a number of style errors, and does not seem to apply to HEAD of dpdk-next-net. See http://dpdk.org/patch/142498 for more detail.

The code supplied in the patch does not seem to have any indentation. Please note that DPDK uses tabs (assumed to take up 8 spaces for the purposes of wrapping long lines) instead of spaces. The style guide can be found at
https://doc.dpdk.org/guides/contributing/coding_style.html.

The dpdk-next-net repository can be found at
http://git.dpdk.org/next/dpdk-next-net.

#3 lore raw

Thanks Joshua, I will fix all the nits in my next email.

Quoted 13 lines · Joshua Washington

My ack might have been a bit premature. This patch seems to have a number of style errors, and does not seem to apply to HEAD of dpdk-next-net. See http://dpdk.org/patch/142498 for more detail.

The code supplied in the patch does not seem to have any indentation. Please note that DPDK uses tabs (assumed to take up 8 spaces for the purposes of wrapping long lines) instead of spaces. The style guide can be found at
https://doc.dpdk.org/guides/contributing/coding_style.html.

The dpdk-next-net repository can be found at
http://git.dpdk.org/next/dpdk-next-net.

#4 lore raw

PATCH 1/1 net/gve: Update Rx/Tx functions for RTE_PROC_SECONDARY

In reply to Tathagat Priyadarshi

The RSS support for GVE allows multiple CPU cores to handle the rx/tx queues as pollers. This requires initializing the eth_dev_ops and updating the RX/TX functions for these pollers.

---
 drivers/net/gve/gve_ethdev.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +11 -1
index ca92277..2d8ef6f 100644
@@ -1173,8 +1173,18 @@ struct gve_queue_page_list *
 	rte_be32_t *db_bar;
 	int err;
 
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+		if (gve_is_gqi(priv)) {
+			gve_set_rx_function(eth_dev);
+			gve_set_tx_function(eth_dev);
+			eth_dev->dev_ops = &gve_eth_dev_ops;
+		} else {
+			gve_set_rx_function_dqo(eth_dev);
+			gve_set_tx_function_dqo(eth_dev);
+			eth_dev->dev_ops = &gve_eth_dev_ops_dqo;
+		}
 		return 0;
+	}
 
 	pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
 
Signature · 1 line
1.8.3.1
#5 lore raw

PATCH v2 1/1 net/gve: Update Rx/Tx functions for RTE_PROC_SECONDARY

In reply to Tathagat Priyadarshi

The RSS support for GVE allows multiple CPU cores to handle the rx/tx queues as pollers. This requires initializing the eth_dev_ops and updating the RX/TX functions for these pollers.

---
 drivers/net/gve/gve_ethdev.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/gve/gve_ethdev.c +11 -1
index ca92277..2d8ef6f 100644
@@ -1173,8 +1173,18 @@ struct gve_queue_page_list *
 	rte_be32_t *db_bar;
 	int err;
 
-	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+		if (gve_is_gqi(priv)) {
+			gve_set_rx_function(eth_dev);
+			gve_set_tx_function(eth_dev);
+			eth_dev->dev_ops = &gve_eth_dev_ops;
+		} else {
+			gve_set_rx_function_dqo(eth_dev);
+			gve_set_tx_function_dqo(eth_dev);
+			eth_dev->dev_ops = &gve_eth_dev_ops_dqo;
+		}
 		return 0;
+	}
 
 	pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
 
Signature · 1 line
1.8.3.1