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 8FCF343F6A for ; Thu, 2 May 2024 17:29:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77CD7402EC; Thu, 2 May 2024 17:29:00 +0200 (CEST) Received: from forward502b.mail.yandex.net (forward502b.mail.yandex.net [178.154.239.146]) by mails.dpdk.org (Postfix) with ESMTP id BA191402DD; Thu, 2 May 2024 17:28:57 +0200 (CEST) Received: from mail-nwsmtp-smtp-production-main-37.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-37.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:1a4:0:640:b6:0]) by forward502b.mail.yandex.net (Yandex) with ESMTPS id EBFFE5EEDF; Thu, 2 May 2024 18:28:56 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-37.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id bSVvo2YOeuQ0-KlCXZ9c9; Thu, 02 May 2024 18:28:56 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1714663736; bh=4i4TFmEE0RKhzFuZUxzT6Bu8+5f6ZVg/Ej+wBuA6C1U=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=hlPj4YJBfBefldGdO0ewtyXs8y4F24aIVeVMsJu1R1GOldGSIw7f+hTpxdhJf5/Y9 /RV3f+hHWQMHrz61joYaEd8Mg1/SdUJGOwoMtvMP9FzrrJimFOz9B7rwtpCUU/dTuO pCCHWFdOUOvAtSZxBEds5L60XfHKmNVZ/xOQDkFw= Authentication-Results: mail-nwsmtp-smtp-production-main-37.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Konstantin Ananyev To: dev@dpdk.org Cc: Konstantin Ananyev , stable@dpdk.org Subject: [PATCH 1/2] examples/l3fwd: fix crash in ACL mode for mixed traffic Date: Thu, 2 May 2024 16:28:15 +0100 Message-Id: <20240502152816.65562-2-konstantin.v.ananyev@yandex.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240502152816.65562-1-konstantin.v.ananyev@yandex.ru> References: <20240502152816.65562-1-konstantin.v.ananyev@yandex.ru> 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 From: Konstantin Ananyev When running l3fwd in ACL mode, if we'll have mix of IPv4/IPv6 packets in the same burst, it will most likely cause a crash. The reason for that is that we split our burst of packets into 2 arrays - one for ipv4, another for ipv6 for classify(). But then we try to send all packets as one burst again, not taking into account that acl_search.res_ipv4[] will be set only for ipv4 packets. Same story for ipv6. The fix is straightforward: use two already split arrays for TX. Bugzilla ID: 1434 Fixes: 6de0ea50e9b9 ("examples/l3fwd: merge l3fwd-acl example") Cc: stable@dpdk.org Signed-off-by: Konstantin Ananyev --- examples/l3fwd/l3fwd_acl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/l3fwd/l3fwd_acl.c b/examples/l3fwd/l3fwd_acl.c index 401692bcec..d9e4ae543f 100644 --- a/examples/l3fwd/l3fwd_acl.c +++ b/examples/l3fwd/l3fwd_acl.c @@ -1073,9 +1073,9 @@ acl_main_loop(__rte_unused void *dummy) l3fwd_acl_send_packets( qconf, - pkts_burst, + acl_search.m_ipv4, acl_search.res_ipv4, - nb_rx); + acl_search.num_ipv4); } if (acl_search.num_ipv6) { @@ -1088,9 +1088,9 @@ acl_main_loop(__rte_unused void *dummy) l3fwd_acl_send_packets( qconf, - pkts_burst, + acl_search.m_ipv6, acl_search.res_ipv6, - nb_rx); + acl_search.num_ipv6); } } } -- 2.35.3