Skip to contentSkip to conversation

net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

PATCH Superseded Bernard Iremonger 6 participants 35 messages Aug 26, 2016 – Nov 7, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
 2 files changed, 25 insertions(+), 21 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +4 -5
index fb618ef..3e62e9e 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +21 -16
index 8a306b0..bef5ef5 100644
@@ -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);
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Bernard Iremonger

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

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
 2 files changed, 25 insertions(+), 21 deletions(-)
#2 lore raw

PATCH v2 1/1 net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

In reply to 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

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
 2 files changed, 25 insertions(+), 21 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +4 -5
index 4ca5747..114698d 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +21 -16
index 2ce8234..bb13889 100644
@@ -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);
Signature · 1 line
2.10.1
#3 lore raw

Hi Bernard, Rahul,

Quoted 10 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Friday, October 14, 2016 9:29 PM
To: [email protected]; 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.

Quoted 16 lines

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

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
 2 files changed, 25 insertions(+), 21 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 4ca5747..114698d 100644

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev *dev) · line 1979

Quoted 3 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
@@ -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?

Quoted 80 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -0
+			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

*/

drivers/net/ixgbe/ixgbe_ethdev.c +2 -5
 			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;

drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 			break;
drivers/net/ixgbe/ixgbe_rxtx.c index renamed from drivers/net/ixgbe/ixgbe_rxtx.c +0 -0

2ce8234..bb13889 100644

drivers/net/ixgbe/ixgbe_rxtx.c +4 -3
@@ -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,

drivers/net/ixgbe/ixgbe_rxtx.c +0 -5
 		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)));

drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		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));

drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		} 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)));

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw, · line 3353

Quoted 1 line
drivers/net/ixgbe/ixgbe_rxtx.c +1 -0
+		}

I think it has nothing to do with mq mode. Do I miss something?

Quoted 23 lines
drivers/net/ixgbe/ixgbe_rxtx.c +1 -0
 		/* 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);

drivers/net/ixgbe/ixgbe_rxtx.c +2 -2
 	/*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");

drivers/net/ixgbe/ixgbe_rxtx.c void ixgbe_configure_dcb(struct rte_eth_dev *dev) · line 3814

Quoted 5 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -2
@@ -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?

Quoted 25 lines
drivers/net/ixgbe/ixgbe_rxtx.c +4 -4
-
 	/** 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;
drivers/net/ixgbe/ixgbe_rxtx.c +0 -1
 		default:
 			ixgbe_config_vf_default(dev);
--

2.10.1

#9 lore raw

v3 cover net/ixgbe: VMDq DCB with SRIOV

In reply to 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(-)
Signature · 1 line
2.10.1
#33 lore raw

PATCH v3 1/2 net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

In reply to 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.

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++----------------
 2 files changed, 25 insertions(+), 21 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +4 -5
index 4ca5747..114698d 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +21 -16
index 2ce8234..bb13889 100644
@@ -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);
Signature · 1 line
2.10.1
#34 lore raw

PATCH v3 2/2 app/test_pmd: fix DCB configuration

In reply to Bernard Iremonger

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

Fixes 2a977b891f99 ("app/testpmd: fix DCB configuration")
---
 app/test-pmd/testpmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/testpmd.c +2 -2
index 6185be6..ee567c3 100644
@@ -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) {
Signature · 1 line
2.10.1
#4 lore raw
In reply to Lu, Wenzhuo

Hi Wenzhuo,

<snip>

Quoted 8 lines
Quoted 6 lines

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.

Quoted 18 lines
Quoted 8 lines

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

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  9 ++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 37 +++++++++++++++++++++------------

----

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev

Quoted 8 lines
 2 files changed, 25 insertions(+), 21 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 4ca5747..114698d 100644
@@ -1977,6 +1977,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev

*dev)

Quoted 4 lines

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev *dev) · line 1979

Quoted 3 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 		/* 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.

Quoted 80 lines

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev · line 1984

Quoted 5 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -0
+			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 */

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev

Quoted 2 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 			PMD_INIT_LOG(ERR, "SRIOV active,"
@@ -2012,11 +2014,8 @@ ixgbe_check_mq_mode(struct rte_eth_dev

*dev)

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev *dev)

Quoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -5
 		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

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev · line 2020

Quoted 3 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
 supported in SRIOV");
+			break;
 		default: /* ETH_MQ_TX_VMDQ_ONLY or

ETH_MQ_TX_NONE */

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev · line 2021

Quoted 1 line
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 			dev->data->dev_conf.txmode.mq_mode =

ETH_MQ_TX_VMDQ_ONLY;

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_vmdq_dcb_configure(struct

Quoted 16 lines
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
 			break;
(quoted diff) +0 -0

b/drivers/net/ixgbe/ixgbe_rxtx.c index
2ce8234..bb13889 100644

drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
@@ -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

Quoted 18 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -0
 *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

drivers/net/ixgbe/ixgbe_rxtx.c +2 -1
-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-
Quoted 1 line

dev_private);

drivers/net/ixgbe/ixgbe_rxtx.c

Quoted 2 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -0
 	PMD_INIT_FUNC_TRACE();
 	if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11 +3340,17

@@

Quoted 16 lines

ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,

drivers/net/ixgbe/ixgbe_rxtx.c +0 -5
 		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)));

drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		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));

Quoted 8 lines

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw, · line 3353

Quoted 7 lines
drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		} 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)));

drivers/net/ixgbe/ixgbe_rxtx.c +1 -0
+		}

I think it has nothing to do with mq mode. Do I miss something?

Behavior is different when SRIOV is enabled.

Quoted 26 lines

drivers/net/ixgbe/ixgbe_rxtx.c

Quoted 6 lines
drivers/net/ixgbe/ixgbe_rxtx.c +1 -0
 		/* 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

?

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_hw_configure(struct rte_eth_dev

Quoted 9 lines

0xFFFF : 0xFFFFFFFF);

drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 	/*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,

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,

Quoted 8 lines
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 		/*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"); @@

Quoted 8 lines

drivers/net/ixgbe/ixgbe_rxtx.c void ixgbe_configure_dcb(struct rte_eth_dev *dev) · line 3814

Quoted 6 lines

-3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)

drivers/net/ixgbe/ixgbe_rxtx.c +0 -2
 	    (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.

Quoted 20 lines

drivers/net/ixgbe/ixgbe_rxtx.c void ixgbe_configure_dcb(struct rte_eth_dev *dev)

Quoted 4 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -1
-
 	/** Configure DCB hardware **/
 	ixgbe_dcb_hw_configure(dev, dcb_cfg);  } @@ -4082,12 +4086,13

@@

Quoted 4 lines

ixgbe_dev_mq_rx_configure(struct rte_eth_dev
*dev)

drivers/net/ixgbe/ixgbe_rxtx.c +0 -0
 		case ETH_MQ_RX_VMDQ_RSS:
 			ixgbe_config_vf_rss(dev);

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dev_mq_rx_configure(struct rte_eth_dev *dev)

Quoted 10 lines
drivers/net/ixgbe/ixgbe_rxtx.c +3 -3
 			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");

Quoted 7 lines
Quoted 7 lines
drivers/net/ixgbe/ixgbe_rxtx.c +1 -0
+				"Could not support DCB/RSS with VMDq &

SRIOV");

drivers/net/ixgbe/ixgbe_rxtx.c +0 -1
 			return -1;
 		default:
 			ixgbe_config_vf_default(dev);
--

2.10.1

Regards,

Bernard.

#10 lore raw

v4 cover net/ixgbe: VMDq DCB with SRIOV

In reply to 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(-)
Signature · 1 line
2.10.1
#31 lore raw

PATCH v4 1/2 net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

In reply to 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.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 36 ++++++++++++++++++++++--------------
 2 files changed, 28 insertions(+), 19 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +6 -5
index 4ca5747..4d5ce83 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +22 -14
index 2ce8234..4c13ed2 100644
@@ -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);
Signature · 1 line
2.10.1
#32 lore raw

PATCH v4 2/2 app/test_pmd: fix DCB configuration

In reply to Bernard Iremonger

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

Fixes 2a977b891f99 ("app/testpmd: fix DCB configuration")
---
 app/test-pmd/testpmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/testpmd.c +2 -2
index 6185be6..ee567c3 100644
@@ -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) {
Signature · 1 line
2.10.1
#5 lore raw
In reply to Iremonger, Bernard

Hi Bernard,

Quoted 36 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Tuesday, October 18, 2016 12:27 AM
To: Lu, Wenzhuo; [email protected]; Shah, Rahul R
Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

Hi Wenzhuo,

Quoted 18 lines
Quoted 1 line

if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11 +3340,17

@@

Quoted 16 lines

ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,

drivers/net/ixgbe/ixgbe_rxtx.c +0 -5
 		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)));

drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		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));

Quoted 8 lines

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw, · line 3353

Quoted 7 lines
drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		} 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)));

drivers/net/ixgbe/ixgbe_rxtx.c +1 -0
+		}

I think it has nothing to do with mq mode. Do I miss something?

Quoted 1 line

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.

Quoted 31 lines
Quoted 31 lines

Review

Quoted 7 lines
(quoted diff) +1 -0
 		/* 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

?

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_hw_configure(struct rte_eth_dev

Quoted 9 lines

0xFFFF : 0xFFFFFFFF);

drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 	/*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,

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,

Quoted 8 lines
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 		/*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"); @@

Quoted 4 lines

-3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)

drivers/net/ixgbe/ixgbe_rxtx.c +0 -0
 	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB_RSS))
 		return;
Quoted 6 lines
Quoted 4 lines

drivers/net/ixgbe/ixgbe_rxtx.c void ixgbe_configure_dcb(struct rte_eth_dev *dev) · line 3814

Quoted 2 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -2
-	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...

#6 lore raw

Hi Wenzhuo,

<snip>

Quoted 32 lines
Quoted 32 lines

Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

Hi Wenzhuo,

Quoted 26 lines
Quoted 1 line

if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11 +3340,17

@@

Quoted 22 lines

ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,

drivers/net/ixgbe/ixgbe_rxtx.c +0 -5
 		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)));

drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		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));

drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		} 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)));

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw, · line 3353

Quoted 1 line
drivers/net/ixgbe/ixgbe_rxtx.c +1 -0
+		}

I think it has nothing to do with mq mode. Do I miss something?

Quoted 6 lines
Quoted 1 line

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

Quoted 34 lines
Quoted 24 lines
Quoted 24 lines

Review

Quoted 4 lines
(quoted diff) +1 -0
 		/* 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

?

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_hw_configure(struct rte_eth_dev

Quoted 9 lines

0xFFFF : 0xFFFFFFFF);

drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 	/*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,

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,

Quoted 8 lines
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 		/*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"); @@

Quoted 1 line
Quoted 1 line
Quoted 1 line

-3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev

*dev)

Quoted 8 lines
Quoted 7 lines

drivers/net/ixgbe/ixgbe_rxtx.c void ixgbe_configure_dcb(struct rte_eth_dev *dev) · line 3814

Quoted 5 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -2
 	    (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?

Quoted 5 lines
Quoted 1 line

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

#7 lore raw

Hi Bernard,

Quoted 18 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Tuesday, October 18, 2016 4:58 PM
To: Lu, Wenzhuo; [email protected]; Shah, Rahul R
Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

Hi Wenzhuo,

<snip>

Quoted 7 lines
Quoted 7 lines

Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

Hi Wenzhuo,

Quoted 2 lines
Quoted 1 line

if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11 +3340,17

@@

Quoted 17 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,

drivers/net/ixgbe/ixgbe_rxtx.c +0 -3
 		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++)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,

Quoted 8 lines
(quoted diff) +0 -2
-			IXGBE_WRITE_REG(hw, IXGBE_QDE,
-				(IXGBE_QDE_WRITE | (q <<

IXGBE_QDE_IDX_SHIFT)));

drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		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 <<

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

IXGBE_QDE_IDX_SHIFT) | IXGBE_QDE_ENABLE));

This code is used to enable drop, but the comments say 'disable drop'.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,

Quoted 5 lines
drivers/net/ixgbe/ixgbe_rxtx.c +5 -0
+		} 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 <<

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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?

Quoted 10 lines
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw, · line 3353

Quoted 1 line
drivers/net/ixgbe/ixgbe_rxtx.c +1 -0
+		}

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.

Quoted 7 lines

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

Quoted 36 lines
Quoted 36 lines
Quoted 26 lines
Quoted 26 lines

Review

Quoted 6 lines
(quoted diff) +1 -0
 		/* 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

?

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_hw_configure(struct rte_eth_dev

Quoted 9 lines

0xFFFF : 0xFFFFFFFF);

drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 	/*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,

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,

Quoted 8 lines
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 		/*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"); @@

Quoted 1 line
Quoted 1 line
Quoted 1 line

-3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev

*dev)

Quoted 8 lines
Quoted 7 lines

drivers/net/ixgbe/ixgbe_rxtx.c void ixgbe_configure_dcb(struct rte_eth_dev *dev) · line 3814

Quoted 5 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -2
 	    (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?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

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

Quoted 4 lines

Regards,

Bernard

#8 lore raw

Hi Wenzhuo,

<snip>

Quoted 21 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Subject: RE: [PATCH v2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

Hi Wenzhuo,

Quoted 3 lines
Quoted 2 lines

if (hw->mac.type != ixgbe_mac_82598EB) { @@ -3339,11
+3340,17

@@

Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,

drivers/net/ixgbe/ixgbe_rxtx.c +0 -0
 		if (dcb_config->vt_mode)
 			reg |= IXGBE_MTQC_VT_ENA;
 		IXGBE_WRITE_REG(hw, IXGBE_MTQC, reg);
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -5
-
-		/* 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)));

(quoted diff) +2 -0
+		if (RTE_ETH_DEV_SRIOV(dev).active == 0) {
+			/* Disable drop for all queues in VMDQ

mode*/

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,

Quoted 3 lines
drivers/net/ixgbe/ixgbe_rxtx.c +3 -0
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE |

(q <<

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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.

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+		} else {
+			/* Enable drop for all queues in SRIOV mode

*/

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw,

Quoted 3 lines
drivers/net/ixgbe/ixgbe_rxtx.c +3 -0
+			for (q = 0; q < 128; q++)
+				IXGBE_WRITE_REG(hw, IXGBE_QDE,
+						(IXGBE_QDE_WRITE |

(q <<

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

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.

Quoted 2 lines

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.

Quoted 60 lines
Quoted 10 lines
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_tx_hw_config(struct ixgbe_hw *hw, · line 3353

Quoted 1 line
drivers/net/ixgbe/ixgbe_rxtx.c +1 -0
+		}

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.

Quoted 7 lines

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

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Review

Quoted 4 lines
(quoted diff) +0 -0
 		/* Enable the Tx desc arbiter */
 		reg = IXGBE_READ_REG(hw, IXGBE_RTTDCS); @@ -

3378,7

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Review

Quoted 3 lines

+3385,7 @@ ixgbe_vmdq_dcb_hw_tx_config(struct rte_eth_dev

(quoted diff) +1 -0
+*dev,
 			vmdq_tx_conf->nb_queue_pools ==

ETH_16_POOLS

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

?

Quoted 7 lines

0xFFFF : 0xFFFFFFFF);

drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 	/*Configure general DCB TX parameters*/
-	ixgbe_dcb_tx_hw_config(hw, dcb_config);
+	ixgbe_dcb_tx_hw_config(dev, dcb_config);
 }
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

static void

(quoted diff) +0 -0
@@ -3661,7 +3668,7 @@ ixgbe_dcb_hw_configure(struct

rte_eth_dev

*dev,

Quoted 1 line

/*get DCB TX configuration parameters from

rte_eth_conf*/

Quoted 18 lines
Quoted 18 lines
Quoted 9 lines
Quoted 9 lines

drivers/net/ixgbe/ixgbe_rxtx.c ixgbe_dcb_hw_configure(struct rte_eth_dev *dev,

Quoted 7 lines
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
 		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"); @@

Quoted 1 line

-3810,9 +3817,6 @@ void ixgbe_configure_dcb(struct rte_eth_dev

*dev)

Quoted 8 lines
Quoted 7 lines

drivers/net/ixgbe/ixgbe_rxtx.c void ixgbe_configure_dcb(struct rte_eth_dev *dev) · line 3814

Quoted 5 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -2
 	    (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?

Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

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

#11 lore raw

v5 cover net/ixgbe: VMDq DCB with SRIOV

In reply to 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(-)
Signature · 1 line
2.10.1
#28 lore raw

PATCH v5 1/2 net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

In reply to 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.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
 2 files changed, 28 insertions(+), 18 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +6 -5
index 4ca5747..4d5ce83 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +22 -13
index 2ce8234..b2d9f45 100644
@@ -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);
Signature · 1 line
2.10.1
#30 lore raw

PATCH v5 2/2 app/test_pmd: fix DCB configuration

In reply to Bernard Iremonger

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

Fixes 2a977b891f99 ("app/testpmd: fix DCB configuration")
---
 app/test-pmd/testpmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/testpmd.c +2 -2
index 6185be6..ee567c3 100644
@@ -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) {
Signature · 1 line
2.10.1
Acked-by on v5 1/2
#29 lore raw
In reply to Bernard Iremonger

Hi,

Quoted 16 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Wednesday, October 19, 2016 6:21 PM
To: [email protected]; 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.

Quoted 8 lines

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.

#12 lore raw

Re: [PATCH v5 0/2] net/ixgbe: VMDq DCB with SRIOV

In reply to Bernard Iremonger

Hi,

Quoted 25 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Wednesday, October 19, 2016 6:21 PM
To: [email protected]; 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

Quoted 7 lines
 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

#13 lore raw

v6 cover net/ixgbe: VMDq DCB with SRIOV

In reply to 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(-)
Signature · 1 line
2.10.1
#14 lore raw

PATCH v6 1/2 net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

In reply to 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.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
 2 files changed, 28 insertions(+), 18 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +6 -5
index 4ca5747..4d5ce83 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +22 -13
index 2ce8234..b2d9f45 100644
@@ -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);
Signature · 1 line
2.10.1
#19 lore raw

PATCH v6 2/2 app/test_pmd: fix DCB configuration

In reply to 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")
---
 app/test-pmd/testpmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/testpmd.c +2 -2
index 6185be6..ee567c3 100644
@@ -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) {
Signature · 1 line
2.10.1
#20 lore raw

Re: [PATCH v6 2/2] app/test_pmd: fix DCB configuration

app/test-pmd/testpmd.c init_port_dcb_config(portid_t pid, · line 2006

Quoted 6 lines
app/test-pmd/testpmd.c +2 -2
 	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

#15 lore raw
In reply to Bernard Iremonger
Quoted 41 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Wednesday, October 26, 2016 12:51 AM
To: [email protected]; Shah, Rahul R <[email protected]>; Lu, Wenzhuo <[email protected]>; Dumitrescu, Cristian <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Iremonger, Bernard <[email protected]>
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.

---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-------------
 2 files changed, 28 insertions(+), 18 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 4ca5747..4d5ce83 100644

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev *dev) · line 1981

Quoted 5 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -0
@@ -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.

#16 lore raw

Hi Jingjing,

<snip>

Quoted 36 lines
Quoted 20 lines

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.

Quoted 6 lines
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++-----------

--

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev

Quoted 8 lines
 2 files changed, 28 insertions(+), 18 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 4ca5747..4d5ce83 100644
@@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev

*dev)

Quoted 8 lines

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev *dev)

Quoted 4 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
 		/* 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");

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev · line 1981

Quoted 1 line
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
+			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.

Quoted 1 line

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

What value is expected for nb_queue at this point?

Regards,

Bernard.

Quoted 1 line
#21 lore raw

PATCH v7 1/1 net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

In reply to 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.

---

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(-)
drivers/net/ixgbe/ixgbe_ethdev.c +5 -5
index 4ca5747..3445a76 100644
@@ -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;
drivers/net/ixgbe/ixgbe_rxtx.c +22 -13
index 2ce8234..b2d9f45 100644
@@ -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);
Signature · 1 line
2.7.4
#22 lore raw
Quoted 14 lines · 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.

Quoted 6 lines

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

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

/Bruce

#17 lore raw
In reply to Iremonger, Bernard

Hi Jingling,

<snip>

Quoted 41 lines
Quoted 19 lines
Quoted 19 lines

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.

Quoted 6 lines
Quoted 6 lines
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++--------

---

Quoted 15 lines

--

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev

Quoted 8 lines
 2 files changed, 28 insertions(+), 18 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 4ca5747..4d5ce83 100644
@@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev

*dev)

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev *dev)

Quoted 4 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
 		/* 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");

Quoted 9 lines
Quoted 3 lines

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev · line 1981

Quoted 1 line
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
+			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.

Quoted 1 line

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.

#18 lore raw
Quoted 59 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Thursday, October 27, 2016 12:10 AM
To: Wu, Jingjing <[email protected]>; [email protected]; Shah, Rahul R <[email protected]>; Lu, Wenzhuo <[email protected]>; Dumitrescu, Cristian <[email protected]>
Subject: RE: [PATCH v6 1/2] net/ixgbe: support multiqueue mode VMDq DCB with SRIOV

Hi Jingling,

<snip>

Quoted 45 lines
Quoted 19 lines
Quoted 19 lines

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.

Quoted 6 lines
Quoted 6 lines
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++-----
 drivers/net/ixgbe/ixgbe_rxtx.c   | 35 ++++++++++++++++++++++--------

---

Quoted 18 lines

--

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev

Quoted 8 lines
 2 files changed, 28 insertions(+), 18 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 4ca5747..4d5ce83 100644
@@ -1977,6 +1977,9 @@ ixgbe_check_mq_mode(struct rte_eth_dev

*dev)

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev *dev)

Quoted 4 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
 		/* 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");

drivers/net/ixgbe/ixgbe_ethdev.c ixgbe_check_mq_mode(struct rte_eth_dev · line 1981

Quoted 1 line
drivers/net/ixgbe/ixgbe_ethdev.c +1 -0
+			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.

Quoted 7 lines
Quoted 5 lines

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

Quoted 1 line

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

Quoted 3 lines

Regards,

Bernard.

#23 lore raw

PATCH v7 1/1 app/testpmd: fix DCB configuration

In reply to 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 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")

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(-)
app/test-pmd/testpmd.c +7 -2
index 6185be6..96f5011 100644
@@ -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) {
Signature · 1 line
2.4.3
#24 lore raw

PATCH v8 1/1 app/testpmd: fix DCB configuration

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

---
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(-)
app/test-pmd/testpmd.c +7 -2
index 6185be6..96f5011 100644
@@ -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) {
Signature · 1 line
2.4.3
#25 lore raw

PATCH v9 1/1 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")

---
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(-)
app/test-pmd/testpmd.c +7 -2
index 6185be6..a0332c2 100644
@@ -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) {
Signature · 1 line
2.10.1
Acked-by on v9 1/1
#26 lore raw

Re: [PATCH v9] app/testpmd: fix DCB configuration

Quoted 13 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Friday, November 4, 2016 1:36 AM
To: [email protected]; Shah, Rahul R <[email protected]>; Wu, Jingjing <[email protected]>; Lu, Wenzhuo <[email protected]>
Cc: Iremonger, Bernard <[email protected]>
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.

Quoted 6 lines

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

Thanks
Jingjing

#27 lore raw

Re: [PATCH v9] app/testpmd: fix DCB configuration

Quoted 11 lines
Quoted 9 lines

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

Applied, thanks