[dpdk-dev,v6] net/ixgbe: fix tx_q check failed on PF
Checks
Commit Message
Tx_q check failed on PF 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>
---
v5:
Rework according to comments
---
v6:
rework commit log
---
drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
Comments
> -----Original Message-----
> From: Wu, Yanglong
> Sent: Wednesday, January 10, 2018 1:52 AM
> To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>; Zhang, Helin <helin.zhang@intel.com>
> Cc: Wu, Yanglong <yanglong.wu@intel.com>
> Subject: [PATCH v6] net/ixgbe: fix tx_q check failed on PF
>
> Tx_q check failed on PF 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>
> ---
> v5:
> Rework according to comments
> ---
> v6:
> rework commit log
> ---
> drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ff19a564a..baaeee5d9 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -95,6 +95,9 @@
> /* Timer value included in XOFF frames. */
> #define IXGBE_FC_PAUSE 0x680
>
> +/*Default value of Max Rx Queue*/
> +#define IXGBE_MAX_RX_QUEUE_NUM 128
> +
> #define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
> #define IXGBE_LINK_UP_CHECK_TIMEOUT 1000 /* ms */
> #define IXGBE_VMDQ_NUM_UC_MAC 4096 /* Maximum nb. of UC MAC addr. */
> @@ -2194,9 +2197,10 @@ 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).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
> -
> + RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
> + IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
> + RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
> + pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
> return 0;
> }
>
> --
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 2.11.0
> -----Original Message-----
> From: Ananyev, Konstantin
> Sent: Wednesday, January 10, 2018 9:57 AM
> To: Wu, Yanglong; dev@dpdk.org; Zhang, Helin
> Subject: RE: [PATCH v6] net/ixgbe: fix tx_q check failed on PF
>
>
>
> > -----Original Message-----
> > From: Wu, Yanglong
> > Sent: Wednesday, January 10, 2018 1:52 AM
> > To: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>;
> > Zhang, Helin <helin.zhang@intel.com>
> > Cc: Wu, Yanglong <yanglong.wu@intel.com>
> > Subject: [PATCH v6] net/ixgbe: fix tx_q check failed on PF
> >
> > Tx_q check failed on PF 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>
> > ---
> > v5:
> > Rework according to comments
> > ---
> > v6:
> > rework commit log
> > ---
> > drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++++---
> > 1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index ff19a564a..baaeee5d9 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -95,6 +95,9 @@
> > /* Timer value included in XOFF frames. */ #define IXGBE_FC_PAUSE
> > 0x680
> >
> > +/*Default value of Max Rx Queue*/
> > +#define IXGBE_MAX_RX_QUEUE_NUM 128
> > +
> > #define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
> > #define IXGBE_LINK_UP_CHECK_TIMEOUT 1000 /* ms */
> > #define IXGBE_VMDQ_NUM_UC_MAC 4096 /* Maximum nb. of UC
> MAC addr. */
> > @@ -2194,9 +2197,10 @@ 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).def_pool_q_idx = pci_dev->max_vfs *
> nb_rx_q;
> > -
> > + RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
> > + IXGBE_MAX_RX_QUEUE_NUM /
> RTE_ETH_DEV_SRIOV(dev).active;
> > + RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
> > + pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
> > return 0;
> > }
> >
> > --
>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Applied to dpdk-next-net-intel, with commit log changes. Thanks!
/Helin
>
> > 2.11.0
@@ -95,6 +95,9 @@
/* Timer value included in XOFF frames. */
#define IXGBE_FC_PAUSE 0x680
+/*Default value of Max Rx Queue*/
+#define IXGBE_MAX_RX_QUEUE_NUM 128
+
#define IXGBE_LINK_DOWN_CHECK_TIMEOUT 4000 /* ms */
#define IXGBE_LINK_UP_CHECK_TIMEOUT 1000 /* ms */
#define IXGBE_VMDQ_NUM_UC_MAC 4096 /* Maximum nb. of UC MAC addr. */
@@ -2194,9 +2197,10 @@ 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).def_pool_q_idx = pci_dev->max_vfs * nb_rx_q;
-
+ RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool =
+ IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+ RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx =
+ pci_dev->max_vfs * RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
return 0;
}