From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40049.outbound.protection.outlook.com [40.107.4.49]) by dpdk.org (Postfix) with ESMTP id 045C71B53; Mon, 23 Jul 2018 09:57:43 +0200 (CEST) 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=hqgxg4CaJyIAMzpYejahs7n2xckB9ISTiM0JIR43aa4=; b=PbX1A4QVxhHu/344S9GW0O71neHFRjcyDZzIxXvBy/6dzlYa+QX2MF0JZLM2FH2dmEik9F5qrIcPm0Y58sCiK+ftoakROu06R4TO60PJwtMf5fcEwe2ALOpmDZ+XyG5eJGXL21vyidYu+g7c9iEeZ895IQj1UL6HE4fqsDwJhC4= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4233.eurprd05.prod.outlook.com (52.134.108.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Mon, 23 Jul 2018 07:57:41 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::52a:650b:ae10:fc3]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::52a:650b:ae10:fc3%3]) with mapi id 15.20.0952.022; Mon, 23 Jul 2018 07:57:41 +0000 From: Shahaf Shuler To: Mordechay Haimovsky , Yongseok Koh CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix compilation issues on old kernels Thread-Index: AQHUHGHntPY22b9qA0Ov1EMmWWyYKaSce+JA Date: Mon, 23 Jul 2018 07:57:41 +0000 Message-ID: References: <1531675899-27007-1-git-send-email-motih@mellanox.com> In-Reply-To: <1531675899-27007-1-git-send-email-motih@mellanox.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; DB7PR05MB4233; 6:NIvhUbQ7dhHwLF3dIYz+DyGfvtshVi4lL3pppkvlDy6RzgHzN1ItIl4qUrqoGqNdHrQJuQC43TtW/DdoD6TlarMFsR3Y+e4TMMkxjerveEEXJWI5zTTvmhSsxzDqUQWRudmPIudynmWs+yihQn/6TKj9QJUV2LHejaTNhXTFFhKqiIcXP+RB/NGsZeb4/oj28DuTjN3CgLVJoBV8wl1aVWtLVctHIQU+8c8jJAkRUaaDHJa/W2CWvcFGGHA7tEYHPMWwO3oNKS/JXW1Jf+ZuHdZ228dJpATfXV/qeMUw+2t8SXnMwXqrN37ieisUJVOKIBHqgEC1fgACzHKixr85abuPjKyPFo4a3nwG8sEjj+B1HEGpl62QkI2x2NnbfZmpPiWMRtwzZlO/lIWNdLfAKwoyBTzrH5FCvvTTTUhX04L5Uko2RlTZ6sT+HTAi4T6ivm6Paa5g4LtXzAVFD78bLA==; 5:P4cXvORG54vn5zMgg6dAJTqsq8hsuDKsN4BdV/uj2Zl9MOzMYZo4UskpRK8d20/44Kz+BL5xt4sTZpBycz5BB0siM9UHk23uYjL8qvA7gChrEA+wEmIiMpGZutEEDPgJ0GiH23QoO31Rl+UjLbF1sbC2C+ggvc7ZZhxhO0Y193k=; 7:e3x0lbcTgmBOHtD+Q1D10ZYrpBz4/vIcfvjCnNpC3xC9PvHNLjdTRLyd5lEi9sFXbtRZkZhfGvceapR+JyjDyIaEEBo2bp/eesdSG/plgHvuntdCgrTx+pNVjFJXhzLeGx2QHA/GuH2UFHgxj6AzW74XrICSFjPjB9kFQvHNnsSWxU9hAYA6he/3v9uTUHHEd/G2E+HKZeqG734AmqshL8gG3wwVr34VKHZOyY2PSVKJHYvreBabZ2qa2ojeoEDf x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: c465951b-1dd1-49fa-48f7-08d5f071f75a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4233; x-ms-traffictypediagnostic: DB7PR05MB4233: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4233; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4233; x-forefront-prvs: 0742443479 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(136003)(346002)(376002)(366004)(199004)(189003)(97736004)(3846002)(2900100001)(99286004)(54906003)(110136005)(81156014)(5250100002)(229853002)(5660300001)(106356001)(81166006)(68736007)(446003)(8676002)(6246003)(11346002)(316002)(6116002)(8936002)(7736002)(74316002)(305945005)(105586002)(55016002)(478600001)(14444005)(7696005)(256004)(76176011)(6636002)(9686003)(26005)(25786009)(53936002)(86362001)(6506007)(102836004)(476003)(66066001)(14454004)(450100002)(33656002)(6436002)(2906002)(486006)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4233; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: yvCdbyZlHh9HezP/ck459c6YaqYnOlkkp6vtlsNV/ol/+HJoi4t6X/v3RxGOk9WIypvUef0zRKICLHFEtyMyVjMWCW1WEAyCcOyGngJsxY4VtBXUlLGHJ1f6Bkw0xhSDU7gEAzI6CMSoHr238YqyawH7vqBw4GX/TAh9AnkSKZi+NhKoy/SK+vkVsU4bqocib2Ds7Xgb83mZKuvbjOrVWeMjp+x+u09yvJQQhKPP/Hud8d9tI/VfyJopaHcmTjmzB7PDP7Tra8t6vgBbMGs+e54yDIdURaUxOPSiHcA6WjimX0prZOyLTKonF7oqHaViAQWOKT2IQHoReN9ZUcMaGu6LmpK/HFcBbxr/hiOSDtk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: c465951b-1dd1-49fa-48f7-08d5f071f75a X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2018 07:57:41.3559 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4233 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix compilation issues on old kernels 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, 23 Jul 2018 07:57:43 -0000 Sunday, July 15, 2018 8:32 PM, Mordechay Haimovsky: > Subject: [PATCH] net/mlx5: fix compilation issues on old kernels >=20 > This commit fixes compilation errors due to missing definitions found whe= n > compiling mlx5 PMD from DPDK 17.11-LTS on Ubuntu 12.4 with kernel 3.15. >=20 > Fixes: 75ef62a94301 ("net/mlx5: fix link speed capability information") > Fixes: 5bfc9fc112dd ("net/mlx5: use static assert for compile-time sanity > checks") > Cc: stable@dpdk.org >=20 > Signed-off-by: Moti Haimovsky Acked-by: Shahaf Shuler Applied to next-net-mlx, thanks. > --- > drivers/net/mlx5/Makefile | 45 > ++++++++++++++++++++++++++++++++++++++++++ > drivers/net/mlx5/mlx5_defs.h | 5 +++++ > drivers/net/mlx5/mlx5_ethdev.c | 26 ++++++++++++++++++++++++ > 3 files changed, 76 insertions(+) >=20 > diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index > d86c6bb..156c130 100644 > --- a/drivers/net/mlx5/Makefile > +++ b/drivers/net/mlx5/Makefile > @@ -197,6 +197,51 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto- > config-h.sh > linux/if_link.h \ > enum IFLA_PHYS_PORT_NAME \ > $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_SUPPORTED_40000baseKR4_Full \ > + /usr/include/linux/ethtool.h \ > + define SUPPORTED_40000baseKR4_Full \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_SUPPORTED_40000baseCR4_Full \ > + /usr/include/linux/ethtool.h \ > + define SUPPORTED_40000baseCR4_Full \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_SUPPORTED_40000baseSR4_Full \ > + /usr/include/linux/ethtool.h \ > + define SUPPORTED_40000baseSR4_Full \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_SUPPORTED_40000baseLR4_Full \ > + /usr/include/linux/ethtool.h \ > + define SUPPORTED_40000baseLR4_Full \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_SUPPORTED_56000baseKR4_Full \ > + /usr/include/linux/ethtool.h \ > + define SUPPORTED_56000baseKR4_Full \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_SUPPORTED_56000baseCR4_Full \ > + /usr/include/linux/ethtool.h \ > + define SUPPORTED_56000baseCR4_Full \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_SUPPORTED_56000baseSR4_Full \ > + /usr/include/linux/ethtool.h \ > + define SUPPORTED_56000baseSR4_Full \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_SUPPORTED_56000baseLR4_Full \ > + /usr/include/linux/ethtool.h \ > + define SUPPORTED_56000baseLR4_Full \ > + $(AUTOCONF_OUTPUT) > + $Q sh -- '$<' '$@' \ > + HAVE_STATIC_ASSERT \ > + /usr/include/assert.h \ > + define static_assert \ > + $(AUTOCONF_OUTPUT) >=20 > # Create mlx5_autoconf.h or update it in case it differs from the new on= e. >=20 > diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h > index f6ec415..439cc15 100644 > --- a/drivers/net/mlx5/mlx5_defs.h > +++ b/drivers/net/mlx5/mlx5_defs.h > @@ -128,4 +128,9 @@ > /* Cache size of mempool for Multi-Packet RQ. */ #define > MLX5_MPRQ_MP_CACHE_SZ 32 >=20 > +/* Definition of static_assert found in /usr/include/assert.h */ > +#ifndef HAVE_STATIC_ASSERT #define static_assert _Static_assert #endif > + > #endif /* RTE_PMD_MLX5_DEFS_H_ */ > diff --git a/drivers/net/mlx5/mlx5_ethdev.c > b/drivers/net/mlx5/mlx5_ethdev.c index 6e44d5f..4b2231f 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -42,6 +42,32 @@ > #include "mlx5_rxtx.h" > #include "mlx5_utils.h" >=20 > +/* Supported speed values found in /usr/include/linux/ethtool.h */ > +#ifndef HAVE_SUPPORTED_40000baseKR4_Full #define > +SUPPORTED_40000baseKR4_Full (1 << 23) #endif #ifndef > +HAVE_SUPPORTED_40000baseCR4_Full #define > SUPPORTED_40000baseCR4_Full (1 > +<< 24) #endif #ifndef HAVE_SUPPORTED_40000baseSR4_Full #define > +SUPPORTED_40000baseSR4_Full (1 << 25) #endif #ifndef > +HAVE_SUPPORTED_40000baseLR4_Full #define > SUPPORTED_40000baseLR4_Full (1 > +<< 26) #endif #ifndef HAVE_SUPPORTED_56000baseKR4_Full #define > +SUPPORTED_56000baseKR4_Full (1 << 27) #endif #ifndef > +HAVE_SUPPORTED_56000baseCR4_Full #define > SUPPORTED_56000baseCR4_Full (1 > +<< 28) #endif #ifndef HAVE_SUPPORTED_56000baseSR4_Full #define > +SUPPORTED_56000baseSR4_Full (1 << 29) #endif #ifndef > +HAVE_SUPPORTED_56000baseLR4_Full #define > SUPPORTED_56000baseLR4_Full (1 > +<< 30) #endif > + > /* Add defines in case the running kernel is not the same as user header= s. */ > #ifndef ETHTOOL_GLINKSETTINGS struct ethtool_link_settings { > -- > 1.8.3.1