[dpdk-dev,v3] ixgbe: fix ixgbevf RX/TX function assignment

Message ID 1457623582-12068-1-git-send-email-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Bruce Richardson March 10, 2016, 3:26 p.m. UTC
  From: Zhe Tao <zhe.tao@intel.com>

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 <zhe.tao@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

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

Comments

Zhang, Helin March 10, 2016, 3:29 p.m. UTC | #1
> -----Original Message-----
> From: Richardson, Bruce
> Sent: Thursday, March 10, 2016 11:26 PM
> To: dev@dpdk.org; Tao, Zhe <zhe.tao@intel.com>
> Cc: Zhang, Helin <helin.zhang@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>
> Subject: [PATCH v3] ixgbe: fix ixgbevf RX/TX function assignment
> 
> From: Zhe Tao <zhe.tao@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
  
Bruce Richardson March 10, 2016, 3:33 p.m. UTC | #2
On Thu, Mar 10, 2016 at 03:29:13PM +0000, Zhang, Helin wrote:
> 
> 
> > -----Original Message-----
> > From: Richardson, Bruce
> > Sent: Thursday, March 10, 2016 11:26 PM
> > To: dev@dpdk.org; Tao, Zhe <zhe.tao@intel.com>
> > Cc: Zhang, Helin <helin.zhang@intel.com>; Richardson, Bruce
> > <bruce.richardson@intel.com>
> > Subject: [PATCH v3] ixgbe: fix ixgbevf RX/TX function assignment
> > 
> > From: Zhe Tao <zhe.tao@intel.com>
> Acked-by: Helin Zhang <helin.zhang@intel.com>
> 
Applied to dpdk-next-net/rel_16_04

/Bruce
  

Patch

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;
 	}