From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 234ED4373B for ; Tue, 19 Dec 2023 04:29:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 125BF42E00; Tue, 19 Dec 2023 04:29:04 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2067.outbound.protection.outlook.com [40.107.100.67]) by mails.dpdk.org (Postfix) with ESMTP id 6365A42DE1; Tue, 19 Dec 2023 04:29:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X658vr9L2efTHCyVqrcg5n5yf8WgtHzGVGMdp/vyXFW+KpK2EWvfaK1PglzrX73+BdxGgnlfK8FSGxDv/OyXaAuPIOkfb7oTpFPDzVLrIkrZqV6BLP6XHJ+YIBgMF7M9gbHgcgk4tvZtovl+PsCU0y086ymzG8zwKiozmYwhgnq57C/XxvQYSg/5pwdNOLZ9xR9iRT4u38Uoohev6qiT61g7wTHSIp6STrrutVahNUkHiyeaGRZ+IdBcGCIlEMerXXj1XFQjgcOrzLcEyaPZsBJVxUaiSjGXmYD00WJUo/8UJicliQ0l+8bx0F8bF7go3U1vr/rP8ZWP9qTmTcOg0g== 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=WTX/dfAUWtPnrTeKM7XgkKOI+3C0YiQsao9l/nyLGXE=; b=j7DSnGHEtWylTJLR0CTNafMx9oRgfCkibud2fjCzw/aLItURXMmJ5bLSRKCDpAmhR9mo0PKyOLxGD4BX6JRXWC+OiDQBRDsDKnCx/Y9B52Kc4eo7e/oGg/N/e5BFN0gbf3nD9KX6CA7CCrzCsfJByjxfAquUwQZkFHyGcIFAHRuPnn9MDy0NXmqIaOdW/I6nJXiRFAYsNycbCy/8yeqZg2HKLdp7GaXdbtPRFDhW5Qmjh+NjoxwltJcs5CmNCcnI+KmsFoXnavuoDgbyG0+YxG+omxsxgDVZRCR358NvjrGIIASMABzJDEdV4qxGR8HVSZbFMWF63SA59IqtEZB5bg== 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=WTX/dfAUWtPnrTeKM7XgkKOI+3C0YiQsao9l/nyLGXE=; b=qy09cXNTnUED5JEpH1stKy9ruWQvTqrDoNK4aK2SQvEhR0CZChf1UUrsyPvEJpd3k3rvjdV6vH+OeTSp8ae/6zci/3KhH8xof3BH5507UF98hSTbnBCm8KdoNLB7rtYuRYGQ7aP+dTnd/zJ4WK6jO7wNp2CcawMNnsIqKJ/5l9g= Received: from CYZPR12CA0008.namprd12.prod.outlook.com (2603:10b6:930:8b::9) by LV2PR12MB5774.namprd12.prod.outlook.com (2603:10b6:408:17a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Tue, 19 Dec 2023 03:28:57 +0000 Received: from CY4PEPF0000EE32.namprd05.prod.outlook.com (2603:10b6:930:8b:cafe::94) by CYZPR12CA0008.outlook.office365.com (2603:10b6:930:8b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.39 via Frontend Transport; Tue, 19 Dec 2023 03:28:56 +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 CY4PEPF0000EE32.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Tue, 19 Dec 2023 03:28:56 +0000 Received: from ubuntu2004.linuxvmimages.local (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 18 Dec 2023 21:28:52 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , Subject: [PATCH v2 2/6] examples/l3fwd-power: fix lcore ID restriction Date: Tue, 19 Dec 2023 04:28:21 +0100 Message-ID: <20231219032826.4814-3-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231219032826.4814-1-sivaprasad.tummala@amd.com> References: <20231218074905.42749-1-sivaprasad.tummala@amd.com> <20231219032826.4814-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE32:EE_|LV2PR12MB5774:EE_ X-MS-Office365-Filtering-Correlation-Id: 91f461e3-7ce1-45f3-bd75-08dc0042a237 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VpveME/uVpd3Ed3kJFaWphT/9HuDzBXkwy7NQ8tXqLPrW8DD5t0v38mW5TUXxRIQuUtp9eD67gklPD5Bmpa8DXgCB4dUpky1XDA9gUlb/7MD28kdAu1oJDhQOtzzCnDU/OEedQdBKrsw84uwvilXd/a423osq3v5w14Q2c4emAPvVEUiGXPkoTUC7MFELnNrXBygUK+SZY1V7ElH+LU3WS1lZhMevQugh1QfIAtgKObpalMicURgc+NThGwA5p5TskmddoVntpSCU5FFwmI2RYjE4JMGulyfbje6r3+T2vEGKe0fCvBK4Cl2xtcO/Vsze3IyHtRITY6hUsRbZ81EypjMRe+Lf53q10I+34oZjJnkzTCbaA1CM6MPv8PTih1VTdd6/i2KxWVZzGnMLXU9fzMP179UZBOtxw5O/4TjO2D2dM68d2q1Rz10gF/cozKKSS0UfH6LmmKa9VRVCF3JhDOALZMGdTxC1gHIPaGkP3el7/Yu56Bvr0MmNiQH4zSb2oWVpplfTP65uUzUKLAry86CTMi6U+Ny/Uze46fynty/wEN5VbLBPhBU8pnbzFPhu045UtKvpej8kQb7qQfAE0scVXGyP/7C3r54cf2LaJdTGAO2zerKH3w7dmWD+8ZP3ukXW0m4+zcvHb05oL7YJuhYlunPryyUCrILFKdSmJuqjfK0jH29USVg6s+B8P7o3byeX3fpI9pL2nAML9PF1IriAAoW/uoHnMRJDt5Ro6gjIldslMDGU0oBhsABkmOLsTmmjsxRzoiG2iy5xK0P+g2KXPF+8/OCOReiL6x5bkEujNRTwP+LoJlrbYHzrvs/ 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)(396003)(136003)(39860400002)(346002)(230922051799003)(230173577357003)(230273577357003)(451199024)(186009)(1800799012)(64100799003)(82310400011)(40470700004)(36840700001)(46966006)(40460700003)(1076003)(2616005)(426003)(26005)(336012)(16526019)(36860700001)(4326008)(8936002)(83380400001)(47076005)(5660300002)(44832011)(8676002)(41300700001)(2906002)(6666004)(478600001)(316002)(70586007)(70206006)(54906003)(110136005)(81166007)(356005)(82740400003)(86362001)(36756003)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2023 03:28:56.8077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 91f461e3-7ce1-45f3-bd75-08dc0042a237 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: CY4PEPF0000EE32.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5774 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Currently the config option allows lcore IDs up to 255, irrespective of RTE_MAX_LCORES and needs to be fixed. The patch allows config options based on DPDK config. Fixes: 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 | 16 +++++++++------- examples/l3fwd-power/main.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index f4adcf41b5..bb9da36455 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1399,8 +1399,8 @@ main_legacy_loop(__rte_unused void *dummy) static int check_lcore_params(void) { - uint8_t queue, lcore; - uint16_t i; + uint8_t queue; + uint16_t lcore, i; int socketid; for (i = 0; i < nb_lcore_params; ++i) { @@ -1411,13 +1411,13 @@ check_lcore_params(void) } 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()) { @@ -1469,7 +1469,7 @@ 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 +1661,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, + 255, RTE_MAX_LCORE}; nb_lcore_params = 0; @@ -1681,7 +1683,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) { @@ -1694,7 +1696,7 @@ parse_config(const char *q_arg) lcore_params_array[nb_lcore_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = - (uint8_t)int_fld[FLD_LCORE]; + (uint16_t)int_fld[FLD_LCORE]; ++nb_lcore_params; } lcore_params = lcore_params_array; diff --git a/examples/l3fwd-power/main.h b/examples/l3fwd-power/main.h index 258de98f5b..4e5fd3b6d6 100644 --- a/examples/l3fwd-power/main.h +++ b/examples/l3fwd-power/main.h @@ -10,7 +10,7 @@ struct lcore_params { uint16_t port_id; uint8_t queue_id; - uint8_t lcore_id; + uint16_t lcore_id; } __rte_cache_aligned; extern struct lcore_params *lcore_params; -- 2.25.1