DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
@ 2016-08-26  9:08 Bernard Iremonger
  2016-09-21 11:07 ` Remy Horton
  2016-10-14 13:29 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
  0 siblings, 2 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-08-26  9:08 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

modify ixgbe_dcb_tx_hw_config function.
modify ixgbe_dev_mq_rx_configure function.
modify ixgbe_configure_dcb function.

Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
 2 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index fb618ef..3e62e9e 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1997,6 +1997,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 		/* check multi-queue mode */
 		switch (dev_conf->rxmode.mq_mode) {
 		case ETH_MQ_RX_VMDQ_DCB:
+			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB mode supported in SRIOV");
+			break;
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			/* DCB/RSS VMDQ in SRIOV mode, not implement yet */
 			PMD_INIT_LOG(ERR, "SRIOV active,"
@@ -2032,11 +2034,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 
 		switch (dev_conf->txmode.mq_mode) {
 		case ETH_MQ_TX_VMDQ_DCB:
-			/* DCB VMDQ in SRIOV mode, not implement yet */
-			PMD_INIT_LOG(ERR, "SRIOV is active,"
-					" unsupported VMDQ mq_mode tx %d.",
-					dev_conf->txmode.mq_mode);
-			return -EINVAL;
+			PMD_INIT_LOG(INFO, "ETH_MQ_TX_VMDQ_DCB mode supported in SRIOV");
+			break;
 		default: /* ETH_MQ_TX_VMDQ_ONLY or ETH_MQ_TX_NONE */
 			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_ONLY;
 			break;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 8a306b0..bef5ef5 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   Copyright 2014 6WIND S.A.
  *   All rights reserved.
  *
@@ -3312,15 +3312,16 @@ ixgbe_vmdq_dcb_configure(struct rte_eth_dev *dev)
 
 /**
  * ixgbe_dcb_config_tx_hw_config - Configure general DCB TX parameters
- * @hw: pointer to hardware structure
+ * @dev: pointer to eth_dev structure
  * @dcb_config: pointer to ixgbe_dcb_config structure
  */
 static void
-ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
+ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev,
 		       struct ixgbe_dcb_config *dcb_config)
 {
 	uint32_t reg;
 	uint32_t q;
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	PMD_INIT_FUNC_TRACE();
 	if (hw->mac.type != ixgbe_mac_82598EB) {
@@ -3338,11 +3339,17 @@ ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
 		if (dcb_config->vt_mode)
 			reg |= IXGBE_MTQC_VT_ENA;
 		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
-
-		/* Disable drop for all queues */
-		for (q = 0; q < 128; q++)
-			IXGBE_WRITE_REG(hw, IXGBE_QDE,
-				(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+			/* Disable drop for all queues in VMDQ mode*/
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
+		} else {
+			/* Enable drop for all queues in SRIOV mode */
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		}
 
 		/* Enable the Tx desc arbiter */
 		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
@@ -3377,7 +3384,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
 			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS ? 0xFFFF : 0xFFFFFFFF);
 
 	/*Configure general DCB TX parameters*/
-	ixgbe_dcb_tx_hw_config(hw, dcb_config);
+	ixgbe_dcb_tx_hw_config(dev, dcb_config);
 }
 
 static void
@@ -3660,7 +3667,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,
 		/*get DCB TX configuration parameters from rte_eth_conf*/
 		ixgbe_dcb_tx_config(dev, dcb_config);
 		/*Configure general DCB TX parameters*/
-		ixgbe_dcb_tx_hw_config(hw, dcb_config);
+		ixgbe_dcb_tx_hw_config(dev, dcb_config);
 		break;
 	default:
 		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode configuration");
@@ -3809,9 +3816,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
 	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
 		return;
 
-	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
-		return;
-
 	/** Configure DCB hardware **/
 	ixgbe_dcb_hw_configure(dev, dcb_cfg);
 }
@@ -4081,12 +4085,13 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev)
 		case ETH_MQ_RX_VMDQ_RSS:
 			ixgbe_config_vf_rss(dev);
 			break;
-
-		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB:
+			ixgbe_vmdq_dcb_configure(dev);
+			break;
+		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			PMD_INIT_LOG(ERR,
-				"Could not support DCB with VMDq & SRIOV");
+				"Could not support DCB/RSS with VMDq & SRIOV");
 			return -1;
 		default:
 			ixgbe_config_vf_default(dev);
-- 
2.9.0

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

* Re: [dpdk-dev] [PATCH] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-08-26  9:08 [dpdk-dev] [PATCH] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
@ 2016-09-21 11:07 ` Remy Horton
  2016-10-14 13:29 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
  1 sibling, 0 replies; 35+ messages in thread
From: Remy Horton @ 2016-09-21 11:07 UTC (permalink / raw)
  To: Bernard Iremonger, dev, rahul.r.shah, wenzhuo.lu


On 26/08/2016 10:08, Bernard Iremonger wrote:
> modify ixgbe_dcb_tx_hw_config function.
> modify ixgbe_dev_mq_rx_configure function.
> modify ixgbe_configure_dcb function.
>
> Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
>  drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
>  2 files changed, 25 insertions(+), 21 deletions(-)

Acked-by: Remy Horton <remy.horton@intel.com>

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

* [dpdk-dev] [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-08-26  9:08 [dpdk-dev] [PATCH] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
  2016-09-21 11:07 ` Remy Horton
@ 2016-10-14 13:29 ` Bernard Iremonger
  2016-10-17  6:12   ` Lu, Wenzhuo
                     ` (3 more replies)
  1 sibling, 4 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-14 13:29 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

modify ixgbe_dcb_tx_hw_config function.
modify ixgbe_dev_mq_rx_configure function.
modify ixgbe_configure_dcb function.

Changes in v2:
Rebased to DPDK v16.11-rc1

Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
 2 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4ca5747..114698d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1977,6 +1977,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 		/* check multi-queue mode */
 		switch (dev_conf->rxmode.mq_mode) {
 		case ETH_MQ_RX_VMDQ_DCB:
+			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB mode supported in SRIOV");
+			break;
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			/* DCB/RSS VMDQ in SRIOV mode, not implement yet */
 			PMD_INIT_LOG(ERR, "SRIOV active,"
@@ -2012,11 +2014,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 
 		switch (dev_conf->txmode.mq_mode) {
 		case ETH_MQ_TX_VMDQ_DCB:
-			/* DCB VMDQ in SRIOV mode, not implement yet */
-			PMD_INIT_LOG(ERR, "SRIOV is active,"
-					" unsupported VMDQ mq_mode tx %d.",
-					dev_conf->txmode.mq_mode);
-			return -EINVAL;
+			PMD_INIT_LOG(INFO, "ETH_MQ_TX_VMDQ_DCB mode supported in SRIOV");
+			break;
 		default: /* ETH_MQ_TX_VMDQ_ONLY or ETH_MQ_TX_NONE */
 			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_ONLY;
 			break;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 2ce8234..bb13889 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   Copyright 2014 6WIND S.A.
  *   All rights reserved.
  *
@@ -3313,15 +3313,16 @@ ixgbe_vmdq_dcb_configure(struct rte_eth_dev *dev)
 
 /**
  * ixgbe_dcb_config_tx_hw_config - Configure general DCB TX parameters
- * @hw: pointer to hardware structure
+ * @dev: pointer to eth_dev structure
  * @dcb_config: pointer to ixgbe_dcb_config structure
  */
 static void
-ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
+ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev,
 		       struct ixgbe_dcb_config *dcb_config)
 {
 	uint32_t reg;
 	uint32_t q;
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	PMD_INIT_FUNC_TRACE();
 	if (hw->mac.type != ixgbe_mac_82598EB) {
@@ -3339,11 +3340,17 @@ ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
 		if (dcb_config->vt_mode)
 			reg |= IXGBE_MTQC_VT_ENA;
 		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
-
-		/* Disable drop for all queues */
-		for (q = 0; q < 128; q++)
-			IXGBE_WRITE_REG(hw, IXGBE_QDE,
-				(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+			/* Disable drop for all queues in VMDQ mode*/
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
+		} else {
+			/* Enable drop for all queues in SRIOV mode */
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		}
 
 		/* Enable the Tx desc arbiter */
 		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
@@ -3378,7 +3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
 			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS ? 0xFFFF : 0xFFFFFFFF);
 
 	/*Configure general DCB TX parameters*/
-	ixgbe_dcb_tx_hw_config(hw, dcb_config);
+	ixgbe_dcb_tx_hw_config(dev, dcb_config);
 }
 
 static void
@@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,
 		/*get DCB TX configuration parameters from rte_eth_conf*/
 		ixgbe_dcb_tx_config(dev, dcb_config);
 		/*Configure general DCB TX parameters*/
-		ixgbe_dcb_tx_hw_config(hw, dcb_config);
+		ixgbe_dcb_tx_hw_config(dev, dcb_config);
 		break;
 	default:
 		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode configuration");
@@ -3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
 	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
 		return;
 
-	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
-		return;
-
 	/** Configure DCB hardware **/
 	ixgbe_dcb_hw_configure(dev, dcb_cfg);
 }
@@ -4082,12 +4086,13 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev)
 		case ETH_MQ_RX_VMDQ_RSS:
 			ixgbe_config_vf_rss(dev);
 			break;
-
-		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB:
+			ixgbe_vmdq_dcb_configure(dev);
+			break;
+		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			PMD_INIT_LOG(ERR,
-				"Could not support DCB with VMDq & SRIOV");
+				"Could not support DCB/RSS with VMDq & SRIOV");
 			return -1;
 		default:
 			ixgbe_config_vf_default(dev);
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-14 13:29 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
@ 2016-10-17  6:12   ` Lu, Wenzhuo
  2016-10-17 16:27     ` Iremonger, Bernard
  2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 0/2] net/ixgbe: " Bernard Iremonger
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 35+ messages in thread
From: Lu, Wenzhuo @ 2016-10-17  6:12 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Shah, Rahul R

Hi Bernard, Rahul,


> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Friday, October 14, 2016 9:29 PM
> To: dev@dpdk.org; Shah, Rahul R; Lu, Wenzhuo
> Cc: Iremonger, Bernard
> Subject: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
> 
> modify ixgbe_dcb_tx_hw_config function.
> modify ixgbe_dev_mq_rx_configure function.
> modify ixgbe_configure_dcb function.
Would you like to add more details about why we need to modify these functions and what has been done? Thanks.

> 
> Changes in v2:
> Rebased to DPDK v16.11-rc1
> 
> Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
>  drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
>  2 files changed, 25 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 4ca5747..114698d 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -1977,6 +1977,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
>  		/* check multi-queue mode */
>  		switch (dev_conf->rxmode.mq_mode) {
>  		case ETH_MQ_RX_VMDQ_DCB:
Should we store the mq mode here?

> +			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB
> mode supported in SRIOV");
> +			break;
>  		case ETH_MQ_RX_VMDQ_DCB_RSS:
>  			/* DCB/RSS VMDQ in SRIOV mode, not implement yet
> */
>  			PMD_INIT_LOG(ERR, "SRIOV active,"
> @@ -2012,11 +2014,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
> 
>  		switch (dev_conf->txmode.mq_mode) {
>  		case ETH_MQ_TX_VMDQ_DCB:
> -			/* DCB VMDQ in SRIOV mode, not implement yet */
> -			PMD_INIT_LOG(ERR, "SRIOV is active,"
> -					" unsupported VMDQ mq_mode
> tx %d.",
> -					dev_conf->txmode.mq_mode);
> -			return -EINVAL;
> +			PMD_INIT_LOG(INFO, "ETH_MQ_TX_VMDQ_DCB mode
> supported in SRIOV");
> +			break;
>  		default: /* ETH_MQ_TX_VMDQ_ONLY or ETH_MQ_TX_NONE
> */
>  			dev->data->dev_conf.txmode.mq_mode =
> ETH_MQ_TX_VMDQ_ONLY;
>  			break;
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index
> 2ce8234..bb13889 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -1,7 +1,7 @@
>  /*-
>   *   BSD LICENSE
>   *
> - *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
> + *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
>   *   Copyright 2014 6WIND S.A.
>   *   All rights reserved.
>   *
> @@ -3313,15 +3313,16 @@ ixgbe_vmdq_dcb_configure(struct rte_eth_dev
> *dev)
> 
>  /**
>   * ixgbe_dcb_config_tx_hw_config - Configure general DCB TX parameters
> - * @hw: pointer to hardware structure
> + * @dev: pointer to eth_dev structure
>   * @dcb_config: pointer to ixgbe_dcb_config structure
>   */
>  static void
> -ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
> +ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev,
>  		       struct ixgbe_dcb_config *dcb_config)  {
>  	uint32_t reg;
>  	uint32_t q;
> +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> 
>  	PMD_INIT_FUNC_TRACE();
>  	if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11 +3340,17 @@
> ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
>  		if (dcb_config->vt_mode)
>  			reg |= IXGBE_MTQC_VT_ENA;
>  		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
> -
> -		/* Disable drop for all queues */
> -		for (q = 0; q < 128; q++)
> -			IXGBE_WRITE_REG(hw, IXGBE_QDE,
> -				(IXGBE_QDE_WRITE | (q <<
> IXGBE_QDE_IDX_SHIFT)));
> +		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
> +			/* Disable drop for all queues in VMDQ mode*/
> +			for (q = 0; q < 128; q++)
> +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> +						(IXGBE_QDE_WRITE | (q <<
> IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
> +		} else {
> +			/* Enable drop for all queues in SRIOV mode */
> +			for (q = 0; q < 128; q++)
> +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> +						(IXGBE_QDE_WRITE | (q <<
> IXGBE_QDE_IDX_SHIFT)));
> +		}
I think it has nothing to do with mq mode. Do I miss something?

> 
>  		/* Enable the Tx desc arbiter */
>  		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS); @@ -3378,7
> +3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
>  			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS ?
> 0xFFFF : 0xFFFFFFFF);
> 
>  	/*Configure general DCB TX parameters*/
> -	ixgbe_dcb_tx_hw_config(hw, dcb_config);
> +	ixgbe_dcb_tx_hw_config(dev, dcb_config);
>  }
> 
>  static void
> @@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,
>  		/*get DCB TX configuration parameters from rte_eth_conf*/
>  		ixgbe_dcb_tx_config(dev, dcb_config);
>  		/*Configure general DCB TX parameters*/
> -		ixgbe_dcb_tx_hw_config(hw, dcb_config);
> +		ixgbe_dcb_tx_hw_config(dev, dcb_config);
>  		break;
>  	default:
>  		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode configuration");
> @@ -3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
>  	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
>  		return;
> 
> -	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
> -		return;
I remember it's a limitation of implementation. The reason is the resource allocation. Why could we remove it now?

> -
>  	/** Configure DCB hardware **/
>  	ixgbe_dcb_hw_configure(dev, dcb_cfg);
>  }
> @@ -4082,12 +4086,13 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev
> *dev)
>  		case ETH_MQ_RX_VMDQ_RSS:
>  			ixgbe_config_vf_rss(dev);
>  			break;
> -
> -		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
>  		case ETH_MQ_RX_VMDQ_DCB:
> +			ixgbe_vmdq_dcb_configure(dev);
> +			break;
> +		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
>  		case ETH_MQ_RX_VMDQ_DCB_RSS:
>  			PMD_INIT_LOG(ERR,
> -				"Could not support DCB with VMDq & SRIOV");
> +				"Could not support DCB/RSS with VMDq &
> SRIOV");
>  			return -1;
>  		default:
>  			ixgbe_config_vf_default(dev);
> --
> 2.10.1

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

* [dpdk-dev] [PATCH v3 0/2] net/ixgbe: VMDq DCB with SRIOV
  2016-10-14 13:29 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
  2016-10-17  6:12   ` Lu, Wenzhuo
@ 2016-10-17 16:07   ` Bernard Iremonger
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 " Bernard Iremonger
                       ` (2 more replies)
  2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
  2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  3 siblings, 3 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-17 16:07 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

Changes in v3:
rebase to latest master.
update commit message for ixgbe patch
add testpmd patch.

Changes in v2:
rebase to  latest master.

Bernard Iremonger (2):
  net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  app/test_pmd: fix DCB configuration

 app/test-pmd/testpmd.c           |  4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
 3 files changed, 27 insertions(+), 23 deletions(-)

-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-14 13:29 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
  2016-10-17  6:12   ` Lu, Wenzhuo
  2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 0/2] net/ixgbe: " Bernard Iremonger
@ 2016-10-17 16:07   ` Bernard Iremonger
  2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  3 siblings, 0 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-17 16:07 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

Modify ixgbe_check_mq_mode function,
when SRIOV is enabled, enable mq_mode
ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.

Modify ixgbe_dcb_tx_hw_config function,
replace the struct ixgbe_hw parameter with a
struct rte_eth_dev parameter and handle SRIOV enabled.

Modify ixgbe_dev_mq_rx_configure function,
when SRIOV is enabled, enable mq_mode ETH_MQ_RX_VMDQ_DCB.

Modify ixgbe_configure_dcb function,
drop check on dev->data->nb_rx_queues.

Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
 2 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4ca5747..114698d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1977,6 +1977,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 		/* check multi-queue mode */
 		switch (dev_conf->rxmode.mq_mode) {
 		case ETH_MQ_RX_VMDQ_DCB:
+			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB mode supported in SRIOV");
+			break;
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			/* DCB/RSS VMDQ in SRIOV mode, not implement yet */
 			PMD_INIT_LOG(ERR, "SRIOV active,"
@@ -2012,11 +2014,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 
 		switch (dev_conf->txmode.mq_mode) {
 		case ETH_MQ_TX_VMDQ_DCB:
-			/* DCB VMDQ in SRIOV mode, not implement yet */
-			PMD_INIT_LOG(ERR, "SRIOV is active,"
-					" unsupported VMDQ mq_mode tx %d.",
-					dev_conf->txmode.mq_mode);
-			return -EINVAL;
+			PMD_INIT_LOG(INFO, "ETH_MQ_TX_VMDQ_DCB mode supported in SRIOV");
+			break;
 		default: /* ETH_MQ_TX_VMDQ_ONLY or ETH_MQ_TX_NONE */
 			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_ONLY;
 			break;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 2ce8234..bb13889 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   Copyright 2014 6WIND S.A.
  *   All rights reserved.
  *
@@ -3313,15 +3313,16 @@ ixgbe_vmdq_dcb_configure(struct rte_eth_dev *dev)
 
 /**
  * ixgbe_dcb_config_tx_hw_config - Configure general DCB TX parameters
- * @hw: pointer to hardware structure
+ * @dev: pointer to eth_dev structure
  * @dcb_config: pointer to ixgbe_dcb_config structure
  */
 static void
-ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
+ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev,
 		       struct ixgbe_dcb_config *dcb_config)
 {
 	uint32_t reg;
 	uint32_t q;
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	PMD_INIT_FUNC_TRACE();
 	if (hw->mac.type != ixgbe_mac_82598EB) {
@@ -3339,11 +3340,17 @@ ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
 		if (dcb_config->vt_mode)
 			reg |= IXGBE_MTQC_VT_ENA;
 		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
-
-		/* Disable drop for all queues */
-		for (q = 0; q < 128; q++)
-			IXGBE_WRITE_REG(hw, IXGBE_QDE,
-				(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+			/* Disable drop for all queues in VMDQ mode*/
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
+		} else {
+			/* Enable drop for all queues in SRIOV mode */
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		}
 
 		/* Enable the Tx desc arbiter */
 		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
@@ -3378,7 +3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
 			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS ? 0xFFFF : 0xFFFFFFFF);
 
 	/*Configure general DCB TX parameters*/
-	ixgbe_dcb_tx_hw_config(hw, dcb_config);
+	ixgbe_dcb_tx_hw_config(dev, dcb_config);
 }
 
 static void
@@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,
 		/*get DCB TX configuration parameters from rte_eth_conf*/
 		ixgbe_dcb_tx_config(dev, dcb_config);
 		/*Configure general DCB TX parameters*/
-		ixgbe_dcb_tx_hw_config(hw, dcb_config);
+		ixgbe_dcb_tx_hw_config(dev, dcb_config);
 		break;
 	default:
 		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode configuration");
@@ -3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
 	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
 		return;
 
-	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
-		return;
-
 	/** Configure DCB hardware **/
 	ixgbe_dcb_hw_configure(dev, dcb_cfg);
 }
@@ -4082,12 +4086,13 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev)
 		case ETH_MQ_RX_VMDQ_RSS:
 			ixgbe_config_vf_rss(dev);
 			break;
-
-		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB:
+			ixgbe_vmdq_dcb_configure(dev);
+			break;
+		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			PMD_INIT_LOG(ERR,
-				"Could not support DCB with VMDq & SRIOV");
+				"Could not support DCB/RSS with VMDq & SRIOV");
 			return -1;
 		default:
 			ixgbe_config_vf_default(dev);
-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 2/2] app/test_pmd: fix DCB configuration
  2016-10-14 13:29 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
                     ` (2 preceding siblings ...)
  2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
@ 2016-10-17 16:07   ` Bernard Iremonger
  3 siblings, 0 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-17 16:07 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

when dcb mode is DCB_VT_ENABLED set nb_rxq and nb_txq to 1.

Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/testpmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6185be6..ee567c3 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2002,8 +2002,8 @@ init_port_dcb_config(portid_t pid,
 	 * and has the same number of rxq and txq in dcb mode
 	 */
 	if (dcb_mode == DCB_VT_ENABLED) {
-		nb_rxq = rte_port->dev_info.max_rx_queues;
-		nb_txq = rte_port->dev_info.max_tx_queues;
+		nb_rxq = 1;
+		nb_txq = 1;
 	} else {
 		/*if vt is disabled, use all pf queues */
 		if (rte_port->dev_info.vmdq_pool_base == 0) {
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-17  6:12   ` Lu, Wenzhuo
@ 2016-10-17 16:27     ` Iremonger, Bernard
  2016-10-18  1:07       ` Lu, Wenzhuo
  0 siblings, 1 reply; 35+ messages in thread
From: Iremonger, Bernard @ 2016-10-17 16:27 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev, Shah, Rahul R

Hi Wenzhuo,

<snip>

> > Subject: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with
> > SRIOV
> >
> > modify ixgbe_dcb_tx_hw_config function.
> > modify ixgbe_dev_mq_rx_configure function.
> > modify ixgbe_configure_dcb function.
> Would you like to add more details about why we need to modify these
> functions and what has been done? Thanks.

I have updated the commit message for this patch with more information.
I have also added a testpmd patch and sent a v3 patchset.


> > Changes in v2:
> > Rebased to DPDK v16.11-rc1
> >
> > Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
> >  drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++------------
> ----
> >  2 files changed, 25 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index 4ca5747..114698d 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -1977,6 +1977,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev
> *dev)
> >  		/* check multi-queue mode */
> >  		switch (dev_conf->rxmode.mq_mode) {
> >  		case ETH_MQ_RX_VMDQ_DCB:
> Should we store the mq mode here?

Yes, it probably should be stored here.

 
> > +			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB
> > mode supported in SRIOV");
> > +			break;
> >  		case ETH_MQ_RX_VMDQ_DCB_RSS:
> >  			/* DCB/RSS VMDQ in SRIOV mode, not implement
> yet */
> >  			PMD_INIT_LOG(ERR, "SRIOV active,"
> > @@ -2012,11 +2014,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev
> *dev)
> >
> >  		switch (dev_conf->txmode.mq_mode) {
> >  		case ETH_MQ_TX_VMDQ_DCB:
> > -			/* DCB VMDQ in SRIOV mode, not implement yet */
> > -			PMD_INIT_LOG(ERR, "SRIOV is active,"
> > -					" unsupported VMDQ mq_mode
> > tx %d.",
> > -					dev_conf->txmode.mq_mode);
> > -			return -EINVAL;
> > +			PMD_INIT_LOG(INFO, "ETH_MQ_TX_VMDQ_DCB
> mode
> > supported in SRIOV");
> > +			break;
> >  		default: /* ETH_MQ_TX_VMDQ_ONLY or
> ETH_MQ_TX_NONE */
> >  			dev->data->dev_conf.txmode.mq_mode =
> ETH_MQ_TX_VMDQ_ONLY;
> >  			break;
> > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c
> > b/drivers/net/ixgbe/ixgbe_rxtx.c index
> > 2ce8234..bb13889 100644
> > --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> > @@ -1,7 +1,7 @@
> >  /*-
> >   *   BSD LICENSE
> >   *
> > - *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
> > + *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
> >   *   Copyright 2014 6WIND S.A.
> >   *   All rights reserved.
> >   *
> > @@ -3313,15 +3313,16 @@ ixgbe_vmdq_dcb_configure(struct
> rte_eth_dev
> > *dev)
> >
> >  /**
> >   * ixgbe_dcb_config_tx_hw_config - Configure general DCB TX
> > parameters
> > - * @hw: pointer to hardware structure
> > + * @dev: pointer to eth_dev structure
> >   * @dcb_config: pointer to ixgbe_dcb_config structure
> >   */
> >  static void
> > -ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
> > +ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev,
> >  		       struct ixgbe_dcb_config *dcb_config)  {
> >  	uint32_t reg;
> >  	uint32_t q;
> > +	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data-
> > >dev_private);
> >
> >  	PMD_INIT_FUNC_TRACE();
> >  	if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11 +3340,17
> @@
> > ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
> >  		if (dcb_config->vt_mode)
> >  			reg |= IXGBE_MTQC_VT_ENA;
> >  		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
> > -
> > -		/* Disable drop for all queues */
> > -		for (q = 0; q < 128; q++)
> > -			IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > -				(IXGBE_QDE_WRITE | (q <<
> > IXGBE_QDE_IDX_SHIFT)));
> > +		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
> > +			/* Disable drop for all queues in VMDQ mode*/
> > +			for (q = 0; q < 128; q++)
> > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > +						(IXGBE_QDE_WRITE | (q <<
> > IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
> > +		} else {
> > +			/* Enable drop for all queues in SRIOV mode */
> > +			for (q = 0; q < 128; q++)
> > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > +						(IXGBE_QDE_WRITE | (q <<
> > IXGBE_QDE_IDX_SHIFT)));
> > +		}
> I think it has nothing to do with mq mode. Do I miss something?

Behavior is different when SRIOV is enabled.

> 
> >
> >  		/* Enable the Tx desc arbiter */
> >  		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS); @@ -3378,7
> > +3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
> >  			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS
> ?
> > 0xFFFF : 0xFFFFFFFF);
> >
> >  	/*Configure general DCB TX parameters*/
> > -	ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > +	ixgbe_dcb_tx_hw_config(dev, dcb_config);
> >  }
> >
> >  static void
> > @@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev
> *dev,
> >  		/*get DCB TX configuration parameters from rte_eth_conf*/
> >  		ixgbe_dcb_tx_config(dev, dcb_config);
> >  		/*Configure general DCB TX parameters*/
> > -		ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > +		ixgbe_dcb_tx_hw_config(dev, dcb_config);
> >  		break;
> >  	default:
> >  		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode
> configuration"); @@
> > -3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
> >  	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
> >  		return;
> >
> > -	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
> > -		return;
> I remember it's a limitation of implementation. The reason is the resource
> allocation. Why could we remove it now?

ETH_DCB_NUM_QUEUES is 128,  nb_rx_queues may not be 128.

> 
> > -
> >  	/** Configure DCB hardware **/
> >  	ixgbe_dcb_hw_configure(dev, dcb_cfg);  } @@ -4082,12 +4086,13
> @@
> > ixgbe_dev_mq_rx_configure(struct rte_eth_dev
> > *dev)
> >  		case ETH_MQ_RX_VMDQ_RSS:
> >  			ixgbe_config_vf_rss(dev);
> >  			break;
> > -
> > -		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
> >  		case ETH_MQ_RX_VMDQ_DCB:
> > +			ixgbe_vmdq_dcb_configure(dev);
> > +			break;
> > +		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
> >  		case ETH_MQ_RX_VMDQ_DCB_RSS:
> >  			PMD_INIT_LOG(ERR,
> > -				"Could not support DCB with VMDq &
> SRIOV");
> > +				"Could not support DCB/RSS with VMDq &
> > SRIOV");
> >  			return -1;
> >  		default:
> >  			ixgbe_config_vf_default(dev);
> > --
> > 2.10.1

Regards,

Bernard.

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

* [dpdk-dev] [PATCH v4 0/2] net/ixgbe: VMDq DCB with SRIOV
  2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 0/2] net/ixgbe: " Bernard Iremonger
@ 2016-10-17 17:01     ` Bernard Iremonger
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
                         ` (2 more replies)
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  2 siblings, 3 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-17 17:01 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

Changes in v4:
changes to ixgbe patch following comments.

Changes in v3:
rebase to latest master.
update commit message for ixgbe patch
add testpmd patch.

Changes in v2:
rebase to  latest master.

Bernard Iremonger (2):
  net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  app/test_pmd: fix DCB configuration

 app/test-pmd/testpmd.c           |  4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 36 ++++++++++++++++++++++--------------
 3 files changed, 30 insertions(+), 21 deletions(-)

-- 
2.10.1

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

* [dpdk-dev] [PATCH v4 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 0/2] net/ixgbe: " Bernard Iremonger
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 " Bernard Iremonger
@ 2016-10-17 17:01     ` Bernard Iremonger
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  2 siblings, 0 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-17 17:01 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

Modify ixgbe_check_mq_mode function,
when SRIOV is enabled, enable mq_mode
ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.

Modify ixgbe_dcb_tx_hw_config function,
replace the struct ixgbe_hw parameter with a
struct rte_eth_dev parameter and handle SRIOV enabled.

Modify ixgbe_dev_mq_rx_configure function,
when SRIOV is enabled, enable mq_mode ETH_MQ_RX_VMDQ_DCB.

Modify ixgbe_configure_dcb function,
drop check on dev->data->nb_rx_queues.

Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 36 ++++++++++++++++++++++--------------
 2 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4ca5747..4d5ce83 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 		/* check multi-queue mode */
 		switch (dev_conf->rxmode.mq_mode) {
 		case ETH_MQ_RX_VMDQ_DCB:
+			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB mode supported in SRIOV");
+			dev->data->dev_conf.rxmode.mq_mode = ETH_MQ_RX_VMDQ_DCB;
+			break;
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			/* DCB/RSS VMDQ in SRIOV mode, not implement yet */
 			PMD_INIT_LOG(ERR, "SRIOV active,"
@@ -2012,11 +2015,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 
 		switch (dev_conf->txmode.mq_mode) {
 		case ETH_MQ_TX_VMDQ_DCB:
-			/* DCB VMDQ in SRIOV mode, not implement yet */
-			PMD_INIT_LOG(ERR, "SRIOV is active,"
-					" unsupported VMDQ mq_mode tx %d.",
-					dev_conf->txmode.mq_mode);
-			return -EINVAL;
+			PMD_INIT_LOG(INFO, "ETH_MQ_TX_VMDQ_DCB mode supported in SRIOV");
+			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_DCB;
+			break;
 		default: /* ETH_MQ_TX_VMDQ_ONLY or ETH_MQ_TX_NONE */
 			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_ONLY;
 			break;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 2ce8234..4c13ed2 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   Copyright 2014 6WIND S.A.
  *   All rights reserved.
  *
@@ -3313,15 +3313,16 @@ ixgbe_vmdq_dcb_configure(struct rte_eth_dev *dev)
 
 /**
  * ixgbe_dcb_config_tx_hw_config - Configure general DCB TX parameters
- * @hw: pointer to hardware structure
+ * @dev: pointer to eth_dev structure
  * @dcb_config: pointer to ixgbe_dcb_config structure
  */
 static void
-ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
+ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev,
 		       struct ixgbe_dcb_config *dcb_config)
 {
 	uint32_t reg;
 	uint32_t q;
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	PMD_INIT_FUNC_TRACE();
 	if (hw->mac.type != ixgbe_mac_82598EB) {
@@ -3339,11 +3340,17 @@ ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
 		if (dcb_config->vt_mode)
 			reg |= IXGBE_MTQC_VT_ENA;
 		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
-
-		/* Disable drop for all queues */
-		for (q = 0; q < 128; q++)
-			IXGBE_WRITE_REG(hw, IXGBE_QDE,
-				(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+			/* Disable drop for all queues in VMDQ mode*/
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
+		} else {
+			/* Enable drop for all queues in SRIOV mode */
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		}
 
 		/* Enable the Tx desc arbiter */
 		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
@@ -3378,7 +3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
 			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS ? 0xFFFF : 0xFFFFFFFF);
 
 	/*Configure general DCB TX parameters*/
-	ixgbe_dcb_tx_hw_config(hw, dcb_config);
+	ixgbe_dcb_tx_hw_config(dev, dcb_config);
 }
 
 static void
@@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,
 		/*get DCB TX configuration parameters from rte_eth_conf*/
 		ixgbe_dcb_tx_config(dev, dcb_config);
 		/*Configure general DCB TX parameters*/
-		ixgbe_dcb_tx_hw_config(hw, dcb_config);
+		ixgbe_dcb_tx_hw_config(dev, dcb_config);
 		break;
 	default:
 		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode configuration");
@@ -3810,7 +3817,7 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
 	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
 		return;
 
-	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
+	if (dev->data->nb_rx_queues > ETH_DCB_NUM_QUEUES)
 		return;
 
 	/** Configure DCB hardware **/
@@ -4082,12 +4089,13 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev)
 		case ETH_MQ_RX_VMDQ_RSS:
 			ixgbe_config_vf_rss(dev);
 			break;
-
-		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB:
+			ixgbe_vmdq_dcb_configure(dev);
+			break;
+		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			PMD_INIT_LOG(ERR,
-				"Could not support DCB with VMDq & SRIOV");
+				"Could not support DCB/RSS with VMDq & SRIOV");
 			return -1;
 		default:
 			ixgbe_config_vf_default(dev);
-- 
2.10.1

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

* [dpdk-dev] [PATCH v4 2/2] app/test_pmd: fix DCB configuration
  2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 0/2] net/ixgbe: " Bernard Iremonger
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 " Bernard Iremonger
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
@ 2016-10-17 17:01     ` Bernard Iremonger
  2 siblings, 0 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-17 17:01 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

when dcb mode is DCB_VT_ENABLED set nb_rxq and nb_txq to 1.

Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/testpmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6185be6..ee567c3 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2002,8 +2002,8 @@ init_port_dcb_config(portid_t pid,
 	 * and has the same number of rxq and txq in dcb mode
 	 */
 	if (dcb_mode == DCB_VT_ENABLED) {
-		nb_rxq = rte_port->dev_info.max_rx_queues;
-		nb_txq = rte_port->dev_info.max_tx_queues;
+		nb_rxq = 1;
+		nb_txq = 1;
 	} else {
 		/*if vt is disabled, use all pf queues */
 		if (rte_port->dev_info.vmdq_pool_base == 0) {
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-17 16:27     ` Iremonger, Bernard
@ 2016-10-18  1:07       ` Lu, Wenzhuo
  2016-10-18  8:58         ` Iremonger, Bernard
  0 siblings, 1 reply; 35+ messages in thread
From: Lu, Wenzhuo @ 2016-10-18  1:07 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Shah, Rahul R

Hi Bernard,


> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Tuesday, October 18, 2016 12:27 AM
> To: Lu, Wenzhuo; dev@dpdk.org; Shah, Rahul R
> Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with
> SRIOV
> 
> Hi Wenzhuo,
> 
> > >  	if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11 +3340,17
> > @@
> > > ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
> > >  		if (dcb_config->vt_mode)
> > >  			reg |= IXGBE_MTQC_VT_ENA;
> > >  		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
> > > -
> > > -		/* Disable drop for all queues */
> > > -		for (q = 0; q < 128; q++)
> > > -			IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > -				(IXGBE_QDE_WRITE | (q <<
> > > IXGBE_QDE_IDX_SHIFT)));
> > > +		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
> > > +			/* Disable drop for all queues in VMDQ mode*/
> > > +			for (q = 0; q < 128; q++)
> > > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > +						(IXGBE_QDE_WRITE | (q <<
> > > IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
> > > +		} else {
> > > +			/* Enable drop for all queues in SRIOV mode */
> > > +			for (q = 0; q < 128; q++)
> > > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > +						(IXGBE_QDE_WRITE | (q <<
> > > IXGBE_QDE_IDX_SHIFT)));
> > > +		}
> > I think it has nothing to do with mq mode. Do I miss something?
> 
> Behavior is different when SRIOV is enabled.
I don't understand why the behavior is different. To my opinion, the drop has nothing to do with the mode. We can enable or disable it.
The old behavior is disabling it by default. Now you change it to disabling it by default in NO-SRIOV mode, but enabling it in SRIOV mode.
What I don't get is the reason.

> 
> >
> > >
> > >  		/* Enable the Tx desc arbiter */
> > >  		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS); @@ -3378,7
> > > +3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
> > >  			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS
> > ?
> > > 0xFFFF : 0xFFFFFFFF);
> > >
> > >  	/*Configure general DCB TX parameters*/
> > > -	ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > > +	ixgbe_dcb_tx_hw_config(dev, dcb_config);
> > >  }
> > >
> > >  static void
> > > @@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev
> > *dev,
> > >  		/*get DCB TX configuration parameters from rte_eth_conf*/
> > >  		ixgbe_dcb_tx_config(dev, dcb_config);
> > >  		/*Configure general DCB TX parameters*/
> > > -		ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > > +		ixgbe_dcb_tx_hw_config(dev, dcb_config);
> > >  		break;
> > >  	default:
> > >  		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode
> > configuration"); @@
> > > -3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
> > >  	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
> > >  		return;
> > >
> > > -	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
> > > -		return;
> > I remember it's a limitation of implementation. The reason is the
> > resource allocation. Why could we remove it now?
> 
> ETH_DCB_NUM_QUEUES is 128,  nb_rx_queues may not be 128.
I think it's a limitation to force the queue number to be ETH_DCB_NUM_QUEUES.
Just to confirm it, have you try to set rx queue number to something different from 128, like 64, 32...

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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-18  1:07       ` Lu, Wenzhuo
@ 2016-10-18  8:58         ` Iremonger, Bernard
  2016-10-19  0:39           ` Lu, Wenzhuo
  0 siblings, 1 reply; 35+ messages in thread
From: Iremonger, Bernard @ 2016-10-18  8:58 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev, Shah, Rahul R

Hi Wenzhuo,

<snip>

> > Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB
> > with SRIOV
> >
> > Hi Wenzhuo,
> >
> > > >  	if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11 +3340,17
> > > @@
> > > > ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
> > > >  		if (dcb_config->vt_mode)
> > > >  			reg |= IXGBE_MTQC_VT_ENA;
> > > >  		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
> > > > -
> > > > -		/* Disable drop for all queues */
> > > > -		for (q = 0; q < 128; q++)
> > > > -			IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > > -				(IXGBE_QDE_WRITE | (q <<
> > > > IXGBE_QDE_IDX_SHIFT)));
> > > > +		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
> > > > +			/* Disable drop for all queues in VMDQ mode*/
> > > > +			for (q = 0; q < 128; q++)
> > > > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > > +						(IXGBE_QDE_WRITE | (q <<
> > > > IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
> > > > +		} else {
> > > > +			/* Enable drop for all queues in SRIOV mode */
> > > > +			for (q = 0; q < 128; q++)
> > > > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > > +						(IXGBE_QDE_WRITE | (q <<
> > > > IXGBE_QDE_IDX_SHIFT)));
> > > > +		}
> > > I think it has nothing to do with mq mode. Do I miss something?
> >
> > Behavior is different when SRIOV is enabled.
> I don't understand why the behavior is different. To my opinion, the drop
> has nothing to do with the mode. We can enable or disable it.
> The old behavior is disabling it by default. Now you change it to disabling it by
> default in NO-SRIOV mode, but enabling it in SRIOV mode.
> What I don't get is the reason.

Please refer to section 4.6.11.3.1 page 180 of the 82599-10-gbe-controller-datasheet.pdf
The last paragraph on page 180 states:

"Queue Drop Enable (PFQDE) - In SR-IO the QDE bit should be set to 1b in the PFQDE register for all queues.
In VMDq mode, the QDE bit should be set to 0b for all queues."
 

> > > >  		/* Enable the Tx desc arbiter */
> > > >  		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS); @@ -3378,7
> > > > +3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
> > > >  			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS
> > > ?
> > > > 0xFFFF : 0xFFFFFFFF);
> > > >
> > > >  	/*Configure general DCB TX parameters*/
> > > > -	ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > > > +	ixgbe_dcb_tx_hw_config(dev, dcb_config);
> > > >  }
> > > >
> > > >  static void
> > > > @@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev
> > > *dev,
> > > >  		/*get DCB TX configuration parameters from rte_eth_conf*/
> > > >  		ixgbe_dcb_tx_config(dev, dcb_config);
> > > >  		/*Configure general DCB TX parameters*/
> > > > -		ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > > > +		ixgbe_dcb_tx_hw_config(dev, dcb_config);
> > > >  		break;
> > > >  	default:
> > > >  		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode
> > > configuration"); @@
> > > > -3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev
> *dev)
> > > >  	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
> > > >  		return;
> > > >
> > > > -	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
> > > > -		return;
> > > I remember it's a limitation of implementation. The reason is the
> > > resource allocation. Why could we remove it now?
> >
> > ETH_DCB_NUM_QUEUES is 128,  nb_rx_queues may not be 128.
> I think it's a limitation to force the queue number to be
> ETH_DCB_NUM_QUEUES.
> Just to confirm it, have you try to set rx queue number to something
> different from 128, like 64, 32...

In my test scenario the nb_rx_queues is 1.

Regards,

Bernard

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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-18  8:58         ` Iremonger, Bernard
@ 2016-10-19  0:39           ` Lu, Wenzhuo
  2016-10-19 10:16             ` Iremonger, Bernard
  0 siblings, 1 reply; 35+ messages in thread
From: Lu, Wenzhuo @ 2016-10-19  0:39 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Shah, Rahul R

Hi Bernard,


> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Tuesday, October 18, 2016 4:58 PM
> To: Lu, Wenzhuo; dev@dpdk.org; Shah, Rahul R
> Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with
> SRIOV
> 
> Hi Wenzhuo,
> 
> <snip>
> 
> > > Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB
> > > with SRIOV
> > >
> > > Hi Wenzhuo,
> > >
> > > > >  	if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11 +3340,17
> > > > @@
> > > > > ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
> > > > >  		if (dcb_config->vt_mode)
> > > > >  			reg |= IXGBE_MTQC_VT_ENA;
> > > > >  		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
> > > > > -
> > > > > -		/* Disable drop for all queues */
> > > > > -		for (q = 0; q < 128; q++)
> > > > > -			IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > > > -				(IXGBE_QDE_WRITE | (q <<
> > > > > IXGBE_QDE_IDX_SHIFT)));
> > > > > +		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
> > > > > +			/* Disable drop for all queues in VMDQ mode*/
> > > > > +			for (q = 0; q < 128; q++)
> > > > > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > > > +						(IXGBE_QDE_WRITE |
> (q <<
> > > > > IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
This code is used to enable drop, but the comments say 'disable drop'.

> > > > > +		} else {
> > > > > +			/* Enable drop for all queues in SRIOV mode */
> > > > > +			for (q = 0; q < 128; q++)
> > > > > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > > > +						(IXGBE_QDE_WRITE |
> (q <<
> > > > > IXGBE_QDE_IDX_SHIFT)));
This code is used to disable drop, but the comments say 'enable drop'.
I've checked the V4, the same problem too. I think the problem is the comments, right?

> > > > > +		}
> > > > I think it has nothing to do with mq mode. Do I miss something?
> > >
> > > Behavior is different when SRIOV is enabled.
> > I don't understand why the behavior is different. To my opinion, the
> > drop has nothing to do with the mode. We can enable or disable it.
> > The old behavior is disabling it by default. Now you change it to
> > disabling it by default in NO-SRIOV mode, but enabling it in SRIOV mode.
> > What I don't get is the reason.
> 
> Please refer to section 4.6.11.3.1 page 180 of the 82599-10-gbe-controller-
> datasheet.pdf
> The last paragraph on page 180 states:
> 
> "Queue Drop Enable (PFQDE) - In SR-IO the QDE bit should be set to 1b in the
> PFQDE register for all queues.
> In VMDq mode, the QDE bit should be set to 0b for all queues."
Got it, thanks a lot :)

> 
> 
> > > > >  		/* Enable the Tx desc arbiter */
> > > > >  		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS); @@ -3378,7
> > > > > +3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
> > > > >  			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS
> > > > ?
> > > > > 0xFFFF : 0xFFFFFFFF);
> > > > >
> > > > >  	/*Configure general DCB TX parameters*/
> > > > > -	ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > > > > +	ixgbe_dcb_tx_hw_config(dev, dcb_config);
> > > > >  }
> > > > >
> > > > >  static void
> > > > > @@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev
> > > > *dev,
> > > > >  		/*get DCB TX configuration parameters from rte_eth_conf*/
> > > > >  		ixgbe_dcb_tx_config(dev, dcb_config);
> > > > >  		/*Configure general DCB TX parameters*/
> > > > > -		ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > > > > +		ixgbe_dcb_tx_hw_config(dev, dcb_config);
> > > > >  		break;
> > > > >  	default:
> > > > >  		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode
> > > > configuration"); @@
> > > > > -3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev
> > *dev)
> > > > >  	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
> > > > >  		return;
> > > > >
> > > > > -	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
> > > > > -		return;
> > > > I remember it's a limitation of implementation. The reason is the
> > > > resource allocation. Why could we remove it now?
> > >
> > > ETH_DCB_NUM_QUEUES is 128,  nb_rx_queues may not be 128.
> > I think it's a limitation to force the queue number to be
> > ETH_DCB_NUM_QUEUES.
> > Just to confirm it, have you try to set rx queue number to something
> > different from 128, like 64, 32...
> 
> In my test scenario the nb_rx_queues is 1.
Glad to know that, thanks :)

> 
> Regards,
> 
> Bernard

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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-19  0:39           ` Lu, Wenzhuo
@ 2016-10-19 10:16             ` Iremonger, Bernard
  0 siblings, 0 replies; 35+ messages in thread
From: Iremonger, Bernard @ 2016-10-19 10:16 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev, Shah, Rahul R

Hi Wenzhuo,

<snip>

> > > > Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq
> > > > DCB with SRIOV
> > > >
> > > > Hi Wenzhuo,
> > > >
> > > > > >  	if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11
> > > > > > +3340,17
> > > > > @@
> > > > > > ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
> > > > > >  		if (dcb_config->vt_mode)
> > > > > >  			reg |= IXGBE_MTQC_VT_ENA;
> > > > > >  		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
> > > > > > -
> > > > > > -		/* Disable drop for all queues */
> > > > > > -		for (q = 0; q < 128; q++)
> > > > > > -			IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > > > > -				(IXGBE_QDE_WRITE | (q <<
> > > > > > IXGBE_QDE_IDX_SHIFT)));
> > > > > > +		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
> > > > > > +			/* Disable drop for all queues in VMDQ
> mode*/
> > > > > > +			for (q = 0; q < 128; q++)
> > > > > > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > > > > +						(IXGBE_QDE_WRITE |
> > (q <<
> > > > > > IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
> This code is used to enable drop, but the comments say 'disable drop'.

The comment is correct but the code is not.
 
> > > > > > +		} else {
> > > > > > +			/* Enable drop for all queues in SRIOV mode
> */
> > > > > > +			for (q = 0; q < 128; q++)
> > > > > > +				IXGBE_WRITE_REG(hw, IXGBE_QDE,
> > > > > > +						(IXGBE_QDE_WRITE |
> > (q <<
> > > > > > IXGBE_QDE_IDX_SHIFT)));
> This code is used to disable drop, but the comments say 'enable drop'.

The comment is correct but the code is not.

> I've checked the V4, the same problem too. I think the problem is the
> comments, right?

No, the comments are correct but the code is reversed.
I will send a v5. 
 
 
> > > > > > +		}
> > > > > I think it has nothing to do with mq mode. Do I miss something?
> > > >
> > > > Behavior is different when SRIOV is enabled.
> > > I don't understand why the behavior is different. To my opinion, the
> > > drop has nothing to do with the mode. We can enable or disable it.
> > > The old behavior is disabling it by default. Now you change it to
> > > disabling it by default in NO-SRIOV mode, but enabling it in SRIOV mode.
> > > What I don't get is the reason.
> >
> > Please refer to section 4.6.11.3.1 page 180 of the
> > 82599-10-gbe-controller- datasheet.pdf The last paragraph on page 180
> > states:
> >
> > "Queue Drop Enable (PFQDE) - In SR-IO the QDE bit should be set to 1b
> > in the PFQDE register for all queues.
> > In VMDq mode, the QDE bit should be set to 0b for all queues."
> Got it, thanks a lot :)
> 
> >
> >
> > > > > >  		/* Enable the Tx desc arbiter */
> > > > > >  		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS); @@ -
> 3378,7
> > > > > > +3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev
> > > > > > +*dev,
> > > > > >  			vmdq_tx_conf->nb_queue_pools ==
> ETH_16_POOLS
> > > > > ?
> > > > > > 0xFFFF : 0xFFFFFFFF);
> > > > > >
> > > > > >  	/*Configure general DCB TX parameters*/
> > > > > > -	ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > > > > > +	ixgbe_dcb_tx_hw_config(dev, dcb_config);
> > > > > >  }
> > > > > >
> > > > > >  static void
> > > > > > @@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct
> > > > > > rte_eth_dev
> > > > > *dev,
> > > > > >  		/*get DCB TX configuration parameters from
> rte_eth_conf*/
> > > > > >  		ixgbe_dcb_tx_config(dev, dcb_config);
> > > > > >  		/*Configure general DCB TX parameters*/
> > > > > > -		ixgbe_dcb_tx_hw_config(hw, dcb_config);
> > > > > > +		ixgbe_dcb_tx_hw_config(dev, dcb_config);
> > > > > >  		break;
> > > > > >  	default:
> > > > > >  		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode
> > > > > configuration"); @@
> > > > > > -3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev
> > > *dev)
> > > > > >  	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
> > > > > >  		return;
> > > > > >
> > > > > > -	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
> > > > > > -		return;
> > > > > I remember it's a limitation of implementation. The reason is
> > > > > the resource allocation. Why could we remove it now?
> > > >
> > > > ETH_DCB_NUM_QUEUES is 128,  nb_rx_queues may not be 128.
> > > I think it's a limitation to force the queue number to be
> > > ETH_DCB_NUM_QUEUES.
> > > Just to confirm it, have you try to set rx queue number to something
> > > different from 128, like 64, 32...
> >
> > In my test scenario the nb_rx_queues is 1.
> Glad to know that, thanks :)
> 

Regards,

Bernard

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

* [dpdk-dev] [PATCH v5 0/2] net/ixgbe: VMDq DCB with SRIOV
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 " Bernard Iremonger
@ 2016-10-19 10:21       ` Bernard Iremonger
  2016-10-25  0:31         ` Lu, Wenzhuo
                           ` (3 more replies)
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  2 siblings, 4 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-19 10:21 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

Changes in v5:
fix enable/disable of the QDE bit in the PFQDE register.

Changes in v4:
changes to ixgbe patch following comments.

Changes in v3:
rebase to latest master.
update commit message for ixgbe patch
add testpmd patch.

Changes in v2:
rebase to  latest master.

Bernard Iremonger (2):
  net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  app/test_pmd: fix DCB configuration

 app/test-pmd/testpmd.c           |  4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
 3 files changed, 30 insertions(+), 20 deletions(-)

-- 
2.10.1

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

* [dpdk-dev] [PATCH v5 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 " Bernard Iremonger
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
@ 2016-10-19 10:21       ` Bernard Iremonger
  2016-10-20  1:24         ` Lu, Wenzhuo
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  2 siblings, 1 reply; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-19 10:21 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

Modify ixgbe_check_mq_mode function,
when SRIOV is enabled, enable mq_mode
ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.

Modify ixgbe_dcb_tx_hw_config function,
replace the struct ixgbe_hw parameter with a
struct rte_eth_dev parameter and handle SRIOV enabled.

Modify ixgbe_dev_mq_rx_configure function,
when SRIOV is enabled, enable mq_mode ETH_MQ_RX_VMDQ_DCB.

Modify ixgbe_configure_dcb function,
drop check on dev->data->nb_rx_queues.

Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
 2 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4ca5747..4d5ce83 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 		/* check multi-queue mode */
 		switch (dev_conf->rxmode.mq_mode) {
 		case ETH_MQ_RX_VMDQ_DCB:
+			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB mode supported in SRIOV");
+			dev->data->dev_conf.rxmode.mq_mode = ETH_MQ_RX_VMDQ_DCB;
+			break;
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			/* DCB/RSS VMDQ in SRIOV mode, not implement yet */
 			PMD_INIT_LOG(ERR, "SRIOV active,"
@@ -2012,11 +2015,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 
 		switch (dev_conf->txmode.mq_mode) {
 		case ETH_MQ_TX_VMDQ_DCB:
-			/* DCB VMDQ in SRIOV mode, not implement yet */
-			PMD_INIT_LOG(ERR, "SRIOV is active,"
-					" unsupported VMDQ mq_mode tx %d.",
-					dev_conf->txmode.mq_mode);
-			return -EINVAL;
+			PMD_INIT_LOG(INFO, "ETH_MQ_TX_VMDQ_DCB mode supported in SRIOV");
+			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_DCB;
+			break;
 		default: /* ETH_MQ_TX_VMDQ_ONLY or ETH_MQ_TX_NONE */
 			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_ONLY;
 			break;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 2ce8234..b2d9f45 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   Copyright 2014 6WIND S.A.
  *   All rights reserved.
  *
@@ -3313,15 +3313,16 @@ ixgbe_vmdq_dcb_configure(struct rte_eth_dev *dev)
 
 /**
  * ixgbe_dcb_config_tx_hw_config - Configure general DCB TX parameters
- * @hw: pointer to hardware structure
+ * @dev: pointer to eth_dev structure
  * @dcb_config: pointer to ixgbe_dcb_config structure
  */
 static void
-ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
+ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev,
 		       struct ixgbe_dcb_config *dcb_config)
 {
 	uint32_t reg;
 	uint32_t q;
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	PMD_INIT_FUNC_TRACE();
 	if (hw->mac.type != ixgbe_mac_82598EB) {
@@ -3340,10 +3341,17 @@ ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
 			reg |= IXGBE_MTQC_VT_ENA;
 		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
 
-		/* Disable drop for all queues */
-		for (q = 0; q < 128; q++)
-			IXGBE_WRITE_REG(hw, IXGBE_QDE,
-				(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+			/* Disable drop for all queues in VMDQ mode*/
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		} else {
+			/* Enable drop for all queues in SRIOV mode */
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
+		}
 
 		/* Enable the Tx desc arbiter */
 		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
@@ -3378,7 +3386,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
 			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS ? 0xFFFF : 0xFFFFFFFF);
 
 	/*Configure general DCB TX parameters*/
-	ixgbe_dcb_tx_hw_config(hw, dcb_config);
+	ixgbe_dcb_tx_hw_config(dev, dcb_config);
 }
 
 static void
@@ -3661,7 +3669,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,
 		/*get DCB TX configuration parameters from rte_eth_conf*/
 		ixgbe_dcb_tx_config(dev, dcb_config);
 		/*Configure general DCB TX parameters*/
-		ixgbe_dcb_tx_hw_config(hw, dcb_config);
+		ixgbe_dcb_tx_hw_config(dev, dcb_config);
 		break;
 	default:
 		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode configuration");
@@ -3810,7 +3818,7 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
 	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
 		return;
 
-	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
+	if (dev->data->nb_rx_queues > ETH_DCB_NUM_QUEUES)
 		return;
 
 	/** Configure DCB hardware **/
@@ -4082,12 +4090,13 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev)
 		case ETH_MQ_RX_VMDQ_RSS:
 			ixgbe_config_vf_rss(dev);
 			break;
-
-		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB:
+			ixgbe_vmdq_dcb_configure(dev);
+			break;
+		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			PMD_INIT_LOG(ERR,
-				"Could not support DCB with VMDq & SRIOV");
+				"Could not support DCB/RSS with VMDq & SRIOV");
 			return -1;
 		default:
 			ixgbe_config_vf_default(dev);
-- 
2.10.1

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

* [dpdk-dev] [PATCH v5 2/2] app/test_pmd: fix DCB configuration
  2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 " Bernard Iremonger
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
@ 2016-10-19 10:21       ` Bernard Iremonger
  2 siblings, 0 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-19 10:21 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu; +Cc: Bernard Iremonger

when dcb mode is DCB_VT_ENABLED set nb_rxq and nb_txq to 1.

Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/testpmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6185be6..ee567c3 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2002,8 +2002,8 @@ init_port_dcb_config(portid_t pid,
 	 * and has the same number of rxq and txq in dcb mode
 	 */
 	if (dcb_mode == DCB_VT_ENABLED) {
-		nb_rxq = rte_port->dev_info.max_rx_queues;
-		nb_txq = rte_port->dev_info.max_tx_queues;
+		nb_rxq = 1;
+		nb_txq = 1;
 	} else {
 		/*if vt is disabled, use all pf queues */
 		if (rte_port->dev_info.vmdq_pool_base == 0) {
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v5 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
@ 2016-10-20  1:24         ` Lu, Wenzhuo
  0 siblings, 0 replies; 35+ messages in thread
From: Lu, Wenzhuo @ 2016-10-20  1:24 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Shah, Rahul R

Hi,

> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Wednesday, October 19, 2016 6:21 PM
> To: dev@dpdk.org; Shah, Rahul R; Lu, Wenzhuo
> Cc: Iremonger, Bernard
> Subject: [PATCH v5 1/2] net/ixgbe: support multiqueue mode VMDq DCB with
> SRIOV
> 
> Modify ixgbe_check_mq_mode function,
> when SRIOV is enabled, enable mq_mode
> ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.
> 
> Modify ixgbe_dcb_tx_hw_config function,
> replace the struct ixgbe_hw parameter with a struct rte_eth_dev parameter and
> handle SRIOV enabled.
> 
> Modify ixgbe_dev_mq_rx_configure function, when SRIOV is enabled, enable
> mq_mode ETH_MQ_RX_VMDQ_DCB.
> 
> Modify ixgbe_configure_dcb function,
> drop check on dev->data->nb_rx_queues.
> 
> Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>

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

* Re: [dpdk-dev] [PATCH v5 0/2] net/ixgbe: VMDq DCB with SRIOV
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
@ 2016-10-25  0:31         ` Lu, Wenzhuo
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 " Bernard Iremonger
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 35+ messages in thread
From: Lu, Wenzhuo @ 2016-10-25  0:31 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Shah, Rahul R

Hi,


> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Wednesday, October 19, 2016 6:21 PM
> To: dev@dpdk.org; Shah, Rahul R; Lu, Wenzhuo
> Cc: Iremonger, Bernard
> Subject: [PATCH v5 0/2] net/ixgbe: VMDq DCB with SRIOV
> 
> Changes in v5:
> fix enable/disable of the QDE bit in the PFQDE register.
> 
> Changes in v4:
> changes to ixgbe patch following comments.
> 
> Changes in v3:
> rebase to latest master.
> update commit message for ixgbe patch
> add testpmd patch.
> 
> Changes in v2:
> rebase to  latest master.
> 
> Bernard Iremonger (2):
>   net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
>   app/test_pmd: fix DCB configuration
> 
>  app/test-pmd/testpmd.c           |  4 ++--
>  drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
>  drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
>  3 files changed, 30 insertions(+), 20 deletions(-)
> 
> --
> 2.10.1
Series-Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>

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

* [dpdk-dev] [PATCH v6 0/2] net/ixgbe: VMDq DCB with SRIOV
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
  2016-10-25  0:31         ` Lu, Wenzhuo
@ 2016-10-25 16:51         ` Bernard Iremonger
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 1/2] net/ixgbe: support multiqueue mode " Bernard Iremonger
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  3 siblings, 0 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-25 16:51 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu, cristian.dumitrescu, jingjing.wu
  Cc: Bernard Iremonger

Changes in v6:
rebase to latest master.
revise commit messages.

Changes in v5:
fix enable/disable of the QDE bit in the PFQDE register.

Changes in v4:
changes to ixgbe patch following comments.

Changes in v3:
rebase to latest master.
update commit message for ixgbe patch
add testpmd patch.

Changes in v2:
rebase to  latest master.

Bernard Iremonger (2):
  net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  app/test_pmd: fix DCB configuration

 app/test-pmd/testpmd.c           |  4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
 3 files changed, 30 insertions(+), 20 deletions(-)

-- 
2.10.1

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

* [dpdk-dev] [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
  2016-10-25  0:31         ` Lu, Wenzhuo
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 " Bernard Iremonger
@ 2016-10-25 16:51         ` Bernard Iremonger
  2016-10-26 14:38           ` Wu, Jingjing
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  3 siblings, 1 reply; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-25 16:51 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu, cristian.dumitrescu, jingjing.wu
  Cc: Bernard Iremonger

The folowing changes have been made to allow Data Centre Bridge
(DCB) configuration when SRIOV is enabled.

Modify ixgbe_check_mq_mode function,
when SRIOV is enabled, enable mq_mode
ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.

Modify ixgbe_dcb_tx_hw_config function,
replace the struct ixgbe_hw parameter with a
struct rte_eth_dev parameter and handle SRIOV enabled.

Modify ixgbe_dev_mq_rx_configure function,
when SRIOV is enabled, enable mq_mode ETH_MQ_RX_VMDQ_DCB.

Modify ixgbe_configure_dcb function,
revise check on dev->data->nb_rx_queues.

Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
 2 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4ca5747..4d5ce83 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 		/* check multi-queue mode */
 		switch (dev_conf->rxmode.mq_mode) {
 		case ETH_MQ_RX_VMDQ_DCB:
+			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB mode supported in SRIOV");
+			dev->data->dev_conf.rxmode.mq_mode = ETH_MQ_RX_VMDQ_DCB;
+			break;
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			/* DCB/RSS VMDQ in SRIOV mode, not implement yet */
 			PMD_INIT_LOG(ERR, "SRIOV active,"
@@ -2012,11 +2015,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 
 		switch (dev_conf->txmode.mq_mode) {
 		case ETH_MQ_TX_VMDQ_DCB:
-			/* DCB VMDQ in SRIOV mode, not implement yet */
-			PMD_INIT_LOG(ERR, "SRIOV is active,"
-					" unsupported VMDQ mq_mode tx %d.",
-					dev_conf->txmode.mq_mode);
-			return -EINVAL;
+			PMD_INIT_LOG(INFO, "ETH_MQ_TX_VMDQ_DCB mode supported in SRIOV");
+			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_DCB;
+			break;
 		default: /* ETH_MQ_TX_VMDQ_ONLY or ETH_MQ_TX_NONE */
 			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_ONLY;
 			break;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 2ce8234..b2d9f45 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   Copyright 2014 6WIND S.A.
  *   All rights reserved.
  *
@@ -3313,15 +3313,16 @@ ixgbe_vmdq_dcb_configure(struct rte_eth_dev *dev)
 
 /**
  * ixgbe_dcb_config_tx_hw_config - Configure general DCB TX parameters
- * @hw: pointer to hardware structure
+ * @dev: pointer to eth_dev structure
  * @dcb_config: pointer to ixgbe_dcb_config structure
  */
 static void
-ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
+ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev,
 		       struct ixgbe_dcb_config *dcb_config)
 {
 	uint32_t reg;
 	uint32_t q;
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	PMD_INIT_FUNC_TRACE();
 	if (hw->mac.type != ixgbe_mac_82598EB) {
@@ -3340,10 +3341,17 @@ ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
 			reg |= IXGBE_MTQC_VT_ENA;
 		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
 
-		/* Disable drop for all queues */
-		for (q = 0; q < 128; q++)
-			IXGBE_WRITE_REG(hw, IXGBE_QDE,
-				(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+			/* Disable drop for all queues in VMDQ mode*/
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		} else {
+			/* Enable drop for all queues in SRIOV mode */
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
+		}
 
 		/* Enable the Tx desc arbiter */
 		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
@@ -3378,7 +3386,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
 			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS ? 0xFFFF : 0xFFFFFFFF);
 
 	/*Configure general DCB TX parameters*/
-	ixgbe_dcb_tx_hw_config(hw, dcb_config);
+	ixgbe_dcb_tx_hw_config(dev, dcb_config);
 }
 
 static void
@@ -3661,7 +3669,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,
 		/*get DCB TX configuration parameters from rte_eth_conf*/
 		ixgbe_dcb_tx_config(dev, dcb_config);
 		/*Configure general DCB TX parameters*/
-		ixgbe_dcb_tx_hw_config(hw, dcb_config);
+		ixgbe_dcb_tx_hw_config(dev, dcb_config);
 		break;
 	default:
 		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode configuration");
@@ -3810,7 +3818,7 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
 	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
 		return;
 
-	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
+	if (dev->data->nb_rx_queues > ETH_DCB_NUM_QUEUES)
 		return;
 
 	/** Configure DCB hardware **/
@@ -4082,12 +4090,13 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev)
 		case ETH_MQ_RX_VMDQ_RSS:
 			ixgbe_config_vf_rss(dev);
 			break;
-
-		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB:
+			ixgbe_vmdq_dcb_configure(dev);
+			break;
+		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			PMD_INIT_LOG(ERR,
-				"Could not support DCB with VMDq & SRIOV");
+				"Could not support DCB/RSS with VMDq & SRIOV");
 			return -1;
 		default:
 			ixgbe_config_vf_default(dev);
-- 
2.10.1

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

* [dpdk-dev] [PATCH v6 2/2] app/test_pmd: fix DCB configuration
  2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
                           ` (2 preceding siblings ...)
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 1/2] net/ixgbe: support multiqueue mode " Bernard Iremonger
@ 2016-10-25 16:51         ` Bernard Iremonger
  2016-10-26 14:30           ` Wu, Jingjing
                             ` (2 more replies)
  3 siblings, 3 replies; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-25 16:51 UTC (permalink / raw)
  To: dev, rahul.r.shah, wenzhuo.lu, cristian.dumitrescu, jingjing.wu
  Cc: Bernard Iremonger

Data Centre Bridge (DCB) configuration fails when SRIOV is
enabled if nb_rxq and nb_txq are not set to 1.

When dcb_mode is DCB_VT_ENABLED set nb_rxq and nb_txq to 1.

The failure occurs during configuration of the ixgbe PMD when
it is started, in the ixgbe_check_mq_mode function, if nb_rxq
and nb_txq are not set to 1.

Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>
---
 app/test-pmd/testpmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6185be6..ee567c3 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2002,8 +2002,8 @@ init_port_dcb_config(portid_t pid,
 	 * and has the same number of rxq and txq in dcb mode
 	 */
 	if (dcb_mode == DCB_VT_ENABLED) {
-		nb_rxq = rte_port->dev_info.max_rx_queues;
-		nb_txq = rte_port->dev_info.max_tx_queues;
+		nb_rxq = 1;
+		nb_txq = 1;
 	} else {
 		/*if vt is disabled, use all pf queues */
 		if (rte_port->dev_info.vmdq_pool_base == 0) {
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v6 2/2] app/test_pmd: fix DCB configuration
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
@ 2016-10-26 14:30           ` Wu, Jingjing
  2016-10-26 15:28           ` [dpdk-dev] [PATCH v7] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
  2016-10-28 14:40           ` [dpdk-dev] [PATCH v7] app/testpmd: fix DCB configuration Bernard Iremonger
  2 siblings, 0 replies; 35+ messages in thread
From: Wu, Jingjing @ 2016-10-26 14:30 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Shah, Rahul R, Lu, Wenzhuo, Dumitrescu,
	Cristian


>  	if (dcb_mode == DCB_VT_ENABLED) {
> -		nb_rxq = rte_port->dev_info.max_rx_queues;
> -		nb_txq = rte_port->dev_info.max_tx_queues;
> +		nb_rxq = 1;
> +		nb_txq = 1;
Before, the 'vt' argument in dcb command is used to distinguish whether the VMDQ is involved, but does mean if SRIOV is enabled.
I guess you want to use mode= ETH_MQ_RX_VMDQ_DCB to cover both VMDQ+DCB and SRIOV+DCB cases.
But if set nb_rxq=1, VMDQ + DCB case will not work in testpmd. And even doesn't care about the VMDQ +DCB case,
setting num of queue to 1 makes no sense to DCB (queue based on TC) cases.

Thanks
Jingjing

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

* Re: [dpdk-dev] [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 1/2] net/ixgbe: support multiqueue mode " Bernard Iremonger
@ 2016-10-26 14:38           ` Wu, Jingjing
  2016-10-26 15:29             ` Iremonger, Bernard
  0 siblings, 1 reply; 35+ messages in thread
From: Wu, Jingjing @ 2016-10-26 14:38 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Shah, Rahul R, Lu, Wenzhuo, Dumitrescu,
	Cristian



> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Wednesday, October 26, 2016 12:51 AM
> To: dev@dpdk.org; Shah, Rahul R <rahul.r.shah@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
> 
> The folowing changes have been made to allow Data Centre Bridge
> (DCB) configuration when SRIOV is enabled.
> 
> Modify ixgbe_check_mq_mode function,
> when SRIOV is enabled, enable mq_mode
> ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.
> 
> Modify ixgbe_dcb_tx_hw_config function,
> replace the struct ixgbe_hw parameter with a
> struct rte_eth_dev parameter and handle SRIOV enabled.
> 
> Modify ixgbe_dev_mq_rx_configure function,
> when SRIOV is enabled, enable mq_mode ETH_MQ_RX_VMDQ_DCB.
> 
> Modify ixgbe_configure_dcb function,
> revise check on dev->data->nb_rx_queues.
> 
> Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
>  drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
>  2 files changed, 28 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 4ca5747..4d5ce83 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
>  		/* check multi-queue mode */
>  		switch (dev_conf->rxmode.mq_mode) {
>  		case ETH_MQ_RX_VMDQ_DCB:
> +			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB mode supported in SRIOV");
> +			dev->data->dev_conf.rxmode.mq_mode = ETH_MQ_RX_VMDQ_DCB;
This line is duplicated, mq_mode is ETH_MQ_RX_VMDQ_DCB already. And it's better to
check if the nb_queue is valid.

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

* [dpdk-dev] [PATCH v7] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  2016-10-26 14:30           ` Wu, Jingjing
@ 2016-10-26 15:28           ` Bernard Iremonger
  2016-10-26 15:41             ` Bruce Richardson
  2016-10-28 14:40           ` [dpdk-dev] [PATCH v7] app/testpmd: fix DCB configuration Bernard Iremonger
  2 siblings, 1 reply; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-26 15:28 UTC (permalink / raw)
  To: dev

The folowing changes have been made to allow Data Centre Bridge
(DCB) configuration when SRIOV is enabled.

Modify ixgbe_check_mq_mode function,
when SRIOV is enabled, enable mq_mode
ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.

Modify ixgbe_dcb_tx_hw_config function,
replace the struct ixgbe_hw parameter with a
struct rte_eth_dev parameter and handle SRIOV enabled.

Modify ixgbe_dev_mq_rx_configure function,
when SRIOV is enabled, enable mq_mode ETH_MQ_RX_VMDQ_DCB.

Modify ixgbe_configure_dcb function,
revise check on dev->data->nb_rx_queues.

Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>
---

Changes in v7:
Removed unnecessary assignment.
Removed testpmd fix from patchset. Will submit separately.

Changes in v6:
rebase to latest master.
revise commit messages.

Changes in v5:
fix enable/disable of the QDE bit in the PFQDE register.

Changes in v4:
changes to ixgbe patch following comments.

Changes in v3:
rebase to latest master.
update commit message for ixgbe patch
add testpmd patch.

Changes in v2:
rebase to  latest master.


drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
 2 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4ca5747..3445a76 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1977,6 +1977,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 		/* check multi-queue mode */
 		switch (dev_conf->rxmode.mq_mode) {
 		case ETH_MQ_RX_VMDQ_DCB:
+			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB mode supported in SRIOV");
+			break;
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			/* DCB/RSS VMDQ in SRIOV mode, not implement yet */
 			PMD_INIT_LOG(ERR, "SRIOV active,"
@@ -2012,11 +2014,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 
 		switch (dev_conf->txmode.mq_mode) {
 		case ETH_MQ_TX_VMDQ_DCB:
-			/* DCB VMDQ in SRIOV mode, not implement yet */
-			PMD_INIT_LOG(ERR, "SRIOV is active,"
-					" unsupported VMDQ mq_mode tx %d.",
-					dev_conf->txmode.mq_mode);
-			return -EINVAL;
+			PMD_INIT_LOG(INFO, "ETH_MQ_TX_VMDQ_DCB mode supported in SRIOV");
+			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_DCB;
+			break;
 		default: /* ETH_MQ_TX_VMDQ_ONLY or ETH_MQ_TX_NONE */
 			dev->data->dev_conf.txmode.mq_mode = ETH_MQ_TX_VMDQ_ONLY;
 			break;
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 2ce8234..b2d9f45 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   Copyright 2014 6WIND S.A.
  *   All rights reserved.
  *
@@ -3313,15 +3313,16 @@ ixgbe_vmdq_dcb_configure(struct rte_eth_dev *dev)
 
 /**
  * ixgbe_dcb_config_tx_hw_config - Configure general DCB TX parameters
- * @hw: pointer to hardware structure
+ * @dev: pointer to eth_dev structure
  * @dcb_config: pointer to ixgbe_dcb_config structure
  */
 static void
-ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
+ixgbe_dcb_tx_hw_config(struct rte_eth_dev *dev,
 		       struct ixgbe_dcb_config *dcb_config)
 {
 	uint32_t reg;
 	uint32_t q;
+	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	PMD_INIT_FUNC_TRACE();
 	if (hw->mac.type != ixgbe_mac_82598EB) {
@@ -3340,10 +3341,17 @@ ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,
 			reg |= IXGBE_MTQC_VT_ENA;
 		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
 
-		/* Disable drop for all queues */
-		for (q = 0; q < 128; q++)
-			IXGBE_WRITE_REG(hw, IXGBE_QDE,
-				(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+			/* Disable drop for all queues in VMDQ mode*/
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT)));
+		} else {
+			/* Enable drop for all queues in SRIOV mode */
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE | (q << IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));
+		}
 
 		/* Enable the Tx desc arbiter */
 		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
@@ -3378,7 +3386,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev *dev,
 			vmdq_tx_conf->nb_queue_pools == ETH_16_POOLS ? 0xFFFF : 0xFFFFFFFF);
 
 	/*Configure general DCB TX parameters*/
-	ixgbe_dcb_tx_hw_config(hw, dcb_config);
+	ixgbe_dcb_tx_hw_config(dev, dcb_config);
 }
 
 static void
@@ -3661,7 +3669,7 @@ ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,
 		/*get DCB TX configuration parameters from rte_eth_conf*/
 		ixgbe_dcb_tx_config(dev, dcb_config);
 		/*Configure general DCB TX parameters*/
-		ixgbe_dcb_tx_hw_config(hw, dcb_config);
+		ixgbe_dcb_tx_hw_config(dev, dcb_config);
 		break;
 	default:
 		PMD_INIT_LOG(ERR, "Incorrect DCB TX mode configuration");
@@ -3810,7 +3818,7 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
 	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
 		return;
 
-	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
+	if (dev->data->nb_rx_queues > ETH_DCB_NUM_QUEUES)
 		return;
 
 	/** Configure DCB hardware **/
@@ -4082,12 +4090,13 @@ ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev)
 		case ETH_MQ_RX_VMDQ_RSS:
 			ixgbe_config_vf_rss(dev);
 			break;
-
-		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB:
+			ixgbe_vmdq_dcb_configure(dev);
+			break;
+		/* FIXME if support DCB/RSS together with VMDq & SRIOV */
 		case ETH_MQ_RX_VMDQ_DCB_RSS:
 			PMD_INIT_LOG(ERR,
-				"Could not support DCB with VMDq & SRIOV");
+				"Could not support DCB/RSS with VMDq & SRIOV");
 			return -1;
 		default:
 			ixgbe_config_vf_default(dev);
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-26 14:38           ` Wu, Jingjing
@ 2016-10-26 15:29             ` Iremonger, Bernard
  2016-10-26 16:09               ` Iremonger, Bernard
  0 siblings, 1 reply; 35+ messages in thread
From: Iremonger, Bernard @ 2016-10-26 15:29 UTC (permalink / raw)
  To: Wu, Jingjing, dev, Shah, Rahul R, Lu, Wenzhuo, Dumitrescu, Cristian

Hi Jingjing,

<snip>

> > Subject: [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB
> > with SRIOV
> >
> > The folowing changes have been made to allow Data Centre Bridge
> > (DCB) configuration when SRIOV is enabled.
> >
> > Modify ixgbe_check_mq_mode function,
> > when SRIOV is enabled, enable mq_mode
> > ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.
> >
> > Modify ixgbe_dcb_tx_hw_config function, replace the struct ixgbe_hw
> > parameter with a struct rte_eth_dev parameter and handle SRIOV
> > enabled.
> >
> > Modify ixgbe_dev_mq_rx_configure function, when SRIOV is enabled,
> > enable mq_mode ETH_MQ_RX_VMDQ_DCB.
> >
> > Modify ixgbe_configure_dcb function,
> > revise check on dev->data->nb_rx_queues.
> >
> > Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
> >  drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-----------
> --
> >  2 files changed, 28 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index 4ca5747..4d5ce83 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev
> *dev)
> >  		/* check multi-queue mode */
> >  		switch (dev_conf->rxmode.mq_mode) {
> >  		case ETH_MQ_RX_VMDQ_DCB:
> > +			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB
> mode supported in SRIOV");
> > +			dev->data->dev_conf.rxmode.mq_mode =
> ETH_MQ_RX_VMDQ_DCB;
> This line is duplicated, mq_mode is ETH_MQ_RX_VMDQ_DCB already.

The mq_mode is assigned at this point in the other cases. This case is coded in line with the other cases.

>  and it's better to check if the nb_queue is valid.

What value is expected for nb_queue at this point?

Regards,

Bernard.


> 

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

* Re: [dpdk-dev] [PATCH v7] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-26 15:28           ` [dpdk-dev] [PATCH v7] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
@ 2016-10-26 15:41             ` Bruce Richardson
  0 siblings, 0 replies; 35+ messages in thread
From: Bruce Richardson @ 2016-10-26 15:41 UTC (permalink / raw)
  To: Bernard Iremonger; +Cc: dev

On Wed, Oct 26, 2016 at 04:28:40PM +0100, Bernard Iremonger wrote:
> The folowing changes have been made to allow Data Centre Bridge
> (DCB) configuration when SRIOV is enabled.
> 
> Modify ixgbe_check_mq_mode function,
> when SRIOV is enabled, enable mq_mode
> ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.
> 
> Modify ixgbe_dcb_tx_hw_config function,
> replace the struct ixgbe_hw parameter with a
> struct rte_eth_dev parameter and handle SRIOV enabled.
> 
> Modify ixgbe_dev_mq_rx_configure function,
> when SRIOV is enabled, enable mq_mode ETH_MQ_RX_VMDQ_DCB.
> 
> Modify ixgbe_configure_dcb function,
> revise check on dev->data->nb_rx_queues.
> 
> Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>

Applied to dpdk-next-net/rel_16_11 with commit message cut down to just
the high-level functional change.

/Bruce

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

* Re: [dpdk-dev] [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-26 15:29             ` Iremonger, Bernard
@ 2016-10-26 16:09               ` Iremonger, Bernard
  2016-10-26 16:33                 ` Wu, Jingjing
  0 siblings, 1 reply; 35+ messages in thread
From: Iremonger, Bernard @ 2016-10-26 16:09 UTC (permalink / raw)
  To: Wu, Jingjing, dev, Shah, Rahul R, Lu, Wenzhuo, Dumitrescu, Cristian

Hi Jingling,

<snip>

> > > Subject: [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB
> > > with SRIOV
> > >
> > > The folowing changes have been made to allow Data Centre Bridge
> > > (DCB) configuration when SRIOV is enabled.
> > >
> > > Modify ixgbe_check_mq_mode function, when SRIOV is enabled, enable
> > > mq_mode ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.
> > >
> > > Modify ixgbe_dcb_tx_hw_config function, replace the struct ixgbe_hw
> > > parameter with a struct rte_eth_dev parameter and handle SRIOV
> > > enabled.
> > >
> > > Modify ixgbe_dev_mq_rx_configure function, when SRIOV is enabled,
> > > enable mq_mode ETH_MQ_RX_VMDQ_DCB.
> > >
> > > Modify ixgbe_configure_dcb function, revise check on
> > > dev->data->nb_rx_queues.
> > >
> > > Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
> > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>
> > > ---
> > >  drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
> > >  drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++--------
> ---
> > --
> > >  2 files changed, 28 insertions(+), 18 deletions(-)
> > >
> > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > index 4ca5747..4d5ce83 100644
> > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > @@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev
> > *dev)
> > >  		/* check multi-queue mode */
> > >  		switch (dev_conf->rxmode.mq_mode) {
> > >  		case ETH_MQ_RX_VMDQ_DCB:
> > > +			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB
> > mode supported in SRIOV");
> > > +			dev->data->dev_conf.rxmode.mq_mode =
> > ETH_MQ_RX_VMDQ_DCB;
> > This line is duplicated, mq_mode is ETH_MQ_RX_VMDQ_DCB already.
> 
> The mq_mode is assigned at this point in the other cases. This case is coded
> in line with the other cases.
> 
> >  and it's better to check if the nb_queue is valid.
> 
The nb_rx_q and nb_tx_q are checked after the switch statements at line 2027 with the v6 patch applied.

Regards,

Bernard.

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

* Re: [dpdk-dev] [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
  2016-10-26 16:09               ` Iremonger, Bernard
@ 2016-10-26 16:33                 ` Wu, Jingjing
  0 siblings, 0 replies; 35+ messages in thread
From: Wu, Jingjing @ 2016-10-26 16:33 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Shah, Rahul R, Lu, Wenzhuo, Dumitrescu,
	Cristian



> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Thursday, October 27, 2016 12:10 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>; dev@dpdk.org; Shah, Rahul R
> <rahul.r.shah@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>
> Subject: RE: [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV
> 
> Hi Jingling,
> 
> <snip>
> 
> > > > Subject: [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB
> > > > with SRIOV
> > > >
> > > > The folowing changes have been made to allow Data Centre Bridge
> > > > (DCB) configuration when SRIOV is enabled.
> > > >
> > > > Modify ixgbe_check_mq_mode function, when SRIOV is enabled, enable
> > > > mq_mode ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB.
> > > >
> > > > Modify ixgbe_dcb_tx_hw_config function, replace the struct ixgbe_hw
> > > > parameter with a struct rte_eth_dev parameter and handle SRIOV
> > > > enabled.
> > > >
> > > > Modify ixgbe_dev_mq_rx_configure function, when SRIOV is enabled,
> > > > enable mq_mode ETH_MQ_RX_VMDQ_DCB.
> > > >
> > > > Modify ixgbe_configure_dcb function, revise check on
> > > > dev->data->nb_rx_queues.
> > > >
> > > > Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
> > > > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > > > Acked-by: Wenzhuo Lu <Wenzhuo.lu@intel.com>
> > > > ---
> > > >  drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
> > > >  drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++--------
> > ---
> > > --
> > > >  2 files changed, 28 insertions(+), 18 deletions(-)
> > > >
> > > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > > b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > > index 4ca5747..4d5ce83 100644
> > > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > > > @@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev
> > > *dev)
> > > >  		/* check multi-queue mode */
> > > >  		switch (dev_conf->rxmode.mq_mode) {
> > > >  		case ETH_MQ_RX_VMDQ_DCB:
> > > > +			PMD_INIT_LOG(INFO, "ETH_MQ_RX_VMDQ_DCB
> > > mode supported in SRIOV");
> > > > +			dev->data->dev_conf.rxmode.mq_mode =
> > > ETH_MQ_RX_VMDQ_DCB;
> > > This line is duplicated, mq_mode is ETH_MQ_RX_VMDQ_DCB already.
> >
> > The mq_mode is assigned at this point in the other cases. This case is coded
> > in line with the other cases.
> >
> > >  and it's better to check if the nb_queue is valid.
> >
> The nb_rx_q and nb_tx_q are checked after the switch statements at line 2027 with the v6
> patch applied.
Thanks, it's fine then. :)
> Regards,
> 
> Bernard.

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

* [dpdk-dev] [PATCH v7] app/testpmd: fix DCB configuration
  2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
  2016-10-26 14:30           ` Wu, Jingjing
  2016-10-26 15:28           ` [dpdk-dev] [PATCH v7] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
@ 2016-10-28 14:40           ` Bernard Iremonger
  2016-11-01 10:36             ` [dpdk-dev] [PATCH v8] " Bernard Iremonger
  2 siblings, 1 reply; 35+ messages in thread
From: Bernard Iremonger @ 2016-10-28 14:40 UTC (permalink / raw)
  To: dev, rahul.r.shah, jingjing.wu, wenzhuo.lu

Data Centre Bridge (DCB) configuration fails when SRIOV is
enabled if nb_rxq and nb_txq are not set to 1.

When dcb_mode is DCB_VT_ENABLED and max_vfs is greater than
zero, set nb_rxq and nb_txq to 1.

The failure occurs during configuration of the ixgbe PMD when
it is started, in the ixgbe_check_mq_mode function, if nb_rxq
and nb_txq are not set to 1.

Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

Changes in v7:
restore nb_rxq and nb_txq setting when max_vfs is 0.
---
 app/test-pmd/testpmd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6185be6..96f5011 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2002,8 +2002,13 @@ init_port_dcb_config(portid_t pid,
 	 * and has the same number of rxq and txq in dcb mode
 	 */
 	if (dcb_mode == DCB_VT_ENABLED) {
-		nb_rxq = rte_port->dev_info.max_rx_queues;
-		nb_txq = rte_port->dev_info.max_tx_queues;
+		if (rte_port->dev_info.max_vfs > 0) {
+			nb_rxq = 1;
+			nb_txq = 1;
+		} else {
+			nb_rxq = rte_port->dev_info.max_rx_queues;
+			nb_txq = rte_port->dev_info.max_tx_queues;
+		}
 	} else {
 		/*if vt is disabled, use all pf queues */
 		if (rte_port->dev_info.vmdq_pool_base == 0) {
-- 
2.4.3

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

* [dpdk-dev] [PATCH v8] app/testpmd: fix DCB configuration
  2016-10-28 14:40           ` [dpdk-dev] [PATCH v7] app/testpmd: fix DCB configuration Bernard Iremonger
@ 2016-11-01 10:36             ` Bernard Iremonger
  2016-11-03 17:35               ` [dpdk-dev] [PATCH v9] " Bernard Iremonger
  0 siblings, 1 reply; 35+ messages in thread
From: Bernard Iremonger @ 2016-11-01 10:36 UTC (permalink / raw)
  To: dev, rahul.r.shah, jingjing.wu, wenzhuo.lu

Data Centre Bridge (DCB) configuration fails when SRIOV is
enabled if nb_rxq and nb_txq are not set to 1.

The failure occurs during configuration of the ixgbe PMD when
it is started, in the ixgbe_check_mq_mode function.

Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 Changes in v8:
 revise commit message.

 Changes in v7:
 restore nb_rxq and nb_txq setting when max_vfs is 0

 app/test-pmd/testpmd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6185be6..96f5011 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2002,8 +2002,13 @@ init_port_dcb_config(portid_t pid,
 	 * and has the same number of rxq and txq in dcb mode
 	 */
 	if (dcb_mode == DCB_VT_ENABLED) {
-		nb_rxq = rte_port->dev_info.max_rx_queues;
-		nb_txq = rte_port->dev_info.max_tx_queues;
+		if (rte_port->dev_info.max_vfs > 0) {
+			nb_rxq = 1;
+			nb_txq = 1;
+		} else {
+			nb_rxq = rte_port->dev_info.max_rx_queues;
+			nb_txq = rte_port->dev_info.max_tx_queues;
+		}
 	} else {
 		/*if vt is disabled, use all pf queues */
 		if (rte_port->dev_info.vmdq_pool_base == 0) {
-- 
2.4.3

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

* [dpdk-dev] [PATCH v9] app/testpmd: fix DCB configuration
  2016-11-01 10:36             ` [dpdk-dev] [PATCH v8] " Bernard Iremonger
@ 2016-11-03 17:35               ` Bernard Iremonger
  2016-11-04  5:40                 ` Wu, Jingjing
  0 siblings, 1 reply; 35+ messages in thread
From: Bernard Iremonger @ 2016-11-03 17:35 UTC (permalink / raw)
  To: dev, rahul.r.shah, jingjing.wu, wenzhuo.lu

Data Centre Bridge (DCB) configuration fails when SRIOV is
enabled if nb_rxq or nb_txq are greater than nb_q_per_pool.

The failure occurs during configuration of the ixgbe PMD when
it is started, in the ixgbe_check_mq_mode function.

Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 Changes in v9:
 when max_vfs is greater then 0, set nb_rxq and nb_txq to
 dev_info.nb_rx_queues and dev_info.nb_tx_queues.

 Changes in v8:
 revise commit message.

 Changes in v7:
 restore nb_rxq and nb_txq setting when max_vfs is 0

 app/test-pmd/testpmd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6185be6..a0332c2 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2002,8 +2002,13 @@ init_port_dcb_config(portid_t pid,
 	 * and has the same number of rxq and txq in dcb mode
 	 */
 	if (dcb_mode == DCB_VT_ENABLED) {
-		nb_rxq = rte_port->dev_info.max_rx_queues;
-		nb_txq = rte_port->dev_info.max_tx_queues;
+		if (rte_port->dev_info.max_vfs > 0) {
+			nb_rxq = rte_port->dev_info.nb_rx_queues;
+			nb_txq = rte_port->dev_info.nb_tx_queues;
+		} else {
+			nb_rxq = rte_port->dev_info.max_rx_queues;
+			nb_txq = rte_port->dev_info.max_tx_queues;
+		}
 	} else {
 		/*if vt is disabled, use all pf queues */
 		if (rte_port->dev_info.vmdq_pool_base == 0) {
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v9] app/testpmd: fix DCB configuration
  2016-11-03 17:35               ` [dpdk-dev] [PATCH v9] " Bernard Iremonger
@ 2016-11-04  5:40                 ` Wu, Jingjing
  2016-11-07 15:56                   ` Thomas Monjalon
  0 siblings, 1 reply; 35+ messages in thread
From: Wu, Jingjing @ 2016-11-04  5:40 UTC (permalink / raw)
  To: Iremonger, Bernard, dev, Shah, Rahul R, Lu, Wenzhuo



> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Friday, November 4, 2016 1:36 AM
> To: dev@dpdk.org; Shah, Rahul R <rahul.r.shah@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v9] app/testpmd: fix DCB configuration
> 
> Data Centre Bridge (DCB) configuration fails when SRIOV is enabled if nb_rxq
> or nb_txq are greater than nb_q_per_pool.
> 
> The failure occurs during configuration of the ixgbe PMD when it is started, in
> the ixgbe_check_mq_mode function.
> 
> Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

Acked-by: Jingjing Wu <jingjing.wu@intel.com>

Thanks
Jingjing

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

* Re: [dpdk-dev] [PATCH v9] app/testpmd: fix DCB configuration
  2016-11-04  5:40                 ` Wu, Jingjing
@ 2016-11-07 15:56                   ` Thomas Monjalon
  0 siblings, 0 replies; 35+ messages in thread
From: Thomas Monjalon @ 2016-11-07 15:56 UTC (permalink / raw)
  To: Iremonger, Bernard; +Cc: dev, Wu, Jingjing, Shah, Rahul R, Lu, Wenzhuo

> > Data Centre Bridge (DCB) configuration fails when SRIOV is enabled if nb_rxq
> > or nb_txq are greater than nb_q_per_pool.
> > 
> > The failure occurs during configuration of the ixgbe PMD when it is started, in
> > the ixgbe_check_mq_mode function.
> > 
> > Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")
> > 
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> 
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>

Applied, thanks

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

end of thread, other threads:[~2016-11-07 15:56 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-26  9:08 [dpdk-dev] [PATCH] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
2016-09-21 11:07 ` Remy Horton
2016-10-14 13:29 ` [dpdk-dev] [PATCH v2] " Bernard Iremonger
2016-10-17  6:12   ` Lu, Wenzhuo
2016-10-17 16:27     ` Iremonger, Bernard
2016-10-18  1:07       ` Lu, Wenzhuo
2016-10-18  8:58         ` Iremonger, Bernard
2016-10-19  0:39           ` Lu, Wenzhuo
2016-10-19 10:16             ` Iremonger, Bernard
2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 0/2] net/ixgbe: " Bernard Iremonger
2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 " Bernard Iremonger
2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 " Bernard Iremonger
2016-10-25  0:31         ` Lu, Wenzhuo
2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 " Bernard Iremonger
2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 1/2] net/ixgbe: support multiqueue mode " Bernard Iremonger
2016-10-26 14:38           ` Wu, Jingjing
2016-10-26 15:29             ` Iremonger, Bernard
2016-10-26 16:09               ` Iremonger, Bernard
2016-10-26 16:33                 ` Wu, Jingjing
2016-10-25 16:51         ` [dpdk-dev] [PATCH v6 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
2016-10-26 14:30           ` Wu, Jingjing
2016-10-26 15:28           ` [dpdk-dev] [PATCH v7] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
2016-10-26 15:41             ` Bruce Richardson
2016-10-28 14:40           ` [dpdk-dev] [PATCH v7] app/testpmd: fix DCB configuration Bernard Iremonger
2016-11-01 10:36             ` [dpdk-dev] [PATCH v8] " Bernard Iremonger
2016-11-03 17:35               ` [dpdk-dev] [PATCH v9] " Bernard Iremonger
2016-11-04  5:40                 ` Wu, Jingjing
2016-11-07 15:56                   ` Thomas Monjalon
2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
2016-10-20  1:24         ` Lu, Wenzhuo
2016-10-19 10:21       ` [dpdk-dev] [PATCH v5 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
2016-10-17 17:01     ` [dpdk-dev] [PATCH v4 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger
2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV Bernard Iremonger
2016-10-17 16:07   ` [dpdk-dev] [PATCH v3 2/2] app/test_pmd: fix DCB configuration Bernard Iremonger

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