From: David Miller <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
Date: Tue, 03 Mar 2020 14:59:16 -0800 (PST) [thread overview]
Message-ID: <20200303.145916.1506066510928020193.davem@davemloft.net> (raw)
In-Reply-To: <20200303082252.81F7FE1F46@unicorn.suse.cz>
From: Michal Kubecek <mkubecek@suse.cz>
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 <mkubecek@suse.cz>
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.
next prev parent reply other threads:[~2020-03-03 22:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 8:22 Michal Kubecek
2020-03-03 22:59 ` David Miller [this message]
2020-03-04 6:57 ` Michal Kubecek
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=20200303.145916.1506066510928020193.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
/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
all inboxes | Powered by JetHome®