[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181129153653.766-1-cera@cera.cz>
Date: Thu, 29 Nov 2018 16:36:53 +0100
From: Ivan Vecera <cera@...a.cz>
To: netdev@...r.kernel.org
Cc: "John W . Linville" <linville@...hat.com>
Subject: [PATCH ethtool] ethtool: don't report UFO on kernels v4.14 and above
Support for UDP fragmentation offloading was removed in kernel v4.14.
The ethtool reports incorrectly its state on this and newer kernels:
$ ethtool -k enp0s31f6 | grep udp-frag
udp-fragmentation-offload: off
It's look like that the feature is supported and disabled only. Instead
of this behavior the status of UFO should not be reported on such kernels.
As the UFO is only one feature that was removed from the ethtool I have
decided after discussion with John to implement only simple check for
this instead of implementing more generic solution like 'max_kernel_ver
field in struct off_flag_def'.
Cc: John W. Linville <linville@...hat.com>
Signed-off-by: Ivan Vecera <cera@...a.cz>
---
ethtool.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ethtool.c b/ethtool.c
index 2f7e96b..6121979 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -1465,8 +1465,10 @@ static void dump_features(const struct feature_defs *defs,
* kernel version
*/
if (defs->off_flag_matched[i] == 0 &&
- off_flag_def[i].get_cmd == 0 &&
- kernel_ver < off_flag_def[i].min_kernel_ver)
+ ((off_flag_def[i].get_cmd == 0 &&
+ kernel_ver < off_flag_def[i].min_kernel_ver) ||
+ (off_flag_def[i].get_cmd == ETHTOOL_GUFO &&
+ kernel_ver >= KERNEL_VERSION(4, 14, 0))))
continue;
value = off_flag_def[i].value;
--
2.18.1
Powered by blists - more mailing lists