From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0084.outbound.protection.outlook.com [104.47.1.84]) by dpdk.org (Postfix) with ESMTP id 685A72C6E; Wed, 1 Feb 2017 07:53:58 +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=cLQ72SGXFLquj5oSAZIm+mfHDQ9L3Frxv/0dHrnmFSM=; b=xGciL5xjZ6IVGCkfSJSlji3+YOZO9MIAYWRFHIsQWijJGyS6wZSW2GHBzU94hBIHKSQ76UmaqtEPdW8BSl5t1uwnmNbsqXpWMa4iXmdp0QHHa4DyxFimrpEFgt2B4DUVmpNIlumlZ7fa+H1GFOMOE43h1VKJ8lURYI47fLSDQX8= Received: from HE1PR05MB1514.eurprd05.prod.outlook.com (10.164.49.148) by HE1PR05MB1515.eurprd05.prod.outlook.com (10.164.49.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Wed, 1 Feb 2017 06:53:56 +0000 Received: from HE1PR05MB1514.eurprd05.prod.outlook.com ([10.164.49.148]) by HE1PR05MB1514.eurprd05.prod.outlook.com ([10.164.49.148]) with mapi id 15.01.0860.026; Wed, 1 Feb 2017 06:53:56 +0000 From: Shahaf Shuler To: Ferruh Yigit , Adrien Mazarguil , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH v2] net/mlx5: fix link status query Thread-Index: AQHSe7eI/Ix87A1wkkSRvMFw7QBsQaFSw4KAgAD0RMA= Date: Wed, 1 Feb 2017 06:53:55 +0000 Message-ID: References: <1485348178-43771-1-git-send-email-shahafs@mellanox.com> <1485863129-6326-1-git-send-email-shahafs@mellanox.com> In-Reply-To: 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-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-office365-filtering-correlation-id: bccd6734-74fd-42ed-d3d4-08d44a6f17af x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:HE1PR05MB1515; x-microsoft-exchange-diagnostics: 1; HE1PR05MB1515; 7:vp2RbaMV5OogO7Pg2TfUJjLE2oH4xHBvRYVVuXm+b8k0n6YSo7nusVMEfFmzjFJXmIVfvhdZZc1pzrVEyUH3fgmxHqjMqcgPnUw8NjZ4Y7geVyen2d16GDCIL/f9LIykpJf/dreK9E0yBuuDwMGwcq7vlHh73Avq9I0xJ917MxL60FnprOTKuYghXaj4o5OiinvL3EMcE5N7n2Nt/SPbATYydqPUVcC3SPJkBFQYsC/EZwLHbSveN8EnU5FdQM4Gg5QxqNC7F5VRO5cSjVCpgtcvKStYe26dPr60i9yt/r1Qv/u9whoM1MExzfPPzWQF2XyIU+wIs0uFahIBcYtGY393+bFxWI+iHTVnR8rPr86Ryzo4IPdzaa2g39JK/3JhMKyP8Z2MNKbnA3uNMTWGPyz2IVncKhYVeiRPpR8EfbWLMWwUX8+0XR13QFXchu9LRgLPVprSNkqE5ZpSu9Yb2UUakUCxK+OIysGc172ECk4ssU2SOBJH9Gn7/gXz6k/nW35fP+Mex1QgwIddbavhE70GF/zoOUMzW7FkPyz42QDqN6V2Y1KEoZOVuTe+vFzQ x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123558025)(20161123562025)(20161123564025)(20161123560025)(6072148); SRVR:HE1PR05MB1515; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB1515; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39840400002)(39410400002)(39850400002)(39450400003)(377454003)(189002)(76104003)(24454002)(199003)(9686003)(305945005)(4326007)(86362001)(7736002)(68736007)(2900100001)(6436002)(38730400001)(74316002)(6116002)(25786008)(102836003)(53936002)(66066001)(97736004)(5001770100001)(3846002)(92566002)(2906002)(77096006)(6506006)(81166006)(2950100002)(8676002)(33656002)(8936002)(101416001)(54356999)(76176999)(189998001)(55016002)(106116001)(105586002)(50986999)(5660300001)(54906002)(99286003)(106356001)(81156014)(7696004)(3660700001)(229853002)(3280700002)(122556002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB1515; H:HE1PR05MB1514.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) 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-originalarrivaltime: 01 Feb 2017 06:53:55.9802 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1515 Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v2] net/mlx5: fix link status query 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: Wed, 01 Feb 2017 06:53:58 -0000 : Tuesday, January 31, 2017 6:17 PM, Ferruh Yigit: > On 1/31/2017 11:45 AM, Shahaf Shuler wrote: > > Trying to query the link status through new kernel ioctl API > > ETHTOOL_GLINKSETTINGS was always failing due to kernel bug. > > The bug was fixed on version 4.9 > > this patch uses the legacy ioctl API for lower kernels. > > > > Fixes: 188408719888 ("net/mlx5: fix support for newer link speeds") > > CC: stable@dpdk.org > > > > Signed-off-by: Shahaf Shuler > > --- >=20 > <...> >=20 > > @@ -707,7 +708,7 @@ struct priv * > > static int > > mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev, int > > wait_to_complete) { -#ifdef ETHTOOL_GLINKSETTINGS > > +#if KERNEL_VERSION(4, 9, 0) <=3D LINUX_VERSION_CODE >=20 > Mostly it is not good idea to do kernel version check in the .c file. >=20 > It is possible to move this comparison to the .h file, and set a feature > macro based on comparison result, like HAVE_ETHTOOL_GLINKSETTINGS, > and > use this macro in the .c file. >=20 > This makes .c code easier to understand. And the abstraction in the > header file lets you update the comparison in the future without > changing the code itself. >=20 > But it is your call, do you prefer to continue with this one? This is a good suggestion.=20 Adrien, N=E9lio what do you think? >=20 > > struct priv *priv =3D mlx5_get_priv(dev); > > struct ethtool_link_settings edata =3D { > > .cmd =3D ETHTOOL_GLINKSETTINGS, > <...>