DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix mbuf fast free wrong check
@ 2021-04-07  6:37 Murphy Yang
  2021-04-08  8:57 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Murphy Yang @ 2021-04-07  6:37 UTC (permalink / raw)
  To: dev
  Cc: qiming.yang, jia.guo, beilei.xing, qi.z.zhang, stevex.yang,
	robinx.zhang, Murphy Yang

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

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 &&
-- 
2.17.1


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

end of thread, other threads:[~2021-04-08  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  6:37 [dpdk-dev] [PATCH] net/i40e: fix mbuf fast free wrong check Murphy Yang
2021-04-08  8:57 ` Zhang, Qi Z

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 \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


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