Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3882402ybf; Tue, 3 Mar 2020 14:59:48 -0800 (PST) X-Google-Smtp-Source: ADFU+vuqsY//c915zbxU3TtJlu2B2VCRpitsvT2SAtmHpPDUPO7hAr+zBar7/dXPZd3RTBSgpBhL X-Received: by 2002:aca:e106:: with SMTP id y6mr595773oig.131.1583276388369; Tue, 03 Mar 2020 14:59:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583276388; cv=none; d=google.com; s=arc-20160816; b=R5rBDXuQMrbjmTxMPXdYCqdz3lLK2/KOGTuxTTgnmAum7jnOQb+FwTMMx3mbYBlBK8 HyNm2p8ZMLOd5sD+SoV4qewz7+kV+RM703VNxBCrrJrFo1qVLGg3zPvEKFFItaqPL7TT FybSBVczPyqXtFNVWEWG5ggLBT9rpVgvQSDvx4y+vFjtVVUvqfAchOk4VVjR/IVhlftE 3g0mptCJeb3eHH0miuIjKolwmjfxb9ANT/ycDS39qjtO/6yXzx6rDeYLi5FBCfpuGmpH e71ftNKab2MGlv833UCcociXhiIhYJnNDbiIoYzvB6KT3sJDEqc381D51S6c0PgufLEC cbdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=2uVV8k1WsThqNBrS+YO4bH2ewiEsr1/obPGpWyWzmm0=; b=qGAg8VrZJkreMjSi1xzDoe/AMwrr/tgv0LVsNHOMt0QKbViC3xGX+PbZt1982YF8ho mke2JXgt7Oc2sxxNn/By9H8qQn2dunryme1wM4H9PbmcC/pu2x/ZlMSoDgqYixWb8AnN 32vX+zNU5nMZLPJnKIBeMMpl0mfdvJqkWcaziV1vs7fSZE2VeYP9K3SQTSL+M7IFy+gj S/bF2t873SzlFudX99O0EFXwnylP1edVKqoCquJDYJZTgTk+HTyn7m1b+Lx88Ofh6wQI 9rzQmGFmPTsFjvr36ULoGyWORcY6XYCidEaag3h8h95ekcE/mbDLRF6jc+oppzTOOdE+ 9PkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y128si121558oie.31.2020.03.03.14.59.36; Tue, 03 Mar 2020 14:59:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728180AbgCCW7R (ORCPT + 99 others); Tue, 3 Mar 2020 17:59:17 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:36990 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726766AbgCCW7R (ORCPT ); Tue, 3 Mar 2020 17:59:17 -0500 Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id E1EC215A0FF4F; Tue, 3 Mar 2020 14:59:16 -0800 (PST) Date: Tue, 03 Mar 2020 14:59:16 -0800 (PST) Message-Id: <20200303.145916.1506066510928020193.davem@davemloft.net> To: mkubecek@suse.cz Cc: kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] tun: fix ethtool_ops get_msglvl and set_msglvl handlers From: David Miller In-Reply-To: <20200303082252.81F7FE1F46@unicorn.suse.cz> References: <20200303082252.81F7FE1F46@unicorn.suse.cz> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 03 Mar 2020 14:59:17 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Kubecek Date: Tue, 3 Mar 2020 09:22:52 +0100 (CET) > The get_msglvl and setmsglvl handlers only work as expected if TUN_DEBUG > is defined (which required editing the source). Otherwise tun_get_msglvl() > returns -EOPNOTSUPP but as this handler is not supposed to return error > code, it is not recognized as one and passed to userspace as is, resulting > in bogus output of ethtool command. The set_msglvl handler ignores its > argument and does nothing if TUN_DEBUG is left undefined. > > The way to return EOPNOTSUPP to userspace for both requests is not to > provide these ethtool_ops callbacks at all if TUN_DEBUG is left undefined. > > Signed-off-by: Michal Kubecek I agree with your analysis. But this TUN_DEBUG thing stands outside of what we let drivers do. Either this tracing is not so useful and can be deleted, or the tracing should be available unconditionally so that it can be turned on by the vast majority of users who do not edit the source. I suspect making the TUN_DEBUG code unconditional is that way to go here.