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 11CFB42DCC; Wed, 5 Jul 2023 12:30:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E183C4021F; Wed, 5 Jul 2023 12:30:52 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 11D1540150; Wed, 5 Jul 2023 12:30:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688553051; x=1720089051; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5x/0zBaEL6IsQ/AqYm1aUvrsCSFXhxhKTaK6Q2oVNfk=; b=ihZxpzW8sOvnOm3OOHu7ej/Jmrt5yFAPzBvl9WUZeFJge56UbywNi+AV niE3XSIJbClmTgUzTISok67c/j0ZItTpNldgxpmQWyu+8w5PMRkaVeSrQ qkfvVL7ru3KSxgtM9KEOXhLmqkfTKv9KrzPAFzsSwTpDUDqEZUcmGjd89 +LkilcjmypDaUsH9ppu6ofE/gq66StGa6IRXHZtYJpdGbiK/ub7HaWP1Z 8m3aXDqWtIJcG2vW89gHcmJPkiGalvR3uJJPabOOZuzBgJNLOKA8/Yh/t VtNPnDBiPvliX+AYP3v7jxH2UbIuM6wT4iM1MsFxIvPkMdNBdC44udgRY Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10761"; a="348093664" X-IronPort-AV: E=Sophos;i="6.01,182,1684825200"; d="scan'208";a="348093664" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2023 03:30:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10761"; a="754311105" X-IronPort-AV: E=Sophos;i="6.01,182,1684825200"; d="scan'208";a="754311105" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.80]) by orsmga001.jf.intel.com with ESMTP; 05 Jul 2023 03:30:48 -0700 From: Ciara Power To: dev@dpdk.org Cc: gakhil@marvell.com, Ciara Power , olivier.matz@6wind.com, stable@dpdk.org Subject: [PATCH] app/crypto-perf: fix socket ID default value Date: Wed, 5 Jul 2023 10:30:46 +0000 Message-Id: <20230705103047.1127985-1-ciara.power@intel.com> X-Mailer: git-send-email 2.25.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, the socket ID should be set 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: Ciara Power --- app/test-crypto-perf/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c index af5bd0d23b..b74e7ba118 100644 --- a/app/test-crypto-perf/main.c +++ b/app/test-crypto-perf/main.c @@ -651,6 +651,11 @@ main(int argc, char **argv) cdev_id = enabled_cdevs[cdev_index]; uint8_t 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 (socket_id >= RTE_MAX_NUMA_NODES) + socket_id = 0; ctx[i] = cperf_testmap[opts.test].constructor( session_pool_socket[socket_id].sess_mp, -- 2.25.1