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 7027B4372C; Mon, 18 Dec 2023 08:49:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2BCC40E0F; Mon, 18 Dec 2023 08:49:25 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2083.outbound.protection.outlook.com [40.107.94.83]) by mails.dpdk.org (Postfix) with ESMTP id 88EB04026A; Mon, 18 Dec 2023 08:49:23 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c4qOJJaMb6SfsvjpyDtlcTApai32B3hgXeaUhP5iG4+BRgwYB5z3ItX1wXNFhnWnK0wYOblkqKi/VQ8UCCTyhKvkt9ELGpTy+GhIisY+k7WcxBEsioyxwbH3TggdoClwQ0EFYvQiGBdbCF5mlmTToqLR+IwawLo/ABnLL9H9EDi/fj3UQlzyOa2DlrykndqvwiXtAcZoOJLzl0Yb0qYg96RSvDBrEYlF98XDVc7Op2fVcDy2qkI7nwyIkTgtYuRSnwCrk/9N3C1r6mcBAek5SASewst/s0EO0d3F3vYcUZDxIWv1+ufp8tgjeEWM0ieFIHQA0NEyjdJNhxTRx2yskw== 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=T59MMZGFtmoI8CGtm4pTJnp2pw2Zhc6yv2vsAxLCkEg=; b=e/KJB4FDFf5Lr72Vg5io1dSJryonFa+qol1HRU8WKLISDD+AClHUxTnAW+WKhMh7hjWIl6lwCXVwU4QxcauIGLI7nzryZaTpmbMO4hKl1zbLh4aEhGkkF0B5PbKzo0FRnVpOhHXLk1h+CUNr1D6DbsHqCefzvPAxBPpzZfFyTarqh0h4XdyteniQN+alPgAYgnlnlG0HINozlu2aG5Df1YtWucqvRzG8ancrJ5xmrnIoM7r3cUfBB+QhJPCycr21SWxXg+aHq2MTEdOyhz7MlG0+toelkQxN5SFZCxAXTN2pp8lpHMutyru0TkhVay7DKoqfxJlgwEnb9Of4yBMapQ== 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=T59MMZGFtmoI8CGtm4pTJnp2pw2Zhc6yv2vsAxLCkEg=; b=A3EHTeS15DoeW68jTvt+pL232Gyi0/FR4uyv5sP1lahm6CMl2TrBj2F2hQhDQC3e+FjTgSZrgxFLaqT74EHvkhXf4+ajACD6n9p42RVGrH93c1MRx6MoCz8zUAl9EKDw97qbs5w2jMCLjRfWzpgQHE1eM+2oDA92sPHM0Hmicm0= Received: from MW2PR16CA0034.namprd16.prod.outlook.com (2603:10b6:907::47) by SA3PR12MB7858.namprd12.prod.outlook.com (2603:10b6:806:306::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Mon, 18 Dec 2023 07:49:20 +0000 Received: from MWH0EPF000989EB.namprd02.prod.outlook.com (2603:10b6:907:0:cafe::d1) by MW2PR16CA0034.outlook.office365.com (2603:10b6:907::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37 via Frontend Transport; Mon, 18 Dec 2023 07:49:20 +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 MWH0EPF000989EB.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7113.14 via Frontend Transport; Mon, 18 Dec 2023 07:49:20 +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; Mon, 18 Dec 2023 01:49:18 -0600 From: Sivaprasad Tummala To: , , , , , , , CC: , Subject: [PATCH 2/6] examples/l3fwd-power: fix lcore ID restriction Date: Mon, 18 Dec 2023 07:49:01 +0000 Message-ID: <20231218074905.42749-2-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231218074905.42749-1-sivaprasad.tummala@amd.com> References: <20231218074905.42749-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: 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: MWH0EPF000989EB:EE_|SA3PR12MB7858:EE_ X-MS-Office365-Filtering-Correlation-Id: ac26263d-40ed-4552-93ae-08dbff9dd83e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mcxbzufX4VsNTnKoI4jq/IbjnII7YPrxsWKLJfGpcg5vNFiCdHqLGzjXLJjh8NpHI9oKF09fRvsG84wGBEZcXQW4MZfXlIIZwHOv8RnsJeM6CaBTMwTWS5phoxkUeSMrquN4ZM6K/kY4QIZwlXbrxGwT91uSl50COCqI9CuZsjQWNSLgS/IGy+YKtHbgEo0fROAszqitQKO7B+curRH0tk/VTlsmxxMhKDNIzHYzu6jRafZoofNKRoMYMw+Nrsbnrc9+u/FkGkZXAwq3WnLwayf05iHILRp27oBKjupaKEZTcA2aGe00UEnwQok59A3U40EnbuuORbFtCrJ5lJr/Z4PYMeLy5hF7f9CLt4r3ND8UYo42XOfQUjraSw7xnRj/Roh7yO4inTcMZ/BCzJkde6PTk8qzkpWGKuJedZQ0+y2oSfe8iH2tUMMnWByR63kze/21TAXIkoDGWhxYInct9HZsxPrvB+eke5so0QebBN+tIsCNaWK/F0C8Mz0xKaAPf9AdFRKohGFaTJkWEdmnKWGVfSdi7Bl7clu/TSmpqI1giciW5i1ALdvJd6Uxqe+joPMDBmjmgY4guws3yL3aNqFFcjTDh4jpuCI9Mur2PXIvfJJKZJ+XTH63+DIX6NRZsgHwSa3k4UkGpI1tnlo70FuXUt3BsX4SetDTYQMFaM7+ErFnXRXGkUySeq8zPV1R7OCXCvm9GuzLjV8LD3UhlT2gleLGVk6l2EgRLnevXlAd4tApffYigbCKxHjgQJP9Eqbt6vrskQnCushWQuyMUw== 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)(39860400002)(136003)(396003)(346002)(230922051799003)(82310400011)(1800799012)(186009)(64100799003)(451199024)(40470700004)(46966006)(36840700001)(16526019)(2616005)(40480700001)(7696005)(26005)(5660300002)(478600001)(6666004)(83380400001)(426003)(336012)(1076003)(70586007)(54906003)(70206006)(316002)(110136005)(40460700003)(8676002)(4326008)(8936002)(47076005)(2906002)(41300700001)(86362001)(44832011)(36860700001)(81166007)(82740400003)(356005)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2023 07:49:20.4110 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac26263d-40ed-4552-93ae-08dbff9dd83e 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: MWH0EPF000989EB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7858 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 | 12 +++++++----- examples/l3fwd-power/main.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index f4adcf41b5..1f0ac3e660 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) { @@ -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