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 54ADAA0542 for ; Fri, 11 Nov 2022 05:17:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3511740141; Fri, 11 Nov 2022 05:17:08 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 0D011400EF; Fri, 11 Nov 2022 05:17:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668140227; x=1699676227; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=q8i/myDNUtWCUNSwselhYGHG9I+qjV+vr5b3RshO/co=; b=NE8mECYka9qmf7BIo9+7RTPI4nv+n66vb1styVmEMjFQqwXoreUnyNrh d/kLIiSZjOgBhEq2IGLJpj1SDEoQghjW9mbWi6JpoNQnhKSseGMiXxLP7 /zbZ6WFD2CZ7/zVZssuT7ubMZOV1uBkRuIq99Ax8af4i6L+S9fxsEHVkb zwrANvJwCu4iZ3PyYUtsPwfHUJLRSoBL/MLkTQJdO/OaVWBcIj8TMeAca 2vtWNX4pFfCrkg+gs6CzfZK51L93S8GC8SsdRLzxeMC1EJr03uecytp3k nbgbig4mKQjBYvDFre1vA32aRqnZ8Ck/FwGZzYafFGklpat9enO0pxlCc g==; X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="397815419" X-IronPort-AV: E=Sophos;i="5.96,155,1665471600"; d="scan'208";a="397815419" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 20:17:06 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="966690104" X-IronPort-AV: E=Sophos;i="5.96,155,1665471600"; d="scan'208";a="966690104" Received: from unknown (HELO yemj..) ([10.239.252.253]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 20:17:03 -0800 From: Mingjin Ye To: dev@dpdk.org Cc: qiming.yang@intel.com, stable@dpdk.org, yidingx.zhou@intel.com, Mingjin Ye , Qi Zhang , Ferruh Yigit , Jingjing Wu , Wenzhuo Lu , Xiaoyun Li Subject: [PATCH v3 1/2] net/ice: fix scalar Rx path segment Date: Fri, 11 Nov 2022 12:04:00 +0000 Message-Id: <20221111120401.802805-1-mingjinx.ye@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109125609.724612-1-mingjinx.ye@intel.com> References: <20221109125609.724612-1-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