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 C1B9AA0093; Mon, 7 Mar 2022 14:59:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 435D540688; Mon, 7 Mar 2022 14:59:11 +0100 (CET) Received: from out203-205-221-231.mail.qq.com (out203-205-221-231.mail.qq.com [203.205.221.231]) by mails.dpdk.org (Postfix) with ESMTP id 588454014E for ; Mon, 7 Mar 2022 14:59:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1646661544; bh=bqNc7jqhxljVP8Qw8Arp8YkMwS/qXhMJiXaKSciuhlw=; h=From:To:Cc:Subject:Date; b=fptrdjE2Apu2INhg2WjM/6s9kfaFhE1PtJX0y1JWpdz1OJZkJqYHanjMsUVEcWx9L JHJ2fxzuyNDrnmFjOKn/b4BtWMuf/7pcMtJxT23IQPUYtkxVlCfgUxmGsgCZ5PfeZJ HAUsMm8mueDr3uKcitkfN+QTstDJohy977Q2F0Fs= Received: from localhost.localdomain.localdomain ([119.3.119.19]) by newxmesmtplogicsvrszc7.qq.com (NewEsmtp) with SMTP id EA91DAB2; Mon, 07 Mar 2022 21:58:41 +0800 X-QQ-mid: xmsmtpt1646661521t3d5p3x9c Message-ID: X-QQ-XMAILINFO: MmPNY57tR1XnK8mDSBiiXmmFc2xBVjnJXOnG1lCljmt82Y3HD4rKUIS5uKHmze MeSMmiDNel3XHQtN9+7tcVl3AucDSIXhm+GR6D7EShR5fmyRWZzE+0neVGprRA4YIjZi7f3Xm2An 91WnMf2ZFasCEKX9y2lJp2IbEZCj2AFVwpluB3aB2JxYChiuFZVa7XQ3SXCL7on2ZxE/wabyD9n0 2nb6eQLPGSYoC4TEmtzGG4zPTmnGl0miOCZjlQWPwHBnVAWPtOHRp5pqwYd+ItTc9dt8bIVLD5PY q2pprshhnBJYus8/7jKnWM7O1Jx9CdNFUFFGznCHPx4jP6nuNsaHPl2yL4rdOERtVdtzC4G0ObZC XZMo0vaXug3xN6DDi2rfVWnmGvfEulgKqQDpSDiOAJQo8u/LQrVFFE2bcWOuIpkSigk4gInjEPAQ vEwY7TmGKPistytifq71eMZzx/518ayQAsMqPYTE8VL93/P1GZCz0IY3ReFkLTjnc3iYLfOfaLRt 125zbI/RbI67zdFERffhsltCqWxravWd3fmaiaM2EQSE/qnb3mbF6zAsieBWXkjlIrZDOU1LOQdg 24vL6GbmO05wQ6lSiWZky43oa196pngGd8Stx0xncwsJP+FX7nJ96n1GXuht4Rr1bkJD6fqTKhf3 mblBinzovvVG395uztZDmQFL3WSACbICCm+exu+b5Djhipv7JnACTykgezcjjoIL+K3zdZ4aHgWG 5pPRxGl5vEMUlfcfOzPwq6MN+VwpSBALaQNC2jphCUIeRk4KZNiN40nCeIUDZw7bt7KNRN8Ghi55 DD3WaSsByFZ3jXUVLMHsHNpBjDmhEGlVAlHoZfWZihrGIOaeDJj2oQurRzja4pg3Ki4lem3n0b+W yINIxD+aExDU8ooTd3LW7RKVaWwGZQm20QftoLF2dDqHZsZH6gu0XY6jjxA4kpjLIfI5PVrWZYTe PEN1JmGps= 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 length problem Date: Mon, 7 Mar 2022 22:12:20 +0800 X-OQ-MSGID: <1646662340-98474-1-git-send-email-277600718@qq.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Junjie Lin 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