From patchwork Tue Jan 16 18:23:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135890 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C96AC438E3; Tue, 16 Jan 2024 19:23:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39DC54069D; Tue, 16 Jan 2024 19:23:52 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2061.outbound.protection.outlook.com [40.107.93.61]) by mails.dpdk.org (Postfix) with ESMTP id 36D6E400D6; Tue, 16 Jan 2024 19:23:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YZlE2eKclTp7x4G4GpUy7Wr1ZzBAqkxTvk1SR5nLyRs/6s462hTzVunsfqCz/Z7yzOywWUHAYMV3K1wHnT/R1WmxbSbe222vuZ5ROCHWenbwbUNYxLoxojKEJSNMdgiPamELrB0QnfNt/oCrJN4MUnoyvkti9KPvA7wxr4T19Y8jKAUhzOdPQH2371m4YNnzMZT0kX7N8ZXC9LZvoJN4f9Prp7kYjWJ6rGV02GgiMU6+k/oaRwcEfWoUrzs/jvFmyIdwqRHsSwbIYavNCgbMB9jisE3aONKUO57dLIV7yU/gzyWqaGYqxKyf0gryYnmPuT5lA3UMoIoqdfw9+M8X8g== 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=imWe6H07kp6wV5GnS/o2knOcOcFfNGYqoByzdCtJLb8=; b=L021otOWaAnQ6MXHzv4WooEIwTRZlx5u5lsAL0hNqT9u4iIE71HZuTxuJQWcRy8n3+jqVEsf37pPmrp3E8KsBo/H0dJ6CinhPDxKalG5Wgz15YxA9Xud/T6LlC7OY1TQ37HfGGqwIlqQQgb0uZacoCB1u/M8FoDlALHlQiX6q06jJ3CwGS66fXqPvnGtyBYSvzezwP5k7IW9+ZABJuRmuJBbsj5QhYC2pLfGIHNcJ/ayBidCE1iubkLRGbMQwY/w+9lufNPuaCWA3J/MwxC1QyXYudqwk1WJNF0AdlGyevGqmym8+b7l2oTARHeZkdCM+OVYAPvIngRvyC6qTGPDNA== 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=imWe6H07kp6wV5GnS/o2knOcOcFfNGYqoByzdCtJLb8=; b=eeqfHAmlJltpc4KsSy6DvABpKOqtaCRr8dJ16AcxUdGQC1CJGsuNf6WQzqcjQ16YKQbCJi8/4wixkPQG86KGZu1gXReMAgvqsavdmY36gJGDzonfZpvHrhBArOjMDNHzvxZT/k/SLsY8M4wj2ODJD2qfemGrfTHDzFCOs8O7tMM= Received: from BYAPR07CA0099.namprd07.prod.outlook.com (2603:10b6:a03:12b::40) by CH0PR12MB5204.namprd12.prod.outlook.com (2603:10b6:610:bb::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Tue, 16 Jan 2024 18:23:47 +0000 Received: from SJ1PEPF00001CDF.namprd05.prod.outlook.com (2603:10b6:a03:12b:cafe::41) by BYAPR07CA0099.outlook.office365.com (2603:10b6:a03:12b::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.23 via Frontend Transport; Tue, 16 Jan 2024 18:23:47 +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 SJ1PEPF00001CDF.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Tue, 16 Jan 2024 18:23:47 +0000 Received: from 7dbylenovo.amd.com (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; Tue, 16 Jan 2024 12:23:45 -0600 From: Sivaprasad Tummala To: , , , , , , , , CC: , Subject: [PATCH v4 1/6] examples/l3fwd: fix lcore ID restriction Date: Tue, 16 Jan 2024 18:23:26 +0000 Message-ID: <20240116182332.95537-2-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240116182332.95537-1-sivaprasad.tummala@amd.com> References: <20231220064502.2830-1-sivaprasad.tummala@amd.com> <20240116182332.95537-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: SJ1PEPF00001CDF:EE_|CH0PR12MB5204:EE_ X-MS-Office365-Filtering-Correlation-Id: cd9d6667-bf15-45d4-506b-08dc16c047ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 63OCM1LKus5COSe0w6MmPWA4AjEkO38BUd2uPQmII4IihT4B2j0WL51mevTccogXHQenQ6yoIApQU68sdwYX6MKrUqX7KPfYiPHeReAk9HDic17yW5Q/B2bb9nuYoMFqzpzK3OxZ6RZ77ME3AULaKjmZZCBX/tdweb7ln3a9kmDWNz2D7tXyi6cHEWLjL33NgUhjpusPHNkgaz8y1NXVoVVnGU2StD69dtHelUwhCQJC1RbGr4Y1gDaEA/ckUTPGtFJWl6wEsJZwX5tUt6ynWwFXHvFNU3/ALu3UJgHPn2XzPLqH3OtjgQq0BiskVWWlyCGFGzxtBvcVkWvOA/sfT5eGxqO+oFBpFo67NJ+bop391zm8nWhmynH7bC/W607IAxa7jEcWKL0eJ34EzPmtc1yEOr0D5Akz4D+w6SgKsX76QPmHTmV913hqEpBE2J7OywjbQ3HQrNUcM1zwZqyu8SUZ22D5cJBrSRyBRcREY3s93MskhqsBXLpGkwkKp60HPHwVSSa7J3ZbejHGZuDfWxqqDLl1RmKh+66aKwOOPy5OrUVweoSuR5U/VQRXznbz7mak//s7i8DuCMIioi/1uLglsu0c0LxzgPyWV1xvGlYhPe8i2mdmAvUabfWy92R6jmMwoFGzW7aQ2DBW9Lue2euwcyNah0kyR/3tqVNIhTdd1/sRAXMPYsBXvsHLiGFd22AOCyHRHU2rPw534ezJjTAYe7f5ECUIP+ptRY/x5W5KmoI5iXY11WWcLWkrhmCdeAj66utUa1nOFGW2hmr1Y4+CqXQngIFzl2jRy3VgUsTIb0EDhD8p+H/mL5VsY7uR 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)(39860400002)(396003)(376002)(136003)(346002)(230273577357003)(230173577357003)(230922051799003)(186009)(64100799003)(451199024)(82310400011)(1800799012)(46966006)(36840700001)(40470700004)(41300700001)(82740400003)(47076005)(83380400001)(36860700001)(36756003)(86362001)(81166007)(356005)(316002)(110136005)(70206006)(70586007)(2906002)(7416002)(8676002)(54906003)(5660300002)(4326008)(8936002)(44832011)(2616005)(1076003)(426003)(336012)(26005)(16526019)(478600001)(6666004)(7696005)(40480700001)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 18:23:47.4915 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd9d6667-bf15-45d4-506b-08dc16c047ef 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: SJ1PEPF00001CDF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5204 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 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: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala Acked-by: Konstantin Ananyev --- examples/l3fwd/l3fwd.h | 2 +- examples/l3fwd/l3fwd_acl.c | 4 ++-- examples/l3fwd/l3fwd_em.c | 4 ++-- examples/l3fwd/l3fwd_event.h | 2 +- examples/l3fwd/l3fwd_fib.c | 4 ++-- examples/l3fwd/l3fwd_lpm.c | 5 ++--- examples/l3fwd/main.c | 36 ++++++++++++++++++++---------------- 7 files changed, 30 insertions(+), 27 deletions(-) diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index e7ae0e5834..12c264cb4c 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -74,7 +74,7 @@ struct mbuf_table { struct lcore_rx_queue { uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; } __rte_cache_aligned; struct lcore_conf { diff --git a/examples/l3fwd/l3fwd_acl.c b/examples/l3fwd/l3fwd_acl.c index 401692bcec..2bd63181bc 100644 --- a/examples/l3fwd/l3fwd_acl.c +++ b/examples/l3fwd/l3fwd_acl.c @@ -997,7 +997,7 @@ acl_main_loop(__rte_unused void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc; int i, nb_rx; uint16_t portid; - uint8_t queueid; + uint16_t queueid; struct lcore_conf *qconf; int socketid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) @@ -1020,7 +1020,7 @@ acl_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%hu\n", lcore_id, portid, queueid); } diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 40e102b38a..cd2bb4a4bb 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -586,7 +586,7 @@ em_main_loop(__rte_unused void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, nb_rx; - uint8_t queueid; + uint16_t queueid; uint16_t portid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / @@ -609,7 +609,7 @@ em_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%hu\n", lcore_id, portid, queueid); } diff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h index 9aad358003..c6a4a89127 100644 --- a/examples/l3fwd/l3fwd_event.h +++ b/examples/l3fwd/l3fwd_event.h @@ -78,8 +78,8 @@ struct l3fwd_event_resources { uint8_t deq_depth; uint8_t has_burst; uint8_t enabled; - uint8_t eth_rx_queues; uint8_t vector_enabled; + uint16_t eth_rx_queues; uint16_t vector_size; uint64_t vector_tmo_ns; }; diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c index 6a21984415..7da55f707a 100644 --- a/examples/l3fwd/l3fwd_fib.c +++ b/examples/l3fwd/l3fwd_fib.c @@ -186,7 +186,7 @@ fib_main_loop(__rte_unused void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc; int i, nb_rx; uint16_t portid; - uint8_t queueid; + uint16_t queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -208,7 +208,7 @@ fib_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%hu\n", lcore_id, portid, queueid); } diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index a484a33089..01d38bc69c 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -148,8 +148,7 @@ lpm_main_loop(__rte_unused void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, nb_rx; - uint16_t portid; - uint8_t queueid; + uint16_t portid, queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -171,7 +170,7 @@ lpm_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%hu\n", lcore_id, portid, queueid); } diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 3bf28aec0c..db49f4707d 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -98,8 +98,8 @@ struct parm_cfg parm_config; struct lcore_params { uint16_t port_id; - uint8_t queue_id; - uint8_t lcore_id; + uint16_t queue_id; + uint16_t lcore_id; } __rte_cache_aligned; static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS]; @@ -292,24 +292,24 @@ setup_l3fwd_lookup_tables(void) static int check_lcore_params(void) { - uint8_t queue, lcore; + uint16_t queue, lcore; uint16_t i; int socketid; for (i = 0; i < nb_lcore_params; ++i) { queue = lcore_params[i].queue_id; if (queue >= MAX_RX_QUEUE_PER_PORT) { - printf("invalid queue number: %hhu\n", queue); + printf("invalid queue number: %hu\n", queue); return -1; } lcore = lcore_params[i].lcore_id; if (!rte_lcore_is_enabled(lcore)) { - printf("error: lcore %hhu is not enabled in lcore mask\n", lcore); + printf("error: lcore %hu is not enabled in lcore mask\n", lcore); return -1; } if ((socketid = rte_lcore_to_socket_id(lcore) != 0) && (numa_on == 0)) { - printf("warning: lcore %hhu is on socket %d with numa off \n", + printf("warning: lcore %hu is on socket %d with numa off\n", lcore, socketid); } } @@ -336,7 +336,7 @@ check_port_config(void) return 0; } -static uint8_t +static uint16_t get_port_n_rx_queues(const uint16_t port) { int queue = -1; @@ -352,14 +352,14 @@ get_port_n_rx_queues(const uint16_t port) lcore_params[i].port_id); } } - return (uint8_t)(++queue); + return (uint16_t)(++queue); } static int 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; @@ -500,6 +500,8 @@ parse_config(const char *q_arg) char *str_fld[_NUM_FLD]; int i; unsigned size; + uint16_t max_fld[_NUM_FLD] = {RTE_MAX_ETHPORTS, + USHRT_MAX, RTE_MAX_LCORE}; nb_lcore_params = 0; @@ -518,7 +520,8 @@ 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) { @@ -527,11 +530,11 @@ parse_config(const char *q_arg) return -1; } lcore_params_array[nb_lcore_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + (uint16_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]; + (uint16_t)int_fld[FLD_LCORE]; ++nb_lcore_params; } lcore_params = lcore_params_array; @@ -630,7 +633,7 @@ parse_event_eth_rx_queues(const char *eth_rx_queues) { struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc(); char *end = NULL; - uint8_t num_eth_rx_queues; + uint16_t num_eth_rx_queues; /* parse decimal string */ num_eth_rx_queues = strtoul(eth_rx_queues, &end, 10); @@ -1211,7 +1214,8 @@ config_port_max_pkt_len(struct rte_eth_conf *conf, static void l3fwd_poll_resource_setup(void) { - uint8_t nb_rx_queue, queue, socketid; + uint8_t socketid; + uint16_t nb_rx_queue, queue; struct rte_eth_dev_info dev_info; uint32_t n_tx_queue, nb_lcores; struct rte_eth_txconf *txconf; @@ -1528,7 +1532,7 @@ main(int argc, char **argv) struct lcore_conf *qconf; uint16_t queueid, portid; unsigned int lcore_id; - uint8_t queue; + uint16_t queue; int ret; /* init EAL */ From patchwork Tue Jan 16 18:23:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135892 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5345D438E3; Tue, 16 Jan 2024 19:24:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 314BE40DDC; Tue, 16 Jan 2024 19:23:56 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2065.outbound.protection.outlook.com [40.107.220.65]) by mails.dpdk.org (Postfix) with ESMTP id 135DC40A73; Tue, 16 Jan 2024 19:23:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KBUvi/OUFxJJWwL2ZVD0gKFf/YK4ecndHAp4j9TnTl0r4a6QJQqfTs9aZeVZXcqk9ydq7ySC6BfoheEWDJP9cvw6Gw6+SRi2xlXCbJJfJUZw/UNus/gPK7yG06Q1kuYjlactjeCIDhL0wJQZxCxNEg7py3DppKIvfJVBt9WM2rLME3XukDsN4s/LR+4JCrp74lGDe2qYKFEFzPakCUSVmVAACbqmGNo0YwUZ+I1pmOBWxvEWf3Xo09muPgyEYnzQJfJs2m0e6yAA8HaJobJr36LowqyTtr6Loi55ZvIJ2Z81sI06Eg9gs0K60WtQwdvbg6kb0T2rUDBLWjRfs0SkOw== 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=tEdzuwMABIKRnPgsOqMhOTy2ypEHQJJZ7eDm8pbf1Jc=; b=Wi8Cr1FPdFAVABF1B2zUjtEM3kC2SaxJLF8sO81ta0AR7CZSixxk0rsvFTfppwvxkH/BLkRdZWipl49L3c1eaXQoNYfhkDF/aFZK7E/a0HVfST8tfuAhCunUW3uKygN+HRjzw03pqc+50qqf/vv1WZPECnQk6aRBmqBx8Jj9xx0XEQRRS4ftSrMhdxi1Hy0dTCYZ350Ttl2kRUbbR4tDQA+S0wFaKtJ3GK6k9wV/jqLXQAj0AbmgvoFvO3OnenxQ69BquoXyCMtZ96xdrGIIZXQFdsniBhFFqK71OyvogiEX5ijeWujkqzgTtxGGgGn9PKIKDWAEtOq0e3pkTIunMQ== 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=tEdzuwMABIKRnPgsOqMhOTy2ypEHQJJZ7eDm8pbf1Jc=; b=1LpUhtMifueiso4n1ICiLJ75E9XM+rZ9tlV12Yp1vV4FS5MLn4yOi/Lk4rVKRZHrxxK+3959Tb+C7JVMAykdt8PSo+mx+NPAxgDefOunRHsH6aFkam8hWKEIa3hEvnzoNvnI/gES+/EaYKNv5qMthe97TKTdfIZunTYMNyDG2l8= Received: from BYAPR07CA0019.namprd07.prod.outlook.com (2603:10b6:a02:bc::32) by IA1PR12MB6187.namprd12.prod.outlook.com (2603:10b6:208:3e5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.29; Tue, 16 Jan 2024 18:23:49 +0000 Received: from SJ1PEPF00001CDC.namprd05.prod.outlook.com (2603:10b6:a02:bc:cafe::b) by BYAPR07CA0019.outlook.office365.com (2603:10b6:a02:bc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26 via Frontend Transport; Tue, 16 Jan 2024 18:23:48 +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 SJ1PEPF00001CDC.mail.protection.outlook.com (10.167.242.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Tue, 16 Jan 2024 18:23:48 +0000 Received: from 7dbylenovo.amd.com (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; Tue, 16 Jan 2024 12:23:46 -0600 From: Sivaprasad Tummala To: , , , , , , , , CC: , Subject: [PATCH v4 2/6] examples/l3fwd-power: fix lcore ID restriction Date: Tue, 16 Jan 2024 18:23:27 +0000 Message-ID: <20240116182332.95537-3-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240116182332.95537-1-sivaprasad.tummala@amd.com> References: <20231220064502.2830-1-sivaprasad.tummala@amd.com> <20240116182332.95537-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: SJ1PEPF00001CDC:EE_|IA1PR12MB6187:EE_ X-MS-Office365-Filtering-Correlation-Id: 2473ac8d-04f0-4cbb-d2c3-08dc16c048ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bdpiTX9ZVqGQW0gS1V2W+dnvc0WcZ3Qtnoc3XehDJok11XsAzBBOXFfNkqiyDyb/ntubd8yDxyA/jATIoYvTxkb6gGLedevoL3UL3mBsFXlrmsBoVOs0e+bfABFSzmO0afHmOhDR/qlT4V9+EsIQ7U2CDN+oL9WMTioGpTd5gBq+js4lSDMWQWnl/M7xcVRgZXQnVb1Q9ykYNiUcHdYKsoQuD940OzMDjvx2DuBAjjKs0e14eXrQvim8gnWPuK/hedKoVPagazl0p4luhkzeMwqRvE3Lj4mTfsvehtBp2RnjYX97G+WD3ZAxcQB7lyGLZgEp2/8dozOaNXlZRpPzPFHQGkuDiPasQ+k9PvoCW945IZYfdK7bW+ZGRZpfPzcndMwfejgjQ864d+LjNhosgzxDY9HWQAnFIx4P30W3qBtehPRYwcobAebyZ8RONU1wSxDgDawcy99QMPxR+0K1Ln9kU//n8MQxVqTuyHhUijVyQHFZuuY6jDMjQOO3YfhISBEReSjoCRAlgRDfiLS+AHLCSYw1Lf8P2tGzCMh4V727jfSkoAnEfjNreUbP/MbheJ4YfZaw4n9MKhKAk+YhYL+RRVyVFc8iJUPqZiqzOv6KQVaZja/iPYDzDcLxt01x+eylG0VlEib+FxFunF2vQmfdP03CWoKaXjOL7Pt6VMeyC8cxdvb3rYtyNzBgtulhfdsYtY6C4+360yTrbCLpd8irlGIiY8rSPwt8RZaab+FCDv5Rtxi6FiIjtsUpfbCer5Uxh/LZYC+5f7N98hveVpLSjvOXy5oX2yob1z2WfBQqaiDv15DPpx56fMpvqmyV 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)(39860400002)(346002)(376002)(396003)(136003)(230273577357003)(230173577357003)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(82310400011)(40470700004)(36840700001)(46966006)(83380400001)(5660300002)(356005)(81166007)(8676002)(8936002)(4326008)(82740400003)(7416002)(2906002)(336012)(16526019)(86362001)(2616005)(47076005)(40460700003)(40480700001)(1076003)(36860700001)(426003)(26005)(478600001)(44832011)(7696005)(6666004)(36756003)(110136005)(316002)(70586007)(70206006)(54906003)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 18:23:48.6775 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2473ac8d-04f0-4cbb-d2c3-08dc16c048ad 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: SJ1PEPF00001CDC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6187 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 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: f88e7c175a68 ("examples/l3fwd-power: add high/regular perf cores options") Cc: radu.nicolau@intel.com Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala --- examples/l3fwd-power/main.c | 57 ++++++++++++++++---------------- examples/l3fwd-power/main.h | 4 +-- examples/l3fwd-power/perf_core.c | 10 +++--- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index f4adcf41b5..d0f3c332ee 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -214,7 +214,7 @@ enum freq_scale_hint_t struct lcore_rx_queue { uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; enum freq_scale_hint_t freq_up_hint; uint32_t zero_rx_packet_count; uint32_t idle_hint; @@ -838,7 +838,7 @@ sleep_until_rx_interrupt(int num, int lcore) struct rte_epoll_event event[num]; int n, i; uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; void *data; if (status[lcore].wakeup) { @@ -850,9 +850,9 @@ sleep_until_rx_interrupt(int num, int lcore) n = rte_epoll_wait(RTE_EPOLL_PER_THREAD, event, num, 10); for (i = 0; i < n; i++) { data = event[i].epdata.data; - port_id = ((uintptr_t)data) >> CHAR_BIT; + port_id = ((uintptr_t)data) >> (sizeof(uint16_t) * CHAR_BIT); queue_id = ((uintptr_t)data) & - RTE_LEN2MASK(CHAR_BIT, uint8_t); + RTE_LEN2MASK((sizeof(uint16_t) * CHAR_BIT), uint16_t); RTE_LOG(INFO, L3FWD_POWER, "lcore %u is waked up from rx interrupt on" " port %d queue %d\n", @@ -867,7 +867,7 @@ static void turn_on_off_intr(struct lcore_conf *qconf, bool on) { int i; struct lcore_rx_queue *rx_queue; - uint8_t queue_id; + uint16_t queue_id; uint16_t port_id; for (i = 0; i < qconf->n_rx_queue; ++i) { @@ -887,7 +887,7 @@ static void turn_on_off_intr(struct lcore_conf *qconf, bool on) static int event_register(struct lcore_conf *qconf) { struct lcore_rx_queue *rx_queue; - uint8_t queueid; + uint16_t queueid; uint16_t portid; uint32_t data; int ret; @@ -897,7 +897,7 @@ static int event_register(struct lcore_conf *qconf) rx_queue = &(qconf->rx_queue_list[i]); portid = rx_queue->port_id; queueid = rx_queue->queue_id; - data = portid << CHAR_BIT | queueid; + data = portid << (sizeof(uint16_t) * CHAR_BIT) | queueid; ret = rte_eth_dev_rx_intr_ctl_q(portid, queueid, RTE_EPOLL_PER_THREAD, @@ -917,8 +917,7 @@ static int main_intr_loop(__rte_unused void *dummy) unsigned int lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, nb_rx; - uint8_t queueid; - uint16_t portid; + uint16_t portid, queueid; struct lcore_conf *qconf; struct lcore_rx_queue *rx_queue; uint32_t lcore_rx_idle_count = 0; @@ -946,7 +945,7 @@ static int main_intr_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD_POWER, - " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + " -- lcoreid=%u portid=%u rxqueueid=%hu\n", lcore_id, portid, queueid); } @@ -1083,8 +1082,7 @@ main_telemetry_loop(__rte_unused void *dummy) unsigned int lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc, prev_tel_tsc; int i, j, nb_rx; - uint8_t queueid; - uint16_t portid; + uint16_t portid, queueid; struct lcore_conf *qconf; struct lcore_rx_queue *rx_queue; uint64_t ep_nep[2] = {0}, fp_nfp[2] = {0}; @@ -1114,7 +1112,7 @@ main_telemetry_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%u " - "rxqueueid=%hhu\n", lcore_id, portid, queueid); + "rxqueueid=%hu\n", lcore_id, portid, queueid); } while (!is_done()) { @@ -1205,8 +1203,7 @@ main_legacy_loop(__rte_unused void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc, tim_res_tsc, hz; uint64_t prev_tsc_power = 0, cur_tsc_power, diff_tsc_power; int i, j, nb_rx; - uint8_t queueid; - uint16_t portid; + uint16_t portid, queueid; struct lcore_conf *qconf; struct lcore_rx_queue *rx_queue; enum freq_scale_hint_t lcore_scaleup_hint; @@ -1234,7 +1231,7 @@ main_legacy_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%u " - "rxqueueid=%hhu\n", lcore_id, portid, queueid); + "rxqueueid=%hu\n", lcore_id, portid, queueid); } /* add into event wait list */ @@ -1399,25 +1396,25 @@ main_legacy_loop(__rte_unused void *dummy) static int check_lcore_params(void) { - uint8_t queue, lcore; + uint16_t queue, lcore; uint16_t i; int socketid; for (i = 0; i < nb_lcore_params; ++i) { queue = lcore_params[i].queue_id; if (queue >= MAX_RX_QUEUE_PER_PORT) { - printf("invalid queue number: %hhu\n", queue); + printf("invalid queue number: %hu\n", queue); return -1; } lcore = lcore_params[i].lcore_id; if (!rte_lcore_is_enabled(lcore)) { - printf("error: lcore %hhu is not enabled in lcore " + printf("error: lcore %hu is not enabled in lcore " "mask\n", lcore); return -1; } if ((socketid = rte_lcore_to_socket_id(lcore) != 0) && (numa_on == 0)) { - printf("warning: lcore %hhu is on socket %d with numa " + printf("warning: lcore %hu is on socket %d with numa " "off\n", lcore, socketid); } if (app_mode == APP_MODE_TELEMETRY && lcore == rte_lcore_id()) { @@ -1451,7 +1448,7 @@ check_port_config(void) return 0; } -static uint8_t +static uint16_t get_port_n_rx_queues(const uint16_t port) { int queue = -1; @@ -1462,14 +1459,14 @@ get_port_n_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 int 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; @@ -1661,6 +1658,8 @@ parse_config(const char *q_arg) char *str_fld[_NUM_FLD]; int i; unsigned size; + unsigned int max_fld[_NUM_FLD] = {RTE_MAX_ETHPORTS, + USHRT_MAX, RTE_MAX_LCORE}; nb_lcore_params = 0; @@ -1681,7 +1680,7 @@ parse_config(const char *q_arg) errno = 0; int_fld[i] = strtoul(str_fld[i], &end, 0); if (errno != 0 || end == str_fld[i] || int_fld[i] > - 255) + max_fld[i]) return -1; } if (nb_lcore_params >= MAX_LCORE_PARAMS) { @@ -1690,11 +1689,11 @@ parse_config(const char *q_arg) return -1; } lcore_params_array[nb_lcore_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + (uint16_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]; + (uint16_t)int_fld[FLD_LCORE]; ++nb_lcore_params; } lcore_params = lcore_params_array; @@ -2501,8 +2500,8 @@ main(int argc, char **argv) uint64_t hz; uint32_t n_tx_queue, nb_lcores; uint32_t dev_rxq_num, dev_txq_num; - uint8_t nb_rx_queue, queue, socketid; - uint16_t portid; + uint8_t socketid; + uint16_t portid, nb_rx_queue, queue; const char *ptr_strings[NUM_TELSTATS]; /* init EAL */ diff --git a/examples/l3fwd-power/main.h b/examples/l3fwd-power/main.h index 258de98f5b..dcb5744ee6 100644 --- a/examples/l3fwd-power/main.h +++ b/examples/l3fwd-power/main.h @@ -9,8 +9,8 @@ #define MAX_LCORE_PARAMS 1024 struct lcore_params { uint16_t port_id; - uint8_t queue_id; - uint8_t lcore_id; + uint16_t queue_id; + uint16_t lcore_id; } __rte_cache_aligned; extern struct lcore_params *lcore_params; diff --git a/examples/l3fwd-power/perf_core.c b/examples/l3fwd-power/perf_core.c index 41ef6d0c9a..1fb9ceb584 100644 --- a/examples/l3fwd-power/perf_core.c +++ b/examples/l3fwd-power/perf_core.c @@ -22,9 +22,9 @@ static uint16_t nb_hp_lcores; struct perf_lcore_params { uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; uint8_t high_perf; - uint8_t lcore_idx; + uint16_t lcore_idx; } __rte_cache_aligned; static struct perf_lcore_params prf_lc_prms[MAX_LCORE_PARAMS]; @@ -161,13 +161,13 @@ parse_perf_config(const char *q_arg) return -1; } prf_lc_prms[nb_prf_lc_prms].port_id = - (uint8_t)int_fld[FLD_PORT]; + (uint16_t)int_fld[FLD_PORT]; prf_lc_prms[nb_prf_lc_prms].queue_id = - (uint8_t)int_fld[FLD_QUEUE]; + (uint16_t)int_fld[FLD_QUEUE]; prf_lc_prms[nb_prf_lc_prms].high_perf = !!(uint8_t)int_fld[FLD_LCORE_HP]; prf_lc_prms[nb_prf_lc_prms].lcore_idx = - (uint8_t)int_fld[FLD_LCORE_IDX]; + (uint16_t)int_fld[FLD_LCORE_IDX]; ++nb_prf_lc_prms; } From patchwork Tue Jan 16 18:23:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135891 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6ECAB438E3; Tue, 16 Jan 2024 19:24:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6AD3D40A7D; Tue, 16 Jan 2024 19:23:54 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2072.outbound.protection.outlook.com [40.107.94.72]) by mails.dpdk.org (Postfix) with ESMTP id A875940A71; Tue, 16 Jan 2024 19:23:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SyVsCxa3SNwOeZLtj5U5UYIPpraLjlBNh/uIHl2gTFuz8dDeExYRg/N4UNAt3a/Q/d294gyewSLFIcbn2LwUkUbuK9DU0S+LC2EXcKvncn+zOBPoVmgUearGITFXCklp1/tjkHMx9ki+lXRwKk7vmIC/Z8H+ReFZgCDs1FSXh7nXRJT7rf/oPo3ob+7oeb9FeDPVfBZSJfsp/V+nHH4JnhawBqoObv7IgWOgyr5xK44KVTF1NbIxKD0h6v5db9P03tH2PaIsCq19pAzvBUinzuicyy+CP9QtAVhQrnIaRsBIdfPYmO1wYX8VHPvo3Hr8VCrGfNnwH/3OtklHb76pQA== 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=oXN2k0uJ8zsf6DSYzvSHhpA7H4yCRiJKvI7trI36LpE=; b=HstkCMFP7HyZ8JuAV6za6cBCLuuYbiYIg/ChaCjwWYJG2i/wdTetnU8sRuwARvCmh5RA/enMz8THjdxw9kp6/7bF8yum+U6qw5XJsOlavcgtGGo0q/+p2cKy1KHH7cor8+kviQfwv7TZZWEdQM3vVjfy/jiJi/YJab4qmpKmmidF7duS9GP3K2lAjrhMv6omDdfdy7BgpvWgOv+1c+7totC9BrEA++DACpavUeSKQbSg1WSa90FUOKrr7hzRizHVMbtEvj2BEWc4fXEFJW17dVmfJQKMFlZyQ3xN8oW3P/HYW/RqM34AsTXr7sRIWTY47BL4SuSdOkYn1Sb+5XJA7Q== 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=oXN2k0uJ8zsf6DSYzvSHhpA7H4yCRiJKvI7trI36LpE=; b=eGaP95B3pSP8U3o24iswhqZoYSf0ghD2HZbjGZ1MYauKFPciJY1FuLX+PCK4wW4QsJT3Mg7rTj+Z8ALLKNnjSOT5uHj+3XZFPI/jyTE5YIgbrEhE/M9uNRKSbr1GDDbxa+z5gj4idx3iiDwtmnZ3yGHhaPjyqEvtTiTGHIkaJAo= Received: from BYAPR07CA0019.namprd07.prod.outlook.com (2603:10b6:a02:bc::32) by DM6PR12MB4386.namprd12.prod.outlook.com (2603:10b6:5:28f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26; Tue, 16 Jan 2024 18:23:49 +0000 Received: from SJ1PEPF00001CDC.namprd05.prod.outlook.com (2603:10b6:a02:bc:cafe::bd) by BYAPR07CA0019.outlook.office365.com (2603:10b6:a02:bc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26 via Frontend Transport; Tue, 16 Jan 2024 18:23:49 +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 SJ1PEPF00001CDC.mail.protection.outlook.com (10.167.242.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Tue, 16 Jan 2024 18:23:49 +0000 Received: from 7dbylenovo.amd.com (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; Tue, 16 Jan 2024 12:23:48 -0600 From: Sivaprasad Tummala To: , , , , , , , , CC: , , Subject: [PATCH v4 3/6] examples/l3fwd-graph: fix lcore ID restriction Date: Tue, 16 Jan 2024 18:23:28 +0000 Message-ID: <20240116182332.95537-4-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240116182332.95537-1-sivaprasad.tummala@amd.com> References: <20231220064502.2830-1-sivaprasad.tummala@amd.com> <20240116182332.95537-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: SJ1PEPF00001CDC:EE_|DM6PR12MB4386:EE_ X-MS-Office365-Filtering-Correlation-Id: 97e23307-613e-46c7-3000-08dc16c0492c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A6PC4ZrcefJDgRbSzroHvymlheX+tOQYH4L+AOcr9iv5MqASlBIuwkTgeNtmRoAAZhBxNCwv1g+xbFbRUZ9YL1cwnMo/HOL8Q+pGOtwW/gWh2l1EgOR+9Fm/vszx3YMqsh9DEKxx6axlY1M1aY/BEZO8+tNEpafybSAxtXRaanq9ajRT19X7sHhJqVmBGvx1FwDxqSOLx/Cbs/hIfYSb+U4SkD02OJKTyYsCVPeLa7Ag3b1K6hKayCpcAw6nJM0VSSZadwGUYSKwSHso2f54r6cw2lbl3uufWnqwcvEdXHbI4NiyCewr8V7dEr+83ugm5BWKctFUEEOocGQ4bqC/6qigkKYM4od1gbFSYf65CcYMi7w5JPbfPPhfQmc/0ufiYGpYA55ZkDpb5iBvNY3WNgIhYCd004XfkBTVfn3X4umwYII82sWMSJFPqTKcUzWa4X54kdjnAXCflwEBCxmaer9KUvNfD53Q6/akSIrexIqVfBaUjs1PvvEbj5D2TAIfgLIJdiDxkHxFOBYKkncEqlgUuONGrurKJtj4q78/iloGWlXKk9K31atLrJSgZu4bw9AL+eRjhASi3eGu0ATHwGpnYPPyyVIYPic4w+6b8IE9Q4eDak30UAmn/nUoHzYtyX/cRNys/BCLOi0GGy26GNq5YaZ4iIPV9qf88X8pRFLJqxGgZBWJyKjaKNhtfsUBy+hLS6oF7036VveQYrRUbmpMUDvqikWzsMMEiJZ36CmCwzM4hzsWaSeZ0ZJXaOh6Az28gqqlm0nPYPSUzGf60w9KLFzYeEnNANkKt50g3HBNKN+tt5G7DzIwClru8Es5 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)(346002)(396003)(376002)(136003)(39860400002)(230922051799003)(230273577357003)(230173577357003)(64100799003)(82310400011)(186009)(451199024)(1800799012)(40470700004)(46966006)(36840700001)(83380400001)(2906002)(426003)(16526019)(2616005)(26005)(336012)(1076003)(47076005)(82740400003)(478600001)(36860700001)(8676002)(44832011)(7696005)(7416002)(8936002)(110136005)(5660300002)(4326008)(54906003)(6666004)(316002)(356005)(81166007)(70586007)(70206006)(36756003)(41300700001)(86362001)(40480700001)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 18:23:49.5838 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97e23307-613e-46c7-3000-08dc16c0492c 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: SJ1PEPF00001CDC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4386 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 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: 08bd1a174461 ("examples/l3fwd-graph: add graph-based l3fwd skeleton") Cc: ndabilpuram@marvell.com Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala --- examples/l3fwd-graph/main.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index 96cb1c81ff..ffb6900fee 100644 --- a/examples/l3fwd-graph/main.c +++ b/examples/l3fwd-graph/main.c @@ -90,7 +90,7 @@ static int pcap_trace_enable; struct lcore_rx_queue { uint16_t port_id; - uint8_t queue_id; + uint16_t queue_id; char node_name[RTE_NODE_NAMESIZE]; }; @@ -110,8 +110,8 @@ static struct lcore_conf lcore_conf[RTE_MAX_LCORE]; struct lcore_params { uint16_t port_id; - uint8_t queue_id; - uint8_t lcore_id; + uint16_t queue_id; + uint16_t lcore_id; } __rte_cache_aligned; static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS]; @@ -205,19 +205,19 @@ check_worker_model_params(void) static int check_lcore_params(void) { - uint8_t queue, lcore; + uint16_t queue; int socketid; - uint16_t i; + uint16_t i, lcore; for (i = 0; i < nb_lcore_params; ++i) { queue = lcore_params[i].queue_id; if (queue >= MAX_RX_QUEUE_PER_PORT) { - printf("Invalid queue number: %hhu\n", queue); + printf("Invalid queue number: %hu\n", queue); return -1; } lcore = lcore_params[i].lcore_id; if (!rte_lcore_is_enabled(lcore)) { - printf("Error: lcore %hhu is not enabled in lcore mask\n", + printf("Error: lcore %hu is not enabled in lcore mask\n", lcore); return -1; } @@ -228,7 +228,7 @@ check_lcore_params(void) } socketid = rte_lcore_to_socket_id(lcore); if ((socketid != 0) && (numa_on == 0)) { - printf("Warning: lcore %hhu is on socket %d with numa off\n", + printf("Warning: lcore %hu is on socket %d with numa off\n", lcore, socketid); } } @@ -257,7 +257,7 @@ check_port_config(void) return 0; } -static uint8_t +static uint16_t get_port_n_rx_queues(const uint16_t port) { int queue = -1; @@ -275,14 +275,14 @@ get_port_n_rx_queues(const uint16_t port) } } - return (uint8_t)(++queue); + return (uint16_t)(++queue); } static int 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; @@ -448,11 +448,11 @@ parse_config(const char *q_arg) } lcore_params_array[nb_lcore_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + (uint16_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]; + (uint16_t)int_fld[FLD_LCORE]; ++nb_lcore_params; } lcore_params = lcore_params_array; @@ -1011,7 +1011,8 @@ main(int argc, char **argv) "ethdev_tx-*", "pkt_drop", }; - uint8_t nb_rx_queue, queue, socketid; + uint8_t socketid; + uint16_t nb_rx_queue, queue; struct rte_graph_param graph_conf; struct rte_eth_dev_info dev_info; uint32_t nb_ports, nb_conf = 0; From patchwork Tue Jan 16 18:23:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135893 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6378A438E3; Tue, 16 Jan 2024 19:24:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D72A40DF5; Tue, 16 Jan 2024 19:23:57 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2060.outbound.protection.outlook.com [40.107.243.60]) by mails.dpdk.org (Postfix) with ESMTP id 57A3240A71; Tue, 16 Jan 2024 19:23:54 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WqaeoaWpxQ9fPQhpVKocMV4nfZUaWDdowlqtq5AgkHGu4ToQg6UrHOj0/KjBc/xklFGuKSPa0VL+RXDOyuGo6p2brx2jLFAQi9u1H+/cEmbvD4Dt4wqB9TH0/+0VVX6QZJGN5zM9+r10qPDAZijYJznuRzLmYC/mTeg0g263R4oUUqxdzf/YoZezF9TOIir1hKP9rixsTT007+m/iYc8+G+ywo33cwtWKRYiw1O5X43te5YXakstMjzFG8BNO4rXTV8EWjy+lOJQ68mCfioL9rOnXzzSs4beg1UpnrG2KPnRR706XphU6DDzTG4Pue6hi8ML75pa2TZzpULIqycRfw== 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=F9ceWULKaFjOsNVTOR2Xh5fJc4EU8Hg4ef9OwPo0Jy8=; b=hzFGQzFvWOibsl2S6sBzRmPRXP6IRmIGoY23qxjNRTfJnpvE1uB88ChFnn2Nt/WFcmLvGC3xZ9t3WE8QyLqi2jGWEEY8eqsVU3dfyc6BQ9hQw5ybfZ4fhf8tuOz/Dk/rtaj640SecexYXkCEUBwJWcPBFJ/NMOjSboocX3FwIjlU5Ud8lb2NAds7+LXEGLuFSZKLt+DE1nZAvMlix5bT+YVLu2/HrVNlGeID5kVseYXRUoSiDgxQ1WpgOiQqm2PfWRJrHAMGi7kSvCvkvMYrOTkkRnqb/YYp6/kgmRb8bRJOIBFkl+INIJEoKqL/CjmeQozi8Ky3q9j6GiRVSoLQQQ== 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=F9ceWULKaFjOsNVTOR2Xh5fJc4EU8Hg4ef9OwPo0Jy8=; b=kOnxNsPHIJOtYrYCIHFX9UXz1RKmtJfJ0T1yAz9/Vi55nJZOgfm7bAGaKZdCZiJjsM110zRiQ+Yb1LBFVhbygIZlb0o5vfxY+juQ+QTr4TIN863jUp/3DZBD2cCGnJaMboIzG1XGcZE5PMUxr+AIGvpB5FSSiYDkIP3MQ6EtNDQ= Received: from SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) by MW4PR12MB7264.namprd12.prod.outlook.com (2603:10b6:303:22e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Tue, 16 Jan 2024 18:23:51 +0000 Received: from SJ1PEPF00001CDD.namprd05.prod.outlook.com (2603:10b6:a03:338:cafe::50) by SJ0PR03CA0166.outlook.office365.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26 via Frontend Transport; Tue, 16 Jan 2024 18:23:51 +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 SJ1PEPF00001CDD.mail.protection.outlook.com (10.167.242.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Tue, 16 Jan 2024 18:23:51 +0000 Received: from 7dbylenovo.amd.com (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; Tue, 16 Jan 2024 12:23:49 -0600 From: Sivaprasad Tummala To: , , , , , , , , CC: , , Subject: [PATCH v4 4/6] examples/ipsec-secgw: fix lcore ID restriction Date: Tue, 16 Jan 2024 18:23:29 +0000 Message-ID: <20240116182332.95537-5-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240116182332.95537-1-sivaprasad.tummala@amd.com> References: <20231220064502.2830-1-sivaprasad.tummala@amd.com> <20240116182332.95537-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: SJ1PEPF00001CDD:EE_|MW4PR12MB7264:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e225c0a-4892-4379-3f2b-08dc16c04a2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Dx7/nVzHSQA7Sw790SkVC8H+3E4E3Mo/lNSdOWdyxiJFGNyF0aEitZF2QwZfcYGON3Pc/IZ9Ewv1bKmJdnfGgnmOEBdey4m1akjpi9YxXS2B5h0VVuClyay11MHNwdLxg6SvlarZW5vUhs0hBDwPGivcBY48xuluagzPSePhjw2KGxEybbakvfj+g15rDWM3lx9hHmjrcdnj122tS3LfdFyE1ixEb7ch70KRCWdLud1cwnoBrOu2S3EKe0h1WiVrKmw4i+Hrn7b3TPL4WfeVJ0QrAn2IqFDeX8Z6X/ZUTnz5b86smqVlp/f+zYDaHFk5YZcfawbJyEwsbOHVOtlH/Yg/rov0mlDeEIIPaEuTgyXubQr/Zzl6pjEV+DdY+neurpLphWb26PxjyqgfNvjwnXW66dlwE2RX0LavhacoCNicmSoVNZFr3bhaOkgZcJuIJK+e2qd+pmZ+PxMd5fZ38x2xDhsXi4PSykLN2YZlD5MjlAMXqftHXzsPOmPGV7hsBIFy1DbIvx8rhs28H9JMfAl8+BwGvHKyu33UiQpaR4u3hSW+t35oH+1c/oxLiVwlhx95m9EikeeRty8zCkVzDXhYAI/2vnmR2zRWo68GBlifbf647NNdGifZclIFKjbnQjYq/dEWAHWZm0dAZ9p4Fb+V5H10XAiA84+kWwgj95eqdXEHhW11rj4iyXDF5zMpju+IUa20ddlDTFk3fu5zTYc+iY/1bd3JaSqZQv+0pHpJ+U3Gxjk2XU4nyu17BVevjgPFjfseo04i8z7auGYoHlz+rgHKD0RJARnSuNcjR8C6ne9TJAf8iGSQpAXcRBaZ 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)(396003)(39860400002)(346002)(376002)(230173577357003)(230922051799003)(230273577357003)(1800799012)(186009)(451199024)(64100799003)(82310400011)(46966006)(40470700004)(36840700001)(41300700001)(40480700001)(40460700003)(7696005)(336012)(426003)(1076003)(26005)(478600001)(6666004)(7416002)(5660300002)(2906002)(82740400003)(110136005)(81166007)(70586007)(54906003)(70206006)(356005)(8936002)(2616005)(316002)(44832011)(16526019)(36756003)(8676002)(47076005)(36860700001)(83380400001)(4326008)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 18:23:51.2660 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e225c0a-4892-4379-3f2b-08dc16c04a2f 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: SJ1PEPF00001CDD.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7264 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 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 Acked-by: Konstantin Ananyev --- examples/ipsec-secgw/event_helper.h | 2 +- examples/ipsec-secgw/ipsec-secgw.c | 34 ++++++++++++++--------------- examples/ipsec-secgw/ipsec.c | 2 +- examples/ipsec-secgw/ipsec.h | 2 +- examples/ipsec-secgw/ipsec_worker.c | 10 ++++----- 5 files changed, 24 insertions(+), 26 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..713a5b5812 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -220,8 +220,8 @@ static const char *cfgfile; struct lcore_params { uint16_t port_id; - uint8_t queue_id; - uint8_t lcore_id; + uint16_t queue_id; + uint16_t lcore_id; } __rte_cache_aligned; static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS]; @@ -696,8 +696,7 @@ ipsec_poll_mode_worker(void) uint32_t lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int32_t i, nb_rx; - uint16_t portid; - uint8_t queueid; + uint16_t portid, queueid; struct lcore_conf *qconf; int32_t rc, socket_id; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) @@ -744,7 +743,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); } @@ -789,8 +788,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; @@ -810,7 +808,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 +827,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); } @@ -852,7 +850,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; @@ -863,14 +861,14 @@ 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 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 +1049,8 @@ parse_config(const char *q_arg) char *str_fld[_NUM_FLD]; int32_t i; uint32_t size; + uint16_t max_fld[_NUM_FLD] = {RTE_MAX_ETHPORTS, + USHRT_MAX, RTE_MAX_LCORE}; nb_lcore_params = 0; @@ -1071,7 +1071,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) { @@ -1080,11 +1080,11 @@ parse_config(const char *q_arg) return -1; } lcore_params_array[nb_lcore_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + (uint16_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]; + (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; 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); } From patchwork Tue Jan 16 18:23:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135894 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F2E6F438E3; Tue, 16 Jan 2024 19:24:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5EF2340E09; Tue, 16 Jan 2024 19:23:58 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2076.outbound.protection.outlook.com [40.107.220.76]) by mails.dpdk.org (Postfix) with ESMTP id 7F3BC40A87; Tue, 16 Jan 2024 19:23:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I/XOBkzmIOlH8Y4ggwcP0akQ77u4Dukqo8/w/ir/LYmVOp0uSKfhfxxmeKi80DrPA8yHrV7pvJWs4rVzXoaWfTG+sJUi0f/kbQ5Y+FcyKiUUkIO1OItW2irwOYAsu7DCSfHaYy6CpD5pXv+psej+tJTlw4+OFludH4QD0PZdR2+xNXhKx1DnjZJE31K5XRZWryIFuWuFPW5s9dyThn+P+oCPUXp/vkYHTL56llz4BoAHGp1v03UVbFarLBakk60aCcjmIemo0RYi4AI3l3PO6HPQj7Dot/gicgfvsc61kV96LM4yziu9rEbIEEuRicOS5XainJ+3S4I9LXcL09xJ2w== 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=jD6y2+mVBnTppD6Uln3qKfA7bxRgibnJHITerqEztrQ=; b=G9ncVFGuZ38jFucjzoyCahQQZNtLNGEvz3HBHdYJSFr0zeDmsyPyG5LaqhFHpdiEqwyK8JfaiTGVdlM7dR/TorP64hx5xbBUCzlO7AzfTuLuVcnE9YuHMVZsQ7udlJjsi4SH88/9mjOhqjwNuFa4iFZLl8hXX/iwrvQi8OIw0BcN41cHJG/qurv/6lV9krh+C+8pMFhwmiceWkb4msNFUyBqLjD+L6YbBs8MHGtHqVxITReLxcYxnmGz8tgHC9ckqIPUI8rGxM4dqSXI1j/v/+hkOgcL7EJWKl8FvOt+FUPh+Uz7qTivW/R87a2uFuhRqbWv4nrPqTBKTOdDekQDXA== 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=jD6y2+mVBnTppD6Uln3qKfA7bxRgibnJHITerqEztrQ=; b=xzyTHybkqiLSFtrwnWMA3kQVzEdbCjF29vWVv9R/BK7bpVLdLgLVRggUKbssGktjuSUaBewPhcfrhoPHSOYGoJH3JXUx6KB1ZqzeaCSblMPKgqoq8ZBlAp9gEntgzWH+W9ngyLgY5xw2rF+bdn6mb6bxm15s9TH/2paPz5zaCNk= Received: from BYAPR01CA0053.prod.exchangelabs.com (2603:10b6:a03:94::30) by BL1PR12MB5333.namprd12.prod.outlook.com (2603:10b6:208:31f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Tue, 16 Jan 2024 18:23:53 +0000 Received: from SJ1PEPF00001CE1.namprd05.prod.outlook.com (2603:10b6:a03:94:cafe::70) by BYAPR01CA0053.outlook.office365.com (2603:10b6:a03:94::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.30 via Frontend Transport; Tue, 16 Jan 2024 18:23:52 +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 SJ1PEPF00001CE1.mail.protection.outlook.com (10.167.242.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Tue, 16 Jan 2024 18:23:52 +0000 Received: from 7dbylenovo.amd.com (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; Tue, 16 Jan 2024 12:23:50 -0600 From: Sivaprasad Tummala To: , , , , , , , , CC: , Subject: [PATCH v4 5/6] examples/qos_sched: fix lcore ID restriction Date: Tue, 16 Jan 2024 18:23:30 +0000 Message-ID: <20240116182332.95537-6-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240116182332.95537-1-sivaprasad.tummala@amd.com> References: <20231220064502.2830-1-sivaprasad.tummala@amd.com> <20240116182332.95537-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: SJ1PEPF00001CE1:EE_|BL1PR12MB5333:EE_ X-MS-Office365-Filtering-Correlation-Id: 254fa43d-b364-411c-b4f8-08dc16c04aec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u5szlC6raLFKzJa6dqezcsiJg/2LeRQysR2dUEudw7ybjm7d4SJXqX2FGH6muL/bepB7Z+/OZ99+InrKMmmgN+5AucOH9mBHSSC8lg6GZM1qnvdF3r8kDeaR6YmNM7XULZit/EXGjV7CrJ2008Za5ISlkQXR02WRsFQVDgkcBnU4Cw73bQqpnn7xxpxyN754lt9Gy+uzrZYgRzH+hlbtEH/YHO67yPnjXgWeOn2/RgEmFJWsijaj0PNxcLigmCb2dov2VKTzDkd2dIqIPuwY7uymQ3o0Zd/KhNlNbhc8+rmxGzIHw8koi1FghKAH0geDgCPq1N4kwct0udn938qr3JVz8uMckJ8uqE3mjBtVQT6ogqV1jlOsXthiI3RS9MHeUqSyhTZXvx+eQ8yqT5wUJlDN6ClAsZ/QHFOY/+oSe3Jehg0QhGtnU+l4wdV4w5QaUyngIsg+9X3XjdTGUnvYYFBZTTnWhxE+AFDj6Ev+PQSIR5uZ2vUDMZk+9Enk1WqfnfTIN/zxLcjjRziT4TUdBPzchXrLYYg0yW2W24pR1cP8M04Uz3tdNuJolrRaEheFsWSGekVVIQm4tuuXEntBoqJKvWyY1HgWD5YBW99ktxiHVjFhwdLKn5L2+KY7kTeNEWvUJz/D98eLKO8a/tFaW2s4LlpNBSR8e612Ncy1uts061t+HoP306697QaIPcJjY0pfWgiagtKqq7yvpHSOTdp3Aoaaubp7vUiG/QlALqdxjIZQB4TkNYP+Cc0JGM17GZ6nICLM2CFCg3sApLwhJg== 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)(396003)(39860400002)(376002)(346002)(230922051799003)(82310400011)(451199024)(186009)(1800799012)(64100799003)(40470700004)(36840700001)(46966006)(81166007)(36860700001)(47076005)(82740400003)(41300700001)(356005)(36756003)(426003)(4744005)(2906002)(7416002)(26005)(336012)(16526019)(40460700003)(5660300002)(83380400001)(40480700001)(1076003)(2616005)(7696005)(44832011)(478600001)(6666004)(70586007)(54906003)(70206006)(316002)(4326008)(86362001)(110136005)(8936002)(8676002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 18:23:52.5076 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 254fa43d-b364-411c-b4f8-08dc16c04aec 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: SJ1PEPF00001CE1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5333 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 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: de3cfa2c9823 ("sched: initial import") Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala --- examples/qos_sched/args.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index e97273152a..22fe76eeb5 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -182,10 +182,10 @@ app_parse_flow_conf(const char *conf_str) pconf->rx_port = vals[0]; pconf->tx_port = vals[1]; - pconf->rx_core = (uint8_t)vals[2]; - pconf->wt_core = (uint8_t)vals[3]; + pconf->rx_core = (uint16_t)vals[2]; + pconf->wt_core = (uint16_t)vals[3]; if (ret == 5) - pconf->tx_core = (uint8_t)vals[4]; + pconf->tx_core = (uint16_t)vals[4]; else pconf->tx_core = pconf->wt_core; From patchwork Tue Jan 16 18:23:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135895 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8EA77438E3; Tue, 16 Jan 2024 19:24:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0884740E25; Tue, 16 Jan 2024 19:24:00 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2055.outbound.protection.outlook.com [40.107.102.55]) by mails.dpdk.org (Postfix) with ESMTP id 5104340DCD; Tue, 16 Jan 2024 19:23:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d/tuxt0dQ3cjLR2hA+MEGoP39Z55IOn4YXykKqyxuzmKlJVUpSYPjeEVistNU7t0c/WBsVQ0Gf8S/gf6jgl++QkxXg+Ozsa/7h5NbdvU5FMLLEDezSX/yEYTKJkOOHG19My1+AZd7JBypcWq3ffG5AN45/DFagW5GBYzZfNh8s9ockbTXpCkvc8UZPhZt6UZMcNKnletvBbDKvdNjBwQUd2p3FUvUWrk8p6zf6lflxilqrU0paYTJ+D0jyiyT3ePwPKI/c82NBTrmiMKhJikYIfBrvP0qNldsZmhMRJWwpNCs7F6PTpcW9kmjHBmo4qRFe6zSx1XpmbL+MrvwRCLlA== 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=pelULDo/Wpz4C81J43QCyteewJdU1439J7sWe81Jjj8=; b=hfuD1TfdsaMEkbEsFfJ1+s36h41KWJ+HrNUWHbIJS0iOb1bo1H05aJw57itm251rhFmn+yWOQgpfeD93iQk+grnTc97KHFW+ZMi+33S5loPxwgQaRNpYuyxj6zeBZWxWIqDGEnHu686s6dVCenrOwIsziBl6LXviWDSJbU9ZltS4ERJSDwDbcj69PqUaFLl5KkobEdLRdtYejAOjut0CFrIGYUzU5J+LFZfLGv9E2MWBvUkcvFzRhX6MhSonT44TQ5+u3VBGnUmb7qHlCdAgShtUZs0aEDRooUKe8nhQ5f1mT65WZBEiuKLV+dGoGJHHqtCFJhtDNspOa/kS5fUsog== 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=pelULDo/Wpz4C81J43QCyteewJdU1439J7sWe81Jjj8=; b=a5K0+3TDOClO0CYDOqK4J7CPr5sC6HfJKhZUiUKeMQwv49AONbUDzw5N/ER4TORFU4b5UBU9kcWQPSSoe7ie8JSxYAWMRK+U9FgGVUmNjEZQE6K41P9YgnQlASYo7tNUXDceg2KFfQ01lOasjMXT2r8/YKbIyeujQacmytqDw9Y= Received: from BYAPR01CA0040.prod.exchangelabs.com (2603:10b6:a03:94::17) by PH8PR12MB6771.namprd12.prod.outlook.com (2603:10b6:510:1c6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17; Tue, 16 Jan 2024 18:23:54 +0000 Received: from SJ1PEPF00001CE1.namprd05.prod.outlook.com (2603:10b6:a03:94:cafe::19) by BYAPR01CA0040.outlook.office365.com (2603:10b6:a03:94::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23 via Frontend Transport; Tue, 16 Jan 2024 18:23:53 +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 SJ1PEPF00001CE1.mail.protection.outlook.com (10.167.242.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Tue, 16 Jan 2024 18:23:53 +0000 Received: from 7dbylenovo.amd.com (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; Tue, 16 Jan 2024 12:23:51 -0600 From: Sivaprasad Tummala To: , , , , , , , , CC: , , Subject: [PATCH v4 6/6] examples/vm_power_manager: fix lcore ID restriction Date: Tue, 16 Jan 2024 18:23:31 +0000 Message-ID: <20240116182332.95537-7-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240116182332.95537-1-sivaprasad.tummala@amd.com> References: <20231220064502.2830-1-sivaprasad.tummala@amd.com> <20240116182332.95537-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: SJ1PEPF00001CE1:EE_|PH8PR12MB6771:EE_ X-MS-Office365-Filtering-Correlation-Id: 23e3fbc1-1fa5-420f-4a2d-08dc16c04ba4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8rJik5DWIjX4fr7UsILPmG81dqWJXxv6YrVNkcylwGidaXpwsMjIcpDJvwenHzONbICZSao0EpXGMsKuAMC6wyajFsceFErcFKr4zrQI6sq9WdrVCOB7MtIx6WzhE8pU536Q50KWWZSFqV7xsUhF30fqs431sEf8EJ4uPBhlmr8jeD+l5DPA3o3Uwx2bFxSRJG/FQc6KCeb6rzKd5eujPYHUS09QfmRpQ60W+fFS1F9C05YG72/bhw+69odE/be/9L3b2QioWqsrcj4cHIiIjigGu3zAySKW8Yq8IgPzY/EAwLSbUGeRW9bpx5LzkidV/v4aYz2Nxz9IfRKq4nicAE2fRdr10cf2bNABSObKJFloAx/FyNdAEexRuh/sjIV4JXlTcSqTRXISy2GK/PoyZx9R47DwvkYOH+gaQUDw0q0uEpfAohyGnT1ooFULFnrlsAdvRVUcxSEjCahzZnoUyb4ZUeEYJEw5ouxTd5Wj8qQJN3xcImFrp5cYVdIqJ8eW08Iwo4bBiNCCtBqXv7KDDeBQEN4occFzE/HU1S0KUGs2gO6UEUI++lcf7CAiH2np9S24w2wPxFn340iH7gseXpxrA7hroEYsskvwjGB+NclX8+XoGqGIwzXu+l/OgBlW2GXoG9eOUcKX+1ZOgAWpXUVPUyNBgJIpaYk0hPDuMAfdTv76iPSgdGSC6aOg415tG797HivxOCgumZzvVqCtu1nVTyIDv0ltueuPTzP0R+mqcJ0Kf48ns4cd87lSc4b8xGMzhzCeup/EAFJnv6Vb/g== 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)(376002)(346002)(136003)(39860400002)(396003)(230922051799003)(64100799003)(451199024)(1800799012)(82310400011)(186009)(46966006)(36840700001)(40470700004)(40480700001)(40460700003)(336012)(83380400001)(26005)(1076003)(426003)(86362001)(16526019)(356005)(81166007)(47076005)(36756003)(5660300002)(7416002)(2906002)(7696005)(44832011)(8936002)(6666004)(4326008)(2616005)(70206006)(36860700001)(82740400003)(8676002)(54906003)(316002)(41300700001)(478600001)(110136005)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2024 18:23:53.7107 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23e3fbc1-1fa5-420f-4a2d-08dc16c04ba4 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: SJ1PEPF00001CE1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6771 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 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: 0e8f47491f09 ("examples/vm_power: add command to query CPU frequency") Cc: marcinx.hajkowski@intel.com Cc: stable@dpdk.org Signed-off-by: Sivaprasad Tummala --- examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c index 94bfbbaf78..a586853a76 100644 --- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c +++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c @@ -401,7 +401,7 @@ check_response_cmd(unsigned int lcore_id, int *result) struct cmd_set_cpu_freq_result { cmdline_fixed_string_t set_cpu_freq; - uint8_t lcore_id; + uint16_t lcore_id; cmdline_fixed_string_t cmd; }; @@ -444,7 +444,7 @@ cmdline_parse_token_string_t cmd_set_cpu_freq = set_cpu_freq, "set_cpu_freq"); cmdline_parse_token_num_t cmd_set_cpu_freq_core_num = TOKEN_NUM_INITIALIZER(struct cmd_set_cpu_freq_result, - lcore_id, RTE_UINT8); + lcore_id, RTE_UINT16); cmdline_parse_token_string_t cmd_set_cpu_freq_cmd_cmd = TOKEN_STRING_INITIALIZER(struct cmd_set_cpu_freq_result, cmd, "up#down#min#max#enable_turbo#disable_turbo");