DPDK patches and discussions
 help / color / mirror / Atom feed
From: Junjie Lin <277600718@qq.com>
To: dev@dpdk.org
Cc: linjunjie6@huawei.com, xuanziyang2@huawei.com, zhouguoyang@huawei.com
Subject: [PATCH] net/hinic: fix Tx mbuf lenght problem
Date: Mon,  7 Mar 2022 21:56:10 +0800	[thread overview]
Message-ID: <tencent_4FA3EB2D3970D2396D78F5D34E7A16CEFF06@qq.com> (raw)

From: Junjie Lin <linjunjie6@huawei.com>

The Tx mbuf needs to be ignored if the pkt_len member is zero.

Fixes: 54faba2295bd ("net/hinic:adds Tx queue xstats members")
Cc: stable@dpdk.org

Signed-off-by: Junjie Lin <linjunjie6@huawei.com>
---
 drivers/net/hinic/hinic_pmd_tx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/hinic/hinic_pmd_tx.c b/drivers/net/hinic/hinic_pmd_tx.c
index f09b1a6..99a5e3a 100644
--- a/drivers/net/hinic/hinic_pmd_tx.c
+++ b/drivers/net/hinic/hinic_pmd_tx.c
@@ -1144,6 +1144,12 @@ u16 hinic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, u16 nb_pkts)
 		mbuf_pkt = *tx_pkts++;
 		queue_info = 0;
 
+		if (unlikely(mbuf_pkt->pkt_len == 0)) {
+			rte_pktmbuf_free(mbuf_pkt);
+			txq->txq_stats.off_errs++;
+			continue;
+		}
+
 		/* 1. parse sge and tx offload info from mbuf */
 		if (unlikely(!hinic_get_sge_txoff_info(mbuf_pkt,
 						       &sqe_info, &off_info))) {
-- 
1.8.3.1



                 reply	other threads:[~2022-03-07 13:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=tencent_4FA3EB2D3970D2396D78F5D34E7A16CEFF06@qq.com \
    --to=277600718@qq.com \
    --cc=dev@dpdk.org \
    --cc=linjunjie6@huawei.com \
    --cc=xuanziyang2@huawei.com \
    --cc=zhouguoyang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).