From patchwork Wed Dec 20 06:44:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135371 X-Patchwork-Delegate: thomas@monjalon.net 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 E3B8F4372F; Wed, 20 Dec 2023 07:45:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF4C642E60; Wed, 20 Dec 2023 07:45:34 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id 7586D42DDB; Wed, 20 Dec 2023 07:45:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dla+7dO9qlmWVhvNWMkw87RyLsuNFNu+Fi606t5wHE0rdna9WKnuUAvwPF6CegH5EpOilPwn2COXQY5fdsLmnk2PeaKJjgOy72xyzI5bo07P5CFoB+rfKn7L1TFRupoPo5E9sca9a3EWKzdoFckCC+vkH0my1KvLUjIFH9TQ7/xLWZgitX6kfeLU0yK312mw11cm0SaD7H4ztf65+5y8V7WFgGOh+E28YQpQ2RnxJfk4PzjyK6gOivtdX56PGawuMJJE6gAsVqR4V2NQKS9/UE4QFGjZRGeP7l6jIlebyuArxZsWg8prBk5pgg2HaAUhjb6LfJQWgacxHpYjPlJz2Q== 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=T1QelKC8ZQCSprFJOlkA8lf3o5SPbDvhBnZZNw6WJIWkTss8z7274mhLFJYnRGatA17SeZhKF/FDVHTQ80V/OfNmFWNf5VorJT79yEzeb8tF3qAtcQAaQAWfkOoGNyQLCDtCOyjNxhPXGs5tqhC/9MtjNVKvYlFagHnCeBLrYGhxvkguEEV5AqeLyZ4j/2dy7i+BYh+YJLfWG3UcEBZuOFacG6BvkOITWmwl0/I9rRI9Lt/WzbXTZnDFzYU31edKJvVInB2BOjdgN/mUyKEBWqwfacqD+/9pJ/j+A+1td10hiT8wdI7g8gkAgvXX8nM07lTHqXqtzI6Y1BrC1E3eLg== 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=VCBhZDcGg4q5olhOwa6nomfxX7sEeU+u7MNlIlbt9zMnEDFLwkkkwRpAojXQbxVATEzRQ2oMr+U6xgCamr297kAlIjpKuSAyVo7Si7pDFgC5tjbsvciXYXyPW/ZnBz/rB1405iKWiZuxU5Q8Oeu7Pv//TXj+xKLFjLdjqToh1vU= Received: from BL0PR02CA0062.namprd02.prod.outlook.com (2603:10b6:207:3d::39) by SJ0PR12MB6854.namprd12.prod.outlook.com (2603:10b6:a03:47c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Wed, 20 Dec 2023 06:45:29 +0000 Received: from BL6PEPF0001AB4C.namprd04.prod.outlook.com (2603:10b6:207:3d:cafe::8) by BL0PR02CA0062.outlook.office365.com (2603:10b6:207:3d::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38 via Frontend Transport; Wed, 20 Dec 2023 06:45: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 BL6PEPF0001AB4C.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Wed, 20 Dec 2023 06:45: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.34; Wed, 20 Dec 2023 00:45:22 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , Subject: [PATCH v3 1/6] examples/l3fwd: fix lcore ID restriction Date: Wed, 20 Dec 2023 07:44:56 +0100 Message-ID: <20231220064502.2830-2-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231220064502.2830-1-sivaprasad.tummala@amd.com> References: <20231219032826.4814-1-sivaprasad.tummala@amd.com> <20231220064502.2830-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: BL6PEPF0001AB4C:EE_|SJ0PR12MB6854:EE_ X-MS-Office365-Filtering-Correlation-Id: f16eac20-b698-4426-4aa0-08dc0127410f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ESaDUvR38P4oV6DG7Da9WCNFwVaV9sTwMOk4R2bxHxGIULX56DFbQb4zSct6RaayWmaPN6KVgwctKuwBheijV8vh8GMIo/sHigLIZT13xGLrubfqE0x25nMa7jbKFX8knZTSYuFL26cj1eJW0gDYjOeUbWqLDEMlERNLXbe939Txz8oKt4ygXtl20jsGyVv9wmAppGe0R0D72ExKHnVo/D9GOvVV6EXfFhdZRhEe472dZ1NpWKv2o42mOiYo59chZt2XL0SOfxmQV0//5f8Q0CZ5aJ1n9RlVuBBn/IdqnMTijC9hIFbw1tR50zzkPQcFVzm8uVEeR5VvfUTMCBNmZtMV+JcXWgvf3IBfDu+21+J2URk8pdXf8V91JYJrQzLmPf2LRErgpKlbzGI1f/luxPBzuo3exMORDo/ExnI1yQxYbhkD/0VgTT1KVdnrY0eFuDauHEfwmLHXoQaWmU8ao2tAU3LRAnGVgL83pMhO0xIjZoGvg8ebx6ep+Cxm+DcVhy/XxONeZCNlYufBXfjoKRRylg8VNA+PmoLtyIyt5Q3RtH0QMCZF1TbagZf8T0patiPfIMgx+cLnPeSgaJxd7hRzcmr2ZytLPdLDmOPMeT/stBQvkWK3esLd3P2grThqW8sgz2qVJWFSTu4op+rOhRqVgrJ2WQ5ayp01CUupZHPa/JaKLVocSRtnld/wJqrMgf7Z2QYgIzJ9wg6OJwLHLKU8Tb2F/lpFZRLz2X5vfcMKHHTm3CcCCbfAA7XlVwq5GJgPkdfRkzukyJ950OtEJqBAqzjvQ/gAyIaQb9Mc3wkzvL+Qmp0vmbmNS8FR9BEW 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)(136003)(39860400002)(396003)(346002)(230173577357003)(230273577357003)(230922051799003)(64100799003)(451199024)(186009)(1800799012)(82310400011)(36840700001)(40470700004)(46966006)(40460700003)(16526019)(2616005)(1076003)(26005)(336012)(426003)(6666004)(36860700001)(47076005)(83380400001)(44832011)(4326008)(8676002)(8936002)(41300700001)(5660300002)(2906002)(478600001)(316002)(70206006)(70586007)(110136005)(54906003)(82740400003)(36756003)(86362001)(356005)(81166007)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 06:45:28.6328 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f16eac20-b698-4426-4aa0-08dc0127410f 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: BL6PEPF0001AB4C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6854 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 Wed Dec 20 06:44:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135372 X-Patchwork-Delegate: thomas@monjalon.net 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 792334372F; Wed, 20 Dec 2023 07:45:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60FF042E7D; Wed, 20 Dec 2023 07:45:37 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 505ED40EF1; Wed, 20 Dec 2023 07:45:35 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZmRun2xOGvL58fDRrM31K71H4a4l5rJxtMQtoc4tdBukXuS0uXucovwyNrX/8risO8pn8kXJmVRV9PeJHw3ZyA9xALDaxe3S9rMknuS4D71tEefp31hEcUR4mOr8WNtPDxm6u6DL73QzskNQrFzilTbYRuANGCd9IcldSdyjNCPnuOqzDYBRuHC1s5XqWBGBiyy1IilkBO09MHbvNkyv5M9zm6OS7Go0Lcz+AY8CQYvfteOYrdWPcamBY5oMLZgTl31wr8e3vOTrBMHg4b7LN5gTjR+qliZ/gl32YUsp9KQ25WR/A5Bsa1qq4jrrqUWswFHIhe7Y+LfqAtz1+Doxxg== 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=eOyXBAJUlcLChFGqRF3gv0M3ucut+TZo1/WCxo3UPrDpM5h2bG/fADwEjR1owj0QBQJCcRU/ya5OzRMNSUt7Z7aWt/LdZTd+UEMr/1jl6GjS18mCuJrWCknbFCFJNDgEg/DrFaqIUvoSCiwGK5LFg4gj4oS2iP0FXwjEpEMFGLNwi0yfANGWXqGqN6/NLvjlYIjVrSIdbjxfSNLZS7m6ckAD7Paw1TZ0OUtNmrqe826mwuaAh03O0H9EzVo3vxETGA2TLyJEbR8n7urvvHoeD0doMr3teKIZXh0sVDbdc4Ks3FqDgyiK/xID3OlJSoUOIpokRfMh8BDSOn8wpX+DKA== 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=Iax6j62DVPUF/l/zBU+dO1GPQumombvCDRFZjaAVqm0zDWs2N5fYxxdR+dmot0VMv2trnNlYMiCY6z3fxO26RP2weNeJiS7uKvNMJ32TPuHE5+REQb+I+tRV6A/1Kamwu0TVxtKtuXenTeRhCVCWLHrQ75RqPm0fdBtaMvhvnzU= Received: from BL1P223CA0008.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::13) by SA0PR12MB4432.namprd12.prod.outlook.com (2603:10b6:806:98::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Wed, 20 Dec 2023 06:45:30 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:2c4:cafe::51) by BL1P223CA0008.outlook.office365.com (2603:10b6:208:2c4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18 via Frontend Transport; Wed, 20 Dec 2023 06:45:30 +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 BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Wed, 20 Dec 2023 06:45:30 +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; Wed, 20 Dec 2023 00:45:26 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , Subject: [PATCH v3 2/6] examples/l3fwd-power: fix lcore ID restriction Date: Wed, 20 Dec 2023 07:44:57 +0100 Message-ID: <20231220064502.2830-3-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231220064502.2830-1-sivaprasad.tummala@amd.com> References: <20231219032826.4814-1-sivaprasad.tummala@amd.com> <20231220064502.2830-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: BL6PEPF0001AB4B:EE_|SA0PR12MB4432:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ee1657c-1dfd-485a-8828-08dc01274215 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EfH5D+pQgM1wL+F9Q/xfnRwHoau3DkKsq687rncdam2prGy4CBXEd0UCiWheqllJUGfYzHrovrgoP9x0Bsh1+dqdXSMr2KSu9TdB7aeDzeoKVcwu/E0PFbAApRS6hJKVlQ0IkjpFn1/OVfDJ/fqpN3Yiji4M/vTF75u6hAb2QYpqTNV8DVUY7VipKLwz1blz5ZWbTOpnOWfUIZWWKfKxFIEZbK1hZolgpYz9UVLDwils9J8j5xdcxMn3nW0y18pEwZY9XhTIksTkYubggNd2C+dHnZpLM01lX0VPknSFh3Ir7WqDOIl7l6b77XhKXDP/YYZsIaqWbGxqLHkdfSYoJSyTVtcQZrOAh0yFoDBR1k/i9O6iyLRnwXBxTWbvUzO++NiJEA0FPdWzqdJ0hergnDoMGKINrzpHo1nKND3Wb7Cn/WpMdl244qGrf9WwgN7AKHM3dX1QgkJMVEAOnio3KQOdBEAtkkSieFD4ur55Le/LqLD2tQ+jEdqsaWBQaZo9Trll/Yq940RsUe2HD3BFY+DHdc2wk7p+GEE5QITmkc7MM+VIBkASCzLkkMNXEL0UEVaBH9Igj9K0lKAiAh+uOp+fT6hQAtYXzXMwYJWsFUwFGV/NCodiFoqAZHkM5RaurL/4NzzKA1DlcrgYWFKZfYAY9eAZp3DapL2KaDeLLk7PEbTCTVPkEQr/ZPb1rNsdQ+El3lHgwlD1Pnikq1tnUcuirsBayKp6pPzbxgb7Ut2i2K+0krAkOc2hV3Qxbl/YcepvDHVpBqfCJJxUOgAkj33WzvkhVnbJ2Fv3kxsx6moVuh0X9HdcrjQvnp8YXsyj 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)(230173577357003)(230922051799003)(230273577357003)(1800799012)(186009)(82310400011)(451199024)(64100799003)(40470700004)(46966006)(36840700001)(40460700003)(40480700001)(478600001)(36860700001)(44832011)(83380400001)(5660300002)(26005)(1076003)(16526019)(426003)(4326008)(336012)(2906002)(8676002)(47076005)(8936002)(2616005)(110136005)(54906003)(316002)(70586007)(70206006)(86362001)(41300700001)(36756003)(82740400003)(356005)(81166007)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 06:45:30.3358 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ee1657c-1dfd-485a-8828-08dc01274215 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: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4432 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 Wed Dec 20 06:44:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135373 X-Patchwork-Delegate: thomas@monjalon.net 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 43ABA4372F; Wed, 20 Dec 2023 07:45:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B91E342E7F; Wed, 20 Dec 2023 07:45:43 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2083.outbound.protection.outlook.com [40.107.95.83]) by mails.dpdk.org (Postfix) with ESMTP id 3B47242E6D; Wed, 20 Dec 2023 07:45:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F9eEQnnWxxjy5WPUCKSUODzU8R+kN8NNnjzhfq/Iil4dwX0mJykbAvjJoxC46R8NZfs9elKWlbAawJrFnGbd4TwUjiDe/+VYp3iCQ3UdQBGOOBDQVzc5cXbZJYhWSRkFhsWBllvwmTLixeACfG+s6gmd3Wmy29FU6jAkHT/pDdArpF1K++XS/u4WepZxRVxwqNXJNrCQC/mOtrNfK+QlVELTxKvylD8TM8My6Z12G8/M8rayKpW1nnKme7ioefqwi7KPR4gcvx24FBUGAmpIJnTVJ/OpxBwFMLa5TjekG1iSEOxGPT7t8MBJ2SCtpidIuMVd6KOGVRPG1egGxGCB+Q== 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=N0J68uh8NRHifQoAFauVNH1GHA4DWSxQppsHxzHEcxkc8N/G2U1nP+H/bNL7IcXMXMGhqqyHUX/cAATHtaSW2A86UdBImtc8Xt6qXVv07B3WPzfvx34myj2z7V8SaqMsFj/5ZqeOarjkUlFb/+PVtp3EzjFJNblfifXMYBw8ajb0pxPnQ6DZ9FwrAdQWoj5zFlLdJGdtv8TP92nS4vlPNDMGCY1MCqKl+FH0xb6DM4njWX644kZfyCpStS1eRmUHnfOxArYSn9zo/klTSEFHhqcWiORcdqDPQFVEymtwI5kmCF3PoVl+BtBhOj+CZCRjqlE78qebplv0XiZIRFQOPg== 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=CofMmQvFiX4B5yim6OxV2JMKQzlH7db0Yh+kY2tRs+a1P3x6Doqe+Xg365v/nZpobtfDwsMpjkTmqZcp6EXPu0iP2+FH+ZxazwBjpS0J38B1+0EO2ETMji3yJcAccO+6tHpkYgWzBltw7XJpTrXEKDSs8HJiznumwoWnV3Nc6xw= Received: from BL1P223CA0025.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::30) by CH3PR12MB8459.namprd12.prod.outlook.com (2603:10b6:610:139::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Wed, 20 Dec 2023 06:45:37 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:2c4:cafe::bb) by BL1P223CA0025.outlook.office365.com (2603:10b6:208:2c4::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18 via Frontend Transport; Wed, 20 Dec 2023 06:45:37 +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 BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Wed, 20 Dec 2023 06:45:37 +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; Wed, 20 Dec 2023 00:45:30 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , , Subject: [PATCH v3 3/6] examples/l3fwd-graph: fix lcore ID restriction Date: Wed, 20 Dec 2023 07:44:58 +0100 Message-ID: <20231220064502.2830-4-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231220064502.2830-1-sivaprasad.tummala@amd.com> References: <20231219032826.4814-1-sivaprasad.tummala@amd.com> <20231220064502.2830-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: BL6PEPF0001AB4B:EE_|CH3PR12MB8459:EE_ X-MS-Office365-Filtering-Correlation-Id: 20537235-b6e2-49de-b812-08dc01274654 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xo4y7yRGIU1xkgewbA0UzDP86jm0/0oNr06neMKlXPbz2fzCfGD1HaoefW1QnUMYBRGYXjLl3zZGdunHqO/dMMKfQWDPHw8z8XDb5fBLg14H7gyIJvlXaXuaSjz03WxLd6Zm+dPoVN8t3OC6x5r33rphytPUjo3mEKefeIVVCCgDR27Pd91XNAHP5mGvJ9S1njenYaOe4Mhbrjmv4ItQSLgp0RzP0lNrRVJUyL6If5uisIUoKQOUfk3FKXK0axtZzsiMG9bKmeHXViwTukiDO1O8qULOonuaSIvPcX/tWq1FEGYyjCLEc0aZImrq9yKU1U23UKIG+hk25IHRn1nxAAXqgLVPtVUEsBAUEYSc1dT5bMRb1J03xUCw3qVL8HZ+YiqBdQeSqlBiNLgigOhXqgp2dIxvbZ5yRhpCyy/JBjYqwVNn8xUie7Chby5Xt1BDkU32L978y5VIkqOqzDeOdsO9LGxkth0W5kjsTxhNtmN3ZZfCz+JAHnz5YoO77XyEDRssVLqdQGLwd15EUvg2AxAJVxakT3fgQwZ7wqIAadeAwQr+NJ2SUooK96nRo3jcFuvUrh+jVbi4vfJwJ8vf0uImPbWZh8EbY4S9z+LJvdwGmtNQ7ReHE00sOMWJgc8vIxKd8bM3qIRjLNFTkRlYUQKDnJMVlB9GFk1inl3Vz2NbKqrplA+VrEXgz5TNrmukHw0UnDYHcYZjepY2u+bMy8ixvtGkIucfavzhgMaiwzT85aCzdS5X+GpL+4Uuu3/zd/KBCO/eOgRgtR89P1VCR+xpy+u4oa2mgd4I9cj0ePBdbPwwyXPaFmkFWVkgRc7m 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)(376002)(39860400002)(346002)(230922051799003)(230273577357003)(230173577357003)(451199024)(1800799012)(64100799003)(82310400011)(186009)(46966006)(40470700004)(36840700001)(8676002)(8936002)(47076005)(4326008)(36756003)(82740400003)(81166007)(356005)(41300700001)(86362001)(2906002)(36860700001)(44832011)(5660300002)(7416002)(16526019)(26005)(2616005)(1076003)(40480700001)(6666004)(478600001)(110136005)(70206006)(70586007)(54906003)(40460700003)(83380400001)(316002)(426003)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 06:45:37.4608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20537235-b6e2-49de-b812-08dc01274654 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: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8459 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 Wed Dec 20 06:44:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135374 X-Patchwork-Delegate: thomas@monjalon.net 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 B02E14372F; Wed, 20 Dec 2023 07:45:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E68F42E8B; Wed, 20 Dec 2023 07:45:45 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id 07D3242E81; Wed, 20 Dec 2023 07:45:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IExwu/AnnRYKWNSkC86znnDEFqeH5EzbYf4dUWFm2qYOEfbGaMAbgFPiIYJGO/fYGtTxJYY3D3wI8rIIrrU60ggJY12+LDukVMdI7NI87aKqCo6Bpa361SB0VS/GrnL13EKgtoVbRfPHopb3s/mBhakuedQR6uUnj9D44VMafhY2SMwL/kDv8WdouhBfFVvOA0w4CgtkeB8R/65Vx3/dl3DNx80irWN5FMc2V9hLDg2MHSZV7dQm5Bbr0sStSPvZqC5FCvXOC5SFMNQDJjV35nOSUQq30OJtw5jGCNJLU4GaeayoAP3ty8gBsiS6Kd1TP129/iPwaJUY0s+2qLfPxg== 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=g4KXxn+RXv3Epj+NNeKc0G63+AmFWcqlfXQO0doW1l8=; b=fBU3mJHHjWcEDs0eMTUBz6bI7Xt2nKEpNK735hh9HRkam/ZZ6/zqZbKEBMNB2HBVjTIoPrfmvMdXaercAQ6iELdqGpIwlqGTQo0yGlXQu0Hqj8Na9X9Gz9kYCAlQNsR/9vyMdD/wQ2d1mqZcx8SbWuzroPXUPymdiQU00kfd0TKzpWnvmfO/A9264n+5rSUciVc9k2mIJU/Bf1oYYmRLOLmACs6RcCZ49G6Chn6qp8M6mU1mA8MkRZ2hWJvvYNAWJHcTdn602OsB497eZ4sfFHewJALQeIbfT/jwGn+xgpyAgRk2Mp8LiZuGrX8F7C/ZwsQY+aK/03w9Vb2fezr1Jg== 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=g4KXxn+RXv3Epj+NNeKc0G63+AmFWcqlfXQO0doW1l8=; b=GsRG42LXqAxXAm84Vz36Uk6r3IeZL/lRRfoVWMT5u/g2I0mmF1YDjyCRcu8T0onWP0dA9Qo28Lwj7bR+4SaS26VB92ucGbn5uaDzh5c3OPAu0NvdFJZt2GqwinHfQA1iEkCZlvF/zI81QmIbYsX8s0BQw2zZ8E5kqmEcAuLEwmM= Received: from BL1P223CA0005.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:2c4::10) by BN9PR12MB5034.namprd12.prod.outlook.com (2603:10b6:408:104::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Wed, 20 Dec 2023 06:45:42 +0000 Received: from BL6PEPF0001AB4D.namprd04.prod.outlook.com (2603:10b6:208:2c4:cafe::ab) by BL1P223CA0005.outlook.office365.com (2603:10b6:208:2c4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18 via Frontend Transport; Wed, 20 Dec 2023 06:45:42 +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 BL6PEPF0001AB4D.mail.protection.outlook.com (10.167.242.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Wed, 20 Dec 2023 06:45:42 +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; Wed, 20 Dec 2023 00:45:37 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , , Subject: [PATCH v3 4/6] examples/ipsec-secgw: fix lcore ID restriction Date: Wed, 20 Dec 2023 07:44:59 +0100 Message-ID: <20231220064502.2830-5-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231220064502.2830-1-sivaprasad.tummala@amd.com> References: <20231219032826.4814-1-sivaprasad.tummala@amd.com> <20231220064502.2830-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: BL6PEPF0001AB4D:EE_|BN9PR12MB5034:EE_ X-MS-Office365-Filtering-Correlation-Id: ef9dc5f2-1d53-4f2d-74a5-08dc0127492b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3fBx+cIos2X0HKSrEBt/iURZndGSPOnCa5u9aPZDBi0XzrF6l6LXAe0z3lLzl2SxtuSFyHm/Xx7iv5iGubdME3gp0OloTzYTe0YvhmkDIP6nCp6BrfL9bG/RXIeO4MQKH4vR1oP2AR+D2H3nf88S+iL6Jz8eYREq6JBPhvZQG4l31wB8QoYkCrDU+UMg1kH2fkjTZQbif2HdMuZRBQte1psrREK08stZaAxWzSn3ZQ+aBfpKLqh12LJS/ZHbN3m3lP+w9af5KWiTleqY2y0yEifAThHe24r8cYyIzBYFuwEWQab7CyaEFiar/V/zVMBMET+zYG7KX3gyAuVztZZ0MnMvScDUTGPMkJ4bS/GfSnzxkWAFOOfDe7dGTc1I0Yd6wxIzWntHUary/xTA1y/02wWrfIOEayaYyN8AUN+O/yst2DfYvLU3cD95EodQeqKiYOLVIn6qPw/XFxekPpbvAi2uRyEWqQtVh3fz5+mKLaA4DdJE5MP/OelBMas5uhJTrFrdKf3LNYA0C959S1jFIVxDMSN2uaPFlGa7XqvJXR9PUSct/tpRJk+Om7J781ZSS6Jh6Rxa0ZQzPUNmy6aF4OT385/A7KyXjjuj7ekPzeXax72PQwPjSwuCTZfBz3ASYqbFjyLh13iLKqx2x3a3cMJO131sU7NMUE3Nv8UfbtPAx5cUAfHhOOY2AROUsDpGklq/U9B/EIyzBjQvkgPw7IcFpJGKzfkeCNmnHuznTdVW69oLV3m5LaXxGWWvywWz5vlK8+jbKdYAtH06lAVxUxaQcHcG2f74NubUzi05lA6GsqYImIkFsM3f0K1mIhOk 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)(136003)(346002)(396003)(376002)(230173577357003)(230273577357003)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(82310400011)(36840700001)(40470700004)(46966006)(110136005)(41300700001)(44832011)(86362001)(8936002)(8676002)(7416002)(316002)(54906003)(70206006)(2906002)(36860700001)(70586007)(40480700001)(82740400003)(40460700003)(36756003)(5660300002)(4326008)(478600001)(6666004)(2616005)(16526019)(356005)(81166007)(26005)(83380400001)(47076005)(426003)(1076003)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 06:45:42.2392 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef9dc5f2-1d53-4f2d-74a5-08dc0127492b 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: BL6PEPF0001AB4D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5034 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 | 32 ++++++++++++++--------------- examples/ipsec-secgw/ipsec.c | 2 +- examples/ipsec-secgw/ipsec.h | 2 +- examples/ipsec-secgw/ipsec_worker.c | 10 ++++----- 5 files changed, 23 insertions(+), 25 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..f03a93259c 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) @@ -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 Wed Dec 20 06:45:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135375 X-Patchwork-Delegate: thomas@monjalon.net 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 F0F444372F; Wed, 20 Dec 2023 07:46:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B901D42E7C; Wed, 20 Dec 2023 07:46:04 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2089.outbound.protection.outlook.com [40.107.244.89]) by mails.dpdk.org (Postfix) with ESMTP id 533C640EF1; Wed, 20 Dec 2023 07:46:03 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ECg94l86VPiH5lQO2svUSsyeKTbOLA+LqvkFKvNzaW7hw2iDKh6a5F3eduJgBSu1l1MS1Ir9MIPv4UqbdCzBj+8t6yLQhK8kawfyj/CmkekyfIA90Y0j2s97zsGkZBya8UYDkXDYi5+kd/p4rqxKC6dv1msRKqyVysRqScSsCe9cyDUTQBgu+/b/zdXVlVS48kV8X2oLA44omMcDxzKGfN4kZ/WQ9GbeQdvbxsfJ0+CbQRycUpsVqXButMGuUdEnTNMwwAlZQDno2T/oW6ySKtRqPIGOAeUMPWdX5fOOAhKZLXx+PzLrhf8a57YY/MjkE1rSndDkmRK6WMJk7wXUOw== 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=JXW1wgAhybdRcsqBYpeWX7YG0kiROWiVLLOWf1/ZBQXdJGYdRlsRJsQ/KWuQCMSu5MVO6aPX44hU2NZmobhgkXuoD1AmIl86HN6mDPmaoKOQ4VCjsGnEjmCmfhgzohbSpcNIMuv86T6kV9sZP3kU1Qpizaq4ek7UWkGAaWZWaCNsKYXBo/lI2y36gaMp8kf8xSVPvRLxBrzJo14uZZFUeJuxB5vGuAhde/VRvC6VkSRE7P3/IyAaKCpWhcDHi+eecHWo5bGxkSyw1NgJClSa6sCz7zj6SyfBp+hk9f3WEK0jTKEW+ZMbyM5MqG1kbhUk+Ws2wkkGreP5wj7YLgehJA== 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=hPDuaI0zn+pZlQKhRSxs1HOTLGt379PXizoEyxEYfTJ8tLZiUcaSBIJbcXgrKA6WBLMtjIfvYp1nRj4Kq70L+VDziWWm8qTyPkR91GHr4No1R/v/98wfuBNs+Y/0f8UfKXQwodL1GlvGjMo6eJmeirMcBGoRv0Vwa+OHiax9Zjg= Received: from BL6PEPF00013E09.NAMP222.PROD.OUTLOOK.COM (2603:10b6:22e:400:0:1001:0:6) by IA0PR12MB7775.namprd12.prod.outlook.com (2603:10b6:208:431::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Wed, 20 Dec 2023 06:46:00 +0000 Received: from BL6PEPF0001AB50.namprd04.prod.outlook.com (2a01:111:f403:f902::) by BL6PEPF00013E09.outlook.office365.com (2603:1036:903:4::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.29 via Frontend Transport; Wed, 20 Dec 2023 06:46:00 +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 BL6PEPF0001AB50.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Wed, 20 Dec 2023 06:46:00 +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; Wed, 20 Dec 2023 00:45:42 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , Subject: [PATCH v3 5/6] examples/qos_sched: fix lcore ID restriction Date: Wed, 20 Dec 2023 07:45:00 +0100 Message-ID: <20231220064502.2830-6-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231220064502.2830-1-sivaprasad.tummala@amd.com> References: <20231219032826.4814-1-sivaprasad.tummala@amd.com> <20231220064502.2830-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: BL6PEPF0001AB50:EE_|IA0PR12MB7775:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a38c117-49aa-4273-5dad-08dc0127543c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r/2vnCLmsf91fq06l2WPdTNqfGLrByYXN4xodajyISaNYve8BzgLWWhB1UzsUlMtUssvqkkHOBBMZaDiNIM0WQHEWjPs2f/v/69uO3OXZTro+q65/BHahuAlfkhARG+PcmRUHutgmo0XrtiLM6aY7KyECs29kMdAHGXVVA6i4hyuU/yibPBfZiuEWmP8VY1SmmWLNtyq2wO6qTwJozSv0mkVE9SWYminlBkzbvAKtCd11kFJteV9Ahg/kRmxKDEtTTrYbL1b6tgKIA03Fkb1MnArSbAbBZIM7viYPfMwMGxAGCjHT+Q2VpWcXJh+x8pTWRbGF8qwRrEsLwzXHVdlaJCjELAKhMfCMK86leTGidgdnb+TZ2vAfgorI5qFF8xrpGFwqTFrh9i/wDf2vnyX06ooNPGfTD6bk1n7DkpNtaoeSVB5nPaROFdNC0Uz2IY1B+Wfk5JyzafYvF+Xr7i8S94AmfepyqjUMGWW98ITcBQRQkLiRJwnd1j6poXn2DBa3cU8QNY6vB0aq8+xOUnDIWzjTKeOaT3lYJnxaXb8Oj/WiVrZx0bwpwmq721AYozSfw5ttzHRyvZ4MtbY/rESgdC8eBIpuRKoluUW23HliIS8Yxeg/IwDd144k9TMdV8qLrEMOC88iSlaeQNb41qXcUd9zVpmQJ0rBEJWNbEl3xwKi9iyR8uvhJtX2IsEgy0LFsllW5r82uG5k0nwQr1Pxu4tbJDXwEYyQS6z8WCeFhLG8BTtF22PUTZSf9Lj7szOE6IY8l3ei8FaATWGhQ5qnA== 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)(396003)(39860400002)(136003)(230922051799003)(451199024)(186009)(82310400011)(1800799012)(64100799003)(36840700001)(46966006)(40470700004)(40480700001)(40460700003)(336012)(1076003)(2616005)(16526019)(6666004)(26005)(426003)(82740400003)(83380400001)(356005)(81166007)(2906002)(36756003)(86362001)(478600001)(41300700001)(8936002)(4326008)(110136005)(36860700001)(8676002)(5660300002)(47076005)(4744005)(70206006)(44832011)(54906003)(70586007)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 06:46:00.7893 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a38c117-49aa-4273-5dad-08dc0127543c 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: BL6PEPF0001AB50.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7775 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 Wed Dec 20 06:45:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaprasad Tummala X-Patchwork-Id: 135376 X-Patchwork-Delegate: thomas@monjalon.net 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 C88494372F; Wed, 20 Dec 2023 07:46:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0581D42E9E; Wed, 20 Dec 2023 07:46:08 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2089.outbound.protection.outlook.com [40.107.223.89]) by mails.dpdk.org (Postfix) with ESMTP id 9FC9142DDB; Wed, 20 Dec 2023 07:46:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4jJ9sA3z6v/YbaG4tn+ndDrQnFMgVV6PE8B9I0lUj/jbMLnaOAaE/796G17UHN7GTvIhsCWa7bRsVshJ47kbIfffebibSlq7YirP/v7aSrJdyHIBK/3ZRi8d/D/omN4hH2kpZHZTRBR5BaWWaNTwe3HEHKb4dpWyI9FVNeNs5qijQaRo3X6pnHB9xCdCqNnA2bO1ImRsznUtkrpaoYI+dba6oy1ODeTi4FbOyLRBQeFggi56HuD5NxGF4e5rYJSue4s4CGawnGHyvYK6RkoFaWHK2NwLGzMqWD2rAwYOdWGglVm2M+kICdLhFj949j2fAq7b3L64aK3n9bFTz2BkA== 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=DP70oIpgPu/QJE3u4riRwKqMYwp3jd05cVYSKgloPSL9rY/NQ2C7oh7bfHHu0Lo0d32P9sDsLUfDAT0Y7ieyLuF8MgINRmhaielEdB89xGAH8/wAZW3YOP+tykL5Q7GXYeud6NAteOttfpGH1yitib+LKmNJuDkO/RQe/sp4nMfSEBaSO2kt5YZdSqGGZJ8tnmCeJAnTAQjRpXIZKDAC7ZZ2do1GPlnCJZxTyiDuS8owpkksB41F4fdOfyGguJw2qv9IPMtAmFPFQyvJyjReTWFJbMqyzzGxjLlvR2ngqWsJ+dxjnIaGYoO3vSKSRWEydOUJbQcr20/xzyW7M66xKQ== 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=g9SI24YmUQFtjZ74dRmUq34DUpvagZ2V1vGKOyD+t6Kgj2GRo+5R6lRGcx0a6jbZa2WDGxERPjAeiMBk1JuPRAl9QVphl2CMKo7sEox3JetfOUbBUEUNi3gX6MY3ckJCdqlHRlHt7r+lvadqbPQDJpTGL1jcdhDsjjhyzh0w3YM= Received: from BL6PEPF00013E0D.NAMP222.PROD.OUTLOOK.COM (2603:10b6:22e:400:0:1001:0:11) by LV8PR12MB9109.namprd12.prod.outlook.com (2603:10b6:408:18a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Wed, 20 Dec 2023 06:46:04 +0000 Received: from BL6PEPF0001AB50.namprd04.prod.outlook.com (2a01:111:f403:f902::) by BL6PEPF00013E0D.outlook.office365.com (2603:1036:903:4::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.33 via Frontend Transport; Wed, 20 Dec 2023 06:46:04 +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 BL6PEPF0001AB50.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Wed, 20 Dec 2023 06:46:04 +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; Wed, 20 Dec 2023 00:45:59 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , , Subject: [PATCH v3 6/6] examples/vm_power_manager: fix lcore ID restriction Date: Wed, 20 Dec 2023 07:45:01 +0100 Message-ID: <20231220064502.2830-7-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231220064502.2830-1-sivaprasad.tummala@amd.com> References: <20231219032826.4814-1-sivaprasad.tummala@amd.com> <20231220064502.2830-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: BL6PEPF0001AB50:EE_|LV8PR12MB9109:EE_ X-MS-Office365-Filtering-Correlation-Id: af68407f-2182-4e5c-915c-08dc01275678 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uVdb8XxCp/+wjPx8IOmF3kzcdrLFetNXhguGCU/v9UHckHx6iKr6i636mwDCOEwudDo+VnAZaYeoPeVInY/mMcZSPU/JahZ8PWgwMIoujpiAdcG2uAqzf6o6YfqFEbS9jrdvFQDZXZGZO5LgwsiJbxeu1FTOFUwgc6IwA/Fg1/S/dCXcb5+Li2u1PsEayEXhXPWNUw+bQM7RVs0SNcP8dTMoRvSDOYDSB4ifKsqBLBuagL829sfrhoM2N5H4swH186siFwysmoJJQzjPgwZUhdIRrhpjT68xpVgyiWF1j2GhCjZDlNQrL1tAQ+emLYzm2X6U/J0RcHs/UdC0tFHmgoUhxW6t9rVVwNtvfMvKDPdO2b58GS0t1pmHzEOZrW61/hiC9bCjFFqdcaef7btl+HKBvGMnfOv+qob1yb8w98XuKGh59EH+/yHPe2bXFDVuZ4bLCFT8IAblqglDty5XNciM96Km7vM2PJ7HPpLiExu1KmxcVv6aPy2Bp4VMXvULQGyqL0AWQ17ixq2YiOTpvxX6XZjFxtOMRPoDbtl1Mpn46JevZnu3s6z3ClORHxDodG7CZ9FtxiJv16XEikG+uQYyP/CwgS3DVt+9iRBvZvsRUZn4KXSoV0RkdR+jbm3sFNbsFVaX2TemZ7fYrDg2Pqoo5KBOmHN+tBN1eyBkYtJu4Drz21oDLBJ08b+hLt8ULhn/kcMNJE0ASmfoe094cQdbEU5kmn33R/yEnVZ+zyNOw5qQC4+oXtYfUFs87v7PfLogYqi49Eo2C9IqXPgf5A== 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)(376002)(39860400002)(346002)(396003)(230922051799003)(451199024)(1800799012)(64100799003)(82310400011)(186009)(36840700001)(40470700004)(46966006)(8676002)(8936002)(47076005)(4326008)(36756003)(82740400003)(81166007)(356005)(41300700001)(86362001)(2906002)(44832011)(36860700001)(5660300002)(7416002)(16526019)(26005)(2616005)(1076003)(40480700001)(6666004)(478600001)(70206006)(54906003)(70586007)(40460700003)(110136005)(83380400001)(316002)(426003)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 06:46:04.5393 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af68407f-2182-4e5c-915c-08dc01275678 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: BL6PEPF0001AB50.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9109 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");