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 A9A9042DDA; Wed, 5 Jul 2023 19:30:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FC66406B5; Wed, 5 Jul 2023 19:30:20 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 8144D4021F; Wed, 5 Jul 2023 19:30:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688578218; x=1720114218; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=UmmrcVVQSJETWNxf0bDSLGsoxP1/HyKMQ42LJGyUSUI=; b=O5aVyjC9FBEC4DeAgyYUD6BOndWITxrCtDQvh6Vocwr/NKvxAT5aZm1Y ZUVNbNnmQg+PglRk/l+EbLm6Wzp1mMHDzKo/ayQgJKef/08RvbdQ9IVpy qMzoIymHX/M0yCaltNSJhvtCLAMbY/AdpiT/Gs3ePaKj4cuC75QnAqnBr 7SQL5uHAdJf/YV0xQ7C02kgWCrRuRNTbv4Gz1kJltsXqqIVGZmS4KBgLN vLOlN6zyBW+Red7OkJrTIDfqQJuylLW6EKMyH25R/uFXcJOrtUR+U0Kqb JWGXbOg/2KJVJ1yIPlyMmAxOp0N9RxhzVJY8meUR5CQukJmaJPjTJFyec Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10762"; a="427084327" X-IronPort-AV: E=Sophos;i="6.01,183,1684825200"; d="scan'208";a="427084327" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2023 10:30:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10762"; a="843360201" X-IronPort-AV: E=Sophos;i="6.01,183,1684825200"; d="scan'208";a="843360201" Received: from silpixa00400465.ir.intel.com ([10.55.129.105]) by orsmga004.jf.intel.com with ESMTP; 05 Jul 2023 10:29:56 -0700 From: Kai Ji To: dev@dpdk.org Cc: gakhil@marvell.com, stable@dpdk.org, Kai Ji , olivier.matz@6wind.com Subject: [dpdk-dev v1] examples/ipsec-secgw: fix of socket id default value Date: Wed, 5 Jul 2023 17:29:54 +0000 Message-Id: <20230705172954.906085-1-kai.ji@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 Due to recent changes to the default device socket ID, before being used as an index for session mempool list, set socket ID to 0 if unknown (-1). Fixes: 7dcd73e37965 ("drivers/bus: set device NUMA node to unknown by default") Cc: olivier.matz@6wind.com Cc: stable@dpdk.org Signed-off-by: Kai Ji --- examples/ipsec-secgw/ipsec-secgw.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 029749e522..e678625ece 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -1699,6 +1699,11 @@ cryptodevs_init(enum eh_pkt_transfer_mode mode) total_nb_qps += qp; dev_conf.socket_id = rte_cryptodev_socket_id(cdev_id); + /* range check the socket_id - negative values become big + * positive ones due to use of unsigned value + */ + if (dev_conf.socket_id >= RTE_MAX_NUMA_NODES) + dev_conf.socket_id = 0; dev_conf.nb_queue_pairs = qp; dev_conf.ff_disable = RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO; -- 2.34.1