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 17DEAA0597; Tue, 21 Apr 2020 15:45:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 538731D5EC; Tue, 21 Apr 2020 15:45:12 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60084.outbound.protection.outlook.com [40.107.6.84]) by dpdk.org (Postfix) with ESMTP id 3EC771D5C9 for ; Tue, 21 Apr 2020 15:45:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f94S8YXg2fQftvq1+yEM7Ob9fc8ykUkxr0P3OxqQIHQ7A2dZ3qpQ1WTpYMNBBaoaATy9D0069B9A5kokyV0G5yW1WC3DgXE6rpMRcunn4TvvskCPhHUWBp0Ee17ekxQ9iOAsu68txyDRjMlWLxRkI8LCzx5ExIkZH/0+/L9xuRzj376b3H1kg2s2YSRHNv9i/sUdmsj6qsZ85IQOUCeZzuRtZxyfy/rHn2ZLP7LuKzzUmYhb+TnAuM6F0bAxCSjTfs4TtHsizqnjHeX72ihp1Qp4b7lV1bmtakeP3EZqq6sS2BsD4i4HXzO1bTB1r84jRNSXAlMf9eQklNDb9mZBYg== 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=A8O01pKjwab+xsnSyZM4ysqyGNthVPQcscCPBfKSR7s=; b=QvP1dDTbe4ecxjoevBH0uv2oq5ZQotYk0BNBB8xuCBjOIL4vZzvox0WTWSCPaLA9dDBPB/YdcB3uJoXuFXvLlAyh2YQXDnem9iUpqUQdTS88dX3SYtpz4JJQBBZPzT8y0dCcZsOHTMLgJdWVbj9cS0WJXYXJagZvF+xwacUlyVhp9sbDT4aVdVLTfwmSyseK781qVl7CN+3hhyavcXKeVR4NzWOgEl482YLFamiyBUIaECXYL4ikcAPJqJdMsVhkvkXStm1pukbrDKWxgseSzsr+JlqMG7NEBB7MLZdkbMF0FjVFHNT407j9YXfcq06tzMlWyQynAN1fNL3/4S87SQ== 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=A8O01pKjwab+xsnSyZM4ysqyGNthVPQcscCPBfKSR7s=; b=U+3MpAd6cTunrKiV2oZy4Ycfgf6BnjLeYiMDHRlNvmpsc5sAwVWA375KRYbG8FKDbIfH67WsVYgd7MRIqFyEbwLW5H90QRdxvlmDNS+a2pu6TzYnNY4pxXocTJYYcQ0MxZdu5wuisupRKqGzwZyxnRSEPMzhXmH7WLcWVKDIuvE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=asafp@mellanox.com; Received: from VI1PR05MB5693.eurprd05.prod.outlook.com (2603:10a6:803:d9::23) by VI1PR05MB3165.eurprd05.prod.outlook.com (2603:10a6:802:25::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.28; Tue, 21 Apr 2020 13:45:10 +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.2921.027; Tue, 21 Apr 2020 13:45:09 +0000 From: Asaf Penso To: dev@dpdk.org Cc: thomas@monjalon.net, viacheslavo@mellanox.com, matan@mellanox.com Date: Tue, 21 Apr 2020 13:44:46 +0000 Message-Id: <1587476686-13929-1-git-send-email-asafp@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Content-Type: text/plain X-ClientProxiedBy: PR3P189CA0057.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:53::32) 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 PR3P189CA0057.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:53::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.25 via Frontend Transport; Tue, 21 Apr 2020 13:45:08 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: eaf6d34a-5984-4742-ed41-08d7e5fa3548 X-MS-TrafficTypeDiagnostic: VI1PR05MB3165:|VI1PR05MB3165: 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:3513; X-Forefront-PRVS: 038002787A 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:(10009020)(4636009)(366004)(55016002)(4326008)(8886007)(5660300002)(36756003)(2906002)(19627235002)(107886003)(66476007)(498600001)(86362001)(6666004)(66946007)(66556008)(956004)(6916009)(81156014)(26005)(16526019)(8936002)(52116002)(2616005)(7696005)(186003)(8676002); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 82lFLBholK2IYD1ppRvusba8JOgU1EfGfSFD9qe2/YhpaKCCR+fxI23SUpp6jmSMF5pG3Ros3RTq8Y4fEknRVqBndBbUsItIVV0H9IlLLdHTbYazsns77cimBzwSpppzc+TG+wbvajmsQzDcyvwMZ6ZiGc5shvJsbt+hONGRSKB3wnExF9GdVoL7C3YMTU/R56+gr9xiFolw+ai05tXawzlTJt4QpFG1d38GtIRwnH3oUPSa8D8kB+VxrMJjNE0dRObdYtvcGYvaDAp0RbsVRWZBOThc+rMKFdSw3wbQXRFKQdiHzmSogbbwNRIQyK12auCtXa678TX146+qSW9fjocCDSlvRv87soha1AWodjtNeLQ4JcAxAcvUnYrwv0dPVuoUWX2/GWXNDVGGlrJFmhy2fpR5SMq8NPrhYaQzN5H5uhJ7uwKBMtp/CoJAMG6+ X-MS-Exchange-AntiSpam-MessageData: /RaCrTjdl0IHqqKT3xWf81FRN4oo6/zSnD8Xn79lslMvQWV+isKJWaIqKlhpPw7Ka1G39OBM/7nXQjSqwc8eAoq2boODTBWbUGo8w6epAu2cBfS3FcnT3bGFkDRzKtT3d2oHoxNvQV4Uz5dbkPtRPQ== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: eaf6d34a-5984-4742-ed41-08d7e5fa3548 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2020 13:45:09.7529 (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: JkfcbjpO+ai32ADwv5wSpXwGwjKisizwkGkAz3hd3buTlKyngJh2l9QcpXkJOwFgzRiy8VyTGZEQ0dwXrSxMNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3165 Subject: [dpdk-dev] [PATCH] net/mlx5: add 200G and 400G 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 nor 400Gbps. Adding both 200G and 400G link speed. Signed-off-by: Asaf Penso --- app/test-pmd/cmdline.c | 14 ++++++++----- doc/guides/rel_notes/release_20_05.rst | 2 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 32 ++++++++++++++++++++++++++++- lib/librte_ethdev/rte_ethdev.c | 4 ++++ lib/librte_ethdev/rte_ethdev.h | 4 ++++ 6 files changed, 51 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index a36c505..7b77584 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|400000|auto)" " duplex (half|full|auto)\n" " Set speed and duplex for all ports or port_id\n\n" @@ -1619,6 +1619,10 @@ struct cmd_config_speed_all { *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, "400000")) { + *speed = ETH_LINK_SPEED_400G; } else if (!strcmp(speedstr, "auto")) { *speed = ETH_LINK_SPEED_AUTONEG; } else { @@ -1666,7 +1670,7 @@ struct cmd_config_speed_all { 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#400000#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 +1681,7 @@ struct 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|400000|auto duplex " "half|full|auto", .tokens = { (void *)&cmd_config_speed_all_port, @@ -1741,7 +1745,7 @@ struct cmd_config_speed_specific { "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#400000#auto"); cmdline_parse_token_string_t cmd_config_speed_specific_item2 = TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, item2, "duplex"); @@ -1753,7 +1757,7 @@ struct 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|400000|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..636c356 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 new values to link speed for 200Gbps and 400Gbps** + * **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..5b8b0dc 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|400000|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..e78a665 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -119,6 +119,20 @@ 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_200000baseCR4_Full_BIT 40 +#define ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT 41 +#define ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT 42 +#define ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT 43 +#define ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT 44 +#endif +#ifndef HAVE_ETHTOOL_LINK_MODE_400G +#define ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT 45 +#define ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT 46 +#define ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT 47 +#define ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT 48 +#define ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT 49 +#endif /** * Get master interface name from private structure. @@ -537,7 +551,9 @@ struct ethtool_link_settings { 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_400G) | + (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 +1044,20 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size) 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_200000baseCR4_Full_BIT) | + MLX5_BITSHIFT(ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT) | + MLX5_BITSHIFT( + ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT) | + MLX5_BITSHIFT(ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT) | + MLX5_BITSHIFT(ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT))) + priv->link_speed_capa |= ETH_LINK_SPEED_200G; + if (sc & (MLX5_BITSHIFT(ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT) | + MLX5_BITSHIFT(ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT) | + MLX5_BITSHIFT( + ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT) | + MLX5_BITSHIFT(ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT) | + MLX5_BITSHIFT(ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT))) + priv->link_speed_capa |= ETH_LINK_SPEED_400G; 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..6c49a59 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1098,6 +1098,10 @@ struct rte_eth_dev * 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; + case ETH_SPEED_NUM_400G: + return ETH_LINK_SPEED_400G; default: return 0; } diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 8d69b88..5509b5a 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -283,6 +283,8 @@ 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 */ +#define ETH_LINK_SPEED_400G (1 << 16) /**< 400 Gbps */ /** * Ethernet numeric link speeds in Mbps @@ -300,6 +302,8 @@ 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 */ +#define ETH_SPEED_NUM_400G 400000 /**< 400 Gbps */ /** * A structure used to retrieve link-level information of an Ethernet port. -- 1.8.3.1