From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id AE999B6D for ; Wed, 25 Jan 2017 13:43:03 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 25 Jan 2017 14:43:02 +0200 Received: from arch010.mtl.labs.mlnx (arch010.mtl.labs.mlnx [10.7.12.210]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v0PCh28i008212; Wed, 25 Jan 2017 14:43:02 +0200 Received: from arch010.mtl.labs.mlnx (localhost [127.0.0.1]) by arch010.mtl.labs.mlnx (8.14.7/8.14.7) with ESMTP id v0PCh248043809; Wed, 25 Jan 2017 14:43:02 +0200 Received: (from root@localhost) by arch010.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id v0PCgw0f043807; Wed, 25 Jan 2017 14:42:58 +0200 From: Shahaf Shuler To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com Cc: dev@dpdk.org, stable@dpdk.org Date: Wed, 25 Jan 2017 14:42:58 +0200 Message-Id: <1485348178-43771-1-git-send-email-shahafs@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH 1/2] 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, 25 Jan 2017 12:43:04 -0000 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 --- while the ETHTOOL_GLINKSETTINGS API was introduced on kernel v4.6 [1] the bug was fixed only on kernel v4.9 [2] [1] https://github.com/torvalds/linux/commit/3f1ac7a700d039c61d8d8b99f28d605d489a60cf [2] https://github.com/torvalds/linux/commit/8006f6bf5e39f11c697f48df20382b81d2f2f8b8 --- drivers/net/mlx5/mlx5_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 8efdff7..e77238f 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -46,6 +46,7 @@ #include #include #include +#include #include /* DPDK headers don't like -pedantic. */ @@ -697,7 +698,7 @@ struct priv * /** * Retrieve physical link information (unlocked version using new ioctl from - * Linux 4.5). + * Linux 4.9). * * @param dev * Pointer to Ethernet device structure. @@ -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) <= LINUX_VERSION_CODE struct priv *priv = mlx5_get_priv(dev); struct ethtool_link_settings edata = { .cmd = ETHTOOL_GLINKSETTINGS, -- 1.8.3.1