DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ixgbe: add TX queue number check
@ 2016-03-22  8:08 Wenzhuo Lu
  2016-03-22  8:42 ` Qiu, Michael
  2016-03-23 15:28 ` [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number Pablo de Lara
  0 siblings, 2 replies; 18+ messages in thread
From: Wenzhuo Lu @ 2016-03-22  8:08 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Ixgbe supports at most 128 TX queues. But in none VT nor DCB mode
the queues 64 ~ 127 should not be used. Ixgbe doesn't do any check
about that. If a queue larger than 64 is used, the TX packets will
be dropped silently. It's hard to debug.
This check is added to forbid using queue number larger than 64
during device configuration, so the user can know the problem as
early as possible.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Reported-by: Antonio Fischetti <antonio.fischetti@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++++++-
 drivers/net/ixgbe/ixgbe_ethdev.h |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 5371720..dd6d00e 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1862,7 +1862,7 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 {
 	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 	uint16_t nb_rx_q = dev->data->nb_rx_queues;
-	uint16_t nb_tx_q = dev->data->nb_rx_queues;
+	uint16_t nb_tx_q = dev->data->nb_tx_queues;
 
 	if (RTE_ETH_DEV_SRIOV(dev).active != 0) {
 		/* check multi-queue mode */
@@ -2002,6 +2002,15 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 				return -EINVAL;
 			}
 		}
+
+		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE) {
+			if (nb_tx_q > IXGBE_NONE_VT_DCB_MAX_TXQ_NB) {
+				PMD_INIT_LOG(ERR,
+					     "None VT nor DCB, nb_tx_q > %d.",
+					     IXGBE_NONE_VT_DCB_MAX_TXQ_NB);
+				return -EINVAL;
+			}
+		}
 	}
 	return 0;
 }
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index 5c3aa16..50ee73f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -61,6 +61,7 @@
 #define IXGBE_MAX_RX_QUEUE_NUM	128
 #define IXGBE_VMDQ_DCB_NB_QUEUES     IXGBE_MAX_RX_QUEUE_NUM
 #define IXGBE_DCB_NB_QUEUES          IXGBE_MAX_RX_QUEUE_NUM
+#define IXGBE_NONE_VT_DCB_MAX_TXQ_NB 64
 
 #ifndef NBBY
 #define NBBY	8	/* number of bits in a byte */
-- 
1.9.3

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH] ixgbe: add TX queue number check
  2016-03-22  8:08 [dpdk-dev] [PATCH] ixgbe: add TX queue number check Wenzhuo Lu
@ 2016-03-22  8:42 ` Qiu, Michael
  2016-03-23 15:28 ` [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number Pablo de Lara
  1 sibling, 0 replies; 18+ messages in thread
From: Qiu, Michael @ 2016-03-22  8:42 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev

On 3/22/2016 4:10 PM, Wenzhuo Lu wrote:
> Ixgbe supports at most 128 TX queues. But in none VT nor DCB mode
> the queues 64 ~ 127 should not be used. Ixgbe doesn't do any check
> about that. If a queue larger than 64 is used, the TX packets will
> be dropped silently. It's hard to debug.
> This check is added to forbid using queue number larger than 64
> during device configuration, so the user can know the problem as
> early as possible.
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Reported-by: Antonio Fischetti <antonio.fischetti@intel.com>
> ---

Acked-by: Michael Qiu <michael.qiu@intel.com>

>  drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++++++-
>  drivers/net/ixgbe/ixgbe_ethdev.h |  1 +
>  2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 5371720..dd6d00e 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -1862,7 +1862,7 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
>  {
>  	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
>  	uint16_t nb_rx_q = dev->data->nb_rx_queues;
> -	uint16_t nb_tx_q = dev->data->nb_rx_queues;
> +	uint16_t nb_tx_q = dev->data->nb_tx_queues;
>  
>  	if (RTE_ETH_DEV_SRIOV(dev).active != 0) {
>  		/* check multi-queue mode */
> @@ -2002,6 +2002,15 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
>  				return -EINVAL;
>  			}
>  		}
> +
> +		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE) {
> +			if (nb_tx_q > IXGBE_NONE_VT_DCB_MAX_TXQ_NB) {
> +				PMD_INIT_LOG(ERR,
> +					     "None VT nor DCB, nb_tx_q > %d.",
> +					     IXGBE_NONE_VT_DCB_MAX_TXQ_NB);
> +				return -EINVAL;
> +			}
> +		}
>  	}
>  	return 0;
>  }
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
> index 5c3aa16..50ee73f 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.h
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.h
> @@ -61,6 +61,7 @@
>  #define IXGBE_MAX_RX_QUEUE_NUM	128
>  #define IXGBE_VMDQ_DCB_NB_QUEUES     IXGBE_MAX_RX_QUEUE_NUM
>  #define IXGBE_DCB_NB_QUEUES          IXGBE_MAX_RX_QUEUE_NUM
> +#define IXGBE_NONE_VT_DCB_MAX_TXQ_NB 64
>  
>  #ifndef NBBY
>  #define NBBY	8	/* number of bits in a byte */


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number
  2016-03-22  8:08 [dpdk-dev] [PATCH] ixgbe: add TX queue number check Wenzhuo Lu
  2016-03-22  8:42 ` Qiu, Michael
@ 2016-03-23 15:28 ` Pablo de Lara
  2016-03-24  8:09   ` Fischetti, Antonio
                     ` (2 more replies)
  1 sibling, 3 replies; 18+ messages in thread
From: Pablo de Lara @ 2016-03-23 15:28 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, Pablo de Lara

IXGBE supports 128 TX queues. However, the full 128 queues
are only available in VT and DCB mode.
In normal default "none" mode (VT/DCB off) the maximum number
of available queues is only 64.
IXGBE doesn't check the mode when reporting the available
number of queues. If a queue larger than 64 is used in default mode,
the TX packets will be dropped silently.

This change adds a check to forbid using a queue number larger than 64
during device configuration (in default mode), so that the problem is
reported as early as possible.
It also changes the order of where the dev_conf parameters are copied
into the dev structure so that the correct maximum number of queues
is reported for the correct mode.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---

Changes in v2:

- Reorder memcpy of device configuration in rte_eth_dev_configure(),
  so function gets the correct maximum number of queues
  (depending on the operation mode), before checking the
  requested number of queues.
- Renamed new macro
- Reworded/wrapped commit message

 drivers/net/ixgbe/ixgbe_ethdev.c | 17 ++++++++++++++++-
 drivers/net/ixgbe/ixgbe_ethdev.h |  1 +
 lib/librte_ether/rte_ethdev.c    |  6 +++---
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d4d883a..c799b47 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1862,7 +1862,7 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 {
 	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 	uint16_t nb_rx_q = dev->data->nb_rx_queues;
-	uint16_t nb_tx_q = dev->data->nb_rx_queues;
+	uint16_t nb_tx_q = dev->data->nb_tx_queues;
 
 	if (RTE_ETH_DEV_SRIOV(dev).active != 0) {
 		/* check multi-queue mode */
@@ -2002,6 +2002,16 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 				return -EINVAL;
 			}
 		}
+
+		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE) {
+			if (nb_tx_q > IXGBE_NONE_MODE_TX_NB_QUEUES) {
+				PMD_INIT_LOG(ERR,
+					     "Neither VT nor DCB are enabled, "
+					     "nb_tx_q > %d.",
+					     IXGBE_NONE_MODE_TX_NB_QUEUES);
+				return -EINVAL;
+			}
+		}
 	}
 	return 0;
 }
@@ -2856,9 +2866,14 @@ static void
 ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 
 	dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
 	dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
+	if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE)
+			dev_info->max_tx_queues = IXGBE_NONE_MODE_TX_NB_QUEUES;
+	}
 	dev_info->min_rx_bufsize = 1024; /* cf BSIZEPACKET in SRRCTL register */
 	dev_info->max_rx_pktlen = 15872; /* includes CRC, cf MAXFRS register */
 	dev_info->max_mac_addrs = hw->mac.num_rar_entries;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index 5c3aa16..691c62f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -61,6 +61,7 @@
 #define IXGBE_MAX_RX_QUEUE_NUM	128
 #define IXGBE_VMDQ_DCB_NB_QUEUES     IXGBE_MAX_RX_QUEUE_NUM
 #define IXGBE_DCB_NB_QUEUES          IXGBE_MAX_RX_QUEUE_NUM
+#define IXGBE_NONE_MODE_TX_NB_QUEUES 64
 
 #ifndef NBBY
 #define NBBY	8	/* number of bits in a byte */
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 8721a6b..b941b0d 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -901,6 +901,9 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		return -EBUSY;
 	}
 
+	/* Copy the dev_conf parameter into the dev structure */
+	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
+
 	/*
 	 * Check that the numbers of RX and TX queues are not greater
 	 * than the maximum number of RX and TX queues supported by the
@@ -925,9 +928,6 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		return -EINVAL;
 	}
 
-	/* Copy the dev_conf parameter into the dev structure */
-	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
-
 	/*
 	 * If link state interrupt is enabled, check that the
 	 * device supports it.
-- 
2.5.5

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number
  2016-03-23 15:28 ` [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number Pablo de Lara
@ 2016-03-24  8:09   ` Fischetti, Antonio
  2016-03-24  8:40   ` Fischetti, Antonio
  2016-03-24 15:17   ` [dpdk-dev] [PATCH v3] " Pablo de Lara
  2 siblings, 0 replies; 18+ messages in thread
From: Fischetti, Antonio @ 2016-03-24  8:09 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev; +Cc: Lu, Wenzhuo, De Lara Guarch, Pablo

Hi, I tested this patch with OVS+DPDK on a 72 lcores board with an 
Intel 82599ES 10 Gb NIC. It works fine.

Now when I call 'rte_eth_dev_info_get()' it returns correctly the number
of available Tx queues for the default mode, i.e. 64 when no VT and no
DCB is set.
Also, if I attempt to request more than the available queues via
'rte_eth_dev_configure()' it correctly returns -EINVAL error.

I checked it works with both DPDK v2.2.0 and the latest master branch.

Without this patch there was a misbehavior: when OVS queried for the
number of available Tx queues, 128 was returned. As a consequence
OVS was requesting 73 Tx queues, even though just 64 were really 
available. No error was returned. Of course any transmission was
failing when OVS attempted to use queues with ID >= 64.

Regards,
Antonio

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Wednesday, March 23, 2016 3:29 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number
> 
> IXGBE supports 128 TX queues. However, the full 128 queues
> are only available in VT and DCB mode.
> In normal default "none" mode (VT/DCB off) the maximum number
> of available queues is only 64.
> IXGBE doesn't check the mode when reporting the available
> number of queues. If a queue larger than 64 is used in default mode,
> the TX packets will be dropped silently.
> 
> This change adds a check to forbid using a queue number larger than 64
> during device configuration (in default mode), so that the problem is
> reported as early as possible.
> It also changes the order of where the dev_conf parameters are copied
> into the dev structure so that the correct maximum number of queues
> is reported for the correct mode.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
> 
> Changes in v2:
> 
> - Reorder memcpy of device configuration in rte_eth_dev_configure(),
>   so function gets the correct maximum number of queues
>   (depending on the operation mode), before checking the
>   requested number of queues.
> - Renamed new macro
> - Reworded/wrapped commit message
> 
>  drivers/net/ixgbe/ixgbe_ethdev.c | 17 ++++++++++++++++-
>  drivers/net/ixgbe/ixgbe_ethdev.h |  1 +
>  lib/librte_ether/rte_ethdev.c    |  6 +++---
>  3 files changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index d4d883a..c799b47 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -1862,7 +1862,7 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
>  {
>  	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
>  	uint16_t nb_rx_q = dev->data->nb_rx_queues;
> -	uint16_t nb_tx_q = dev->data->nb_rx_queues;
> +	uint16_t nb_tx_q = dev->data->nb_tx_queues;
> 
>  	if (RTE_ETH_DEV_SRIOV(dev).active != 0) {
>  		/* check multi-queue mode */
> @@ -2002,6 +2002,16 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
>  				return -EINVAL;
>  			}
>  		}
> +
> +		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE) {
> +			if (nb_tx_q > IXGBE_NONE_MODE_TX_NB_QUEUES) {
> +				PMD_INIT_LOG(ERR,
> +					     "Neither VT nor DCB are enabled, "
> +					     "nb_tx_q > %d.",
> +
> IXGBE_NONE_MODE_TX_NB_QUEUES);
> +				return -EINVAL;
> +			}
> +		}
>  	}
>  	return 0;
>  }
> @@ -2856,9 +2866,14 @@ static void
>  ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info
> *dev_info)
>  {
>  	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
> 
>  	dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
>  	dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
> +	if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
> +		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE)
> +			dev_info->max_tx_queues =
> IXGBE_NONE_MODE_TX_NB_QUEUES;
> +	}
>  	dev_info->min_rx_bufsize = 1024; /* cf BSIZEPACKET in SRRCTL register
> */
>  	dev_info->max_rx_pktlen = 15872; /* includes CRC, cf MAXFRS register
> */
>  	dev_info->max_mac_addrs = hw->mac.num_rar_entries;
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h
> b/drivers/net/ixgbe/ixgbe_ethdev.h
> index 5c3aa16..691c62f 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.h
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.h
> @@ -61,6 +61,7 @@
>  #define IXGBE_MAX_RX_QUEUE_NUM	128
>  #define IXGBE_VMDQ_DCB_NB_QUEUES     IXGBE_MAX_RX_QUEUE_NUM
>  #define IXGBE_DCB_NB_QUEUES          IXGBE_MAX_RX_QUEUE_NUM
> +#define IXGBE_NONE_MODE_TX_NB_QUEUES 64
> 
>  #ifndef NBBY
>  #define NBBY	8	/* number of bits in a byte */
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 8721a6b..b941b0d 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -901,6 +901,9 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t
> nb_rx_q, uint16_t nb_tx_q,
>  		return -EBUSY;
>  	}
> 
> +	/* Copy the dev_conf parameter into the dev structure */
> +	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data-
> >dev_conf));
> +
>  	/*
>  	 * Check that the numbers of RX and TX queues are not greater
>  	 * than the maximum number of RX and TX queues supported by the
> @@ -925,9 +928,6 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t
> nb_rx_q, uint16_t nb_tx_q,
>  		return -EINVAL;
>  	}
> 
> -	/* Copy the dev_conf parameter into the dev structure */
> -	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data-
> >dev_conf));
> -
>  	/*
>  	 * If link state interrupt is enabled, check that the
>  	 * device supports it.
> --
> 2.5.5

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number
  2016-03-23 15:28 ` [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number Pablo de Lara
  2016-03-24  8:09   ` Fischetti, Antonio
@ 2016-03-24  8:40   ` Fischetti, Antonio
  2016-03-24 10:27     ` De Lara Guarch, Pablo
  2016-03-24 15:17   ` [dpdk-dev] [PATCH v3] " Pablo de Lara
  2 siblings, 1 reply; 18+ messages in thread
From: Fischetti, Antonio @ 2016-03-24  8:40 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev; +Cc: Lu, Wenzhuo, De Lara Guarch, Pablo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Wednesday, March 23, 2016 3:29 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number
> 
> IXGBE supports 128 TX queues. However, the full 128 queues
> are only available in VT and DCB mode.
> In normal default "none" mode (VT/DCB off) the maximum number
> of available queues is only 64.
> IXGBE doesn't check the mode when reporting the available
> number of queues. If a queue larger than 64 is used in default mode,
> the TX packets will be dropped silently.
> 
> This change adds a check to forbid using a queue number larger than 64
> during device configuration (in default mode), so that the problem is
> reported as early as possible.
> It also changes the order of where the dev_conf parameters are copied
> into the dev structure so that the correct maximum number of queues
> is reported for the correct mode.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Tested-by: Antonio Fischetti <antonio.fischetti@intel.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number
  2016-03-24  8:40   ` Fischetti, Antonio
@ 2016-03-24 10:27     ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 18+ messages in thread
From: De Lara Guarch, Pablo @ 2016-03-24 10:27 UTC (permalink / raw)
  To: Fischetti, Antonio, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: Fischetti, Antonio
> Sent: Thursday, March 24, 2016 8:40 AM
> To: De Lara Guarch, Pablo; dev@dpdk.org
> Cc: Lu, Wenzhuo; De Lara Guarch, Pablo
> Subject: RE: [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> > Sent: Wednesday, March 23, 2016 3:29 PM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; De Lara Guarch, Pablo
> > <pablo.de.lara.guarch@intel.com>
> > Subject: [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number
> >
> > IXGBE supports 128 TX queues. However, the full 128 queues
> > are only available in VT and DCB mode.
> > In normal default "none" mode (VT/DCB off) the maximum number
> > of available queues is only 64.
> > IXGBE doesn't check the mode when reporting the available
> > number of queues. If a queue larger than 64 is used in default mode,
> > the TX packets will be dropped silently.
> >
> > This change adds a check to forbid using a queue number larger than 64
> > during device configuration (in default mode), so that the problem is
> > reported as early as possible.
> > It also changes the order of where the dev_conf parameters are copied
> > into the dev structure so that the correct maximum number of queues
> > is reported for the correct mode.
> >
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> 
> Tested-by: Antonio Fischetti <antonio.fischetti@intel.com>

Self-NACK. Will include release notes update and split the patch.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v3] ixgbe: add check for tx queue number
  2016-03-23 15:28 ` [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number Pablo de Lara
  2016-03-24  8:09   ` Fischetti, Antonio
  2016-03-24  8:40   ` Fischetti, Antonio
@ 2016-03-24 15:17   ` Pablo de Lara
  2016-03-24 15:22     ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Pablo de Lara
  2016-03-26  9:17     ` [dpdk-dev] [PATCH v3] ixgbe: add check for tx queue number Fischetti, Antonio
  2 siblings, 2 replies; 18+ messages in thread
From: Pablo de Lara @ 2016-03-24 15:17 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, Pablo de Lara

From: Wenzhuo Lu <wenzhuo.lu@intel.com>

IXGBE supports 128 TX queues. However, the full 128 queues
are only available in VT and DCB mode.
In normal default "none" mode (VT/DCB off) the maximum number
of available queues is only 64
(except for 82598EB, which is 32 for all modes).

IXGBE doesn't check the mode when reporting the available
number of queues. If a queue larger than 64 is used in default mode,
the TX packets will be dropped silently.

This change adds a check to forbid using a queue number larger than 64
during device configuration (in default mode), so that the problem is
reported as early as possible.
It also changes the order of where the dev_conf parameters are copied
into the dev structure so that the correct maximum number of queues
is reported for the correct mode.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---

Respin for automated testing.
Will send a v4 splitting the patch.

Changes in v3:
- Fixed wrong set of TX queues for 82596EB

Changes in v2:

- Reorder memcpy of device configuration in rte_eth_dev_configure(),
  so function gets the correct maximum number of queues
  (depending on the operation mode), before checking the
  requested number of queues.
- Renamed new macro
- Reworded/wrapped commit message

 drivers/net/ixgbe/ixgbe_ethdev.c | 28 +++++++++++++++++++++++++++-
 drivers/net/ixgbe/ixgbe_ethdev.h |  1 +
 lib/librte_ether/rte_ethdev.c    |  6 +++---
 3 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d4d883a..bfd8cb3 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1861,8 +1861,9 @@ static int
 ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 {
 	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint16_t nb_rx_q = dev->data->nb_rx_queues;
-	uint16_t nb_tx_q = dev->data->nb_rx_queues;
+	uint16_t nb_tx_q = dev->data->nb_tx_queues;
 
 	if (RTE_ETH_DEV_SRIOV(dev).active != 0) {
 		/* check multi-queue mode */
@@ -2002,6 +2003,21 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 				return -EINVAL;
 			}
 		}
+
+		/*
+		 * When DCB/VT is off, maximum number of queues changes,
+		 * except for 82598EB, which remains constant.
+		 */
+		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE &&
+				hw->mac.type != ixgbe_mac_82598EB) {
+			if (nb_tx_q > IXGBE_NONE_MODE_TX_NB_QUEUES) {
+				PMD_INIT_LOG(ERR,
+					     "Neither VT nor DCB are enabled, "
+					     "nb_tx_q > %d.",
+					     IXGBE_NONE_MODE_TX_NB_QUEUES);
+				return -EINVAL;
+			}
+		}
 	}
 	return 0;
 }
@@ -2856,9 +2872,19 @@ static void
 ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 
 	dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
 	dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
+	if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+		/*
+		 * When DCB/VT is off, maximum number of queues changes,
+		 * except for 82598EB, which remains constant.
+		 */
+		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE &&
+				hw->mac.type != ixgbe_mac_82598EB)
+			dev_info->max_tx_queues = IXGBE_NONE_MODE_TX_NB_QUEUES;
+	}
 	dev_info->min_rx_bufsize = 1024; /* cf BSIZEPACKET in SRRCTL register */
 	dev_info->max_rx_pktlen = 15872; /* includes CRC, cf MAXFRS register */
 	dev_info->max_mac_addrs = hw->mac.num_rar_entries;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index 5c3aa16..691c62f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -61,6 +61,7 @@
 #define IXGBE_MAX_RX_QUEUE_NUM	128
 #define IXGBE_VMDQ_DCB_NB_QUEUES     IXGBE_MAX_RX_QUEUE_NUM
 #define IXGBE_DCB_NB_QUEUES          IXGBE_MAX_RX_QUEUE_NUM
+#define IXGBE_NONE_MODE_TX_NB_QUEUES 64
 
 #ifndef NBBY
 #define NBBY	8	/* number of bits in a byte */
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 8721a6b..b941b0d 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -901,6 +901,9 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		return -EBUSY;
 	}
 
+	/* Copy the dev_conf parameter into the dev structure */
+	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
+
 	/*
 	 * Check that the numbers of RX and TX queues are not greater
 	 * than the maximum number of RX and TX queues supported by the
@@ -925,9 +928,6 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		return -EINVAL;
 	}
 
-	/* Copy the dev_conf parameter into the dev structure */
-	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
-
 	/*
 	 * If link state interrupt is enabled, check that the
 	 * device supports it.
-- 
2.5.5

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe
  2016-03-24 15:17   ` [dpdk-dev] [PATCH v3] " Pablo de Lara
@ 2016-03-24 15:22     ` Pablo de Lara
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 1/3] ixgbe: fix incorrect tx queue number assignment Pablo de Lara
                         ` (3 more replies)
  2016-03-26  9:17     ` [dpdk-dev] [PATCH v3] ixgbe: add check for tx queue number Fischetti, Antonio
  1 sibling, 4 replies; 18+ messages in thread
From: Pablo de Lara @ 2016-03-24 15:22 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, bruce.richardson, Pablo de Lara

IXGBE supports 128 TX queues. However, the full 128 queues
are only available in VT and DCB mode.
In normal default "none" mode (VT/DCB off) the maximum number
of available queues is only 64.
IXGBE doesn't check the mode when reporting the available
number of queues. If a queue larger than 64 is used in default mode,
the TX packets will be dropped silently.

This patchset:

- Modifies the device info to show the correct maximum number of available TX queues,
  depending on the mode.

- Adds a check to forbid using a queue number larger than 64
  during device configuration (in default mode), so that the problem is
  reported as early as possible.

- It also changes the order of where the dev_conf parameters are copied
  into the dev structure so that the correct maximum number of queues
  is reported for the correct mode.

Changes in v4:
- Split the patch in three smaller patches
- Updated release notes document

Changes in v3:
- Fixed wrong set of TX queues for 82596EB

Changes in v2:

- Reorder memcpy of device configuration in rte_eth_dev_configure(),
  so function gets the correct maximum number of queues
  (depending on the operation mode), before checking the
  requested number of queues.
- Renamed new macro
- Reworded/wrapped commit message

Pablo de Lara (1):
  ethdev: copy device configuration earlier

Wenzhuo Lu (2):
  ixgbe: fix incorrect tx queue number assignment
  ixgbe: fix incorrect max tx queue number

 doc/guides/rel_notes/release_16_04.rst |  6 ++++++
 drivers/net/ixgbe/ixgbe_ethdev.c       | 22 +++++++++++++++++++++-
 drivers/net/ixgbe/ixgbe_ethdev.h       |  1 +
 lib/librte_ether/rte_ethdev.c          |  6 +++---
 4 files changed, 31 insertions(+), 4 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v4 1/3] ixgbe: fix incorrect tx queue number assignment
  2016-03-24 15:22     ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Pablo de Lara
@ 2016-03-24 15:22       ` Pablo de Lara
  2016-03-24 16:57         ` Mcnamara, John
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration earlier Pablo de Lara
                         ` (2 subsequent siblings)
  3 siblings, 1 reply; 18+ messages in thread
From: Pablo de Lara @ 2016-03-24 15:22 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, bruce.richardson

From: Wenzhuo Lu <wenzhuo.lu@intel.com>

Internal variable containing the number of TX queues for a device,
was being incorrectly assigned the number of RX queues, instead of TX.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@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 d4d883a..0d867fc 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1862,7 +1862,7 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 {
 	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 	uint16_t nb_rx_q = dev->data->nb_rx_queues;
-	uint16_t nb_tx_q = dev->data->nb_rx_queues;
+	uint16_t nb_tx_q = dev->data->nb_tx_queues;
 
 	if (RTE_ETH_DEV_SRIOV(dev).active != 0) {
 		/* check multi-queue mode */
-- 
2.5.5

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration earlier
  2016-03-24 15:22     ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Pablo de Lara
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 1/3] ixgbe: fix incorrect tx queue number assignment Pablo de Lara
@ 2016-03-24 15:22       ` Pablo de Lara
  2016-03-24 16:57         ` Mcnamara, John
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue number Pablo de Lara
  2016-03-24 17:44       ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Bruce Richardson
  3 siblings, 1 reply; 18+ messages in thread
From: Pablo de Lara @ 2016-03-24 15:22 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, bruce.richardson, Pablo de Lara

In rte_eth_dev_configure(), device configuration was copied
after requesting the device information, to check the
maximum number of RX/TX queues. Since this number may change
depending on the device configuration, the memcpy of it
has to be performed before requesting the device information.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_ether/rte_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 8721a6b..b941b0d 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -901,6 +901,9 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		return -EBUSY;
 	}
 
+	/* Copy the dev_conf parameter into the dev structure */
+	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
+
 	/*
 	 * Check that the numbers of RX and TX queues are not greater
 	 * than the maximum number of RX and TX queues supported by the
@@ -925,9 +928,6 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		return -EINVAL;
 	}
 
-	/* Copy the dev_conf parameter into the dev structure */
-	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
-
 	/*
 	 * If link state interrupt is enabled, check that the
 	 * device supports it.
-- 
2.5.5

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue number
  2016-03-24 15:22     ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Pablo de Lara
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 1/3] ixgbe: fix incorrect tx queue number assignment Pablo de Lara
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration earlier Pablo de Lara
@ 2016-03-24 15:22       ` Pablo de Lara
  2016-03-24 16:58         ` Mcnamara, John
  2016-03-24 17:44       ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Bruce Richardson
  3 siblings, 1 reply; 18+ messages in thread
From: Pablo de Lara @ 2016-03-24 15:22 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, bruce.richardson, Pablo de Lara

From: Wenzhuo Lu <wenzhuo.lu@intel.com>

IXGBE supports 128 TX queues. However, the full 128 queues
are only available in VT and DCB mode.
In normal default "none" mode (VT/DCB off) the maximum number
of available queues is only 64.
IXGBE doesn't check the mode when reporting the available
number of queues. If a queue larger than 64 is used in default mode,
the TX packets will be dropped silently.

This change adds a check to forbid using a queue number larger than 64
during device configuration (in default mode), so that the problem is
reported as early as possible.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 doc/guides/rel_notes/release_16_04.rst |  6 ++++++
 drivers/net/ixgbe/ixgbe_ethdev.c       | 26 ++++++++++++++++++++++++++
 drivers/net/ixgbe/ixgbe_ethdev.h       |  1 +
 3 files changed, 33 insertions(+)

diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst
index 9922bcb..d0d5c89 100644
--- a/doc/guides/rel_notes/release_16_04.rst
+++ b/doc/guides/rel_notes/release_16_04.rst
@@ -302,6 +302,12 @@ Drivers
   The driver now set the MDIO clock speed prior to initializing PHY ops and
   again after the MAC reset.
 
+* **ixgbe: Fixed maximum number of available TX queues.**
+
+  In IXGBE, the maximum number of TX queues varies depending on the NIC operating
+  mode. This was not being updated in the device information, providing
+  an incorrect number in some cases.
+
 * **i40e: Generated MAC address for each VFs.**
 
   It generates a MAC address for each VFs during PF host initialization,
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 0d867fc..bfd8cb3 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1861,6 +1861,7 @@ static int
 ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 {
 	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint16_t nb_rx_q = dev->data->nb_rx_queues;
 	uint16_t nb_tx_q = dev->data->nb_tx_queues;
 
@@ -2002,6 +2003,21 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 				return -EINVAL;
 			}
 		}
+
+		/*
+		 * When DCB/VT is off, maximum number of queues changes,
+		 * except for 82598EB, which remains constant.
+		 */
+		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE &&
+				hw->mac.type != ixgbe_mac_82598EB) {
+			if (nb_tx_q > IXGBE_NONE_MODE_TX_NB_QUEUES) {
+				PMD_INIT_LOG(ERR,
+					     "Neither VT nor DCB are enabled, "
+					     "nb_tx_q > %d.",
+					     IXGBE_NONE_MODE_TX_NB_QUEUES);
+				return -EINVAL;
+			}
+		}
 	}
 	return 0;
 }
@@ -2856,9 +2872,19 @@ static void
 ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 
 	dev_info->max_rx_queues = (uint16_t)hw->mac.max_rx_queues;
 	dev_info->max_tx_queues = (uint16_t)hw->mac.max_tx_queues;
+	if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+		/*
+		 * When DCB/VT is off, maximum number of queues changes,
+		 * except for 82598EB, which remains constant.
+		 */
+		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE &&
+				hw->mac.type != ixgbe_mac_82598EB)
+			dev_info->max_tx_queues = IXGBE_NONE_MODE_TX_NB_QUEUES;
+	}
 	dev_info->min_rx_bufsize = 1024; /* cf BSIZEPACKET in SRRCTL register */
 	dev_info->max_rx_pktlen = 15872; /* includes CRC, cf MAXFRS register */
 	dev_info->max_mac_addrs = hw->mac.num_rar_entries;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index 5c3aa16..691c62f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -61,6 +61,7 @@
 #define IXGBE_MAX_RX_QUEUE_NUM	128
 #define IXGBE_VMDQ_DCB_NB_QUEUES     IXGBE_MAX_RX_QUEUE_NUM
 #define IXGBE_DCB_NB_QUEUES          IXGBE_MAX_RX_QUEUE_NUM
+#define IXGBE_NONE_MODE_TX_NB_QUEUES 64
 
 #ifndef NBBY
 #define NBBY	8	/* number of bits in a byte */
-- 
2.5.5

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/3] ixgbe: fix incorrect tx queue number assignment
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 1/3] ixgbe: fix incorrect tx queue number assignment Pablo de Lara
@ 2016-03-24 16:57         ` Mcnamara, John
  0 siblings, 0 replies; 18+ messages in thread
From: Mcnamara, John @ 2016-03-24 16:57 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev; +Cc: Lu, Wenzhuo, Richardson, Bruce

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, March 24, 2016 3:22 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH v4 1/3] ixgbe: fix incorrect tx queue number
> assignment
> 
> From: Wenzhuo Lu <wenzhuo.lu@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration earlier
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration earlier Pablo de Lara
@ 2016-03-24 16:57         ` Mcnamara, John
  0 siblings, 0 replies; 18+ messages in thread
From: Mcnamara, John @ 2016-03-24 16:57 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev
  Cc: Lu, Wenzhuo, Richardson, Bruce, De Lara Guarch, Pablo

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, March 24, 2016 3:22 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration
> earlier
> 
> In rte_eth_dev_configure(), device configuration was copied after
> requesting the device information, to check the maximum number of RX/TX
> queues. Since this number may change depending on the device
> configuration, the memcpy of it has to be performed before requesting the
> device information.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>


Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue number
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue number Pablo de Lara
@ 2016-03-24 16:58         ` Mcnamara, John
  2016-03-26  9:10           ` Fischetti, Antonio
  0 siblings, 1 reply; 18+ messages in thread
From: Mcnamara, John @ 2016-03-24 16:58 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev
  Cc: Lu, Wenzhuo, Richardson, Bruce, De Lara Guarch, Pablo

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, March 24, 2016 3:22 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue
> number
> 
> From: Wenzhuo Lu <wenzhuo.lu@intel.com>
> 
> IXGBE supports 128 TX queues. However, the full 128 queues are only
> available in VT and DCB mode.
> In normal default "none" mode (VT/DCB off) the maximum number of available
> queues is only 64.
> IXGBE doesn't check the mode when reporting the available number of
> queues. If a queue larger than 64 is used in default mode, the TX packets
> will be dropped silently.
> 
> This change adds a check to forbid using a queue number larger than 64
> during device configuration (in default mode), so that the problem is
> reported as early as possible.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe
  2016-03-24 15:22     ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Pablo de Lara
                         ` (2 preceding siblings ...)
  2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue number Pablo de Lara
@ 2016-03-24 17:44       ` Bruce Richardson
  2016-03-24 17:46         ` Bruce Richardson
  3 siblings, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2016-03-24 17:44 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev, wenzhuo.lu

On Thu, Mar 24, 2016 at 03:22:01PM +0000, Pablo de Lara wrote:
> IXGBE supports 128 TX queues. However, the full 128 queues
> are only available in VT and DCB mode.
> In normal default "none" mode (VT/DCB off) the maximum number
> of available queues is only 64.
> IXGBE doesn't check the mode when reporting the available
> number of queues. If a queue larger than 64 is used in default mode,
> the TX packets will be dropped silently.
> 
> This patchset:
> 
> - Modifies the device info to show the correct maximum number of available TX queues,
>   depending on the mode.
> 
> - Adds a check to forbid using a queue number larger than 64
>   during device configuration (in default mode), so that the problem is
>   reported as early as possible.
> 
> - It also changes the order of where the dev_conf parameters are copied
>   into the dev structure so that the correct maximum number of queues
>   is reported for the correct mode.
> 
> Changes in v4:
> - Split the patch in three smaller patches
> - Updated release notes document
> 
> Changes in v3:
> - Fixed wrong set of TX queues for 82596EB
> 
> Changes in v2:
> 
> - Reorder memcpy of device configuration in rte_eth_dev_configure(),
>   so function gets the correct maximum number of queues
>   (depending on the operation mode), before checking the
>   requested number of queues.
> - Renamed new macro
> - Reworded/wrapped commit message
> 
> Pablo de Lara (1):
>   ethdev: copy device configuration earlier
> 
> Wenzhuo Lu (2):
>   ixgbe: fix incorrect tx queue number assignment
>   ixgbe: fix incorrect max tx queue number
> 
All three patches are fixes, so all three should have "Fixes" lines in them.
Please remember for next time!

Thanks,
/Bruce

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe
  2016-03-24 17:44       ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Bruce Richardson
@ 2016-03-24 17:46         ` Bruce Richardson
  0 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2016-03-24 17:46 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev, wenzhuo.lu

On Thu, Mar 24, 2016 at 05:44:58PM +0000, Bruce Richardson wrote:
> On Thu, Mar 24, 2016 at 03:22:01PM +0000, Pablo de Lara wrote:
> > IXGBE supports 128 TX queues. However, the full 128 queues
> > are only available in VT and DCB mode.
> > In normal default "none" mode (VT/DCB off) the maximum number
> > of available queues is only 64.
> > IXGBE doesn't check the mode when reporting the available
> > number of queues. If a queue larger than 64 is used in default mode,
> > the TX packets will be dropped silently.
> > 
> > This patchset:
> > 
> > - Modifies the device info to show the correct maximum number of available TX queues,
> >   depending on the mode.
> > 
> > - Adds a check to forbid using a queue number larger than 64
> >   during device configuration (in default mode), so that the problem is
> >   reported as early as possible.
> > 
> > - It also changes the order of where the dev_conf parameters are copied
> >   into the dev structure so that the correct maximum number of queues
> >   is reported for the correct mode.
> > 
> > Changes in v4:
> > - Split the patch in three smaller patches
> > - Updated release notes document
> > 
> > Changes in v3:
> > - Fixed wrong set of TX queues for 82596EB
> > 
> > Changes in v2:
> > 
> > - Reorder memcpy of device configuration in rte_eth_dev_configure(),
> >   so function gets the correct maximum number of queues
> >   (depending on the operation mode), before checking the
> >   requested number of queues.
> > - Renamed new macro
> > - Reworded/wrapped commit message
> > 
> > Pablo de Lara (1):
> >   ethdev: copy device configuration earlier
> > 
> > Wenzhuo Lu (2):
> >   ixgbe: fix incorrect tx queue number assignment
> >   ixgbe: fix incorrect max tx queue number
> > 
> All three patches are fixes, so all three should have "Fixes" lines in them.
> Please remember for next time!
> 
> Thanks,
> /Bruce

Applied to dpdk-next-net/rel_16_04, with added fixes lines in each case.

/Bruce

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue number
  2016-03-24 16:58         ` Mcnamara, John
@ 2016-03-26  9:10           ` Fischetti, Antonio
  0 siblings, 0 replies; 18+ messages in thread
From: Fischetti, Antonio @ 2016-03-26  9:10 UTC (permalink / raw)
  To: Mcnamara, John, De Lara Guarch, Pablo, dev
  Cc: Lu, Wenzhuo, Richardson, Bruce, De Lara Guarch, Pablo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mcnamara, John
> Sent: Thursday, March 24, 2016 4:58 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue
> number
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> > Sent: Thursday, March 24, 2016 3:22 PM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Richardson, Bruce
> > <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> > <pablo.de.lara.guarch@intel.com>
> > Subject: [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue
> > number
> >
> > From: Wenzhuo Lu <wenzhuo.lu@intel.com>
> >
> > IXGBE supports 128 TX queues. However, the full 128 queues are only
> > available in VT and DCB mode.
> > In normal default "none" mode (VT/DCB off) the maximum number of
> available
> > queues is only 64.
> > IXGBE doesn't check the mode when reporting the available number of
> > queues. If a queue larger than 64 is used in default mode, the TX packets
> > will be dropped silently.
> >
> > This change adds a check to forbid using a queue number larger than 64
> > during device configuration (in default mode), so that the problem is
> > reported as early as possible.
> >
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> 
> Acked-by: John McNamara <john.mcnamara@intel.com>

Tested-by: Antonio Fischetti <antonio.fischetti@intel.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ixgbe: add check for tx queue number
  2016-03-24 15:17   ` [dpdk-dev] [PATCH v3] " Pablo de Lara
  2016-03-24 15:22     ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Pablo de Lara
@ 2016-03-26  9:17     ` Fischetti, Antonio
  1 sibling, 0 replies; 18+ messages in thread
From: Fischetti, Antonio @ 2016-03-26  9:17 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev; +Cc: Lu, Wenzhuo, De Lara Guarch, Pablo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, March 24, 2016 3:18 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH v3] ixgbe: add check for tx queue number
> 
> From: Wenzhuo Lu <wenzhuo.lu@intel.com>
> 
> IXGBE supports 128 TX queues. However, the full 128 queues
> are only available in VT and DCB mode.
> In normal default "none" mode (VT/DCB off) the maximum number
> of available queues is only 64
> (except for 82598EB, which is 32 for all modes).
> 
> IXGBE doesn't check the mode when reporting the available
> number of queues. If a queue larger than 64 is used in default mode,
> the TX packets will be dropped silently.
> 
> This change adds a check to forbid using a queue number larger than 64
> during device configuration (in default mode), so that the problem is
> reported as early as possible.
> It also changes the order of where the dev_conf parameters are copied
> into the dev structure so that the correct maximum number of queues
> is reported for the correct mode.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Tested-by: Antonio Fischetti <antonio.fischetti@intel.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-03-26  9:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-22  8:08 [dpdk-dev] [PATCH] ixgbe: add TX queue number check Wenzhuo Lu
2016-03-22  8:42 ` Qiu, Michael
2016-03-23 15:28 ` [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number Pablo de Lara
2016-03-24  8:09   ` Fischetti, Antonio
2016-03-24  8:40   ` Fischetti, Antonio
2016-03-24 10:27     ` De Lara Guarch, Pablo
2016-03-24 15:17   ` [dpdk-dev] [PATCH v3] " Pablo de Lara
2016-03-24 15:22     ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Pablo de Lara
2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 1/3] ixgbe: fix incorrect tx queue number assignment Pablo de Lara
2016-03-24 16:57         ` Mcnamara, John
2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration earlier Pablo de Lara
2016-03-24 16:57         ` Mcnamara, John
2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue number Pablo de Lara
2016-03-24 16:58         ` Mcnamara, John
2016-03-26  9:10           ` Fischetti, Antonio
2016-03-24 17:44       ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Bruce Richardson
2016-03-24 17:46         ` Bruce Richardson
2016-03-26  9:17     ` [dpdk-dev] [PATCH v3] ixgbe: add check for tx queue number Fischetti, Antonio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).