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 E98ACA00C2; Sat, 7 Jan 2023 16:19:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 092E941138; Sat, 7 Jan 2023 16:19:54 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 6B11A40E09 for ; Sat, 7 Jan 2023 16:19:52 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 307EscFt001629; Sat, 7 Jan 2023 07:19:51 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Kig7+AxUBH0iSh7dsVggoWC7DRLoGNOBZJs2OecOorE=; b=BAiegWrABfffFkTr2J0m7cquHlTljuszzto9cEbpB60gdmh/JvaTopyGXH3I+SFGcu3E /x3aaUTsolUVsOUWuiY4x222qOK+ApUM7ahoxfiZsP+gNMkHo/xRDjKDUL74A3v2/nkZ 7gw8N0Hh76AWSySz3ji7O6Fhzrz7PiPKGkduBhWZKuO9OtY9ifB1zOGEA1VClZ73V0mD nwypGAF2Wd9ohgyWoMd0oy18Exx0NEk9tvqK0KP36e4VqYrQpt9OO9Z+Uuu+eCxgrvwh gRDZlgVyLxoSrrnTqFmECiOkCWcetOiRTm2R6/t/Y/JXBTuZVEyi9TYLfhaI2wVTFvWL 3w== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3my6yw0a8n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 07 Jan 2023 07:19:51 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Sat, 7 Jan 2023 07:19:49 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Sat, 7 Jan 2023 07:19:49 -0800 Received: from cavium-DT10.. (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 1404F5B6925; Sat, 7 Jan 2023 07:19:47 -0800 (PST) From: Volodymyr Fialko To: , Reshma Pattan CC: , , Volodymyr Fialko Subject: [PATCH 1/2] reorder: invalidate buf from ready queue in drain Date: Sat, 7 Jan 2023 16:19:38 +0100 Message-ID: <20230107151939.2540148-2-vfialko@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230107151939.2540148-1-vfialko@marvell.com> References: <20230107151939.2540148-1-vfialko@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: eqkLlggrdQuh2Dx36Hiio7GWyQOeWbjp X-Proofpoint-ORIG-GUID: eqkLlggrdQuh2Dx36Hiio7GWyQOeWbjp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-07_06,2023-01-06_01,2022-06-22_01 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 Set drained buffers from ready queue to NULL, since their ownership returned to user. Otherwise it's possible that both user and library will attempt to free the packet. Signed-off-by: Volodymyr Fialko --- lib/reorder/rte_reorder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c index 385ee479da..b38e71f460 100644 --- a/lib/reorder/rte_reorder.c +++ b/lib/reorder/rte_reorder.c @@ -389,6 +389,7 @@ rte_reorder_drain(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs, /* Try to fetch requested number of mbufs from ready buffer */ while ((drain_cnt < max_mbufs) && (ready_buf->tail != ready_buf->head)) { mbufs[drain_cnt++] = ready_buf->entries[ready_buf->tail]; + ready_buf->entries[ready_buf->tail] = NULL; ready_buf->tail = (ready_buf->tail + 1) & ready_buf->mask; } -- 2.34.1