From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
Nikolay Aleksandrov <razor@blackwall.org>
Cc: netdev@vger.kernel.org, mst@redhat.com,
roopa@cumulusnetworks.com, davem@davemloft.net
Subject: Re: [PATCH net-next v5 1/2] ethtool: add speed/duplex validation functions
Date: Thu, 4 Feb 2016 12:02:48 +0100 [thread overview]
Message-ID: <56B32FD8.7020407@cumulusnetworks.com> (raw)
In-Reply-To: <20160204103226.333d98ca@samsung9>
On 02/04/2016 12:32 AM, Stephen Hemminger wrote:
> On Wed, 3 Feb 2016 04:04:36 +0100
> Nikolay Aleksandrov <razor@blackwall.org> wrote:
>
>>
>> +static inline int ethtool_validate_speed(__u32 speed)
>> +{
>
>
> No need for inline.
>
This is defined in a header, if it's not inline you start getting
"defined but not used" warnings.
> But why check for valid value at all. At some point in the
> future, there will be yet another speed adopted by some standard body
> and the switch statement would need another value.
>
> Why not accept any value? This is a virtual device.
>
It was moved near the defined values so everyone adding a new speed would
remember to update the validation function as well. That being said, I don't
object to being able to set any custom speed to the virtio_net device especially
when there're physical devices that can have speeds outside of these defines.
Michael do you have any objections if I respin without the speed validation ?
Thanks,
Nik
next prev parent reply other threads:[~2016-02-04 11:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-03 3:04 [PATCH net-next v5 0/2] virtio_net: add ethtool get/set settings support Nikolay Aleksandrov
2016-02-03 3:04 ` [PATCH net-next v5 1/2] ethtool: add speed/duplex validation functions Nikolay Aleksandrov
2016-02-03 23:32 ` Stephen Hemminger
2016-02-03 23:49 ` Rick Jones
2016-02-04 12:47 ` Michael S. Tsirkin
2016-02-04 17:30 ` Rick Jones
2016-02-04 11:02 ` Nikolay Aleksandrov [this message]
2016-02-04 12:18 ` Michael S. Tsirkin
2016-02-03 3:04 ` [PATCH net-next v5 2/2] virtio_net: add ethtool support for set and get of settings Nikolay Aleksandrov
2016-02-03 9:19 ` Nikolay Aleksandrov
2016-02-04 12:23 ` Michael S. Tsirkin
2016-02-04 12:21 ` Michael S. Tsirkin
2016-02-04 12:26 ` Nikolay Aleksandrov
2016-02-07 19:31 ` [PATCH net-next v5 0/2] virtio_net: add ethtool get/set settings support David Miller
2016-02-07 19:35 ` Nikolay Aleksandrov
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=56B32FD8.7020407@cumulusnetworks.com \
--to=nikolay@cumulusnetworks.com \
--cc=davem@davemloft.net \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=roopa@cumulusnetworks.com \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).