From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
Yongseok Koh <yskoh@mellanox.com>
Subject: [dpdk-dev] [PATCH v2 1/3] net/mlx5: remove kernel version check
Date: Mon, 12 Mar 2018 14:43:17 +0100 [thread overview]
Message-ID: <3e8709786512b811e7386c3cf615b5d34767cd45.1520862100.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <cover.1520862100.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <cover.1520862100.git.nelio.laranjeiro@6wind.com>
Kernel version check was introduced in
commit 3a49ffe38a95 ("net/mlx5: fix link status query")
due to a bug fixed by
commit ef09a7fc7620 ("net/mlx5: fix inconsistent link status query")
This patch restore the previous behavior as described in Linux API.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx5/mlx5_ethdev.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index dd46124ec..26f13fb1b 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -18,11 +18,9 @@
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
-#include <sys/utsname.h>
#include <netinet/in.h>
#include <linux/ethtool.h>
#include <linux/sockios.h>
-#include <linux/version.h>
#include <fcntl.h>
#include <stdalign.h>
#include <sys/un.h>
@@ -734,20 +732,15 @@ mlx5_force_link_status_change(struct rte_eth_dev *dev, int status)
int
mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
{
- struct utsname utsname;
- int ver[3];
int ret;
struct rte_eth_link dev_link = dev->data->dev_link;
- if (uname(&utsname) == -1 ||
- sscanf(utsname.release, "%d.%d.%d",
- &ver[0], &ver[1], &ver[2]) != 3 ||
- KERNEL_VERSION(ver[0], ver[1], ver[2]) < KERNEL_VERSION(4, 9, 0))
- ret = mlx5_link_update_unlocked_gset(dev);
- else
+ ret = mlx5_link_update_unlocked_gset(dev);
+ if (ret) {
ret = mlx5_link_update_unlocked_gs(dev);
- if (ret)
- return ret;
+ if (ret)
+ return ret;
+ }
/* If lsc interrupt is disabled, should always be ready for traffic. */
if (!dev->data->dev_conf.intr_conf.lsc) {
mlx5_link_start(dev);
--
2.11.0
next prev parent reply other threads:[~2018-03-12 13:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-15 8:47 [dpdk-dev] [PATCH 1/2] net/mlx5: add kernel version function Nelio Laranjeiro
2018-02-15 8:47 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix link status to use wait to complete Nelio Laranjeiro
2018-02-16 10:49 ` Adrien Mazarguil
2018-02-16 12:08 ` Nélio Laranjeiro
2018-02-16 10:48 ` [dpdk-dev] [PATCH 1/2] net/mlx5: add kernel version function Adrien Mazarguil
2018-02-16 18:03 ` Stephen Hemminger
2018-02-19 7:42 ` Nélio Laranjeiro
2018-03-12 13:43 ` [dpdk-dev] [PATCH v2 0/3] net/mlx5: cleanup link status Nelio Laranjeiro
2018-03-19 19:15 ` Shahaf Shuler
2018-03-12 13:43 ` Nelio Laranjeiro [this message]
2018-03-12 13:43 ` [dpdk-dev] [PATCH v2 2/3] net/mlx5: fix link status behavior Nelio Laranjeiro
2018-03-13 21:54 ` Yongseok Koh
2018-03-14 12:18 ` Adrien Mazarguil
2018-03-14 17:40 ` Yongseok Koh
2018-03-14 19:00 ` Adrien Mazarguil
2018-03-14 12:22 ` Nélio Laranjeiro
2018-03-15 18:08 ` Yongseok Koh
2018-03-12 13:43 ` [dpdk-dev] [PATCH v2 3/3] net/mlx5: fix link status to use wait to complete Nelio Laranjeiro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e8709786512b811e7386c3cf615b5d34767cd45.1520862100.git.nelio.laranjeiro@6wind.com \
--to=nelio.laranjeiro@6wind.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=yskoh@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).