From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D024FA0351 for ; Fri, 4 Mar 2022 10:00:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3AFE4013F; Fri, 4 Mar 2022 10:00:05 +0100 (CET) Received: from localhost.localdomain (unknown [119.3.119.20]) by mails.dpdk.org (Postfix) with ESMTP id 2D9344013F for ; Fri, 4 Mar 2022 10:00:03 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id 109DA207DB96; Fri, 4 Mar 2022 17:13:18 +0800 (CST) From: Junjie Lin <277600718@qq.com> To: 277600718@qq.com Cc: root , stable@dpdk.org, Junjie Lin Subject: [PATCH] net/hinic: fix Tx mbuf lenght problem Date: Fri, 4 Mar 2022 17:13:11 +0800 Message-Id: <1646385191-53934-1-git-send-email-277600718@qq.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: root 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 --- 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