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 48A10A034F; Wed, 6 May 2020 12:58:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 04E921D92B; Wed, 6 May 2020 12:58:38 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130078.outbound.protection.outlook.com [40.107.13.78]) by dpdk.org (Postfix) with ESMTP id BF5E31D927 for ; Wed, 6 May 2020 12:58:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XtdkhJza0FGgHGdHN0Z3fwzR4VNRsha1tkD3IjxgRhfE67amp7QLti6W1kDVdiFyZ3DbSYooMfbf8DvzIuouaVrMGRtqf5CLvOlu6VPL8ahyS6doCZCovz0/cj+sWgaFytpic0bqmvJVgF8o8Ykib+eofh4iaKZ26r5FAVa4dzJ2n6oyopWN50XoVLKvuFNZGlGG2GnoowFN4v3/+ouEYXI7yoodso714iYtmNgm8IOKLY6dfSCwgQysAhxKndXpPmbUzPKqTxvpVz7niFN8GRd9Uuaw0HaZ/jYP+myvYfdejPdYiW9Up3ZuaJCxLUIdEdJDUQp1VgOw5fGgjzb8pg== 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=ws5r/MizG+OdyFuridMecuywHz3smJfRGzgt4j9Wvn4=; b=N7OCvl5u4TxjR4MyOxOeBzOQCcQWNPwmPMZoir48SY4UEDF0Axqqe4DD+8jeA21lwyB4AA/oRWaKYYt+UCOiYXG2/3DpcTADpoi3sYguzcPTJP5kNucGFakANm9ewnku7sLZWrQjaA6EPrJ0Ujfedxo7j64e8EWTIetL/Aq3qzkbFt1XbbuzyezCt4W8SX9rU25S3CdnBcKBTv/JDLgBQCFTcg/yO+AD6lDzckFKVowCc1kvDm5C4BbRD++uzkL4lX2DegtCflICz3HScGIf4p5EXW3dJqlc6fAgXkBXMuD58ATCF9vDQUWcOriVjtpLOhxRIrpC++OypRDbH6cgKg== 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=ws5r/MizG+OdyFuridMecuywHz3smJfRGzgt4j9Wvn4=; b=l6qxjSvDf1XTbnNEccMJkoHAwZZ0OtIIynAQsZZAmuEA8XukSyAE082uR6iGrNMrcyB7tJ1od45WXW1xMprAGKjZbW2ORmHkgZroY6CAW5d9+aagdngiE37Ap/g2nk6MyYjVcuIrcTHp6/qSSlceLv0PpBfZhyQ1RbswFh+fMo4= 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 VI1PR05MB4174.eurprd05.prod.outlook.com (2603:10a6:803:4b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.29; Wed, 6 May 2020 10:58:34 +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 10:58:34 +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, ajit.khaparde@broadcom.com Date: Wed, 6 May 2020 10:58:15 +0000 Message-Id: <1588762695-2489-1-git-send-email-asafp@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587476686-13929-1-git-send-email-asafp@mellanox.com> References: <1587476686-13929-1-git-send-email-asafp@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: PR0P264CA0095.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::35) 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 PR0P264CA0095.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:18::35) 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 10:58:32 +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: 70d63b8a-2e59-4de3-96bc-08d7f1ac6b87 X-MS-TrafficTypeDiagnostic: VI1PR05MB4174:|VI1PR05MB4174: 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:397; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sqkgLfIGzmCs9TUXDgDjqmnGA3D2tyIelwj29oQaTu5I/W2HXOA8+KmHNcwbxUbAMcDbOd+at47hj94WHbLvC2buk6LuPL76BuzfmRBo7tKbmq3fRngcsSXeXawhwZKsaU/ObJ0ru5gZAq89chIobZKJEucOKzk98gRHcXKmVdxyCqUrwS+xRlsSF2mpGEnTc5K+u4ksRAbFxyLD6OIJaqbvp4fyBS3KdeJO1/BPDL38pA5WMMTr8ajCvTutIB5CFuzJKQCMQBq1NoI1nTJ++Q53AJTrf8gqZkMGcyPWlB43GS+rgDR4NB8A2JbrKqXGFgbeEfaRyORX8EUB47u26nghExz7a1iCfSqKak/ZRnkEa4vWejJdR47EDUWsZxgV6TENwSlD/OY9J7CNEwOQY+qWMyLeePIQBaiIjpD242QE/5QwQt2iuOdqDYCZNShAdcpj7oAFpuSOHUoEvAlyhKhEP0hQatn615DiKHFN+8N92XxHqQNq5m5obH2qV9DbiClgLEkGHJBNnTe0Juf28w== 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)(366004)(396003)(346002)(39860400002)(136003)(33430700001)(55016002)(316002)(8676002)(6636002)(5660300002)(956004)(2616005)(26005)(33440700001)(6666004)(8936002)(4326008)(16526019)(2906002)(478600001)(19627235002)(36756003)(186003)(66556008)(8886007)(52116002)(86362001)(7696005)(66476007)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: H7W6l9Ab/yJVXYvFXb07xHCe3lAxlGTGIKhwVtiYwbGCDa7OVoBomtmF1Paqs6bI7VumKrOsi4oS+lwW28LDnB8mKMkr5S+yqo7ENGQ8rBw4DDYfBSY0U48WnBPQig7TbXZmtiO9mcMcVYBgW/NTBBC3kTJ3bm1ujYVvvs7ykvAHaQMF9OYPwaduhjIU+C89ONPsRLXsM8aAK8ANTD37/6qzAcY1Rotz/zGkCKSGdJnjXrWNH19gyXqLs+vAUW+5sNVcRKeS4rATzIcFwkjDuS8v/Y2tIEq84ymPGrer71sxKtI1VnY40NZy9a9zh/C1GQFyGodPZk83bfuat7JwiKiuPSp6u3S5ZJO/rna+FAZ1dzGJiOVAJwmXgcrMrAqBnqiIn12LYJNm2vwQYTJEH/MKxqI5pDk9/5xn9WewPL9k6B3K7qzJ4p2querYM1J+ButaBG/I3LnwXLuvKZC/n8d4tay4/7sVQj7eK7ox9S49jdCNNhTwieEao8Njdk1Cy2KlyfnVeUfRLX5Q1XWa2htJRDEfKQlVVwYb8yfFrEKLkCUR510XroxnOugt9LrN3iWOzH7zLKGyn8osKlZdQ3aDQGGRVMTjqghfLlfRy7osUt113UME0vU0ysgNpfImU3QWQI1EfjpOWSODe9BG0997l1kUaDYPc5xvgwQ5WwJJW7WIRs3cbMS0Ihkgpltqxx4KQhXtvBqUPGcIM2+XX9AqCPj0gz1JYcGhi+6nzYCJ1+TcqQ6OGwe//rEJ8ybQkoEl0WbGgnajQDGPjgt8JEEV8QkUUpQxVBdzlqssIR0= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70d63b8a-2e59-4de3-96bc-08d7f1ac6b87 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 10:58:33.8970 (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: uv74olCC8iR3bY3qas0hs+P9pGlWkLQLfJ2dLtwtFgofaKigptLb4JZ3wM7uOfIXlTn4o1l0BseHXomLlZQeFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4174 Subject: [dpdk-dev] [PATCH v2] 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 --- 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 | 23 ++++++++++++++++++++++- lib/librte_ethdev/rte_ethdev.c | 2 ++ lib/librte_ethdev/rte_ethdev.h | 2 ++ 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index a36c505..63954ed 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 bacd4c6..5441605 100644 --- a/doc/guides/rel_notes/release_20_05.rst +++ b/doc/guides/rel_notes/release_20_05.rst @@ -56,6 +56,8 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **ethdev: Added a new value to link speed for 200Gbps ** + * **Updated Mellanox mlx5 driver.** Updated Mellanox mlx5 driver with new features and improvements, including: diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index dcee5de..51054d9 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..3953787 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -86,6 +86,8 @@ struct ethtool_link_settings { uint32_t link_mode_masks[]; }; +/* The following 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 +121,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 +546,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 +1038,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 0854ef8..43a0489 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1098,6 +1098,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 8d69b88..221072c 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -283,6 +283,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 @@ -300,6 +301,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