All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/i40e: fix incorrect var assignment
@ 2017-09-13 17:31 Jingjing Wu
  2017-09-15  2:06 ` Xing, Beilei
  2017-09-18 18:53 ` [PATCH v2] " Jingjing Wu
  0 siblings, 2 replies; 5+ messages in thread
From: Jingjing Wu @ 2017-09-13 17:31 UTC (permalink / raw)
  To: beilei.xing; +Cc: dev, jingjing.wu, stable

rx/tx_queue_setup functions are shared between PF and VF
drivers. So the var 'pf' should not be assigned at the beginning.
This patch fixes the issue, and also corrects the return err code.

Cc: stable@dpdk.org
Fixes: b6583ee40265 ("i40e: full VMDQ pools support")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 72 +++++++++++++++++++++++---------------------
 1 file changed, 37 insertions(+), 35 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index d42c23c..232d850 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1736,34 +1736,40 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
 {
 	struct i40e_vsi *vsi;
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct i40e_pf *pf = NULL;
 	struct i40e_adapter *ad =
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct i40e_rx_queue *rxq;
 	const struct rte_memzone *rz;
 	uint32_t ring_size;
 	uint16_t len, i;
-	uint16_t base, bsf, tc_mapping;
-	int use_def_burst_func = 1;
+	uint16_t reg_idx, base, bsf, tc_mapping;
+	int q_offset, use_def_burst_func = 1;
 
 	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF) {
 		struct i40e_vf *vf =
 			I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 		vsi = &vf->vsi;
-	} else
+		if (!vsi)
+			return -EINVAL;
+		reg_idx = queue_idx;
+	} else {
+		pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 		vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
-
-	if (vsi == NULL) {
-		PMD_DRV_LOG(ERR, "VSI not available or queue "
-			    "index exceeds the maximum");
-		return I40E_ERR_PARAM;
+		if (!vsi)
+			return -EINVAL;
+		q_offset = i40e_get_queue_offset_by_qindex(pf, queue_idx);
+		if (q_offset < 0)
+			return -EINVAL;
+		reg_idx = vsi->base_queue + q_offset;
 	}
+
 	if (nb_desc % I40E_ALIGN_RING_DESC != 0 ||
-			(nb_desc > I40E_MAX_RING_DESC) ||
-			(nb_desc < I40E_MIN_RING_DESC)) {
+	    (nb_desc > I40E_MAX_RING_DESC) ||
+	    (nb_desc < I40E_MIN_RING_DESC)) {
 		PMD_DRV_LOG(ERR, "Number (%u) of receive descriptors is "
 			    "invalid", nb_desc);
-		return I40E_ERR_PARAM;
+		return -EINVAL;
 	}
 
 	/* Free memory if needed */
@@ -1786,12 +1792,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	rxq->nb_rx_desc = nb_desc;
 	rxq->rx_free_thresh = rx_conf->rx_free_thresh;
 	rxq->queue_id = queue_idx;
-	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF)
-		rxq->reg_idx = queue_idx;
-	else /* PF device */
-		rxq->reg_idx = vsi->base_queue +
-			i40e_get_queue_offset_by_qindex(pf, queue_idx);
-
+	rxq->reg_idx = reg_idx;
 	rxq->port_id = dev->data->port_id;
 	rxq->crc_len = (uint8_t) ((dev->data->dev_conf.rxmode.hw_strip_crc) ?
 							0 : ETHER_CRC_LEN);
@@ -2014,32 +2015,38 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
 {
 	struct i40e_vsi *vsi;
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct i40e_pf *pf = NULL;
 	struct i40e_tx_queue *txq;
 	const struct rte_memzone *tz;
 	uint32_t ring_size;
 	uint16_t tx_rs_thresh, tx_free_thresh;
-	uint16_t i, base, bsf, tc_mapping;
+	uint16_t reg_idx, i, base, bsf, tc_mapping;
+	int q_offset;
 
 	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF) {
 		struct i40e_vf *vf =
 			I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 		vsi = &vf->vsi;
-	} else
+		if (!vsi)
+			return -EINVAL;
+		reg_idx = queue_idx;
+	} else {
+		pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 		vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
-
-	if (vsi == NULL) {
-		PMD_DRV_LOG(ERR, "VSI is NULL, or queue index (%u) "
-			    "exceeds the maximum", queue_idx);
-		return I40E_ERR_PARAM;
+		if (!vsi)
+			return -EINVAL;
+		q_offset = i40e_get_queue_offset_by_qindex(pf, queue_idx);
+		if (q_offset < 0)
+			return -EINVAL;
+		reg_idx = vsi->base_queue + q_offset;
 	}
 
 	if (nb_desc % I40E_ALIGN_RING_DESC != 0 ||
-			(nb_desc > I40E_MAX_RING_DESC) ||
-			(nb_desc < I40E_MIN_RING_DESC)) {
+	    (nb_desc > I40E_MAX_RING_DESC) ||
+	    (nb_desc < I40E_MIN_RING_DESC)) {
 		PMD_DRV_LOG(ERR, "Number (%u) of transmit descriptors is "
 			    "invalid", nb_desc);
-		return I40E_ERR_PARAM;
+		return -EINVAL;
 	}
 
 	/**
@@ -2148,12 +2155,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->hthresh = tx_conf->tx_thresh.hthresh;
 	txq->wthresh = tx_conf->tx_thresh.wthresh;
 	txq->queue_id = queue_idx;
-	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF)
-		txq->reg_idx = queue_idx;
-	else /* PF device */
-		txq->reg_idx = vsi->base_queue +
-			i40e_get_queue_offset_by_qindex(pf, queue_idx);
-
+	txq->reg_idx = reg_idx;
 	txq->port_id = dev->data->port_id;
 	txq->txq_flags = tx_conf->txq_flags;
 	txq->vsi = vsi;
-- 
2.7.4

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

* Re: [PATCH] net/i40e: fix incorrect var assignment
  2017-09-13 17:31 [PATCH] net/i40e: fix incorrect var assignment Jingjing Wu
@ 2017-09-15  2:06 ` Xing, Beilei
  2017-09-18 18:53 ` [PATCH v2] " Jingjing Wu
  1 sibling, 0 replies; 5+ messages in thread
From: Xing, Beilei @ 2017-09-15  2:06 UTC (permalink / raw)
  To: Wu, Jingjing; +Cc: dev, stable



> -----Original Message-----
> From: Wu, Jingjing
> Sent: Thursday, September 14, 2017 1:31 AM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/i40e: fix incorrect var assignment
> 
> rx/tx_queue_setup functions are shared between PF and VF drivers. So the
> var 'pf' should not be assigned at the beginning.
> This patch fixes the issue, and also corrects the return err code.
> 
> Cc: stable@dpdk.org
> Fixes: b6583ee40265 ("i40e: full VMDQ pools support")
> 
> Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
> ---
>  drivers/net/i40e/i40e_rxtx.c | 72 +++++++++++++++++++++++----------------
> -----
>  1 file changed, 37 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index
> d42c23c..232d850 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -1736,34 +1736,40 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev
> *dev,  {
>  	struct i40e_vsi *vsi;
>  	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> -	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data-
> >dev_private);
> +	struct i40e_pf *pf = NULL;
>  	struct i40e_adapter *ad =
>  		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
>  	struct i40e_rx_queue *rxq;
>  	const struct rte_memzone *rz;
>  	uint32_t ring_size;
>  	uint16_t len, i;
> -	uint16_t base, bsf, tc_mapping;
> -	int use_def_burst_func = 1;
> +	uint16_t reg_idx, base, bsf, tc_mapping;
> +	int q_offset, use_def_burst_func = 1;
> 
>  	if (hw->mac.type == I40E_MAC_VF || hw->mac.type ==
> I40E_MAC_X722_VF) {
>  		struct i40e_vf *vf =
>  			I40EVF_DEV_PRIVATE_TO_VF(dev->data-
> >dev_private);

One minor comment: how about moving  variable vf to the beginning of the function to align with variable pf?

>  		vsi = &vf->vsi;
> -	} else
> +		if (!vsi)
> +			return -EINVAL;
> +		reg_idx = queue_idx;
> +	} else {
> +		pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
>  		vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
> -
> -	if (vsi == NULL) {
> -		PMD_DRV_LOG(ERR, "VSI not available or queue "
> -			    "index exceeds the maximum");
> -		return I40E_ERR_PARAM;
> +		if (!vsi)
> +			return -EINVAL;
> +		q_offset = i40e_get_queue_offset_by_qindex(pf,
> queue_idx);
> +		if (q_offset < 0)
> +			return -EINVAL;
> +		reg_idx = vsi->base_queue + q_offset;
>  	}
> +
>  	if (nb_desc % I40E_ALIGN_RING_DESC != 0 ||
> -			(nb_desc > I40E_MAX_RING_DESC) ||
> -			(nb_desc < I40E_MIN_RING_DESC)) {
> +	    (nb_desc > I40E_MAX_RING_DESC) ||
> +	    (nb_desc < I40E_MIN_RING_DESC)) {
>  		PMD_DRV_LOG(ERR, "Number (%u) of receive descriptors is
> "
>  			    "invalid", nb_desc);
> -		return I40E_ERR_PARAM;
> +		return -EINVAL;
>  	}
> 
>  	/* Free memory if needed */
> @@ -1786,12 +1792,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev
> *dev,
>  	rxq->nb_rx_desc = nb_desc;
>  	rxq->rx_free_thresh = rx_conf->rx_free_thresh;
>  	rxq->queue_id = queue_idx;
> -	if (hw->mac.type == I40E_MAC_VF || hw->mac.type ==
> I40E_MAC_X722_VF)
> -		rxq->reg_idx = queue_idx;
> -	else /* PF device */
> -		rxq->reg_idx = vsi->base_queue +
> -			i40e_get_queue_offset_by_qindex(pf, queue_idx);
> -
> +	rxq->reg_idx = reg_idx;
>  	rxq->port_id = dev->data->port_id;
>  	rxq->crc_len = (uint8_t) ((dev->data-
> >dev_conf.rxmode.hw_strip_crc) ?
>  							0 : ETHER_CRC_LEN);
> @@ -2014,32 +2015,38 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev
> *dev,  {
>  	struct i40e_vsi *vsi;
>  	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> -	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data-
> >dev_private);
> +	struct i40e_pf *pf = NULL;
>  	struct i40e_tx_queue *txq;
>  	const struct rte_memzone *tz;
>  	uint32_t ring_size;
>  	uint16_t tx_rs_thresh, tx_free_thresh;
> -	uint16_t i, base, bsf, tc_mapping;
> +	uint16_t reg_idx, i, base, bsf, tc_mapping;
> +	int q_offset;
> 
>  	if (hw->mac.type == I40E_MAC_VF || hw->mac.type ==
> I40E_MAC_X722_VF) {
>  		struct i40e_vf *vf =
>  			I40EVF_DEV_PRIVATE_TO_VF(dev->data-
> >dev_private);

Same comment here.

>  		vsi = &vf->vsi;
> -	} else
> +		if (!vsi)
> +			return -EINVAL;
> +		reg_idx = queue_idx;
> +	} else {
> +		pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
>  		vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
> -
> -	if (vsi == NULL) {
> -		PMD_DRV_LOG(ERR, "VSI is NULL, or queue index (%u) "
> -			    "exceeds the maximum", queue_idx);
> -		return I40E_ERR_PARAM;
> +		if (!vsi)
> +			return -EINVAL;
> +		q_offset = i40e_get_queue_offset_by_qindex(pf,
> queue_idx);
> +		if (q_offset < 0)
> +			return -EINVAL;
> +		reg_idx = vsi->base_queue + q_offset;
>  	}
> 
>  	if (nb_desc % I40E_ALIGN_RING_DESC != 0 ||
> -			(nb_desc > I40E_MAX_RING_DESC) ||
> -			(nb_desc < I40E_MIN_RING_DESC)) {
> +	    (nb_desc > I40E_MAX_RING_DESC) ||
> +	    (nb_desc < I40E_MIN_RING_DESC)) {
>  		PMD_DRV_LOG(ERR, "Number (%u) of transmit descriptors
> is "
>  			    "invalid", nb_desc);
> -		return I40E_ERR_PARAM;
> +		return -EINVAL;
>  	}
> 
>  	/**
> @@ -2148,12 +2155,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev
> *dev,
>  	txq->hthresh = tx_conf->tx_thresh.hthresh;
>  	txq->wthresh = tx_conf->tx_thresh.wthresh;
>  	txq->queue_id = queue_idx;
> -	if (hw->mac.type == I40E_MAC_VF || hw->mac.type ==
> I40E_MAC_X722_VF)
> -		txq->reg_idx = queue_idx;
> -	else /* PF device */
> -		txq->reg_idx = vsi->base_queue +
> -			i40e_get_queue_offset_by_qindex(pf, queue_idx);
> -
> +	txq->reg_idx = reg_idx;
>  	txq->port_id = dev->data->port_id;
>  	txq->txq_flags = tx_conf->txq_flags;
>  	txq->vsi = vsi;
> --
> 2.7.4

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

* [PATCH v2] net/i40e: fix incorrect var assignment
  2017-09-13 17:31 [PATCH] net/i40e: fix incorrect var assignment Jingjing Wu
  2017-09-15  2:06 ` Xing, Beilei
@ 2017-09-18 18:53 ` Jingjing Wu
  2017-09-20  1:42   ` Xing, Beilei
  2017-10-11  2:46   ` [dpdk-stable] " Ferruh Yigit
  1 sibling, 2 replies; 5+ messages in thread
From: Jingjing Wu @ 2017-09-18 18:53 UTC (permalink / raw)
  To: beilei.xing; +Cc: dev, jingjing.wu, stable

rx/tx_queue_setup functions are shared between PF and VF
drivers. So the var 'pf' should not be assigned at the beginning.
This patch fixes the issue, and also corrects the return err code.

Cc: stable@dpdk.org
Fixes: b6583ee40265 ("i40e: full VMDQ pools support")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
v2 change:
 - move declaration of variable 'vf' to the beginning of function

 drivers/net/i40e/i40e_rxtx.c | 84 +++++++++++++++++++++++---------------------
 1 file changed, 43 insertions(+), 41 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index d42c23c..3a7b68e 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1734,36 +1734,42 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			const struct rte_eth_rxconf *rx_conf,
 			struct rte_mempool *mp)
 {
-	struct i40e_vsi *vsi;
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct i40e_adapter *ad =
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	struct i40e_vsi *vsi;
+	struct i40e_pf *pf = NULL;
+	struct i40e_vf *vf = NULL;
 	struct i40e_rx_queue *rxq;
 	const struct rte_memzone *rz;
 	uint32_t ring_size;
 	uint16_t len, i;
-	uint16_t base, bsf, tc_mapping;
-	int use_def_burst_func = 1;
+	uint16_t reg_idx, base, bsf, tc_mapping;
+	int q_offset, use_def_burst_func = 1;
 
 	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF) {
-		struct i40e_vf *vf =
-			I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+		vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 		vsi = &vf->vsi;
-	} else
+		if (!vsi)
+			return -EINVAL;
+		reg_idx = queue_idx;
+	} else {
+		pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 		vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
-
-	if (vsi == NULL) {
-		PMD_DRV_LOG(ERR, "VSI not available or queue "
-			    "index exceeds the maximum");
-		return I40E_ERR_PARAM;
+		if (!vsi)
+			return -EINVAL;
+		q_offset = i40e_get_queue_offset_by_qindex(pf, queue_idx);
+		if (q_offset < 0)
+			return -EINVAL;
+		reg_idx = vsi->base_queue + q_offset;
 	}
+
 	if (nb_desc % I40E_ALIGN_RING_DESC != 0 ||
-			(nb_desc > I40E_MAX_RING_DESC) ||
-			(nb_desc < I40E_MIN_RING_DESC)) {
+	    (nb_desc > I40E_MAX_RING_DESC) ||
+	    (nb_desc < I40E_MIN_RING_DESC)) {
 		PMD_DRV_LOG(ERR, "Number (%u) of receive descriptors is "
 			    "invalid", nb_desc);
-		return I40E_ERR_PARAM;
+		return -EINVAL;
 	}
 
 	/* Free memory if needed */
@@ -1786,12 +1792,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	rxq->nb_rx_desc = nb_desc;
 	rxq->rx_free_thresh = rx_conf->rx_free_thresh;
 	rxq->queue_id = queue_idx;
-	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF)
-		rxq->reg_idx = queue_idx;
-	else /* PF device */
-		rxq->reg_idx = vsi->base_queue +
-			i40e_get_queue_offset_by_qindex(pf, queue_idx);
-
+	rxq->reg_idx = reg_idx;
 	rxq->port_id = dev->data->port_id;
 	rxq->crc_len = (uint8_t) ((dev->data->dev_conf.rxmode.hw_strip_crc) ?
 							0 : ETHER_CRC_LEN);
@@ -2012,34 +2013,40 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			unsigned int socket_id,
 			const struct rte_eth_txconf *tx_conf)
 {
-	struct i40e_vsi *vsi;
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct i40e_vsi *vsi;
+	struct i40e_pf *pf = NULL;
+	struct i40e_vf *vf = NULL;
 	struct i40e_tx_queue *txq;
 	const struct rte_memzone *tz;
 	uint32_t ring_size;
 	uint16_t tx_rs_thresh, tx_free_thresh;
-	uint16_t i, base, bsf, tc_mapping;
+	uint16_t reg_idx, i, base, bsf, tc_mapping;
+	int q_offset;
 
 	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF) {
-		struct i40e_vf *vf =
-			I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+		vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 		vsi = &vf->vsi;
-	} else
+		if (!vsi)
+			return -EINVAL;
+		reg_idx = queue_idx;
+	} else {
+		pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 		vsi = i40e_pf_get_vsi_by_qindex(pf, queue_idx);
-
-	if (vsi == NULL) {
-		PMD_DRV_LOG(ERR, "VSI is NULL, or queue index (%u) "
-			    "exceeds the maximum", queue_idx);
-		return I40E_ERR_PARAM;
+		if (!vsi)
+			return -EINVAL;
+		q_offset = i40e_get_queue_offset_by_qindex(pf, queue_idx);
+		if (q_offset < 0)
+			return -EINVAL;
+		reg_idx = vsi->base_queue + q_offset;
 	}
 
 	if (nb_desc % I40E_ALIGN_RING_DESC != 0 ||
-			(nb_desc > I40E_MAX_RING_DESC) ||
-			(nb_desc < I40E_MIN_RING_DESC)) {
+	    (nb_desc > I40E_MAX_RING_DESC) ||
+	    (nb_desc < I40E_MIN_RING_DESC)) {
 		PMD_DRV_LOG(ERR, "Number (%u) of transmit descriptors is "
 			    "invalid", nb_desc);
-		return I40E_ERR_PARAM;
+		return -EINVAL;
 	}
 
 	/**
@@ -2148,12 +2155,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->hthresh = tx_conf->tx_thresh.hthresh;
 	txq->wthresh = tx_conf->tx_thresh.wthresh;
 	txq->queue_id = queue_idx;
-	if (hw->mac.type == I40E_MAC_VF || hw->mac.type == I40E_MAC_X722_VF)
-		txq->reg_idx = queue_idx;
-	else /* PF device */
-		txq->reg_idx = vsi->base_queue +
-			i40e_get_queue_offset_by_qindex(pf, queue_idx);
-
+	txq->reg_idx = reg_idx;
 	txq->port_id = dev->data->port_id;
 	txq->txq_flags = tx_conf->txq_flags;
 	txq->vsi = vsi;
-- 
2.7.4

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

* Re: [PATCH v2] net/i40e: fix incorrect var assignment
  2017-09-18 18:53 ` [PATCH v2] " Jingjing Wu
@ 2017-09-20  1:42   ` Xing, Beilei
  2017-10-11  2:46   ` [dpdk-stable] " Ferruh Yigit
  1 sibling, 0 replies; 5+ messages in thread
From: Xing, Beilei @ 2017-09-20  1:42 UTC (permalink / raw)
  To: Wu, Jingjing; +Cc: dev, stable



> -----Original Message-----
> From: Wu, Jingjing
> Sent: Tuesday, September 19, 2017 2:53 AM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/i40e: fix incorrect var assignment
> 
> rx/tx_queue_setup functions are shared between PF and VF drivers. So the
> var 'pf' should not be assigned at the beginning.
> This patch fixes the issue, and also corrects the return err code.
> 
> Cc: stable@dpdk.org
> Fixes: b6583ee40265 ("i40e: full VMDQ pools support")
> 
> Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>

Acked-by: Beilei Xing <beilei.xing@intel.com>

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

* Re: [dpdk-stable] [PATCH v2] net/i40e: fix incorrect var assignment
  2017-09-18 18:53 ` [PATCH v2] " Jingjing Wu
  2017-09-20  1:42   ` Xing, Beilei
@ 2017-10-11  2:46   ` Ferruh Yigit
  1 sibling, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2017-10-11  2:46 UTC (permalink / raw)
  To: Jingjing Wu, beilei.xing; +Cc: dev, stable

On 9/18/2017 7:53 PM, Jingjing Wu wrote:
> rx/tx_queue_setup functions are shared between PF and VF
> drivers. So the var 'pf' should not be assigned at the beginning.
> This patch fixes the issue, and also corrects the return err code.
> 
> Cc: stable@dpdk.org
> Fixes: b6583ee40265 ("i40e: full VMDQ pools support")
> 
> Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>

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

(This applied long ago, already merged into main repo, missed to send
the email.)

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

end of thread, other threads:[~2017-10-11  2:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-13 17:31 [PATCH] net/i40e: fix incorrect var assignment Jingjing Wu
2017-09-15  2:06 ` Xing, Beilei
2017-09-18 18:53 ` [PATCH v2] " Jingjing Wu
2017-09-20  1:42   ` Xing, Beilei
2017-10-11  2:46   ` [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.