DPDK patches and discussions
 help / color / mirror / Atom feed
From: Murphy Yang <murphyx.yang@intel.com>
To: dev@dpdk.org
Cc: qiming.yang@intel.com, jia.guo@intel.com, beilei.xing@intel.com,
	qi.z.zhang@intel.com, stevex.yang@intel.com,
	robinx.zhang@intel.com, Murphy Yang <murphyx.yang@intel.com>
Subject: [dpdk-dev] [PATCH] net/i40e: fix mbuf fast free wrong check
Date: Wed,  7 Apr 2021 06:37:29 +0000
Message-ID: <20210407063729.67731-1-murphyx.yang@intel.com> (raw)

If no offload flags are set, then 0 == 0 & <anything> is true.
This means that if DEV_TX_OFFLOAD_MBUF_FAST_FREE is not
set (and no other flags are set) then this check will still
enable `tx_simple_allowed`.

This patch adds the 'offloads' flag not equal zero to avoid this

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

Signed-off-by: Murphy Yang <murphyx.yang@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 b3d7765e3b..1450b228ca 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3345,7 +3345,7 @@ i40e_set_tx_function_flag(struct rte_eth_dev *dev, struct i40e_tx_queue *txq)
 	/* Use a simple Tx queue if possible (only fast free is allowed) */
 	ad->tx_simple_allowed =
-		(txq->offloads ==
+		(txq->offloads != 0 && txq->offloads ==
 		 (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) &&
 		 txq->tx_rs_thresh >= RTE_PMD_I40E_TX_MAX_BURST);
 	ad->tx_vec_allowed = (ad->tx_simple_allowed &&

             reply	other threads:[~2021-04-07  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07  6:37 Murphy Yang [this message]
2021-04-08  8:57 ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210407063729.67731-1-murphyx.yang@intel.com \
    --to=murphyx.yang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jia.guo@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=robinx.zhang@intel.com \
    --cc=stevex.yang@intel.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git