[PATCH] ixgbe: fix ixgbevf RX/TX function assignment

Subsystems: networking drivers, the rest

STALE3859d

8 messages, 4 authors, 2016-03-14 · open the first message on its own page

[PATCH] ixgbe: fix ixgbevf RX/TX function assignment

From: Zhe Tao <hidden>
Date: 2016-02-28 15:07:37

For the secondary process of DPDK to initialize ixgbevf, it will always
use the simple RX function or LRO RX function, and this behavior is not
the same RX/TX function selection logic as it is for the primary process,
so use the ixgbe_set_tx_function and ixgbe_set_rx_function to select the
RX/TX function when secondary process call the init function for eth dev.  
Signed-off-by: Zhe Tao <redacted>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3e6fe86..0f9d048 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1278,8 +1278,21 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 	 * has already done this work. Only check we don't need a different
 	 * RX function */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY){
-		if (eth_dev->data->scattered_rx)
-			eth_dev->rx_pkt_burst = ixgbe_recv_pkts_lro_single_alloc;
+		struct ixgbe_tx_queue *txq;
+		/* TX queue function in primary, set by last queue initialized
+		 * Tx queue may not initialized by primary process
+		 */
+		if (eth_dev->data->tx_queues) {
+			txq = eth_dev->data->tx_queues[eth_dev->data->nb_tx_queues-1];
+			ixgbe_set_tx_function(eth_dev, txq);
+		} else {
+			/* Use default TX function if we get here */
+			PMD_INIT_LOG(NOTICE, "No TX queues configured yet. "
+					     "Using default TX function.");
+		}
+
+		ixgbe_set_rx_function(eth_dev);
+
 		return 0;
 	}
 
-- 
2.1.4

Re: [PATCH] ixgbe: fix ixgbevf RX/TX function assignment

From: Wu, Jingjing <hidden>
Date: 2016-03-04 05:30:16

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhe Tao
Sent: Sunday, February 28, 2016 11:08 PM
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] ixgbe: fix ixgbevf RX/TX function assignment

For the secondary process of DPDK to initialize ixgbevf, it will always
use the simple RX function or LRO RX function, and this behavior is not
the same RX/TX function selection logic as it is for the primary process,
so use the ixgbe_set_tx_function and ixgbe_set_rx_function to select the
RX/TX function when secondary process call the init function for eth dev.
Fixes line is missing here.

[PATCH v2] ixgbe: fix ixgbevf RX/TX function assignment

From: Zhe Tao <hidden>
Date: 2016-03-08 08:49:51

For the secondary process of DPDK to initialize ixgbevf, it will always
use the simple RX function or LRO RX function, and this behavior is not
the same RX/TX function selection logic as it is for the primary process,
so use the ixgbe_set_tx_function and ixgbe_set_rx_function to select the
RX/TX function when secondary process call the init function for eth dev.  

Fixes: abf7275bbaa2918 (ixgbe: move to drivers/net/)

V2:add fixes line

Signed-off-by: Zhe Tao <redacted>

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3e6fe86..0f9d048 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1278,8 +1278,21 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 	 * has already done this work. Only check we don't need a different
 	 * RX function */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY){
-		if (eth_dev->data->scattered_rx)
-			eth_dev->rx_pkt_burst = ixgbe_recv_pkts_lro_single_alloc;
+		struct ixgbe_tx_queue *txq;
+		/* TX queue function in primary, set by last queue initialized
+		 * Tx queue may not initialized by primary process
+		 */
+		if (eth_dev->data->tx_queues) {
+			txq = eth_dev->data->tx_queues[eth_dev->data->nb_tx_queues-1];
+			ixgbe_set_tx_function(eth_dev, txq);
+		} else {
+			/* Use default TX function if we get here */
+			PMD_INIT_LOG(NOTICE, "No TX queues configured yet. "
+					     "Using default TX function.");
+		}
+
+		ixgbe_set_rx_function(eth_dev);
+
 		return 0;
 	}
 
-- 
2.1.4

Re: [PATCH v2] ixgbe: fix ixgbevf RX/TX function assignment

From: Bruce Richardson <hidden>
Date: 2016-03-10 15:20:09

On Tue, Mar 08, 2016 at 04:49:41PM +0800, Zhe Tao wrote:
For the secondary process of DPDK to initialize ixgbevf, it will always
use the simple RX function or LRO RX function, and this behavior is not
the same RX/TX function selection logic as it is for the primary process,
so use the ixgbe_set_tx_function and ixgbe_set_rx_function to select the
RX/TX function when secondary process call the init function for eth dev.  

Fixes: abf7275bbaa2918 (ixgbe: move to drivers/net/)
That doesn't look to be the commit that actually introduced the bug.
V2:add fixes line

Signed-off-by: Zhe Tao <redacted>
Checkpatch flags two minor issues with this:
CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#33: FILE: drivers/net/ixgbe/ixgbe_ethdev.c:1299:
+                       txq = eth_dev->data->tx_queues[eth_dev->data->nb_tx_queues-1];
                                                                                  ^

WARNING:SPLIT_STRING: quoted string split across lines
#38: FILE: drivers/net/ixgbe/ixgbe_ethdev.c:1304:
+                       PMD_INIT_LOG(NOTICE, "No TX queues configured yet. "
+                                            "Using default TX function.");

total: 0 errors, 1 warnings, 1 checks, 23 lines checked

/Bruce

[PATCH v3] ixgbe: fix ixgbevf RX/TX function assignment

From: Bruce Richardson <hidden>
Date: 2016-03-10 15:26:33

From: Zhe Tao <redacted>

For the secondary process of DPDK to initialize ixgbevf, it will always
use the simple RX function or LRO RX function, and this behavior is not
the same RX/TX function selection logic as it is for the primary process.
Use the ixgbe_set_tx_function and ixgbe_set_rx_function to select the
RX/TX function when secondary process calls the init function for eth dev.

Fixes: 9d8a92628f21 ("ixgbe: remove simple scalar scattered Rx method") 

Signed-off-by: Zhe Tao <redacted>
Signed-off-by: Bruce Richardson <redacted>

---
V3: fixed spacing and string splitting issues flagged by checkpatch.pl
    adjusted the fixes line to show original commit to introduce the bug
V2: add fixes line
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 891be50..a9a1583 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1291,8 +1291,21 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 	 * has already done this work. Only check we don't need a different
 	 * RX function */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY){
-		if (eth_dev->data->scattered_rx)
-			eth_dev->rx_pkt_burst = ixgbe_recv_pkts_lro_single_alloc;
+		struct ixgbe_tx_queue *txq;
+		/* TX queue function in primary, set by last queue initialized
+		 * Tx queue may not initialized by primary process
+		 */
+		if (eth_dev->data->tx_queues) {
+			txq = eth_dev->data->tx_queues[eth_dev->data->nb_tx_queues - 1];
+			ixgbe_set_tx_function(eth_dev, txq);
+		} else {
+			/* Use default TX function if we get here */
+			PMD_INIT_LOG(NOTICE,
+				"No TX queues configured yet. Using default TX function.");
+		}
+
+		ixgbe_set_rx_function(eth_dev);
+
 		return 0;
 	}
 
-- 
2.5.0

Re: [PATCH v3] ixgbe: fix ixgbevf RX/TX function assignment

From: Zhang, Helin <hidden>
Date: 2016-03-10 15:29:40

-----Original Message-----
From: Richardson, Bruce
Sent: Thursday, March 10, 2016 11:26 PM
To: dev@dpdk.org; Tao, Zhe <redacted>
Cc: Zhang, Helin <redacted>; Richardson, Bruce
[off-list ref]
Subject: [PATCH v3] ixgbe: fix ixgbevf RX/TX function assignment

From: Zhe Tao <redacted>
Acked-by: Helin Zhang <redacted>

Re: [PATCH v3] ixgbe: fix ixgbevf RX/TX function assignment

From: Bruce Richardson <hidden>
Date: 2016-03-10 15:33:58

On Thu, Mar 10, 2016 at 03:29:13PM +0000, Zhang, Helin wrote:
quoted
-----Original Message-----
From: Richardson, Bruce
Sent: Thursday, March 10, 2016 11:26 PM
To: dev@dpdk.org; Tao, Zhe <redacted>
Cc: Zhang, Helin <redacted>; Richardson, Bruce
[off-list ref]
Subject: [PATCH v3] ixgbe: fix ixgbevf RX/TX function assignment

From: Zhe Tao <redacted>
Acked-by: Helin Zhang <redacted>
Applied to dpdk-next-net/rel_16_04

/Bruce

[PATCH v3] ixgbe: fix ixgbevf RX/TX function assignment

From: Zhe Tao <hidden>
Date: 2016-03-14 03:42:44

For the secondary process of DPDK to initialize ixgbevf, it will always
use the simple RX function or LRO RX function, and this behavior is not
the same RX/TX function selection logic as it is for the primary process,
so use the ixgbe_set_tx_function and ixgbe_set_rx_function to select the
RX/TX function when secondary process call the init function for eth dev.  

Fixes: 46bc9d75 (ixgbe: fix multi-process support)

Signed-off-by: Zhe Tao <redacted>
---
V2:added fixes line
V3:changed fixes line

 drivers/net/ixgbe/ixgbe_ethdev.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3e6fe86..0f9d048 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1278,8 +1278,21 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 	 * has already done this work. Only check we don't need a different
 	 * RX function */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY){
-		if (eth_dev->data->scattered_rx)
-			eth_dev->rx_pkt_burst = ixgbe_recv_pkts_lro_single_alloc;
+		struct ixgbe_tx_queue *txq;
+		/* TX queue function in primary, set by last queue initialized
+		 * Tx queue may not initialized by primary process
+		 */
+		if (eth_dev->data->tx_queues) {
+			txq = eth_dev->data->tx_queues[eth_dev->data->nb_tx_queues-1];
+			ixgbe_set_tx_function(eth_dev, txq);
+		} else {
+			/* Use default TX function if we get here */
+			PMD_INIT_LOG(NOTICE, "No TX queues configured yet. "
+					     "Using default TX function.");
+		}
+
+		ixgbe_set_rx_function(eth_dev);
+
 		return 0;
 	}
 
-- 
2.1.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help