All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/ixgbe: fix PF DCB info
@ 2017-10-23  6:43 Wei Dai
  2017-10-24  2:50 ` Wu, Jingjing
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Dai @ 2017-10-23  6:43 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev, jingjing.wu; +Cc: dev, Wei Dai, stable

When SRIOV is active, the function ixgbe_dev_get_dcb_info( )
should return the DCB traffic class info of its own queues,
not including any DCB info of the queues of any its VF.
When VMDQ is active, all queues are belonged to the PF,
the function ixgbe_dev_get_dcb_info can return DCB info
of all queues.

Fixes: 89d6728c7837 ("ethdev: get DCB information")
Cc: stable@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 14b9c53..2ff9041 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -7229,6 +7229,8 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev,
 	struct ixgbe_dcb_config *dcb_config =
 			IXGBE_DEV_PRIVATE_TO_DCB_CFG(dev->data->dev_private);
 	struct ixgbe_dcb_tc_config *tc;
+	struct rte_eth_dcb_tc_queue_mapping *tc_queue;
+	uint8_t nb_tcs;
 	uint8_t i, j;
 
 	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_DCB_FLAG)
@@ -7236,19 +7238,31 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev,
 	else
 		dcb_info->nb_tcs = 1;
 
+	tc_queue = &dcb_info->tc_queue;
+	nb_tcs = dcb_info->nb_tcs;
+
 	if (dcb_config->vt_mode) { /* vt is enabled*/
 		struct rte_eth_vmdq_dcb_conf *vmdq_rx_conf =
 				&dev->data->dev_conf.rx_adv_conf.vmdq_dcb_conf;
 		for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++)
 			dcb_info->prio_tc[i] = vmdq_rx_conf->dcb_tc[i];
-		for (i = 0; i < vmdq_rx_conf->nb_queue_pools; i++) {
-			for (j = 0; j < dcb_info->nb_tcs; j++) {
-				dcb_info->tc_queue.tc_rxq[i][j].base =
-						i * dcb_info->nb_tcs + j;
-				dcb_info->tc_queue.tc_rxq[i][j].nb_queue = 1;
-				dcb_info->tc_queue.tc_txq[i][j].base =
-						i * dcb_info->nb_tcs + j;
-				dcb_info->tc_queue.tc_txq[i][j].nb_queue = 1;
+		if (RTE_ETH_DEV_SRIOV(dev).active > 0) {
+			for (j = 0; j < nb_tcs; j++) {
+				tc_queue->tc_rxq[0][j].base = j;
+				tc_queue->tc_rxq[0][j].nb_queue = 1;
+				tc_queue->tc_txq[0][j].base = j;
+				tc_queue->tc_txq[0][j].nb_queue = 1;
+			}
+		} else {
+			for (i = 0; i < vmdq_rx_conf->nb_queue_pools; i++) {
+				for (j = 0; j < nb_tcs; j++) {
+					tc_queue->tc_rxq[i][j].base =
+						i * nb_tcs + j;
+					tc_queue->tc_rxq[i][j].nb_queue = 1;
+					tc_queue->tc_txq[i][j].base =
+						i * nb_tcs + j;
+					tc_queue->tc_txq[i][j].nb_queue = 1;
+				}
 			}
 		}
 	} else { /* vt is disabled*/
-- 
2.5.5

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

* Re: [PATCH] net/ixgbe: fix PF DCB info
  2017-10-23  6:43 [PATCH] net/ixgbe: fix PF DCB info Wei Dai
@ 2017-10-24  2:50 ` Wu, Jingjing
  2017-10-24 17:42   ` [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Wu, Jingjing @ 2017-10-24  2:50 UTC (permalink / raw)
  To: Dai, Wei, Lu, Wenzhuo, Ananyev, Konstantin; +Cc: dev, stable



> -----Original Message-----
> From: Dai, Wei
> Sent: Monday, October 23, 2017 2:44 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/ixgbe: fix PF DCB info
> 
> When SRIOV is active, the function ixgbe_dev_get_dcb_info( ) should return the
> DCB traffic class info of its own queues, not including any DCB info of the
> queues of any its VF.
> When VMDQ is active, all queues are belonged to the PF, the function
> ixgbe_dev_get_dcb_info can return DCB info of all queues.
> 
> Fixes: 89d6728c7837 ("ethdev: get DCB information")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Dai <wei.dai@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>

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

* Re: [dpdk-stable] [PATCH] net/ixgbe: fix PF DCB info
  2017-10-24  2:50 ` Wu, Jingjing
@ 2017-10-24 17:42   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-10-24 17:42 UTC (permalink / raw)
  To: Wu, Jingjing, Dai, Wei, Lu, Wenzhuo, Ananyev, Konstantin; +Cc: dev, stable

On 10/23/2017 7:50 PM, Wu, Jingjing wrote:
> 
> 
>> -----Original Message-----
>> From: Dai, Wei
>> Sent: Monday, October 23, 2017 2:44 PM
>> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
>> <konstantin.ananyev@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>; stable@dpdk.org
>> Subject: [PATCH] net/ixgbe: fix PF DCB info
>>
>> When SRIOV is active, the function ixgbe_dev_get_dcb_info( ) should return the
>> DCB traffic class info of its own queues, not including any DCB info of the
>> queues of any its VF.
>> When VMDQ is active, all queues are belonged to the PF, the function
>> ixgbe_dev_get_dcb_info can return DCB info of all queues.
>>
>> Fixes: 89d6728c7837 ("ethdev: get DCB information")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Wei Dai <wei.dai@intel.com>
> Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>

Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2017-10-24 17:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-23  6:43 [PATCH] net/ixgbe: fix PF DCB info Wei Dai
2017-10-24  2:50 ` Wu, Jingjing
2017-10-24 17:42   ` [dpdk-stable] " Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.