From patchwork Thu Nov 29 15:36:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 1005506 X-Patchwork-Delegate: linville@tuxdriver.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cera.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 435M896cvyz9s47 for ; Fri, 30 Nov 2018 02:36:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728667AbeK3Cml (ORCPT ); Thu, 29 Nov 2018 21:42:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56896 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728423AbeK3Cmk (ORCPT ); Thu, 29 Nov 2018 21:42:40 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F2268E5A8 for ; Thu, 29 Nov 2018 15:36:55 +0000 (UTC) Received: from ceranb.redhat.com (ovpn-204-70.brq.redhat.com [10.40.204.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35D3D600C6; Thu, 29 Nov 2018 15:36:53 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: "John W . Linville" Subject: [PATCH ethtool] ethtool: don't report UFO on kernels v4.14 and above Date: Thu, 29 Nov 2018 16:36:53 +0100 Message-Id: <20181129153653.766-1-cera@cera.cz> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 29 Nov 2018 15:36:55 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Signed-off-by: Ivan Vecera --- 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;