[ethtool] ethtool: don't report UFO on kernels v4.14 and above
diff mbox series

Message ID 20181129153653.766-1-cera@cera.cz
State Accepted, archived
Delegated to: John Linville
Headers show
Series
  • [ethtool] ethtool: don't report UFO on kernels v4.14 and above
Related show

Commit Message

Ivan Vecera Nov. 29, 2018, 3:36 p.m. UTC
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@redhat.com>
Signed-off-by: Ivan Vecera <cera@cera.cz>
---
 ethtool.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

John W. Linville Jan. 18, 2019, 6:39 p.m. UTC | #1
On Thu, Nov 29, 2018 at 04:36:53PM +0100, Ivan Vecera wrote:
> 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@redhat.com>
> Signed-off-by: Ivan Vecera <cera@cera.cz>

Queued for next release.

Patch
diff mbox series

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;