From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5EECA034F; Wed, 6 May 2020 14:22:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE38C1D6BF; Wed, 6 May 2020 14:22:19 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70044.outbound.protection.outlook.com [40.107.7.44]) by dpdk.org (Postfix) with ESMTP id 194C61D63E for ; Wed, 6 May 2020 14:22:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C4oyChHpV/Z/Hk1t987myjb/elmyBdLmjNWVrtu756kLZVWWNJsuzAEGJcMDC96SFhUTJj/VoiKPm2+lf8yCTfJ+Dz+P1IYeKOATccDDZhN06F/XzVXJKxArKhw/kv0wOzpkbiNMMd0j1j3leF4RyTOaVXLnh78WzaTigA2dRr5ofme4MYlY5Fex8IKlTt6xCSnDbacWcEjxWwUubLGHj8W3RtolefldvTeXqICLGxtL1W0t4DYrP0ux3lAc9M3mcYioIAVB+L62H0tP7GC6HSzLi/au3ZZa2OIOTPyBs29LDghyhpTyNHoBL3NkPUcIgnGfOyurMkdtDCocozsN3Q== 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-SenderADCheck; bh=9KW90oGWkfDE+ifYpYI3pASjtA/oJyzhfJ9E9+k3/vs=; b=ZX/H2icrbWDSQc0chi1qjAQFOsXfBIRCfzZVfOlL2tqeJcNrQi7FSTH2ERR9z3cV2p24wtHNPStA3AsAKTL1kRR1Xb6mm5KknGNppmQ6BA6PBn+okuMzskyB3xbsFPwqGs1ECUHdLeM5nCBvn3E3v3gD31lbQCL9+M+zDyP9AoqL72v918CfLVkpbxaOtmboK3H0omW/Lqof5axacASS1WAtj1Vt2BxR10T/XiNFZERVhzQsBd7hyV/ydDT8G+RA3Cs0UQXvKNYfz7zOqTefPBhvaLXYds2F7KJynp/z9En77nAAEP247jfk42BMCbmmBG28Wuxj8vw/3UQ5JGxSvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9KW90oGWkfDE+ifYpYI3pASjtA/oJyzhfJ9E9+k3/vs=; b=dQEM16KFpZI4Vi7+5MvhmgvX4WDJK2cVRt/QyX0n86gL14WVyztT1iI3zoYX1u5lkU/G2FAa7y5wveRE19O5LLp312/gNxF0kC/+jEgOZMA3vOBQ3NuShg5hxMNI/NILwZt5cIOdjV9jApfHBodO/hfQsECg5Ju0Gx0xmIf9Tcs= Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5693.eurprd05.prod.outlook.com (2603:10a6:803:d9::23) by VI1PR05MB5551.eurprd05.prod.outlook.com (2603:10a6:803:9e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.30; Wed, 6 May 2020 12:22:15 +0000 Received: from VI1PR05MB5693.eurprd05.prod.outlook.com ([fe80::e8b6:1a7e:e23f:568a]) by VI1PR05MB5693.eurprd05.prod.outlook.com ([fe80::e8b6:1a7e:e23f:568a%5]) with mapi id 15.20.2979.028; Wed, 6 May 2020 12:22:14 +0000 From: Asaf Penso To: thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com, viacheslavo@mellanox.com, matan@mellanox.com Cc: dev@dpdk.org Date: Wed, 6 May 2020 12:22:08 +0000 Message-Id: <1588767728-5722-1-git-send-email-asafp@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1588762695-2489-1-git-send-email-asafp@mellanox.com> References: <1588762695-2489-1-git-send-email-asafp@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: PR3P189CA0012.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:52::17) To VI1PR05MB5693.eurprd05.prod.outlook.com (2603:10a6:803:d9::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by PR3P189CA0012.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:52::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2979.29 via Frontend Transport; Wed, 6 May 2020 12:22:13 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b00d6ed5-40df-4f0e-732e-08d7f1b81c32 X-MS-TrafficTypeDiagnostic: VI1PR05MB5551:|VI1PR05MB5551: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:48; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i3og2cKlDIZXM1p6FrpBCiAafbBgnFuV76BrE/EZl+xRHjZCnyvNj1e5c4z8kE8U9YwJsB/GuJ3QKTGINSXUShZtaZPY4fn3/lWueXtar2zq67c1cb+KNHh/oLP2io4zu/cOG86IB8USIHKUgscPNCrtWCrdwP3oJzZe28DXFqjmK6t4nuZRgWa5GCgjRWyCgmjIfb60GkuCdQbgjsgGfPFsPeDUEkNdkHZj/IL91xcAwgAiblfKlhuJQHzoNoNmGI8i/Ia1W2syJZTk6awpEAOg+qXpMwd/pWnUtf4ifhHpShuUqShOgbp2njZox1tfZf7Z9Jj4Rpqfh8o7PZlpNLCUCA8urNJYof3IQQCxaqzke2/VB6ncvTWd32yOu5RmnmmCgOTnp3v5lmdpit+ImRYcK+4Ce2rc2sRKqT71oJcidnAML/WnfOjEznTf+b/3TRjBYmL1s9Tw0BmDYbFyM5CreHeX4X2YldktsMwIiEtR2c3rLm9atsuwQZszbmYCGmBCm/iVo0INhbDjdX0Z+w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5693.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(33430700001)(19627235002)(52116002)(6636002)(7696005)(6666004)(66946007)(5660300002)(33440700001)(66476007)(66556008)(16526019)(186003)(36756003)(26005)(86362001)(8936002)(956004)(2616005)(316002)(2906002)(478600001)(4326008)(55016002)(8886007)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: TFLHznYIvpLn9v2MxZI8vk14AROvYvCjzLM9G9TUBcE9sRMRx4xwg98Tf8hF4Y33+1QtPsnAxCZhjBvM+mMSBiOmiifRUJ/irwCJPa+uvkjuS6WPBRqCEYjIK3yG0jCKG1L/tCVLo2T6cq6aVdaWCZ13OrDYLkITdvYhwmDDGRXHYTH8AiTd/S6VwqI9Pm89uTjb0UEGOp6ZRjD1Ku0VqV5CdF4ZnzRS17aWzzkX9lUOk4W3OGQWEZ9WUqztSVET67xwrli2I9dhdkeopR9RuKU8L/p+VhlJ8mUGzBRrYsq4ax8FejoBoKzmRxpLvzloae1IgkiYeXMW2HYFLLpDPxJgsIlATMGBZK6r0cFnR+h4eyan7rIyi/Xu8igsAtOEd540yFhOIpjmDSJAUnyZyFU+kDoET6EaaUKif3oB0Z0ayma+KQM6EJPBrtvEP9r3GVY07mFFI/88DsbQIm6ab657K0ZX54v992KiLtss0gvcadTiNF2Togdgw0sSV5cXnQ6tENetX2RlQedNgrwuK5xCzrawhfrGTWaBcgMAA0W1FH1J431eJPV+tK8SNgfNQwxOZV080xTkaRCnVzT555eqpUnOCUy/TcBPir7wWP9gtfm4rJCtfK1Fr4Q2kWQzM50KD/0RM9iQHoAWDy2+kDczZOaS58tVvrRNi9VGA0w32Ev5VKOYz9n6Z8SPpuIxU9gt0YXZ9LxMzB/ZaUnlLJUGXPJiJ4cLrtnD/1Y6IxNh3hYlcWRczWGhuGft7S03Zk+9S+XGQ8zUSK5X61mS/w8RgEYR4Dd/uLoKq3sjud4= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b00d6ed5-40df-4f0e-732e-08d7f1b81c32 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 12:22:14.7917 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: e7FxZS+4zFCL2Hj3nZReg6vrlrMhrTP8Gsqb6yOxgpMd49ZFmfuwJw/ozt7hmoELmN/ObAalrGDpdmNp0Dv8mA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5551 Subject: [dpdk-dev] [PATCH v3] net/mlx5: add 200G link speed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is no way to report back a link speed of 200Gbps. Adding 200G link speed. Signed-off-by: Asaf Penso --- v2 - reword commit log and remove 400G v3 - rebase and fix checkpatch warning --- app/test-pmd/cmdline.c | 12 +++++++----- doc/guides/rel_notes/release_20_05.rst | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 22 +++++++++++++++++++++- lib/librte_ethdev/rte_ethdev.c | 2 ++ lib/librte_ethdev/rte_ethdev.h | 2 ++ 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 1375f22..e6c6b68 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -769,7 +769,7 @@ static void cmd_help_long_parsed(void *parsed_result, " Detach physical or virtual dev by port_id\n\n" "port config (port_id|all)" - " speed (10|100|1000|10000|25000|40000|50000|100000|auto)" + " speed (10|100|1000|10000|25000|40000|50000|100000|200000|auto)" " duplex (half|full|auto)\n" " Set speed and duplex for all ports or port_id\n\n" @@ -1619,6 +1619,8 @@ parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint32_t *speed) *speed = ETH_LINK_SPEED_50G; } else if (!strcmp(speedstr, "100000")) { *speed = ETH_LINK_SPEED_100G; + } else if (!strcmp(speedstr, "200000")) { + *speed = ETH_LINK_SPEED_200G; } else if (!strcmp(speedstr, "auto")) { *speed = ETH_LINK_SPEED_AUTONEG; } else { @@ -1666,7 +1668,7 @@ cmdline_parse_token_string_t cmd_config_speed_all_item1 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item1, "speed"); cmdline_parse_token_string_t cmd_config_speed_all_value1 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, value1, - "10#100#1000#10000#25000#40000#50000#100000#auto"); + "10#100#1000#10000#25000#40000#50000#100000#200000#auto"); cmdline_parse_token_string_t cmd_config_speed_all_item2 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item2, "duplex"); cmdline_parse_token_string_t cmd_config_speed_all_value2 = @@ -1677,7 +1679,7 @@ cmdline_parse_inst_t cmd_config_speed_all = { .f = cmd_config_speed_all_parsed, .data = NULL, .help_str = "port config all speed " - "10|100|1000|10000|25000|40000|50000|100000|auto duplex " + "10|100|1000|10000|25000|40000|50000|100000|200000|auto duplex " "half|full|auto", .tokens = { (void *)&cmd_config_speed_all_port, @@ -1741,7 +1743,7 @@ cmdline_parse_token_string_t cmd_config_speed_specific_item1 = "speed"); cmdline_parse_token_string_t cmd_config_speed_specific_value1 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, value1, - "10#100#1000#10000#25000#40000#50000#100000#auto"); + "10#100#1000#10000#25000#40000#50000#100000#200000#auto"); cmdline_parse_token_string_t cmd_config_speed_specific_item2 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item2, "duplex"); @@ -1753,7 +1755,7 @@ cmdline_parse_inst_t cmd_config_speed_specific = { .f = cmd_config_speed_specific_parsed, .data = NULL, .help_str = "port config speed " - "10|100|1000|10000|25000|40000|50000|100000|auto duplex " + "10|100|1000|10000|25000|40000|50000|100000|200000|auto duplex " "half|full|auto", .tokens = { (void *)&cmd_config_speed_specific_port, diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/release_20_05.rst index 777d36e..eb8a623 100644 --- a/doc/guides/rel_notes/release_20_05.rst +++ b/doc/guides/rel_notes/release_20_05.rst @@ -66,6 +66,8 @@ New Features Added tracepoints in ``EAL``, ``ethdev``, ``cryptodev``, ``eventdev`` and ``mempool`` libraries for important functions. +* **ethdev: Added a new value to link speed for 200Gbps ** + * **Added new API for rte_ring.** * New synchronization modes for rte_ring. diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index a360ecc..a1cbb2e 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -2153,7 +2153,7 @@ port config - speed Set the speed and duplex mode for all ports or a specific port:: - testpmd> port config (port_id|all) speed (10|100|1000|10000|25000|40000|50000|100000|auto) \ + testpmd> port config (port_id|all) speed (10|100|1000|10000|25000|40000|50000|100000|200000|auto) \ duplex (half|full|auto) port config - queues/descriptors diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index d7d3bc7..47f11b9 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -86,6 +86,7 @@ struct ethtool_link_settings { uint32_t link_mode_masks[]; }; +/* The kernel values can be found in /include/uapi/linux/ethtool.h */ #define ETHTOOL_GLINKSETTINGS 0x0000004c #define ETHTOOL_LINK_MODE_1000baseT_Full_BIT 5 #define ETHTOOL_LINK_MODE_Autoneg_BIT 6 @@ -119,6 +120,13 @@ struct ethtool_link_settings { #define ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT 38 #define ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT 39 #endif +#ifndef HAVE_ETHTOOL_LINK_MODE_200G +#define ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT 62 +#define ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT 63 +#define ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT 0 /* 64 - 64 */ +#define ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT 1 /* 65 - 64 */ +#define ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT 2 /* 66 - 64 */ +#endif /** * Get master interface name from private structure. @@ -537,7 +545,8 @@ mlx5_set_default_params(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) info->default_txportconf.ring_size = 256; info->default_rxportconf.burst_size = MLX5_RX_DEFAULT_BURST; info->default_txportconf.burst_size = MLX5_TX_DEFAULT_BURST; - if (priv->link_speed_capa & ETH_LINK_SPEED_100G) { + if ((priv->link_speed_capa & ETH_LINK_SPEED_200G) | + (priv->link_speed_capa & ETH_LINK_SPEED_100G)) { info->default_rxportconf.nb_queues = 16; info->default_txportconf.nb_queues = 16; if (dev->data->nb_rx_queues > 2 || @@ -1028,6 +1037,17 @@ mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev, MLX5_BITSHIFT(ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT) | MLX5_BITSHIFT(ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT))) priv->link_speed_capa |= ETH_LINK_SPEED_100G; + if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT) | + MLX5_BITSHIFT(ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT))) + priv->link_speed_capa |= ETH_LINK_SPEED_200G; + + sc = ecmd->link_mode_masks[2] | + ((uint64_t)ecmd->link_mode_masks[3] << 32); + if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT) | + MLX5_BITSHIFT( + ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT) | + MLX5_BITSHIFT(ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT))) + priv->link_speed_capa |= ETH_LINK_SPEED_200G; dev_link.link_duplex = ((ecmd->duplex == DUPLEX_HALF) ? ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX); dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds & diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 72aed59..a64df8f 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1099,6 +1099,8 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex) return ETH_LINK_SPEED_56G; case ETH_SPEED_NUM_100G: return ETH_LINK_SPEED_100G; + case ETH_SPEED_NUM_200G: + return ETH_LINK_SPEED_200G; default: return 0; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 0f6d053..a49242b 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -284,6 +284,7 @@ struct rte_eth_stats { #define ETH_LINK_SPEED_50G (1 << 12) /**< 50 Gbps */ #define ETH_LINK_SPEED_56G (1 << 13) /**< 56 Gbps */ #define ETH_LINK_SPEED_100G (1 << 14) /**< 100 Gbps */ +#define ETH_LINK_SPEED_200G (1 << 15) /**< 200 Gbps */ /** * Ethernet numeric link speeds in Mbps @@ -301,6 +302,7 @@ struct rte_eth_stats { #define ETH_SPEED_NUM_50G 50000 /**< 50 Gbps */ #define ETH_SPEED_NUM_56G 56000 /**< 56 Gbps */ #define ETH_SPEED_NUM_100G 100000 /**< 100 Gbps */ +#define ETH_SPEED_NUM_200G 200000 /**< 200 Gbps */ /** * A structure used to retrieve link-level information of an Ethernet port. -- 2.7.4