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 B3361A034F; Wed, 6 May 2020 15:43:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 20F5A1BFA6; Wed, 6 May 2020 15:43:19 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70078.outbound.protection.outlook.com [40.107.7.78]) by dpdk.org (Postfix) with ESMTP id 1F7841D984 for ; Wed, 6 May 2020 15:43:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jgwNbMIK2hrxIYyWnSZrHM0YHpa7x5U6XctRk+8naCbTw1lvUSr58J097vhgVl152NSqNKZQtFW07sD7EAN2YA+M/HH8YtAAu84ee+0+NKKXGW82EYYcxbMHN9LQAzqUpkp1IEo6LXHm+dsSUD6yTuMwykq+1XsrIWqsCMifbseTS5ZFH+kbfo3hY3Gi2jwu+b29w3wnV8zN8jjZzkQv81aCTvJao/lfukccezMLkusGW5twPdl7WkDeeSRFE0/LO9bNsvNuH3l4uVZIz3cpGGPJTk8qLaPYWdwfhUvv8XqQthw6u130Y0nLeenW2NcZPARcmJ2Rwz148ZnHi+NFvQ== 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=G1Wv8GDGrw8MjTAS2bslnS+62tiq45STcg8z0tIc5uI=; b=Xt3ZSFHOE0i9YZiSZLaDpC83IjMiHZT8OIzimVXAVGXF7p3Jm6SB4W0a633iT9DZunbjRVVVpQNsd8qQeuPUXCWLTq72Raq+XyraeuQeTknJ0YN2iSbs3tjQjywVCQsSptiOCutg3JnLWdk0Iw9OuZsJ4oOG0ohLM3CK8ojwXxG4PFVKTQYt7X7h7Z8YgbQXLjUick+59t2ZSSbCm7H7+F9Z15As88mHgZAEHMe3zske3yJEW+BaVKnqwTDu35yoQ5y0D0+OTTMbqkqu1aC5vOJ+DVzU8evcj//tZlMrFK9sTUk3tmFO6IA9wBs8uBCN6e/Y3atljDKgJBwHB7Vt4Q== 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=G1Wv8GDGrw8MjTAS2bslnS+62tiq45STcg8z0tIc5uI=; b=fdO8yK+MxXzZDxviQw7LWhJK/Z0HF+2xe/mO5FpUrDnOHXuosSlHhq63EM9c71uY0aFuYdtMlywwCkX0Ncb8AvutCzN6rUle4Y11aR1mOrRHnlZhVsztP7tAOO0/FfvntmkXR6iVkcjACz9kaNDQdBg4oJ0x3TRpPKlBCYbCjhs= Received: from VI1PR05MB3278.eurprd05.prod.outlook.com (2603:10a6:802:1f::28) by VI1PR05MB5262.eurprd05.prod.outlook.com (2603:10a6:803:aa::27) 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 13:43:11 +0000 Received: from VI1PR05MB3278.eurprd05.prod.outlook.com ([fe80::dc31:eda3:1f30:48ce]) by VI1PR05MB3278.eurprd05.prod.outlook.com ([fe80::dc31:eda3:1f30:48ce%6]) with mapi id 15.20.2979.028; Wed, 6 May 2020 13:43:11 +0000 From: Slava Ovsiienko To: Asaf Penso , Thomas Monjalon , "ferruh.yigit@intel.com" , "arybchenko@solarflare.com" , Matan Azrad CC: "dev@dpdk.org" Thread-Topic: [PATCH v3] net/mlx5: add 200G link speed Thread-Index: AQHWI57ejkd9JHF6YUew61wY/bzm96ibERaw Date: Wed, 6 May 2020 13:43:10 +0000 Message-ID: References: <1588762695-2489-1-git-send-email-asafp@mellanox.com> <1588766823-5198-1-git-send-email-asafp@mellanox.com> In-Reply-To: <1588766823-5198-1-git-send-email-asafp@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d66a4b87-6c0f-4e6c-4904-08d7f1c36b17 x-ms-traffictypediagnostic: VI1PR05MB5262:|VI1PR05MB5262: 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:3631; x-forefront-prvs: 03950F25EC x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KJHfvT56qa8WVYqES4wg1UDj6D4sXxu6pgxDzkerODNKUVoqSHXslspfFIZr/4BdwgNA7bp6gcSr5fIHnqAfKwGegrn1fkLXsUVUaRHceDxEukDT40FV5AdkTWByZzuHTRlqD6HmrP1jou2b296IVavhTc5HBB9UVIYnCJZUPUjoaZ62uftykG5awmueFMAMYOfOcqAD/9GhCcGEQlI7foffYFcIwGt3BaWdVOOhphArrd9ZIK/sekUppQ84HUS5BLooeIpeW7pBXnKKH2653QakBp2lEgXjrmTMqW3A4WDGMbL+R7CbkdY1nStlKxNjcT1f3fXJw0ZAOU1f6T9PE5dv/09Oa15TRbVdTWqoTbDUoAw4WJvs4A2SJ0TH2jhaCLvGnCv364EBexTFeamCqU8DP1/MdDO458pviWD+eZz6Apfx6ftXbcNkkno9HW8EGT6+Ngo95wptwty+iSuj0rT4eDx0j3drMG81kVnMz2KT0KW9lEThyC4Afha7XrU/EycTpCCD4im3DeFr9ZE1vg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB3278.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(366004)(136003)(39860400002)(346002)(376002)(33430700001)(186003)(316002)(7696005)(86362001)(2906002)(26005)(4326008)(110136005)(6506007)(53546011)(33440700001)(33656002)(66946007)(76116006)(5660300002)(6636002)(66446008)(66556008)(64756008)(9686003)(52536014)(55016002)(66476007)(478600001)(8936002)(19627235002)(8676002)(71200400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: WsgjMC7hrTSyi00p4BJ5J/AWII2vFznvrJW1V27EAWxnS8DUtcoi8DBzdterARQvE+/v4sGzqKM3Wb6ACPxpnyw9q+yMO8pOIVkVJeUFT5xZzIWmx47Hc3rd/sEGzZRu1IfEkLDuxn9PxAwa5Yf/ZfsOYVymbPfNVsQCPVEVSmdb8i1fTHfTjjowI/6v+mOG6txW2mwjrZl6fpC3QNr8clY0hjuYTm7kTIC1j9jtCIs9w1W7i53FHVWA5zZoG/fmdMsp1RP/vH0tqGEnapYIMHN1niVdxzU2rb21btge3LmRdUT/sPl8DAvOcYI9jRdTOLfcMzO+kqTbv9WpR3Quq1CNX8Hc3y11aqsDL9+nHAPFvXUTwgx3+142IDSdvAZ58HcBToTkNwpfpHBHTgv61nZiZqV08AO29/ItFjw+CGe8ceiAHivq5n2g7K8UNk8b4iW4IRz/UBvRhnQXkwnMmh1Q+50tSRwGfuCpIEUIRV2VBwW5FjQ+QBM0A89ftxk4ifyZfAOu9BBE1JFfgL5UQjjXAIZ3fl9B8TRPxcv3mTyZMS4SaDRj4kPxgdZVd1GPOM6giVjpXrVsVp1mga14eMN3FWd0U/473C3PrHp5F2zscmW92TBJH60nAr+r2abBKfb1/gEOl6A8PGUsoXoAQ5ttbj4wsJaLr3zXzDsUgQ+wtwU/6cIEpNHWMFYDWiW7RBfA60xXHIGERIF7vRYHKfqMAv4nK3zb2oEoMCMGJ1wN3SdodQw9D55mdnv8MjJVexmteRQvIryXCWGgfPPcJCJP1hOrR2l8b+4LSMXGzqg= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d66a4b87-6c0f-4e6c-4904-08d7f1c36b17 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 May 2020 13:43:10.9671 (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: YQqsGa7sNJQHK6uZFRfF/XpE+bnfVAcS3omz+PONie9ZjPyD9cOh/PhGZUbj8FYq6N4pjniZVXt+0N5mIDTZj2x088deAnw2m40A2kVuZ68= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5262 Subject: Re: [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" > -----Original Message----- > From: Asaf Penso > Sent: Wednesday, May 6, 2020 15:07 > To: Thomas Monjalon ; ferruh.yigit@intel.com; > arybchenko@solarflare.com; Slava Ovsiienko ; > Matan Azrad > Cc: dev@dpdk.org > Subject: [PATCH v3] net/mlx5: add 200G link speed >=20 > There is no way to report back a link speed of 200Gbps. >=20 > Adding 200G link speed. >=20 > Signed-off-by: Asaf Penso For the mlx5-related part: Acked-by: Viacheslav Ovsiienko > --- > 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(-) >=20 > 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" >=20 > "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" >=20 > @@ -1619,6 +1619,8 @@ parse_and_check_speed_duplex(char *speedstr, > char *duplexstr, uint32_t *speed) > *speed =3D ETH_LINK_SPEED_50G; > } else if (!strcmp(speedstr, "100000")) { > *speed =3D ETH_LINK_SPEED_100G; > + } else if (!strcmp(speedstr, "200000")) { > + *speed =3D ETH_LINK_SPEED_200G; > } else if (!strcmp(speedstr, "auto")) { > *speed =3D ETH_LINK_SPEED_AUTONEG; > } else { > @@ -1666,7 +1668,7 @@ cmdline_parse_token_string_t > cmd_config_speed_all_item1 =3D > TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item1, > "speed"); cmdline_parse_token_string_t cmd_config_speed_all_value1 =3D > 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 =3D > TOKEN_STRING_INITIALIZER(struct cmd_config_speed_all, item2, > "duplex"); cmdline_parse_token_string_t cmd_config_speed_all_value2 =3D > @@ -1677,7 +1679,7 @@ cmdline_parse_inst_t cmd_config_speed_all =3D { > .f =3D cmd_config_speed_all_parsed, > .data =3D NULL, > .help_str =3D "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 =3D { > (void *)&cmd_config_speed_all_port, > @@ -1741,7 +1743,7 @@ cmdline_parse_token_string_t > cmd_config_speed_specific_item1 =3D > "speed"); > cmdline_parse_token_string_t cmd_config_speed_specific_value1 =3D > 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 =3D > TOKEN_STRING_INITIALIZER(struct cmd_config_speed_specific, > item2, > "duplex"); > @@ -1753,7 +1755,7 @@ cmdline_parse_inst_t cmd_config_speed_specific > =3D { > .f =3D cmd_config_speed_specific_parsed, > .data =3D NULL, > .help_str =3D "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 =3D { > (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. >=20 > +* **ethdev: Added a new value to link speed for 200Gbps ** > + > * **Added new API for rte_ring.** >=20 > * 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 >=20 > Set the speed and duplex mode for all ports or a specific port:: >=20 > - 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) >=20 > 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[]; > }; >=20 > +/* 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 >=20 > /** > * 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 =3D 256; > info->default_rxportconf.burst_size =3D MLX5_RX_DEFAULT_BURST; > info->default_txportconf.burst_size =3D 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 =3D 16; > info->default_txportconf.nb_queues =3D 16; > if (dev->data->nb_rx_queues > 2 || > @@ -1028,6 +1037,17 @@ mlx5_link_update_unlocked_gs(struct > rte_eth_dev *dev, >=20 > MLX5_BITSHIFT(ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT) | >=20 > MLX5_BITSHIFT(ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT))) > priv->link_speed_capa |=3D 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 |=3D ETH_LINK_SPEED_200G; > + > + sc =3D 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 |=3D ETH_LINK_SPEED_200G; > dev_link.link_duplex =3D ((ecmd->duplex =3D=3D DUPLEX_HALF) ? > ETH_LINK_HALF_DUPLEX : > ETH_LINK_FULL_DUPLEX); > dev_link.link_autoneg =3D !(dev->data->dev_conf.link_speeds & diff -- > git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c ind= ex > 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_ethde= v.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 */ >=20 > /** > * 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 */ >=20 > /** > * A structure used to retrieve link-level information of an Ethernet po= rt. > -- > 2.7.4