[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160204121836.GA5864@redhat.com>
Date: Thu, 4 Feb 2016 14:18:36 +0200
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Nikolay Aleksandrov <razor@...ckwall.org>, netdev@...r.kernel.org,
roopa@...ulusnetworks.com, davem@...emloft.net,
Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
Subject: Re: [PATCH net-next v5 1/2] ethtool: add speed/duplex validation
functions
On Thu, Feb 04, 2016 at 10:32:26AM +1100, Stephen Hemminger wrote:
> On Wed, 3 Feb 2016 04:04:36 +0100
> Nikolay Aleksandrov <razor@...ckwall.org> wrote:
>
> >
> > +static inline int ethtool_validate_speed(__u32 speed)
> > +{
>
>
> No need for inline.
>
> 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's virtual but often there's a physical backend behind it. In the
future we will likely forward the values to and from that physical
device. And if guest passes an unexpected value, host is unlikely to be
able to support it.
--
MST
Powered by blists - more mailing lists