[dpdk-dev,RFC] net/ixgbe: start rxtx after all nic config done.

Message ID 1473163517-19404-1-git-send-email-lnykww@gmail.com
State Accepted, archived
Delegated to: Bruce Richardson
Headers show

Commit Message

wang wei Sept. 6, 2016, 12:05 p.m.
if start rxtx before flow director config, will cause driver can't receive
packets from nic.

Signed-off-by: wang wei <lnykww@gmail.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 60 ++++++++++++++++++++--------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

Comments

Wu, Jingjing Sept. 7, 2016, 1:33 a.m. | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wang wei
> Sent: Tuesday, September 6, 2016 8:05 PM
> To: thomas.monjalon@6wind.com
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [RFC] net/ixgbe: start rxtx after all nic config done.
> 
> if start rxtx before flow director config, will cause driver can't receive packets
> from nic.
> 
Good pointer. How about move all flow director and VMDQ configure to
ixgbe_dev_configure?

Thanks
Jingjing
wang wei Sept. 7, 2016, 4:30 a.m. | #2
2016-09-07 9:33 GMT+08:00 Wu, Jingjing <jingjing.wu@intel.com>:
>
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wang wei
>> Sent: Tuesday, September 6, 2016 8:05 PM
>> To: thomas.monjalon@6wind.com
>> Cc: dev@dpdk.org
>> Subject: [dpdk-dev] [RFC] net/ixgbe: start rxtx after all nic config done.
>>
>> if start rxtx before flow director config, will cause driver can't receive packets
>> from nic.
>>
> Good pointer. How about move all flow director and VMDQ configure to
> ixgbe_dev_configure?
>
> Thanks
> Jingjing

Initialization of flow director and VMDQ needs to be after calling
ixgbe_pf_reset_hw, otherwise the configuration will be lost.
Lu, Wenzhuo Sept. 8, 2016, 1:07 a.m. | #3
Hi Wei,


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wang wei
> Sent: Tuesday, September 6, 2016 8:05 PM
> To: thomas.monjalon@6wind.com
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [RFC] net/ixgbe: start rxtx after all nic config done.
> 
> if start rxtx before flow director config, will cause driver can't receive packets
> from nic.
> 
> Signed-off-by: wang wei <lnykww@gmail.com>
I think you're right. We should start rx/tx after the config is done.
Ferruh Yigit Sept. 20, 2016, 2:17 p.m. | #4
Hi Wenzhuo,

On 9/8/2016 2:07 AM, Lu, Wenzhuo wrote:
> Hi Wei,
> 
> 
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wang wei
>> Sent: Tuesday, September 6, 2016 8:05 PM
>> To: thomas.monjalon@6wind.com
>> Cc: dev@dpdk.org
>> Subject: [dpdk-dev] [RFC] net/ixgbe: start rxtx after all nic config done.
>>
>> if start rxtx before flow director config, will cause driver can't receive packets
>> from nic.
>>
>> Signed-off-by: wang wei <lnykww@gmail.com>
> I think you're right. We should start rx/tx after the config is done.
> 

Is this an Ack?
Lu, Wenzhuo Sept. 21, 2016, 12:46 a.m. | #5
Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Tuesday, September 20, 2016 10:18 PM
> To: Lu, Wenzhuo; wang wei; thomas.monjalon@6wind.com
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [RFC] net/ixgbe: start rxtx after all nic config done.
> 
> Hi Wenzhuo,
> 
> On 9/8/2016 2:07 AM, Lu, Wenzhuo wrote:
> > Hi Wei,
> >
> >
> >> -----Original Message-----
> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wang wei
> >> Sent: Tuesday, September 6, 2016 8:05 PM
> >> To: thomas.monjalon@6wind.com
> >> Cc: dev@dpdk.org
> >> Subject: [dpdk-dev] [RFC] net/ixgbe: start rxtx after all nic config done.
> >>
> >> if start rxtx before flow director config, will cause driver can't
> >> receive packets from nic.
> >>
> >> Signed-off-by: wang wei <lnykww@gmail.com>
> > I think you're right. We should start rx/tx after the config is done.
> >
> 
> Is this an Ack?
Yes.
Ferruh Yigit Sept. 21, 2016, 9:28 a.m. | #6
...

>>>> Subject: [dpdk-dev] [RFC] net/ixgbe: start rxtx after all nic config done.
>>>>
>>>> if start rxtx before flow director config, will cause driver can't
>>>> receive packets from nic.
>>>>
>>>> Signed-off-by: wang wei <lnykww@gmail.com>
>>> I think you're right. We should start rx/tx after the config is done.
>>>
>>
>> Is this an Ack?
> Yes. 
> 

To put it explicitly:
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Bruce Richardson Sept. 21, 2016, 12:36 p.m. | #7
On Wed, Sep 21, 2016 at 10:28:39AM +0100, Ferruh Yigit wrote:
> ...
> 
> >>>> Subject: [dpdk-dev] [RFC] net/ixgbe: start rxtx after all nic config done.
> >>>>
> >>>> if start rxtx before flow director config, will cause driver can't
> >>>> receive packets from nic.
> >>>>
> >>>> Signed-off-by: wang wei <lnykww@gmail.com>
> >>> I think you're right. We should start rx/tx after the config is done.
> >>>
> >>
> >> Is this an Ack?
> > Yes. 
> > 
> 
> To put it explicitly:
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Applied to dpdk-next-net/rel_16_11

/Bruce

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index fb618ef..5ee51d5 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2291,6 +2291,36 @@  ixgbe_dev_start(struct rte_eth_dev *dev)
 		goto error;
 	}
 
+    mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
+		ETH_VLAN_EXTEND_MASK;
+	ixgbe_vlan_offload_set(dev, mask);
+
+	if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_VMDQ_ONLY) {
+		/* Enable vlan filtering for VMDq */
+		ixgbe_vmdq_vlan_hw_filter_enable(dev);
+	}
+
+	/* Configure DCB hw */
+	ixgbe_configure_dcb(dev);
+
+	if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_NONE) {
+		err = ixgbe_fdir_configure(dev);
+		if (err)
+			goto error;
+	}
+
+	/* Restore vf rate limit */
+	if (vfinfo != NULL) {
+		for (vf = 0; vf < dev->pci_dev->max_vfs; vf++)
+			for (idx = 0; idx < IXGBE_MAX_QUEUE_NUM_PER_VF; idx++)
+				if (vfinfo[vf].tx_rate[idx] != 0)
+					ixgbe_set_vf_rate_limit(dev, vf,
+						vfinfo[vf].tx_rate[idx],
+						1 << idx);
+	}
+
+	ixgbe_restore_statistics_mapping(dev);
+
 	err = ixgbe_dev_rxtx_start(dev);
 	if (err < 0) {
 		PMD_INIT_LOG(ERR, "Unable to start rxtx queues");
@@ -2376,36 +2406,6 @@  skip_link_setup:
 	/* resume enabled intr since hw reset */
 	ixgbe_enable_intr(dev);
 
-	mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
-		ETH_VLAN_EXTEND_MASK;
-	ixgbe_vlan_offload_set(dev, mask);
-
-	if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_VMDQ_ONLY) {
-		/* Enable vlan filtering for VMDq */
-		ixgbe_vmdq_vlan_hw_filter_enable(dev);
-	}
-
-	/* Configure DCB hw */
-	ixgbe_configure_dcb(dev);
-
-	if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_NONE) {
-		err = ixgbe_fdir_configure(dev);
-		if (err)
-			goto error;
-	}
-
-	/* Restore vf rate limit */
-	if (vfinfo != NULL) {
-		for (vf = 0; vf < dev->pci_dev->max_vfs; vf++)
-			for (idx = 0; idx < IXGBE_MAX_QUEUE_NUM_PER_VF; idx++)
-				if (vfinfo[vf].tx_rate[idx] != 0)
-					ixgbe_set_vf_rate_limit(dev, vf,
-						vfinfo[vf].tx_rate[idx],
-						1 << idx);
-	}
-
-	ixgbe_restore_statistics_mapping(dev);
-
 	return 0;
 
 error: