From patchwork Tue Feb 6 12:38:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Bhansali X-Patchwork-Id: 136424 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A3E6243A95; Tue, 6 Feb 2024 13:38:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D8394025E; Tue, 6 Feb 2024 13:38:32 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 75D924021E for ; Tue, 6 Feb 2024 13:38:31 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 416B5pmw027405; Tue, 6 Feb 2024 04:38:30 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=pfpt0220; bh=dX+1uiST AnmrX7GBvRnhywQaxdpFb4lTONh2jR8Ad1w=; b=bAv/HnTaz/riZZ9kBvnV54Do 7aZ2JfoiCnLiqA1DCdSznTz7DD6ve/5kWk5vSd4eVxIaZt5e9yrPkKF5Pzbb/drd sbN5XcMebWDmf8aMrlDXLmD0E1DXispXxh1PO9KVsy2G9ukAJ1IxWdQmgfb2zsmo 3z6aE/mh2nCU5OKOJsmdJ8P0B0m0wD4+f3d21u94MSkh+ReKUPIbhYcjM9uRU5Xe V7nTS7oAZMTqKuHZKL1c8SdWPWOHdTWClG/iZHTKx1q/DAuNL3S+3JYDZVZCZlgB zbgyfG6mbPmWJmwZmvzpNbbOaRMSb2BUUp317U2PikZoUM7dtHwpXdR0QkxsrQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3w38u8231u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 06 Feb 2024 04:38:30 -0800 (PST) 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.48; Tue, 6 Feb 2024 04:38:28 -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.48 via Frontend Transport; Tue, 6 Feb 2024 04:38:28 -0800 Received: from localhost.localdomain (unknown [10.28.36.158]) by maili.marvell.com (Postfix) with ESMTP id 54A153F7084; Tue, 6 Feb 2024 04:38:26 -0800 (PST) From: Rahul Bhansali To: , Radu Nicolau , Akhil Goyal , Konstantin Ananyev , Anoob Joseph CC: Rahul Bhansali Subject: [PATCH] examples/ipsec-secgw: fix IPsec performance drop Date: Tue, 6 Feb 2024 18:08:11 +0530 Message-ID: <20240206123811.3452587-1-rbhansali@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: d2KrwwDTKh84PktM4AoYnAGJMHsQYLjn X-Proofpoint-GUID: d2KrwwDTKh84PktM4AoYnAGJMHsQYLjn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-06_06,2024-01-31_01,2023-05-22_02 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 Single packet free using rte_pktmbuf_free_bulk() is dropping the performance. On cn10k, maximum of ~4% drop observed for IPsec event mode single SA outbound case. To fix this issue, single packet free will use rte_pktmbuf_free API. Fixes: bd7c063561b3 ("examples/ipsec-secgw: use bulk free") Signed-off-by: Rahul Bhansali Acked-by: Akhil Goyal --- examples/ipsec-secgw/ipsec-secgw.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.h b/examples/ipsec-secgw/ipsec-secgw.h index 8baab44ee7..ec33a982df 100644 --- a/examples/ipsec-secgw/ipsec-secgw.h +++ b/examples/ipsec-secgw/ipsec-secgw.h @@ -229,11 +229,10 @@ free_reassembly_fail_pkt(struct rte_mbuf *mb) } /* helper routine to free bulk of packets */ -static inline void -free_pkts(struct rte_mbuf *mb[], uint32_t n) +static __rte_always_inline void +free_pkts(struct rte_mbuf *mb[], const uint32_t n) { - rte_pktmbuf_free_bulk(mb, n); - + n == 1 ? rte_pktmbuf_free(mb[0]) : rte_pktmbuf_free_bulk(mb, n); core_stats_update_drop(n); }