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 5DAAC43D0F; Thu, 21 Mar 2024 19:48:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E94342E6B; Thu, 21 Mar 2024 19:48:34 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2064.outbound.protection.outlook.com [40.107.101.64]) by mails.dpdk.org (Postfix) with ESMTP id 651CE42E6B for ; Thu, 21 Mar 2024 19:48:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AIDbig1W8dO5EG7zVuFqd7UAGxiEiaXCqELdjHlbOu/opN7ihhiShJcU+BbHdKDWJ1A44YApu39oc9RkQHPhb5Sla0oltkfKwn02B2sYXg/OFXIKvfriGCNdIJw/6spethrJI3nVzMlMCEq/H0Ghk7o52MLhGRWTDrzEpDYecMci/P6P2kV6/6Oz4UaAGU1riSXJ35kUoY2n5c5B8+mNghzWWQ7ARMgbhXlCF93oZ0dfGavMHgHJ0A/CjHB8kYi7iwVbYeCqG+Nqf8ic4Y9zKOPu51sNxovAIVHeNAJmOhRKC9FqFh05oHeV0eGxHJvIbYuDgkuR/ctBFCMKliUBqw== 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=7B9NXtAogO5duT3T8ebCvhVu80cSN9+05fr8y4JFmMs=; b=SD3FvK5s0hR0sf9ybGeAyP+ZXNHEHouV3sFud3ftnsg9wx/SLY/wlhjKm6YAEBKRov5FLVyqEAQErD1b/G65jZlRUjLwqiD9F0a78x6kAkH7sP0Nnymq0gpz6/VYGfWfClgzlshrnndYnAyurPQvU2EITmUO7XWAxHQwIR1ye/s/7x5QyQnwL83niUsqp8lXJY4ftXJ0HXz5HJr4We+Spbca+PBXKR4L0jYCe5Kla5qJwa5pGuG+N6FwTXjty0cG/9CYK85jv+sTCQZLhd/AcfXX8ZZd2C0kRO6wHNA/c7Y0lrb08X60gH0E1RnlKrpcl9LTz8yHhHEQiH8yOhTZcg== 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=7B9NXtAogO5duT3T8ebCvhVu80cSN9+05fr8y4JFmMs=; b=rdjr8GCtH1rxRg3NOPgbnC+K9M1vMJLnPqB0ZvR6Vp/5AzCp16MHEaSKBbN0TjIjnifLEbjBqB23WY8WcCq7Ka2/SxE9xuwF2yPSjtNb/u8w7uDyio6AGVJQzh6SIsRgmCEIi7r4IaoANJJcuxg+lUmRt5EMovkqY1M8ydgBlSs= Received: from MN2PR04CA0005.namprd04.prod.outlook.com (2603:10b6:208:d4::18) by PH8PR12MB7374.namprd12.prod.outlook.com (2603:10b6:510:216::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.34; Thu, 21 Mar 2024 18:48:29 +0000 Received: from BL6PEPF0001AB78.namprd02.prod.outlook.com (2603:10b6:208:d4:cafe::16) by MN2PR04CA0005.outlook.office365.com (2603:10b6:208:d4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.27 via Frontend Transport; Thu, 21 Mar 2024 18:48:29 +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 BL6PEPF0001AB78.mail.protection.outlook.com (10.167.242.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7409.10 via Frontend Transport; Thu, 21 Mar 2024 18:48:28 +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.35; Thu, 21 Mar 2024 13:48:25 -0500 From: Sivaprasad Tummala To: , , , , , , , , , , CC: Subject: [PATCH v6 04/14] examples/ipsec-secgw: fix queue ID restriction Date: Thu, 21 Mar 2024 19:47:10 +0100 Message-ID: <20240321184721.69040-5-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240321184721.69040-1-sivaprasad.tummala@amd.com> References: <20240318173146.24303-1-sivaprasad.tummala@amd.com> <20240321184721.69040-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB78:EE_|PH8PR12MB7374:EE_ X-MS-Office365-Filtering-Correlation-Id: 70021199-8c17-429c-b60a-08dc49d77fc0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w5CJr9mF7CfePnX4JjIrIYkeJvNFj6TofYsdLjewboolzlC1ibFwfu+P9pY8q671dLGlJ/J1T8B8Ew/LCH02TpR+kAxBp+4qeRTE8+Ih72aKkYcYdM3GA06zbnORDIo3NG5B87ir5EJemwmVrc7R90b1VlywGua5OJGouerO0hIKxbpr7HLh1HBtCo4Hj67H1oYvgFUGbwd4WfM7XaN4oRNe6DK7p7VvMT5CMC6f1jnKMxl4R5s3Py0jbDbfB80tQep61Y8a5yhtHIF7F+NoH7o6QHn78wjJB8/q+HEqCiFYpVPSCdm6qhmglp0EuJmL9wWZOWkSCyOgXXFJawNF6pW6f+J1sa324vtGyYtVGlNvXajnCPinjqTI6hSpT+NwUGSRE+kWazCyvg1MZ2AUEcLtUrZSIk7tYtWPHfPUhzkeqPU4RGnbuWtCBWk1Gov/va95iUk67M6JYgV6LZMlJjgQk9eU+4WI8dT4K3Wp9TY0PgmjoNM1lcTDOAqCxMdIvnxLh4QuZukn/9PKDB0sikCImOe3xyDz6pliliAAykV54i/qvWzBRTp31wZIkuIKaPrHx1jxkFLaDwxksv7zjcVSM6eSZopUEHFF5Fj/SvE+/kGl9i5EEen7VbDH8KSRrs2V2nNaJQ0OceT3WDhskerDPYxiD02p1n/VOVU7f66o78AIBDIHC919IKYyrLrvahtKsOkHD5rj2ma0Iv4eebXIjuH8G1xvA57qsU6J3cOUBgpBJPIRn3eyOwZlajlVeB4eFI9ABrUzfcc9aJsA6g== 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)(82310400014)(36860700004)(1800799015)(7416005)(376005)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2024 18:48:28.8649 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70021199-8c17-429c-b60a-08dc49d77fc0 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: BL6PEPF0001AB78.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7374 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 Currently application supports queue IDs up to 255 and max queues of 256 irrespective of device support. This limits the number of active lcores to 256. The patch fixes these constraints by increasing the queue IDs to support up to 65535. Signed-off-by: Sivaprasad Tummala Acked-by: Konstantin Ananyev Acked-by: Morten Brørup Acked-by: Ferruh Yigit --- examples/ipsec-secgw/ipsec-secgw.c | 20 ++++++++++---------- examples/ipsec-secgw/ipsec.h | 2 +- examples/ipsec-secgw/ipsec_worker.c | 10 ++++------ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 45a303850d..106a058b60 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -220,7 +220,7 @@ static const char *cfgfile; struct lcore_params { uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -695,8 +695,7 @@ ipsec_poll_mode_worker(void) struct rte_mbuf *pkts[MAX_PKT_BURST]; uint32_t lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; - uint16_t i, nb_rx, portid; - uint8_t queueid; + uint16_t i, nb_rx, portid, queueid; struct lcore_conf *qconf; int32_t rc, socket_id; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) @@ -743,7 +742,7 @@ ipsec_poll_mode_worker(void) portid = rxql[i].port_id; queueid = rxql[i].queue_id; RTE_LOG(INFO, IPSEC, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%hu\n", lcore_id, portid, queueid); } @@ -788,8 +787,7 @@ int check_flow_params(uint16_t fdir_portid, uint8_t fdir_qid) { uint16_t i; - uint16_t portid; - uint8_t queueid; + uint16_t portid, queueid; for (i = 0; i < nb_lcore_params; ++i) { portid = lcore_params_array[i].port_id; @@ -851,7 +849,7 @@ check_poll_mode_params(struct eh_conf *eh_conf) return 0; } -static uint8_t +static uint16_t get_port_nb_rx_queues(const uint16_t port) { int32_t queue = -1; @@ -862,7 +860,7 @@ get_port_nb_rx_queues(const uint16_t port) lcore_params[i].queue_id > queue) queue = lcore_params[i].queue_id; } - return (uint8_t)(++queue); + return (uint16_t)(++queue); } static int32_t @@ -1050,6 +1048,8 @@ parse_config(const char *q_arg) char *str_fld[_NUM_FLD]; int32_t i; uint32_t size; + uint32_t max_fld[_NUM_FLD] = {USHRT_MAX, + USHRT_MAX, UCHAR_MAX}; nb_lcore_params = 0; @@ -1070,7 +1070,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) { @@ -1081,7 +1081,7 @@ parse_config(const char *q_arg) lcore_params_array[nb_lcore_params].port_id = (uint8_t)int_fld[FLD_PORT]; lcore_params_array[nb_lcore_params].queue_id = - (uint8_t)int_fld[FLD_QUEUE]; + (uint16_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = (uint8_t)int_fld[FLD_LCORE]; ++nb_lcore_params; diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h index bdcada1c40..29b9b283f0 100644 --- a/examples/ipsec-secgw/ipsec.h +++ b/examples/ipsec-secgw/ipsec.h @@ -285,7 +285,7 @@ struct cnt_blk { struct lcore_rx_queue { uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; void *sec_ctx; } __rte_cache_aligned; diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c index 8d122e8519..90a4c38ba4 100644 --- a/examples/ipsec-secgw/ipsec_worker.c +++ b/examples/ipsec-secgw/ipsec_worker.c @@ -1598,8 +1598,7 @@ ipsec_poll_mode_wrkr_inl_pr(void) int32_t socket_id; uint32_t lcore_id; int32_t i, nb_rx; - uint16_t portid; - uint8_t queueid; + uint16_t portid, queueid; prev_tsc = 0; lcore_id = rte_lcore_id(); @@ -1633,7 +1632,7 @@ ipsec_poll_mode_wrkr_inl_pr(void) portid = rxql[i].port_id; queueid = rxql[i].queue_id; RTE_LOG(INFO, IPSEC, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%hu\n", lcore_id, portid, queueid); } @@ -1729,8 +1728,7 @@ ipsec_poll_mode_wrkr_inl_pr_ss(void) uint32_t i, nb_rx, j; int32_t socket_id; uint32_t lcore_id; - uint16_t portid; - uint8_t queueid; + uint16_t portid, queueid; prev_tsc = 0; lcore_id = rte_lcore_id(); @@ -1764,7 +1762,7 @@ ipsec_poll_mode_wrkr_inl_pr_ss(void) portid = rxql[i].port_id; queueid = rxql[i].queue_id; RTE_LOG(INFO, IPSEC, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%hu\n", lcore_id, portid, queueid); } -- 2.34.1