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 A88F5A0543 for ; Fri, 11 Nov 2022 09:14:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A333D410F2; Fri, 11 Nov 2022 09:14:57 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id AECD440141; Fri, 11 Nov 2022 09:14:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668154495; x=1699690495; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=q8i/myDNUtWCUNSwselhYGHG9I+qjV+vr5b3RshO/co=; b=SHQ78KutODBD8IS2+uv47+WkLRnlViuwEb/jYUP6TY7ZUbMIefr5T7r4 5PvtRpNSr3zwy0fxgjH5xqf1ZqKQbNWuGCaJrg7yCpWosv1MQUrxZ9Ojk IXRWa+W5igWrno00FOslvX2hZUO/4cICWOOF1XoxXqBl1KSTP1LOggXWn fk2nD4afXMHgrW8D++8tq/jSlzcUE1iVZvhxovTGMBYHOW25+gMVVkrg9 ecp7axm8jYNf1lvFuMTqO0jnMxr4tedIiVZSJYq7fZGQNNh4bkZXV7QFV KJnuAzXDVyGvAsVo1iFMsX0Au9/W5h6XcKsCa8tE6JAZEVnKHzZc97Dqu g==; X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="291957034" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="291957034" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 00:14:53 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="706472227" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="706472227" Received: from unknown (HELO yemj..) ([10.239.252.253]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 00:14:41 -0800 From: Mingjin Ye To: dev@dpdk.org Cc: qiming.yang@intel.com, stable@dpdk.org, yidingx.zhou@intel.com, Mingjin Ye , Qi Zhang , Xiaoyun Li , Jingjing Wu , Wenzhuo Lu , Ferruh Yigit Subject: [PATCH v4 1/2] net/ice: fix scalar Rx path segment Date: Fri, 11 Nov 2022 16:01:39 +0000 Message-Id: <20221111160140.860054-1-mingjinx.ye@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221111120401.802805-2-mingjinx.ye@intel.com> References: <20221111120401.802805-2-mingjinx.ye@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 CRC is stripped by the hardware in the scattered Rx path. The last buffer is invalid if it's packet length is zero. This patch adds a judgment for the last buffer length to fix this issue, it would free the mbuf associated to the last one if the last buffer is empty. Fixes: 6eac0b7fde95 ("net/ice: support advance Rx/Tx") Cc: stable@dpdk.org Signed-off-by: Mingjin Ye --- drivers/net/ice/ice_rxtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 0a2b0376ac..e6ddd2513d 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -2111,6 +2111,10 @@ ice_recv_scattered_pkts(void *rx_queue, } else rxm->data_len = (uint16_t)(rx_packet_len - RTE_ETHER_CRC_LEN); + } else if (rx_packet_len == 0) { + rte_pktmbuf_free_seg(rxm); + first_seg->nb_segs--; + last_seg->next = NULL; } first_seg->port = rxq->port_id; -- 2.34.1