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 67744455E2; Tue, 9 Jul 2024 13:10:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53D5240689; Tue, 9 Jul 2024 13:10:37 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2074.outbound.protection.outlook.com [40.107.244.74]) by mails.dpdk.org (Postfix) with ESMTP id B3D084067D for ; Tue, 9 Jul 2024 13:10:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mtUCyZjz+sHru0XlDAI2Be7ZyWGTZWzocWlMfM5yUcB64kMH6Ty4dBT0EJyuc24cDuLGjmrIG20f10nVKGbHcQxSGmClRQzddcSNqqYGm/zk4bSRQiCI7iasWNuv1GMl4WcjcMNzLZM6O3CR3UDeWkkue+MAIEZYsFMPr2MdfA9u2vvDcen4/xuWHkDW4VrNdeK0za/OL6YUiQUab9h+zOaM6dmPkVUhS9sheW1bHcXe+81JGOXVaYKYa2kjUlhHyHuez6s3lBeJjzOvmfYXLHmCzg6kZgeqgwPbnxYRSxqjiiTmYyI9SBjhsb0S/xs9zbllEgOrJWhNE8UXs/DT2A== 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=WKCIsAFrl8qNR28F9JFgMPSFJJDz3gLKbJEbJXmvzC4=; b=ZUL5DwLSZTWtS6JtjbMWB5P/Oncdzn3PTjHkoRdlwVSouR970YpC4RPi9X7Wdbda1bO8aZO3Kk3g+7GRrvHnNCGnbGS/wwXSOKGvIb9i0QbLS9ThdsG1X5qrSyD+PiTmTMAuB6ymsF7zMasep8SYjk+aak1hMj3rYjnKNqdFtktoIocfaI5aIs/a3MxtS/KqFg9ThcPvKzKmQKYg3CUaSd8myeoyZLyRZjzGImNxrCc0UuiwIuPb8CaHJ7LlEErRlIIIEnsKaqlMrqhvBzJdKwMxzjTKfNQ2FpYWpqFbv34LLqWIODimuZYH4IGtE+HNFsimXr90tFfFZnFn1UXgKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none 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=WKCIsAFrl8qNR28F9JFgMPSFJJDz3gLKbJEbJXmvzC4=; b=ALQl3Me1DCRCascyqnm8C6xoikseCIhVC3nXsVOXZwjP/k7ExBlpq4rAVtSiVfL+jC1p26he+weC62ZWxo4/oXKJJziKYeKYnwKw6Z895b87hCUkefDbGxSygHJLzdrYa278uZebKOiOphy/+uHRXTtmkBoH2h1NyhkwpzquaXg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by PH0PR12MB8049.namprd12.prod.outlook.com (2603:10b6:510:28f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.30; Tue, 9 Jul 2024 11:10:32 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::ebfb:2f9f:f9ca:82cd]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::ebfb:2f9f:f9ca:82cd%4]) with mapi id 15.20.7762.016; Tue, 9 Jul 2024 11:10:32 +0000 Message-ID: <3577879f-4652-4633-8ea8-badd36aaeb8a@amd.com> Date: Tue, 9 Jul 2024 12:10:27 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] ethdev: Add link_speed lanes support To: Damodharam Ammepalli Cc: ajit.khaparde@broadcom.com, dev@dpdk.org, huangdengdui@huawei.com, kalesh-anakkur.purayil@broadcom.com References: <20240708232351.491529-1-damodharam.ammepalli@broadcom.com> Content-Language: en-US From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCK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MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20240708232351.491529-1-damodharam.ammepalli@broadcom.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0249.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:350::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH0PR12MB8049:EE_ X-MS-Office365-Filtering-Correlation-Id: 5aae29a9-6710-4849-aedf-08dca007bfae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?dDBGNkdFUHh1RkttVlFoYjdReDVabHEydmZ0YTBqdDFKWlBrNHZVakJHQ1Vv?= =?utf-8?B?OXg0RVh0R2tHMkp2MEczNnVnZGE2OUJMSlNxWUpTTkVYWlV5V3BnT3N0UVZG?= =?utf-8?B?VXVoMUlhREdkVnFxc3V6NVYzUU55QWRlV2dLVFhPQTl2SytTTFgzbDhSYllN?= =?utf-8?B?SzVVeDFzS0xrdUIzLy8zTm1LSCsrUTF1TjhoODZwcytkbERZbWFxQW9idjhh?= =?utf-8?B?eWMwNGRLVFFMQnRMMkJjUXRiZU41d1BubzBiUEtLWUNxZ0xLZFpDWTJkT2o2?= =?utf-8?B?V1ZMblZ1SDM3THovNXJ6TEc0OW1BZ002WFRMQkhqaDVWOEFJSGVzTndkaFYz?= =?utf-8?B?VzhaYXFEUEt1aTBZZjRvRENuVVloaE1vQmh5S245aFljZit1MlhXUUJFQ0NB?= =?utf-8?B?cmZ6LzRBNm9RM0JlOFM1N2o2MTVkOCtsVjJCNXB5Y2pFazBLZjhFTVJhdUdv?= =?utf-8?B?U1FLS1FqdWRESDhvV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U2V3dNaWlzQ1U2RFJqeXNKRUI0WlN1UjkvcEQyMnlhOCtaNFB2Vkd4L3l1?= =?utf-8?B?ZnJWV1p3N3lJeVhvazhYWklJVzQ1ZHhjcTlBb21QZU8yNlc0TnFBOE5qYlo5?= =?utf-8?B?S1Q3QTdvR25NaXlSS1FxQ21zdU41SFRuUWtTK0FreXN0RFRBZjNjZ3RTV2tj?= =?utf-8?B?a21jTnNweXlFVW9xc1lYWDNCdDhWNnQ4WHYwNXNUN2pSd0pwWWdtalROb3Bw?= =?utf-8?B?cWZKYWxacS9EUExSUE9Mekp2Wis0M2VhU05ieW9qVjF4MXVHK0JwKy9wR0tD?= =?utf-8?B?QVkrQmVNVnBnbHBTdEZqNDNDQzUrbGtkTnZZMFFZeGdEcXd3SXBSeUVTR3FS?= =?utf-8?B?NE9PVlJsRC9ybjJ3WUwxVXZRZzhadlNHaWpJTUVxOFh4OWtRRTdBcXZmb0c4?= =?utf-8?B?QXhoVEpEY0dpSkNoaEpEdz09?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YVlKcjIxa2NEUHpGbGxqVzBScVN2US9NQWJkOVFsVERlS3R2ZlNEREN6NEx4?= =?utf-8?B?RCsxTUVQYkJQSHhrMmlUaTFyTHhiQ3gyS3htVFptV0YzRmd5VWJMdXZEcTBt?= =?utf-8?B?ak5zV25JajR4ZzJTSWxKVlZHZS9xYmNDN3ZlZVJ2RXZBV1RjMmhkUXd5QTNy?= =?utf-8?B?bUFBUHdLZmpENllBNlpvRGNaUS9pL1hSUlk0alR4THQ3R0pJa0VmUnlsOTJZ?= =?utf-8?B?NElmK0pGRUFYTCsxTG4z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TzJuTUUwWEF2?= =?utf-8?B?RnV5S1FZNkd6c3EzOC9uL1ZUQitrUGEzQnlsbGtIMnFvSzc2SW9IVGJWUnRW?= =?utf-8?Q?i+taylfFA7X8xv9dSzL90SSHO?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5aae29a9-6710-4849-aedf-08dca007bfae X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 11:10:32.2734 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6uQRE6U117bEfkhv1v03tgfCLTU1F5DaR16owf8DLO4FebLQWWSC8Hc2WjFs4SOm X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8049 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 On 7/9/2024 12:22 AM, Damodharam Ammepalli wrote: > Update the eth_dev_ops structure with new function vectors > to get, get capabilities and set ethernet link speed lanes. > Update the testpmd to provide required config and information > display infrastructure. > > The supporting ethernet controller driver will register callbacks > to avail link speed lanes config and get services. This lanes > configuration is applicable only when the nic is forced to fixed > speeds. In Autonegiation mode, the hardware automatically > negotiates the number of lanes. > > These are the new commands. > > testpmd> show port 0 speed_lanes capabilities > > Supported speeds Valid lanes > ----------------------------------- > 10 Gbps 1 > 25 Gbps 1 > 40 Gbps 4 > 50 Gbps 1 2 > 100 Gbps 1 2 4 > 200 Gbps 2 4 > 400 Gbps 4 8 > testpmd> > > testpmd> > testpmd> port stop 0 > testpmd> port config 0 speed_lanes 4 > testpmd> port config 0 speed 200000 duplex full > Is there a requirement to set speed before speed_lane? Because I expect driver will verify if a speed_lane value is valid or not for a specific speed value. In above usage, driver will verify based on existing speed, whatever it is, later chaning speed may cause invalid speed_lane configuration. > testpmd> port start 0 > testpmd> > testpmd> show port info 0 > > ********************* Infos for port 0 ********************* > MAC address: 14:23:F2:C3:BA:D2 > Device name: 0000:b1:00.0 > Driver name: net_bnxt > Firmware-version: 228.9.115.0 > Connect to socket: 2 > memory allocation on the socket: 2 > Link status: up > Link speed: 200 Gbps > Active Lanes: 4 > Link duplex: full-duplex > Autoneg status: Off > > Signed-off-by: Damodharam Ammepalli > --- > v2->v3 Consolidating the testpmd and rtelib patches into a single patch > as requested. > v3->v4 Addressed comments and fix help string and documentation. > > app/test-pmd/cmdline.c | 230 +++++++++++++++++++++++++++++++++++++ > app/test-pmd/config.c | 69 ++++++++++- > app/test-pmd/testpmd.h | 4 + > lib/ethdev/ethdev_driver.h | 77 +++++++++++++ > lib/ethdev/rte_ethdev.c | 51 ++++++++ > lib/ethdev/rte_ethdev.h | 92 +++++++++++++++ > lib/ethdev/version.map | 5 + > 7 files changed, 526 insertions(+), 2 deletions(-) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index b7759e38a8..a507df31d8 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -284,6 +284,9 @@ static void cmd_help_long_parsed(void *parsed_result, > > "dump_log_types\n" > " Dumps the log level for all the dpdk modules\n\n" > + > + "show port (port_id) speed_lanes capabilities" > + " Show speed lanes capabilities of a port.\n\n" > ); > } > > @@ -823,6 +826,9 @@ static void cmd_help_long_parsed(void *parsed_result, > "port config (port_id) txq (queue_id) affinity (value)\n" > " Map a Tx queue with an aggregated port " > "of the DPDK port\n\n" > + > + "port config (port_id|all) speed_lanes (0|1|4|8)\n" > + " Set number of lanes for all ports or port_id for a forced speed\n\n" > ); > } > > @@ -1560,6 +1566,110 @@ static cmdline_parse_inst_t cmd_config_speed_specific = { > }, > }; > > +static int > +parse_speed_lanes_cfg(portid_t pid, uint32_t lanes) > +{ > + int ret; > + uint32_t lanes_capa; > + > + ret = parse_speed_lanes(lanes, &lanes_capa); > + if (ret < 0) { > + fprintf(stderr, "Unknown speed lane value: %d for port %d\n", lanes, pid); > + return -1; > + } > + > + ret = rte_eth_speed_lanes_set(pid, lanes_capa); > + if (ret == -ENOTSUP) { > + fprintf(stderr, "Function not implemented\n"); > + return -1; > + } else if (ret < 0) { > + fprintf(stderr, "Set speed lanes failed\n"); > + return -1; > + } > + > + return 0; > +} > + > +/* *** display speed lanes per port capabilities *** */ > +struct cmd_show_speed_lanes_result { > + cmdline_fixed_string_t cmd_show; > + cmdline_fixed_string_t cmd_port; > + cmdline_fixed_string_t cmd_keyword; > + portid_t cmd_pid; > +}; > + > +static void > +cmd_show_speed_lanes_parsed(void *parsed_result, > + __rte_unused struct cmdline *cl, > + __rte_unused void *data) > +{ > + struct cmd_show_speed_lanes_result *res = parsed_result; > + struct rte_eth_speed_lanes_capa *speed_lanes_capa; > + unsigned int num; > + int ret; > + > + if (!rte_eth_dev_is_valid_port(res->cmd_pid)) { > + fprintf(stderr, "Invalid port id %u\n", res->cmd_pid); > + return; > + } > + > + ret = rte_eth_speed_lanes_get_capability(res->cmd_pid, NULL, 0); > + if (ret == -ENOTSUP) { > + fprintf(stderr, "Function not implemented\n"); > + return; > + } else if (ret < 0) { > + fprintf(stderr, "Get speed lanes capability failed: %d\n", ret); > + return; > + } > + > + num = (unsigned int)ret; > + speed_lanes_capa = calloc(num, sizeof(*speed_lanes_capa)); > + if (speed_lanes_capa == NULL) { > + fprintf(stderr, "Failed to alloc speed lanes capability buffer\n"); > + return; > + } > + > + ret = rte_eth_speed_lanes_get_capability(res->cmd_pid, speed_lanes_capa, num); > + if (ret < 0) { > + fprintf(stderr, "Error getting speed lanes capability: %d\n", ret); > + goto out; > + } > + > + show_speed_lanes_capability(num, speed_lanes_capa); > +out: > + free(speed_lanes_capa); > +} > + > +static cmdline_parse_token_string_t cmd_show_speed_lanes_show = > + TOKEN_STRING_INITIALIZER(struct cmd_show_speed_lanes_result, > + cmd_show, "show"); > +static cmdline_parse_token_string_t cmd_show_speed_lanes_port = > + TOKEN_STRING_INITIALIZER(struct cmd_show_speed_lanes_result, > + cmd_port, "port"); > +static cmdline_parse_token_num_t cmd_show_speed_lanes_pid = > + TOKEN_NUM_INITIALIZER(struct cmd_show_speed_lanes_result, > + cmd_pid, RTE_UINT16); > +static cmdline_parse_token_string_t cmd_show_speed_lanes_keyword = > + TOKEN_STRING_INITIALIZER(struct cmd_show_speed_lanes_result, > + cmd_keyword, "speed_lanes"); > +static cmdline_parse_token_string_t cmd_show_speed_lanes_cap_keyword = > + TOKEN_STRING_INITIALIZER(struct cmd_show_speed_lanes_result, > + cmd_keyword, "capabilities"); > + > +static cmdline_parse_inst_t cmd_show_speed_lanes = { > + .f = cmd_show_speed_lanes_parsed, > + .data = NULL, > + .help_str = "show port speed_lanes capabilities", > + .tokens = { > + (void *)&cmd_show_speed_lanes_show, > + (void *)&cmd_show_speed_lanes_port, > + (void *)&cmd_show_speed_lanes_pid, > + (void *)&cmd_show_speed_lanes_keyword, > + (void *)&cmd_show_speed_lanes_cap_keyword, > + NULL, > + }, > +}; > + > /* *** configure loopback for all ports *** */ > struct cmd_config_loopback_all { > cmdline_fixed_string_t port; > @@ -1676,6 +1786,123 @@ static cmdline_parse_inst_t cmd_config_loopback_specific = { > }, > }; > > +/* *** configure speed_lanes for all ports *** */ > +struct cmd_config_speed_lanes_all { > + cmdline_fixed_string_t port; > + cmdline_fixed_string_t keyword; > + cmdline_fixed_string_t all; > + cmdline_fixed_string_t item; > + uint32_t lanes; > +}; > + > +static void > +cmd_config_speed_lanes_all_parsed(void *parsed_result, > + __rte_unused struct cmdline *cl, > + __rte_unused void *data) > +{ > + struct cmd_config_speed_lanes_all *res = parsed_result; > + portid_t pid; > + > + if (!all_ports_stopped()) { > + fprintf(stderr, "Please stop all ports first\n"); > + return; > + } > + > + RTE_ETH_FOREACH_DEV(pid) { > + if (parse_speed_lanes_cfg(pid, res->lanes)) > + return; > + } > + > + cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1); > +} > + > +static cmdline_parse_token_string_t cmd_config_speed_lanes_all_port = > + TOKEN_STRING_INITIALIZER(struct cmd_config_speed_lanes_all, port, "port"); > +static cmdline_parse_token_string_t cmd_config_speed_lanes_all_keyword = > + TOKEN_STRING_INITIALIZER(struct cmd_config_speed_lanes_all, keyword, > + "config"); > +static cmdline_parse_token_string_t cmd_config_speed_lanes_all_all = > + TOKEN_STRING_INITIALIZER(struct cmd_config_speed_lanes_all, all, "all"); > +static cmdline_parse_token_string_t cmd_config_speed_lanes_all_item = > + TOKEN_STRING_INITIALIZER(struct cmd_config_speed_lanes_all, item, > + "speed_lanes"); > +static cmdline_parse_token_num_t cmd_config_speed_lanes_all_lanes = > + TOKEN_NUM_INITIALIZER(struct cmd_config_speed_lanes_all, lanes, RTE_UINT32); > + > +static cmdline_parse_inst_t cmd_config_speed_lanes_all = { > + .f = cmd_config_speed_lanes_all_parsed, > + .data = NULL, > + .help_str = "port config all speed_lanes ", > + .tokens = { > + (void *)&cmd_config_speed_lanes_all_port, > + (void *)&cmd_config_speed_lanes_all_keyword, > + (void *)&cmd_config_speed_lanes_all_all, > + (void *)&cmd_config_speed_lanes_all_item, > + (void *)&cmd_config_speed_lanes_all_lanes, > + NULL, > + }, > +}; > + > +/* *** configure speed_lanes for specific port *** */ > +struct cmd_config_speed_lanes_specific { > + cmdline_fixed_string_t port; > + cmdline_fixed_string_t keyword; > + uint16_t port_id; > + cmdline_fixed_string_t item; > + uint32_t lanes; > +}; > + > +static void > +cmd_config_speed_lanes_specific_parsed(void *parsed_result, > + __rte_unused struct cmdline *cl, > + __rte_unused void *data) > +{ > + struct cmd_config_speed_lanes_specific *res = parsed_result; > + > + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) > + return; > + > + if (!port_is_stopped(res->port_id)) { > + fprintf(stderr, "Please stop port %u first\n", res->port_id); > + return; > + } > There is a requirement here, that port needs to be stopped before calling the rte_eth_speed_lanes_set(), is this requirement documented in the API documentation? > + > + if (parse_speed_lanes_cfg(res->port_id, res->lanes)) > + return; > + > + cmd_reconfig_device_queue(res->port_id, 1, 1); > +} > + > +static cmdline_parse_token_string_t cmd_config_speed_lanes_specific_port = > + TOKEN_STRING_INITIALIZER(struct cmd_config_speed_lanes_specific, port, > + "port"); > +static cmdline_parse_token_string_t cmd_config_speed_lanes_specific_keyword = > + TOKEN_STRING_INITIALIZER(struct cmd_config_speed_lanes_specific, keyword, > + "config"); > +static cmdline_parse_token_num_t cmd_config_speed_lanes_specific_id = > + TOKEN_NUM_INITIALIZER(struct cmd_config_speed_lanes_specific, port_id, > + RTE_UINT16); > +static cmdline_parse_token_string_t cmd_config_speed_lanes_specific_item = > + TOKEN_STRING_INITIALIZER(struct cmd_config_speed_lanes_specific, item, > + "speed_lanes"); > +static cmdline_parse_token_num_t cmd_config_speed_lanes_specific_lanes = > + TOKEN_NUM_INITIALIZER(struct cmd_config_speed_lanes_specific, lanes, > + RTE_UINT32); > + > +static cmdline_parse_inst_t cmd_config_speed_lanes_specific = { > + .f = cmd_config_speed_lanes_specific_parsed, > + .data = NULL, > + .help_str = "port config speed_lanes ", > + .tokens = { > + (void *)&cmd_config_speed_lanes_specific_port, > + (void *)&cmd_config_speed_lanes_specific_keyword, > + (void *)&cmd_config_speed_lanes_specific_id, > + (void *)&cmd_config_speed_lanes_specific_item, > + (void *)&cmd_config_speed_lanes_specific_lanes, > + NULL, > + }, > +}; > + > /* *** configure txq/rxq, txd/rxd *** */ > struct cmd_config_rx_tx { > cmdline_fixed_string_t port; > @@ -13238,6 +13465,9 @@ static cmdline_parse_ctx_t builtin_ctx[] = { > (cmdline_parse_inst_t *)&cmd_set_port_setup_on, > (cmdline_parse_inst_t *)&cmd_config_speed_all, > (cmdline_parse_inst_t *)&cmd_config_speed_specific, > + (cmdline_parse_inst_t *)&cmd_config_speed_lanes_all, > + (cmdline_parse_inst_t *)&cmd_config_speed_lanes_specific, > + (cmdline_parse_inst_t *)&cmd_show_speed_lanes, > (cmdline_parse_inst_t *)&cmd_config_loopback_all, > (cmdline_parse_inst_t *)&cmd_config_loopback_specific, > (cmdline_parse_inst_t *)&cmd_config_rx_tx, > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index 66c3a68c1d..498a7db467 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -207,6 +207,32 @@ static const struct { > {"gtpu", RTE_ETH_FLOW_GTPU}, > }; > > +static const struct { > + enum rte_eth_speed_lanes lane; > + const uint32_t value; > +} speed_lane_name[] = { > + { > + .lane = RTE_ETH_SPEED_LANE_UNKNOWN, > + .value = 0, > + }, > + { > + .lane = RTE_ETH_SPEED_LANE_1, > + .value = 1, > + }, > + { > + .lane = RTE_ETH_SPEED_LANE_2, > + .value = 2, > + }, > + { > + .lane = RTE_ETH_SPEED_LANE_4, > + .value = 4, > + }, > + { > + .lane = RTE_ETH_SPEED_LANE_8, > + .value = 8, > + }, > +}; > + > static void > print_ethaddr(const char *name, struct rte_ether_addr *eth_addr) > { > @@ -786,6 +812,7 @@ port_infos_display(portid_t port_id) > char name[RTE_ETH_NAME_MAX_LEN]; > int ret; > char fw_version[ETHDEV_FWVERS_LEN]; > + uint32_t lanes; > > if (port_id_is_invalid(port_id, ENABLED_WARN)) { > print_valid_ports(); > @@ -828,6 +855,12 @@ port_infos_display(portid_t port_id) > > printf("\nLink status: %s\n", (link.link_status) ? ("up") : ("down")); > printf("Link speed: %s\n", rte_eth_link_speed_to_str(link.link_speed)); > + if (rte_eth_speed_lanes_get(port_id, &lanes) == 0) { > + if (lanes > 0) > + printf("Active Lanes: %d\n", lanes); > + else > + printf("Active Lanes: %s\n", "Unknown"); > What can be the 'else' case? As 'lanes' is unsigned, only option is it being zero. Is API allowed to return zero as lane number? > + } > printf("Link duplex: %s\n", (link.link_duplex == RTE_ETH_LINK_FULL_DUPLEX) ? > ("full-duplex") : ("half-duplex")); > printf("Autoneg status: %s\n", (link.link_autoneg == RTE_ETH_LINK_AUTONEG) ? > @@ -962,7 +995,7 @@ port_summary_header_display(void) > > port_number = rte_eth_dev_count_avail(); > printf("Number of available ports: %i\n", port_number); > - printf("%-4s %-17s %-12s %-14s %-8s %s\n", "Port", "MAC Address", "Name", > + printf("%-4s %-17s %-12s %-14s %-8s %-8s\n", "Port", "MAC Address", "Name", > "Driver", "Status", "Link"); > } > > @@ -993,7 +1026,7 @@ port_summary_display(portid_t port_id) > if (ret != 0) > return; > > - printf("%-4d " RTE_ETHER_ADDR_PRT_FMT " %-12s %-14s %-8s %s\n", > + printf("%-4d " RTE_ETHER_ADDR_PRT_FMT " %-12s %-14s %-8s %-8s\n", > Summary updates are irrelevant in the patch, can you please drop them. > port_id, RTE_ETHER_ADDR_BYTES(&mac_addr), name, > dev_info.driver_name, (link.link_status) ? ("up") : ("down"), > rte_eth_link_speed_to_str(link.link_speed)); > @@ -7244,3 +7277,35 @@ show_mcast_macs(portid_t port_id) > printf(" %s\n", buf); > } > } > + > +int > +parse_speed_lanes(uint32_t lane, uint32_t *speed_lane) > +{ > + uint8_t i; > + > + for (i = 0; i < RTE_DIM(speed_lane_name); i++) { > + if (speed_lane_name[i].value == lane) { > + *speed_lane = lane; > This converts from 8 -> 8, 4 -> 4 .... Why not completely eliminate this fucntion? See below. > + return 0; > + } > + } > + return -1; > +} > + > +void > +show_speed_lanes_capability(unsigned int num, struct rte_eth_speed_lanes_capa *speed_lanes_capa) > +{ > + unsigned int i, j; > + > + printf("\n%-15s %-10s", "Supported-speeds", "Valid-lanes"); > + printf("\n-----------------------------------\n"); > + for (i = 0; i < num; i++) { > + printf("%-17s ", rte_eth_link_speed_to_str(speed_lanes_capa[i].speed)); > + > + for (j = 0; j < RTE_ETH_SPEED_LANE_MAX; j++) { > + if (RTE_ETH_SPEED_LANES_TO_CAPA(j) & speed_lanes_capa[i].capa) > + printf("%-2d ", speed_lane_name[j].value); > + } To eliminate both RTE_ETH_SPEED_LANE_MAX & speed_lane_name, what do you think about: capa = speed_lanes_capa[i].capa; int s = 0; while (capa) { if (capa & 0x1) printf("%-2d ", 1 << s); s++; capa = capa >> 1; } > + printf("\n"); > + } > +} > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > index 9facd7f281..fb9ef05cc5 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -1253,6 +1253,10 @@ extern int flow_parse(const char *src, void *result, unsigned int size, > struct rte_flow_item **pattern, > struct rte_flow_action **actions); > > +void show_speed_lanes_capability(uint32_t num, > + struct rte_eth_speed_lanes_capa *speed_lanes_capa); > +int parse_speed_lanes(uint32_t lane, uint32_t *speed_lane); > + > These functions only called in 'test-pmd/cmdline.c', what do you think move functions to that file and make them static? > uint64_t str_to_rsstypes(const char *str); > const char *rsstypes_to_str(uint64_t rss_type); > > diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h > index 883e59a927..0f10aec3a1 100644 > --- a/lib/ethdev/ethdev_driver.h > +++ b/lib/ethdev/ethdev_driver.h > @@ -1179,6 +1179,79 @@ typedef int (*eth_rx_descriptor_dump_t)(const struct rte_eth_dev *dev, > uint16_t queue_id, uint16_t offset, > uint16_t num, FILE *file); > > +/** > + * @internal > + * Get number of current active lanes > + * > + * @param dev > + * ethdev handle of port. > + * @param speed_lanes > + * Number of active lanes that the link is trained up. > + * @return > + * Negative errno value on error, 0 on success. > + * > + * @retval 0 > + * Success, get speed_lanes data success. > + * @retval -ENOTSUP > + * Operation is not supported. > + * @retval -EIO > + * Device is removed. > Is above '-ENOTSUP' & '-EIO' return values are valid? Normally we expect those two from ethdev API, not from dev_ops. In which case a dev_ops expected to return these? Same comment for all three new APIs. > + */ > +typedef int (*eth_speed_lanes_get_t)(struct rte_eth_dev *dev, uint32_t *speed_lanes); > + > +/** > + * @internal > + * Set speed lanes > + * > + * @param dev > + * ethdev handle of port. > + * @param speed_lanes > + * Non-negative number of lanes > + * > + * @return > + * Negative errno value on error, 0 on success. > + * > + * @retval 0 > + * Success, set lanes success. > + * @retval -ENOTSUP > + * Operation is not supported. > + * @retval -EINVAL > + * Unsupported mode requested. > + * @retval -EIO > + * Device is removed. > + */ > +typedef int (*eth_speed_lanes_set_t)(struct rte_eth_dev *dev, uint32_t speed_lanes); > + > +/** > + * @internal > + * Get supported link speed lanes capability > + * > + * @param speed_lanes_capa > + * speed_lanes_capa is out only with per-speed capabilities. > I can understand what above says but I think it can be clarified more, what do you think? > + * @param num > + * a number of elements in an speed_speed_lanes_capa array. > 'a number of elements' or 'number of elements' ? > + * > + * @return > + * Negative errno value on error, positive value on success. > + * > + * @retval positive value > + * A non-negative value lower or equal to num: success. The return value > + * is the number of entries filled in the speed lanes array. > + * A non-negative value higher than num: error, the given speed lanes capa array > + * is too small. The return value corresponds to the num that should > + * be given to succeed. The entries in the speed lanes capa array are not valid > + * and shall not be used by the caller. > + * @retval -ENOTSUP > + * Operation is not supported. > + * @retval -EIO > + * Device is removed. > + * @retval -EINVAL > + * *num* or *speed_lanes_capa* invalid. > + */ > +typedef int (*eth_speed_lanes_get_capability_t)(struct rte_eth_dev *dev, > + struct rte_eth_speed_lanes_capa *speed_lanes_capa, > + unsigned int num); > + > These new dev_ops placed just in between existing dev_ops 'eth_rx_descriptor_dump_t' and 'eth_tx_descriptor_dump_t', if you were looking this header file as whole, what would you think about quality of it? Please group new dev_ops below link related ones. > /** > * @internal > * Dump Tx descriptor info to a file. > @@ -1247,6 +1320,10 @@ struct eth_dev_ops { > eth_dev_close_t dev_close; /**< Close device */ > eth_dev_reset_t dev_reset; /**< Reset device */ > eth_link_update_t link_update; /**< Get device link state */ > + eth_speed_lanes_get_t speed_lanes_get; /** + eth_speed_lanes_set_t speed_lanes_set; /** + /** Get link speed lanes capability */ > + eth_speed_lanes_get_capability_t speed_lanes_get_capa; > /** Check if the device was physically removed */ > eth_is_removed_t is_removed; > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index f1c658f49e..07cefea307 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -7008,4 +7008,55 @@ int rte_eth_dev_map_aggr_tx_affinity(uint16_t port_id, uint16_t tx_queue_id, > return ret; > } > > +int > +rte_eth_speed_lanes_get(uint16_t port_id, uint32_t *lane) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + dev = &rte_eth_devices[port_id]; > + > + if (*dev->dev_ops->speed_lanes_get == NULL) > + return -ENOTSUP; > + return eth_err(port_id, (*dev->dev_ops->speed_lanes_get)(dev, lane)); > +} > + > +int > +rte_eth_speed_lanes_get_capability(uint16_t port_id, > + struct rte_eth_speed_lanes_capa *speed_lanes_capa, > + unsigned int num) > +{ > + struct rte_eth_dev *dev; > + int ret; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + dev = &rte_eth_devices[port_id]; > + > + if (speed_lanes_capa == NULL && num > 0) { > + RTE_ETHDEV_LOG_LINE(ERR, > + "Cannot get ethdev port %u speed lanes capability to NULL when array size is non zero", > + port_id); > + return -EINVAL; > + } > According above check, "speed_lanes_capa == NULL && num == 0" is a valid input, I assume this is useful to get expected size of the 'speed_lanes_capa' array, but this is not mentioned in the API documentation, can you please update API doxygen comment to cover this case. > + > + if (*dev->dev_ops->speed_lanes_get_capa == NULL) > + return -ENOTSUP; > About the order or the checks, should we first check if the dev_ops exist than validating the input arguments? If dev_ops is not available, input variables doesn't matter anyway. > + ret = (*dev->dev_ops->speed_lanes_get_capa)(dev, speed_lanes_capa, num); > + > + return ret; > API returns -EIO only if it is returned with 'eth_err()', that is to cover the hot remove case. It is missing in this function. > +} > + > +int > +rte_eth_speed_lanes_set(uint16_t port_id, uint32_t speed_lanes_capa) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + dev = &rte_eth_devices[port_id]; > + > + if (*dev->dev_ops->speed_lanes_set == NULL) > + return -ENOTSUP; > + return eth_err(port_id, (*dev->dev_ops->speed_lanes_set)(dev, speed_lanes_capa)); > +} > Simiar location comment with the header one, instead of adding new APIs to the very bottom of the file, can you please group them just below the link related APIs? > + > RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO); > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index 548fada1c7..35d0b81452 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -357,6 +357,30 @@ struct rte_eth_link { > #define RTE_ETH_LINK_MAX_STR_LEN 40 /**< Max length of default link string. */ > /**@}*/ > > +/** > + * This enum indicates the possible link speed lanes of an ethdev port. > + */ > +enum rte_eth_speed_lanes { > + RTE_ETH_SPEED_LANE_UNKNOWN = 0, /**< speed lanes unsupported mode or default */ > + RTE_ETH_SPEED_LANE_1 = 1, /**< Link speed lane 1 */ > + RTE_ETH_SPEED_LANE_2 = 2, /**< Link speed lanes 2 */ > + RTE_ETH_SPEED_LANE_4 = 4, /**< Link speed lanes 4 */ > + RTE_ETH_SPEED_LANE_8 = 8, /**< Link speed lanes 8 */ > Do we really need enum for the lane number? Why not use it as just number? As far as I can see APIs get "uint32 lanes" parameter anyway. > + RTE_ETH_SPEED_LANE_MAX, > This kind of MAX enum usage is causing trouble when we want to extend the support in the future. Like when 16 lane is required, adding it changes the value of MAX and as this is a public structure, change is causing ABI break, making us wait until next ABI break realease. So better if we can prevent MAX enum usage. > +}; > + > +/* Translate from link speed lanes to speed lanes capa */ > +#define RTE_ETH_SPEED_LANES_TO_CAPA(x) RTE_BIT32(x) > + > +/* This macro indicates link speed lanes capa mask */ > +#define RTE_ETH_SPEED_LANES_CAPA_MASK(x) RTE_BIT32(RTE_ETH_SPEED_ ## x) > Why is above macro needed? > + > +/* A structure used to get and set lanes capabilities per link speed */ > +struct rte_eth_speed_lanes_capa { > + uint32_t speed; > + uint32_t capa; > +}; > + > /** > * A structure used to configure the ring threshold registers of an Rx/Tx > * queue for an Ethernet port. > @@ -6922,6 +6946,74 @@ rte_eth_tx_queue_count(uint16_t port_id, uint16_t queue_id) > return rc; > } > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice > + * > + * Get Active lanes. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param lanes > + * driver populates a active lanes value whether link is Autonegotiated or Fixed speed. > As these doxygen comments are API docummentation, can you please form them as proper sentences, like start with uppercase, end with '.', etc... Same comment for all APIs. > + * > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if underlying hardware OR driver doesn't support. > + * that operation. > + * - (-EIO) if device is removed. > + * - (-ENODEV) if *port_id* invalid. > + */ > +__rte_experimental > +int rte_eth_speed_lanes_get(uint16_t port_id, uint32_t *lanes); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice > + * > + * Set speed lanes supported by the NIC. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param speed_lanes > + * speed_lanes a non-zero value of number lanes for this speeds. > 'this speeds' ? > + * > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if underlying hardware OR driver doesn't support. > + * that operation. > + * - (-EIO) if device is removed. > + * - (-ENODEV) if *port_id* invalid. > + */ > +__rte_experimental > +int rte_eth_speed_lanes_set(uint16_t port_id, uint32_t speed_lanes); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice > + * > + * Get speed lanes supported by the NIC. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param speed_lanes_capa > + * speed_lanes_capa int array with valid lanes per speed. > + * @param num > + * size of the speed_lanes_capa array. > + * > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if underlying hardware OR driver doesn't support. > + * that operation. > + * - (-EIO) if device is removed. > + * - (-ENODEV) if *port_id* invalid. > + * - (-EINVAL) if *speed_lanes* invalid > + */ > +__rte_experimental > +int rte_eth_speed_lanes_get_capability(uint16_t port_id, > + struct rte_eth_speed_lanes_capa *speed_lanes_capa, > + unsigned int num); > + > The bottom of the header file is for static inline functions. Instead of adding these new APIs at the very bottom of the header, can you please group them just below the link speed related APIs? > #ifdef __cplusplus > } > #endif > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index 79f6f5293b..db9261946f 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -325,6 +325,11 @@ EXPERIMENTAL { > rte_flow_template_table_resizable; > rte_flow_template_table_resize; > rte_flow_template_table_resize_complete; > + > + # added in 24.07 > + rte_eth_speed_lanes_get; > + rte_eth_speed_lanes_get_capability; > + rte_eth_speed_lanes_set; > }; > > INTERNAL {