net/i40e: fix tx queue setup after stop queue

Message ID 20180710103727.209243-1-shaopeng.he@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/i40e: fix tx queue setup after stop queue |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

He, Shaopeng July 10, 2018, 10:37 a.m. UTC
  Currently, i40e_dev_tx_queue_setup_runtime checks simple tx and treats
mbuf fast free offloading as No-simple, which is classified as simple tx
in i40e_set_tx_function_flag. This inconsistent behavior causes tx queue
setup fail after queue was stopped. This patch fixes this bug.

Fixes: 399421100e08 ("net/i40e: fix missing mbuf fast free offload")

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Qi Zhang July 10, 2018, 8:09 a.m. UTC | #1
> -----Original Message-----
> From: He, Shaopeng
> Sent: Tuesday, July 10, 2018 6:37 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; He, Shaopeng
> <shaopeng.he@intel.com>
> Subject: [PATCH] net/i40e: fix tx queue setup after stop queue

tx -> Tx in title

> 
> Currently, i40e_dev_tx_queue_setup_runtime checks simple tx and treats
> mbuf fast free offloading as No-simple, which is classified as simple tx in
> i40e_set_tx_function_flag. This inconsistent behavior causes tx queue setup
> fail after queue was stopped. This patch fixes this bug.
> 
> Fixes: 399421100e08 ("net/i40e: fix missing mbuf fast free offload")
> 
> Signed-off-by: Shaopeng He <shaopeng.he@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks!
Qi
  
Kevin Traynor July 25, 2018, 6:19 p.m. UTC | #2
On 07/10/2018 11:37 AM, Shaopeng He wrote:
> Currently, i40e_dev_tx_queue_setup_runtime checks simple tx and treats
> mbuf fast free offloading as No-simple, which is classified as simple tx
> in i40e_set_tx_function_flag. This inconsistent behavior causes tx queue
> setup fail after queue was stopped. This patch fixes this bug.
> 
> Fixes: 399421100e08 ("net/i40e: fix missing mbuf fast free offload")

Is it missing Cc: stable@dpdk.org tag for 18.05 stable branch?

> 
> Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
> ---
>  drivers/net/i40e/i40e_rxtx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 6032d5541..2bbb82fc3 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -2087,7 +2087,7 @@ i40e_dev_tx_queue_setup_runtime(struct rte_eth_dev *dev,
>  	}
>  	/* check simple tx conflict */
>  	if (ad->tx_simple_allowed) {
> -		if (txq->offloads != 0 ||
> +		if ((txq->offloads & ~DEV_TX_OFFLOAD_MBUF_FAST_FREE) != 0 ||
>  				txq->tx_rs_thresh < RTE_PMD_I40E_TX_MAX_BURST) {
>  			PMD_DRV_LOG(ERR, "No-simple tx is required.");
>  			return -EINVAL;
>
  

Patch

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 6032d5541..2bbb82fc3 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2087,7 +2087,7 @@  i40e_dev_tx_queue_setup_runtime(struct rte_eth_dev *dev,
 	}
 	/* check simple tx conflict */
 	if (ad->tx_simple_allowed) {
-		if (txq->offloads != 0 ||
+		if ((txq->offloads & ~DEV_TX_OFFLOAD_MBUF_FAST_FREE) != 0 ||
 				txq->tx_rs_thresh < RTE_PMD_I40E_TX_MAX_BURST) {
 			PMD_DRV_LOG(ERR, "No-simple tx is required.");
 			return -EINVAL;