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 D6E07A034F; Wed, 6 May 2020 14:07:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 427131D982; Wed, 6 May 2020 14:07:12 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130075.outbound.protection.outlook.com [40.107.13.75]) by dpdk.org (Postfix) with ESMTP id 639F01D97C for ; Wed, 6 May 2020 14:07:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OL0eue+V2DrG149PlA6dts4iR1BOqpnfwhk5iSLbxkXTHD8+FK4t19afaUS1OWHoH6UoN/MkejOfZTaC7gwXrsr0J0cQeQ9HSI3xIr0gC/G2TPPuL+w1qr5SKr9VRejeALUGjTZxghtJOk6eIyRg08OdD3FobJ6filU9+CG5Hms6N/p0WoqcZGY315WspeQZ1RVvKXAQ7sVVqRMjr6X7LXvV9XbI9g+aX3/LRNLoA6OdzwZcy+wFYspjB9I04XnJKO4O9LjkA+66pf0u+XcfIMhRaJRs+TO2hwtKDw2z5532ymibrTLM8IOCLGWAJMfIf8tQ8rGt9eJuBjquk4TSmg== 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=puxbP3N9TySzDiZy/r4jkNByZjZhDHrUcn700MKaMAk=; b=nk4S5olgcrv0/AqfvOYS9Zb+cBJRZpJzKm6Ob53Mey19tNREozQD45REDmfQ08cS3yOPXMr0CItrWcq+tPW5ayLPTaQylMVWsk1oWKV9rB610epWSuMALatoaPc5l6wXEVEQtVV0Wd4KKpIsn4gWg5HemRM4VwH8yCdBLe3+cuZu5v9CYhOW3XlIFllcQD4Q9ldBMdkFxk1E3mNuyukVgW0zaouVKr9wykwgp7O54GgG6xZkESwG69eJGikzaTIJAqSbAKUs79TkVD9AeBPoxgRqjWPh36Sro6PDCA8iDRpPkLfGw/ibvzBteQl0bamKsPADh/NmuPVVi/BOeEMllQ== 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=puxbP3N9TySzDiZy/r4jkNByZjZhDHrUcn700MKaMAk=; b=jz6omrj+I8RMmhnbcuC0fVJx4tLg1FTKSn17oHv2eqEyI2OO6jo3JHfsw7hKAWgeXNK2y0GlQaMQfOIRzrds7f4rlgTW4Cp/KlxK9hX+uQ8Vlz8w8q4Q1JfUIdCeIanqONd1uJ746XKiSS33382jKJGn+UNU6PVln/8mRs6uFmg= 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 VI1PR05MB5776.eurprd05.prod.outlook.com (2603:10a6:803:d1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Wed, 6 May 2020 12:07:08 +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:07:08 +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:07:03 +0000 Message-Id: <1588766823-5198-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: PR3P192CA0010.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::15) 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 PR3P192CA0010.EURP192.PROD.OUTLOOK.COM (2603:10a6:102:56::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2979.27 via Frontend Transport; Wed, 6 May 2020 12:07:07 +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: 5970b32a-ff99-4d7b-accb-08d7f1b5ffe0 X-MS-TrafficTypeDiagnostic: VI1PR05MB5776:|VI1PR05MB5776: 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:238; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YGKIi3t2cOZkVHrOuA6BUYOdzzMaTAJWTrzXPtrp7yk2W/GoW9IsxJ5HFEpKzfkwxvbA2PjQMU97Hk8asFYGWPpFj4YZsrsUF20SVEA9SJy4cJeZRIBL89Wn5H4vr5FOS+IfxTkDbKqV+JuBLUcWS4sXlahPHLicge4uEeSlMO1QSMGie+P4qA3g3GxgAj+Sn1gKHzvvY9VTwq0R34vLuNGhA9kFt6/zAyZ5Rk8o11S8+swU4MWWi+W/d9FkbLi7aaIUre/2YZLihLWccPv96JFqfCCVXirI01D3MWwTRRCqSYLR6KqyADwynZalVJl5Ekks+l3FUWw3UnxNF6Jji+WpIhDkRMJvgWLV1z3P5FWqma6tSMdLITRXMP+WRaIrgmese0XRH8fQvMYlxOEe0aBIf4I4DMVnWhAnY2IWlIiOaSgiX9ip6xpb0HhC8Tnsz9vaYC3+dvGP5wXW/+ThHmy5m9MQHRASdmIC7XX8YHMFxWCZklerRs56TYI1SbG4YlhbTPR6rj9WjphJam2xow== 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(33430700001)(8886007)(55016002)(478600001)(7696005)(52116002)(6666004)(36756003)(66556008)(66476007)(26005)(186003)(2616005)(956004)(16526019)(66946007)(8676002)(86362001)(8936002)(19627235002)(316002)(5660300002)(2906002)(4326008)(6636002)(33440700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: b45XwwN+RSG+MtQvzuCqv0ZZ6gmhKkXLUT1xa4Zcg+t0lqjt5A8Ocv7iQyvRbyAQ11zssqJ1FxljPNFWGOvUf21UJzm0jMHGpN31FRqZGuE3ezUo+hwVvXB2cvBHacuh1JsAl1h+9GozbRruxDWQoIcNGR9bbTo7ynGsyNcA+Gef2vSpAZ1rlYgEZNC2vliXox05NNSF20ZyDk1DXFMz7EMsM1mHwdT+9HIeXOzOYbNZOyHUde/8F65EdDNMnY2Dgyze4xzBk7XuXRpILDbqy9LND+EEDVMuHloIniPTrV6ZRbWP3F50m7NaTrcuO0ZTSed2C4rDzCJl0oyb/ETIyYlq4cwVtzEhbvgvU2yW7mhCGixBOjpxQz0swTszFKFqGTUxzs9BJYbzpnq31cS79auGgRAvaXWZFLDqtsWN9Tqq9j3Z4MHbSzhbZdLMiHazAJcGA5lYBdW6wSkByaI9gA3DEDe+10lJ9Mwg5s2EdxNl6lgJMHbnGrX15xFUO1gGwbPK2ORgee7wNhRLEqeh9kl+D7ggvNXRIFZkEQnzvVjxIBG/g4iUMJiiCevetpQ76GUfcySa8XRywP44RNaIYh0k1L5Gy6eE0Hb+Gv1Xy84Zg7Rei8RcyRBtLbjIELAEUPS/WCKmZE0eV4mGQGYIR0K/pj9+RhZOpV5i3TGCZhqAdsj7z4lsxbobW5sJQuYCDYpbUoA2CbXTRD1nUp0OI2gVPoPMJThhf8UV4znHnIjUg6uZKzNmJQdo3bZ9GQEBQ28oTMwoMmVx0dDFpTGuBOKR1xQESi4nYEjVxixZmWE= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5970b32a-ff99-4d7b-accb-08d7f1b5ffe0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 12:07:08.2572 (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: a2fEhQiGk/e5j444StrQNCzfM9o7wC2tsLYP3dVYEsE9fxFMgTxq3UR06O7oSTbmmIrm5zxFF3ZhT2hqeh6U3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5776 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 --- 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