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 D58944373B for ; Tue, 19 Dec 2023 03:56:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF27F402D0; Tue, 19 Dec 2023 03:56:42 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2078.outbound.protection.outlook.com [40.107.100.78]) by mails.dpdk.org (Postfix) with ESMTP id C383A402D0 for ; Tue, 19 Dec 2023 03:56:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eCa6IVgX3CZY2c6wXJqIDMkgWwu4Adre8MsNIkFBH+96gWkdXPEK8Vf9cJgJuus9f/tt+mvm/y5vGAswVaEousFa9OCz4ZgmAbdBFvPlG1wuYxb0GwgPMVIInEURTObxTcSWXuYvBo4j3tKqrGMPp4qGYU4oxbJddOT+aE2JUabBcOw06SsdMyquqPwSlgvyxyAvNGpCTCT54xj3mxjeem/5mKE8e1sUAQxKojSXlE17QolPY/yoF5UwQ+hSUf9KQ3+dR47SgV6KHRXeUTtQhWPnzRrEKGDRk9/6/EHe8f9y9LWoJimLzPVJCaFxGL5RCf9Hk3r4alTrCuJbIgnAzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7SlHXDPxt2WYHbhj7Rgx+Bub8Fy3GSxeEUL5rVh7qCI=; b=IOqLKaU+kKVPFwoFuhwt5juFAfVrGvEbci/jJf1ZxnhxuFt9nifxwkG8vRbygR48wvUIjiDq0eKYHVzCbOHnv/WNfozlG7xjJEg+cxBmbQdP4cSqlvbsKyCH48SagGviA1NFEjbxJGFOJlw5P5ljVoYm0a+USoewLd+h+KDSUY+h/RjeavcVROg1Ia9cxcaQVwByCI/OJU+j+u4CvePer/dqAyOZFvqgkokQJmkSWY+ca5P6luQoWpzgmY77errwrK84kmwkK0F0E0jHZmsswQYD0D9jRfGdWL74xaviKwnirmRLlL4lgxjo1GNoBTU/hSUrNm4lHOViw2dBdOMegg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7SlHXDPxt2WYHbhj7Rgx+Bub8Fy3GSxeEUL5rVh7qCI=; b=C9fRI/9+VfQ5PK4Xg/Fog+9WEVhB3k1AjOULusjZ9TrRDv+e1JpBEbgdjAfMDAbqPBkgHgYJ98gCkBhM3WKHAt0rDL+zudJ+srSSR6BNh1VEpvLza8YWtNubYEyfnzMw5rAeRvmmsNRe6dRPVlDFB2t+I5ASVKZomOZcBlRIMnU= Received: from CY5PR18CA0031.namprd18.prod.outlook.com (2603:10b6:930:13::14) by SN7PR12MB8057.namprd12.prod.outlook.com (2603:10b6:806:34a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 02:56:39 +0000 Received: from CY4PEPF0000EE3E.namprd03.prod.outlook.com (2603:10b6:930:13:cafe::d5) by CY5PR18CA0031.outlook.office365.com (2603:10b6:930:13::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38 via Frontend Transport; Tue, 19 Dec 2023 02:56:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EE3E.mail.protection.outlook.com (10.167.242.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Tue, 19 Dec 2023 02:56:39 +0000 Received: from ubuntu2004.linuxvmimages.local (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 18 Dec 2023 20:56:37 -0600 From: Sivaprasad Tummala To: CC: , Subject: [PATCH v2 4/6] examples/ipsec-secgw: fix lcore ID restriction Date: Tue, 19 Dec 2023 03:56:05 +0100 Message-ID: <20231219025608.2538-5-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231219025608.2538-1-sivaprasad.tummala@amd.com> References: <20231218074905.42749-1-sivaprasad.tummala@amd.com> <20231219025608.2538-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3E:EE_|SN7PR12MB8057:EE_ X-MS-Office365-Filtering-Correlation-Id: 5fce83be-0a76-4596-92bf-08dc003e1f70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q38BVB3RGPT4c/QRaQ/D3rAQiKPqXbKnycHKL7BagUFQMvEDLePWzfzY+prhh4blUBTX146hsRIH+UJjJapXYJNQx0EdYdhCZLwy3nP6BlSKyUGwRrT+2NKnoMVmuRQ+t3r6dUyBo1dv0Wb2c7r9YLk8FR+HBPg0mhNvoSePd/F2jX/K7xgJXrVTCe8s01za+fVjPjyhjSFmTBoAIsDTOSSqnvBzkcV+AGKMdmhnhaYPPNDGrFcXmcoZKYPIwPJsOAntQ4GhVC49xx3N6Qq+OKCu4n7RoMvFD8OqhM/r0ySH+ppZsu0jSYTeKVcMrc7wh4tYL3CQoveFIa8OMZlWwzw1PWYKc9UoP/RMlX1Fvte6soigCTP+4a5jH2QUQJOaBLLuDxkpL1AE3KUU+ox4QXD7biU3aQvB21IXI75el2g9Vv9bUjK7XjvUgGn9LkVrhflwjJUEO6YrxQ0OX3UyVci0XUZGxUB2AJMF333f2KnTQvil4DPbcPtghFMP/fpXJ60i33yvWl35eleZ+Haiura+1xmd+LaeI8d13fAKmQ60w9lX2vYhpD1mrOL99dVoYprocRhlu359j3UD1ZCY795J69KjHTgdLDkZ2gg+cAMtdqxoom6cgKhBTcrKVo5PktXiMJBOeOpsDcSe77JdLBlXGPBpiRdhTrl/1msevnvxVKK0peACqVL1zJNrFlwvOZPGig+TuS4G8jdzCfWrI3y+blcAzqKQKkhNDcNmb4gRI8V4FujBjUzX/IHUrgeRW9Rw4mYoDcNokIlcQ72gPrn2UuVKmlcMPXR8pRpoy3ZMwceTt9O3pLyjXAKuiHes X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(136003)(39860400002)(376002)(346002)(396003)(230922051799003)(230173577357003)(230273577357003)(451199024)(64100799003)(1800799012)(82310400011)(186009)(46966006)(36840700001)(40470700004)(36756003)(40480700001)(40460700003)(2616005)(1076003)(26005)(16526019)(2906002)(478600001)(70586007)(4326008)(6862004)(8676002)(8936002)(70206006)(54906003)(37006003)(6636002)(316002)(6666004)(47076005)(426003)(336012)(36860700001)(41300700001)(5660300002)(44832011)(356005)(81166007)(83380400001)(82740400003)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 02:56:39.4117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fce83be-0a76-4596-92bf-08dc003e1f70 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8057 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 Currently the config option allows lcore IDs up to 255, irrespective of RTE_MAX_LCORES and needs to be fixed. The patch allows config options based on DPDK config. Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application") Cc: sergio.gonzalez.monroy@intel.com Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala --- examples/ipsec-secgw/event_helper.h | 2 +- examples/ipsec-secgw/ipsec-secgw.c | 16 +++++++++------- examples/ipsec-secgw/ipsec.c | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/examples/ipsec-secgw/event_helper.h b/examples/ipsec-secgw/event_helper.h index dfb81bfcf1..9923700f03 100644 --- a/examples/ipsec-secgw/event_helper.h +++ b/examples/ipsec-secgw/event_helper.h @@ -102,7 +102,7 @@ struct eh_event_link_info { /**< Event port ID */ uint8_t eventq_id; /**< Event queue to be linked to the port */ - uint8_t lcore_id; + uint16_t lcore_id; /**< Lcore to be polling on this port */ }; diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index bf98d2618b..6f550db05c 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -221,7 +221,7 @@ static const char *cfgfile; struct lcore_params { uint16_t port_id; uint8_t queue_id; - uint8_t lcore_id; + uint16_t lcore_id; } __rte_cache_aligned; static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS]; @@ -810,7 +810,7 @@ check_flow_params(uint16_t fdir_portid, uint8_t fdir_qid) static int32_t check_poll_mode_params(struct eh_conf *eh_conf) { - uint8_t lcore; + uint16_t lcore; uint16_t portid; uint16_t i; int32_t socket_id; @@ -829,13 +829,13 @@ check_poll_mode_params(struct eh_conf *eh_conf) for (i = 0; i < nb_lcore_params; ++i) { lcore = lcore_params[i].lcore_id; if (!rte_lcore_is_enabled(lcore)) { - printf("error: lcore %hhu is not enabled in " + printf("error: lcore %hu is not enabled in " "lcore mask\n", lcore); return -1; } socket_id = rte_lcore_to_socket_id(lcore); if (socket_id != 0 && numa_on == 0) { - printf("warning: lcore %hhu is on socket %d " + printf("warning: lcore %hu is on socket %d " "with numa off\n", lcore, socket_id); } @@ -870,7 +870,7 @@ static int32_t init_lcore_rx_queues(void) { uint16_t i, nb_rx_queue; - uint8_t lcore; + uint16_t lcore; for (i = 0; i < nb_lcore_params; ++i) { lcore = lcore_params[i].lcore_id; @@ -1051,6 +1051,8 @@ parse_config(const char *q_arg) char *str_fld[_NUM_FLD]; int32_t i; uint32_t size; + unsigned int max_fld[_NUM_FLD] = {RTE_MAX_ETHPORTS, + 255, RTE_MAX_LCORE}; nb_lcore_params = 0; @@ -1071,7 +1073,7 @@ parse_config(const char *q_arg) for (i = 0; i < _NUM_FLD; i++) { errno = 0; int_fld[i] = strtoul(str_fld[i], &end, 0); - if (errno != 0 || end == str_fld[i] || int_fld[i] > 255) + if (errno != 0 || end == str_fld[i] || int_fld[i] > max_fld[i]) return -1; } if (nb_lcore_params >= MAX_LCORE_PARAMS) { @@ -1084,7 +1086,7 @@ parse_config(const char *q_arg) lcore_params_array[nb_lcore_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = - (uint8_t)int_fld[FLD_LCORE]; + (uint16_t)int_fld[FLD_LCORE]; ++nb_lcore_params; } lcore_params = lcore_params_array; diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c index f5cec4a928..5ebb71bb9a 100644 --- a/examples/ipsec-secgw/ipsec.c +++ b/examples/ipsec-secgw/ipsec.c @@ -259,7 +259,7 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[], continue; /* Looking for cryptodev, which can handle this SA */ - key.lcore_id = (uint8_t)lcore_id; + key.lcore_id = (uint16_t)lcore_id; key.cipher_algo = (uint8_t)sa->cipher_algo; key.auth_algo = (uint8_t)sa->auth_algo; key.aead_algo = (uint8_t)sa->aead_algo; -- 2.25.1