[dpdk-dev,v4] net/ixgbe: fix l3fwd start failed on PF

Message ID 20171120024026.152048-1-yanglong.wu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Helin Zhang
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Yanglong Wu Nov. 20, 2017, 2:40 a.m. UTC
  L3fwd start failed on PF, for tx_q check failed.
That occurred when the SRIOV is active and tx_q > rx_q.
The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool
should equeal to max number of queues supported by HW not nb_rx_q.

Fixes: 27b609cbd1c6 (ethdev: move the multi-queue mode check to specific drivers)

Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ananyev, Konstantin Nov. 20, 2017, 10:43 a.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> Sent: Monday, November 20, 2017 2:40 AM
> To: dev@dpdk.org
> Cc: Wu, Yanglong <yanglong.wu@intel.com>
> Subject: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF
> 
> L3fwd start failed on PF, for tx_q check failed.
> That occurred when the SRIOV is active and tx_q > rx_q.
> The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool
> should equeal to max number of queues supported by HW not nb_rx_q.
> 
> Fixes: 27b609cbd1c6 (ethdev: move the multi-queue mode check to specific drivers)
> 
> Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ae9c44421..0f0641da1 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2180,7 +2180,7 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
>  		return -EINVAL;
>  	}
> 
> -	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
> +	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128 / RTE_ETH_DEV_SRIOV(dev).active;

Please use appropriate macros instead of constants (s/128/IXGBE_MAX_RX_QUEUE_NUM).


>  	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;


Shouldn't we also change that line to:
RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
?

Konstantin

> 
>  	return 0;
> --
> 2.11.0
  
Yanglong Wu Nov. 21, 2017, 2:17 a.m. UTC | #2
Hi,
Yes, I think so, we can change it. nb_rx_q just means the number of queue used for a port and RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool means max queue can be used.

-----Original Message-----
From: Ananyev, Konstantin 
Sent: Monday, November 20, 2017 6:44 PM
To: Wu, Yanglong <yanglong.wu@intel.com>; dev@dpdk.org
Cc: Wu, Yanglong <yanglong.wu@intel.com>
Subject: RE: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> Sent: Monday, November 20, 2017 2:40 AM
> To: dev@dpdk.org
> Cc: Wu, Yanglong <yanglong.wu@intel.com>
> Subject: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF
> 
> L3fwd start failed on PF, for tx_q check failed.
> That occurred when the SRIOV is active and tx_q > rx_q.
> The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should 
> equeal to max number of queues supported by HW not nb_rx_q.
> 
> Fixes: 27b609cbd1c6 (ethdev: move the multi-queue mode check to 
> specific drivers)
> 
> Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c 
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ae9c44421..0f0641da1 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2180,7 +2180,7 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
>  		return -EINVAL;
>  	}
> 
> -	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
> +	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128 / 
> +RTE_ETH_DEV_SRIOV(dev).active;

Please use appropriate macros instead of constants (s/128/IXGBE_MAX_RX_QUEUE_NUM).


>  	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;


Shouldn't we also change that line to:
RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
?

Konstantin

> 
>  	return 0;
> --
> 2.11.0
  
Zhang, Helin Jan. 7, 2018, 3:34 p.m. UTC | #3
Hi Yanglong

Please follow the comments, and get all of them well addressed.
My comments is you need to use in-reply-to when you send any
updated versions of a patch.

Regards,
Helin

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev,
> Konstantin
> Sent: Monday, November 20, 2017 6:44 PM
> To: Wu, Yanglong; dev@dpdk.org
> Cc: Wu, Yanglong
> Subject: Re: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yanglong Wu
> > Sent: Monday, November 20, 2017 2:40 AM
> > To: dev@dpdk.org
> > Cc: Wu, Yanglong <yanglong.wu@intel.com>
> > Subject: [dpdk-dev] [PATCH v4] net/ixgbe: fix l3fwd start failed on PF
> >
> > L3fwd start failed on PF, for tx_q check failed.
> > That occurred when the SRIOV is active and tx_q > rx_q.
> > The tx_q is equal to nb_q_per_pool. The number of nb_q_per_pool should
> > equeal to max number of queues supported by HW not nb_rx_q.
> >
> > Fixes: 27b609cbd1c6 (ethdev: move the multi-queue mode check to
> > specific drivers)
> >
> > Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index ae9c44421..0f0641da1 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -2180,7 +2180,7 @@ ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev
> *dev, uint16_t nb_rx_q)
> >  		return -EINVAL;
> >  	}
> >
> > -	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
> > +	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128 /
> > +RTE_ETH_DEV_SRIOV(dev).active;
> 
> Please use appropriate macros instead of constants
> (s/128/IXGBE_MAX_RX_QUEUE_NUM).
> 
> 
> >  	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs *
> nb_rx_q;
> 
> 
> Shouldn't we also change that line to:
> RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs *
> RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
> ?
> 
> Konstantin
> 
> >
> >  	return 0;
> > --
> > 2.11.0
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ae9c44421..0f0641da1 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2180,7 +2180,7 @@  ixgbe_check_vf_rss_rxq_num(struct rte_eth_dev *dev, uint16_t nb_rx_q)
 		return -EINVAL;
 	}
 
-	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = nb_rx_q;
+	RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool = 128 / RTE_ETH_DEV_SRIOV(dev).active;
 	RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
 
 	return 0;