From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0043.outbound.protection.outlook.com [104.47.0.43]) by dpdk.org (Postfix) with ESMTP id 003CA1B2EA; Mon, 5 Feb 2018 14:39:28 +0100 (CET) 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; bh=Mlh5GAJ4C9jfFXjMbzb2TdjCE3pKrNh2l6vaKD0Gbqs=; b=HIEhaaADz1UU5xcqPBMF6cghXholn2YGOYJ0FgQGDBD5G89c2s2uaq/VWXdOtoNF4l6sAGX5x3HsoaEbGmXHbm3WOVEU+H/JVgeQxMcTtzk5eeIZ2lj6lnGkRloD3WfjjM1tSwYXrFBnB68tYs3wjwgB/5fzZ4aS6rcAHpuzDCs= Received: from VI1PR05MB3149.eurprd05.prod.outlook.com (10.170.237.142) by VI1PR05MB0974.eurprd05.prod.outlook.com (10.162.10.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Mon, 5 Feb 2018 13:39:27 +0000 Received: from VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::cd00:54ee:63a8:937c]) by VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::cd00:54ee:63a8:937c%13]) with mapi id 15.20.0464.015; Mon, 5 Feb 2018 13:39:26 +0000 From: Shahaf Shuler To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= , "Yuanhan Liu" CC: "dev@dpdk.org" , Adrien Mazarguil , Yongseok Koh , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix link speed Thread-Index: AQHTnnllh4fSSA8GGE+PU1zCJ/vHiqOVvL6AgAATZtA= Date: Mon, 5 Feb 2018 13:39:26 +0000 Message-ID: References: <1517832104-2800-1-git-send-email-yliu@fridaylinux.org> <20180205122837.g62yquxw6uzgh2mu@laranjeiro-vm.dev.6wind.com> In-Reply-To: <20180205122837.g62yquxw6uzgh2mu@laranjeiro-vm.dev.6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB0974; 6:RMgdnK2tvFdcA/gHahG7qmjwfTgUFVPe12913AAbk+f7SGdlDPOtSFla21AxwRbHqhoNSLzp0cb06KpO6yiGYbVzNxhmLtcPLIvwZwz30o6Sb3UKaVQUUXeBrA0XBJfWhm+jVwwciCPaQXKsGwnJxYNrQsO1x4Sk1Wb2rdd5t+1CSQEWyiW8oimzbjDTkHlcvQFkGJ3KwpBirFSxgCC3nz82sZRiwMVUFodUaWHRLEfwrJiRCDnDJkSQ2gS27x4eYJloWh0VLu+554RcYN6yhnpJam003XaVZEqRpqy/IZOS2CgkhsP0BzCdQhiFMPQazaP7LY12x9W2dQoLkRimFTUwF/04jTaCp1BLqaLciFGd2hVk0dZ8WWf7k3exSdo3; 5:FTvWbd5dMHIs3f9EEKPHPShJ6s3f7gf7etj7wwt5Z/csNIECx63koU3KhFKwF6Szc7gVcCVCt24/UrPLUJup5Tjwl4N9TOqKI9SooP0CNZShfXxNkmr3VoaONqczPrGL5IZMQ500bT4mA56+IB9QCTGtMzskLXop/08MnDMXxAI=; 24:tGJEOaT48lUCZoYlTy9ymJAX+ctnzxJ1oMZnL5EtPhoFxCLOTdTlyikX+VoyK0/nunh0YRbE8kPT3vfGdCwxynK3iocj7HhykM6iWQdBEoU=; 7:r9yyPBf1z2c91t54wS0HRONy4OpxZsuLJKrACob6bHWBpOrHvHL64AX3VPfDC6THPfRasDzhBxE3uzh9WPV9H4ZVwAQSVgo+03+FGekQYri7S5W1iibJOs+RIbOa6wWKzcMNBRC54292AL0otwqnghBJoLC9C8CaJckDE2krg0U9SzBg4JP1ZnIL0k3fOr4CdUY4aYqdRzCPsfPJsYRGwgHnHRdUkXz0Yv1wscO5ytK3csy2RU9pICxc9PuXsDXz x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 14946724-5d59-4e75-b83f-08d56c9de020 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:VI1PR05MB0974; x-ms-traffictypediagnostic: VI1PR05MB0974: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(20558992708506); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231101)(2400082)(944501161)(10201501046)(3002001)(6055026)(6041288)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR05MB0974; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB0974; x-forefront-prvs: 0574D4712B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(39380400002)(366004)(396003)(376002)(189003)(199004)(6246003)(316002)(8936002)(478600001)(68736007)(14454004)(81156014)(81166006)(2950100002)(2906002)(97736004)(3846002)(6116002)(8676002)(105586002)(7736002)(74316002)(3280700002)(2900100001)(305945005)(66066001)(33656002)(5660300001)(229853002)(86362001)(7696005)(55016002)(5250100002)(3660700001)(186003)(99286004)(26005)(6436002)(59450400001)(110136005)(6506007)(76176011)(102836004)(9686003)(54906003)(53936002)(25786009)(4326008)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB0974; H:VI1PR05MB3149.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ccArIIZDynZswh/X5r8E1u4MtP90W5sZpMUUMQ3Zajs7LZuIT0l9S9FeG5fWbHK2xuRWFgrwg7OHb+V2cSE0QQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14946724-5d59-4e75-b83f-08d56c9de020 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2018 13:39:26.7605 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB0974 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix 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: , X-List-Received-Date: Mon, 05 Feb 2018 13:39:29 -0000 Monday, February 5, 2018 2:29 PM, N=E9lio Laranjeiro: > Subject: Re: [PATCH] net/mlx5: fix link speed >=20 > On Mon, Feb 05, 2018 at 08:01:44PM +0800, Yuanhan Liu wrote: > > When the link is down, mlx5 kernel driver reports the link speed as -1 > > (UNKNOWN_SPEED). We need turn it to 0 for such case, otherwise, it > > will be re-queried again due to the link_speed is not 0, due to > > following > > code: > > > > 1201 if (((link->link_speed =3D=3D 0) && link->link_status) || > > 1202 ((link->link_speed !=3D 0) && !link->link_status)) { > > 1203 /* > > 1204 * Inconsistent status. Event likely occurred before t= he > > 1205 * kernel netdevice exposes the new status. > > 1206 */ > > > > Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds") > > > > Cc: stable@dpdk.org > > Signed-off-by: Yuanhan Liu >=20 > Acked-by: Nelio Laranjeiro >=20 > > --- > > drivers/net/mlx5/mlx5_ethdev.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/net/mlx5/mlx5_ethdev.c > > b/drivers/net/mlx5/mlx5_ethdev.c index 6665076..492ca07 100644 > > --- a/drivers/net/mlx5/mlx5_ethdev.c > > +++ b/drivers/net/mlx5/mlx5_ethdev.c > > @@ -808,6 +808,10 @@ mlx5_link_update_unlocked_gs(struct > rte_eth_dev *dev, int wait_to_complete) > > return -1; > > } > > dev_link.link_speed =3D ecmd->speed; > > + if (link_speed =3D=3D -1) Looks like link_speed is not defined (code is not compiling). > > + dev_link.link_speed =3D 0; > > + else > > + dev_link.link_speed =3D link_speed; > > sc =3D ecmd->link_mode_masks[0] | > > ((uint64_t)ecmd->link_mode_masks[1] << 32); > > priv->link_speed_capa =3D 0; > > -- > > 2.7.4 > > >=20 > Thanks, >=20 > -- > N=E9lio Laranjeiro > 6WIND