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 4C53D4555B; Wed, 3 Jul 2024 10:49:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFEA941060; Wed, 3 Jul 2024 10:49:01 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id 2CCE44003C; Wed, 3 Jul 2024 10:48:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719996539; x=1751532539; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QzOHVZxwy/pTDuJKFPqvYust+aIyIG6CCHIFqQF1bCM=; b=cksw+rhHNIOvD1nuV6xMLQFz5QXufStNmqrz+XojYNfqywaf5eF0Uos2 p+UpmODxWl9QKfm+0GYpi8uD5j5GD8U02rmVefKcrIuZuFMisMwWHzEuR nxR7jr0cEV3fg3QesTCIz0pFV73HYh/kXsrZgDBl2Cj4bXlDIQ38twXqW gUvfv+62HazgZy/WsqT1Wk2xOWrZCpyNqRSMWluBTav9c6ASA8BdrHUU+ KEJhrVEAx5PfCAlbp5CTUMcqubxhZ2NH44y5u9W+UzLK+KCg56mjkhoRM CjJUv+S/nqkuXVVubIpnk2wsK+5w4VwUv3ZIoA1LEptEUSZ206SsuXfD1 Q==; X-CSE-ConnectionGUID: bUIt0cS8Su6sGjfI7eBy9A== X-CSE-MsgGUID: uht3yI9NSMSsiXzs3qgYnA== X-IronPort-AV: E=McAfee;i="6700,10204,11121"; a="28608401" X-IronPort-AV: E=Sophos;i="6.09,181,1716274800"; d="scan'208";a="28608401" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 01:48:58 -0700 X-CSE-ConnectionGUID: fL9DPI2aRAiJfkAtICu/uw== X-CSE-MsgGUID: BD7AFbHEQVWt3lYlV/Z5eg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,181,1716274800"; d="scan'208";a="51132443" Received: from shwdenpg561.ccr.corp.intel.com (HELO dpdk..) ([10.239.252.3]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 01:48:56 -0700 From: Kaiwen Deng To: dev@dpdk.org Cc: stable@dpdk.org, yidingx.zhou@intel.com, Kaiwen Deng , Sean Morrissey Subject: [PATCH] examples/l3fwd: Fix core dump with multiple socket Date: Wed, 3 Jul 2024 15:50:37 +0800 Message-Id: <20240703075038.1594523-1-kaiwenx.deng@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Setting acl will clear the acl config of other sockets, which will result in core dump. This commit will no longer clear the acl config when setting acl. Fixes: 6de0ea50e9b9 ("examples/l3fwd: merge l3fwd-acl example") Cc: stable@dpdk.org Signed-off-by: Kaiwen Deng --- examples/l3fwd/l3fwd_acl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/l3fwd/l3fwd_acl.c b/examples/l3fwd/l3fwd_acl.c index 401692bcec..c8958f59fc 100644 --- a/examples/l3fwd/l3fwd_acl.c +++ b/examples/l3fwd/l3fwd_acl.c @@ -962,8 +962,6 @@ setup_acl(const int socket_id) acl_log("IPv6 ACL entries %u:\n", acl_num_ipv6); dump_ipv6_rules((struct acl6_rule *)acl_base_ipv6, acl_num_ipv6, 1); - memset(&acl_config, 0, sizeof(acl_config)); - /* Check sockets a context should be created on */ if (socket_id >= NB_SOCKETS) { acl_log("Socket %d is out " @@ -973,6 +971,9 @@ setup_acl(const int socket_id) return; } + rte_acl_free(acl_config.acx_ipv4[socket_id]); + rte_acl_free(acl_config.acx_ipv6[socket_id]); + acl_config.acx_ipv4[socket_id] = app_acl_init(route_base_ipv4, acl_base_ipv4, route_num_ipv4, acl_num_ipv4, 0, socket_id); -- 2.34.1