[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191220103837.GF21614@unicorn.suse.cz>
Date: Fri, 20 Dec 2019 11:38:37 +0100
From: Michal Kubecek <mkubecek@...e.cz>
To: Andrew Lunn <andrew@...n.ch>
Cc: Cris Forno <cforno12@...ux.vnet.ibm.com>, netdev@...r.kernel.org,
mst@...hat.com, jasowang@...hat.com, haiyangz@...rosoft.com,
sthemmin@...rosoft.com, sashal@...nel.org, tlfalcon@...ux.ibm.com
Subject: Re: [PATCH, net-next, v3, 1/2] ethtool: Factored out similar ethtool
link settings for virtual devices to core
On Fri, Dec 20, 2019 at 11:18:31AM +0100, Andrew Lunn wrote:
> On Thu, Dec 19, 2019 at 02:54:09PM -0600, Cris Forno wrote:
> > @@ -579,6 +579,32 @@ static int load_link_ksettings_from_user(struct ethtool_link_ksettings *to,
> > return 0;
> > }
> >
> > +/* Check if the user is trying to change anything besides speed/duplex */
> > +static bool
> > +ethtool_virtdev_validate_cmd(const struct ethtool_link_ksettings *cmd)
> > +{
> > + struct ethtool_link_ksettings diff1 = *cmd;
> > + struct ethtool_link_ksettings diff2 = {};
>
> Hi Cris
>
> These are not the best of names. How about request and valid?
>
> > +
> > + /* cmd is always set so we need to clear it, validate the port type
> > + * and also without autonegotiation we can ignore advertising
> > + */
> > + diff1.base.speed = 0;
> > + diff2.base.port = PORT_OTHER;
> > + ethtool_link_ksettings_zero_link_mode(&diff1, advertising);
> > + diff1.base.duplex = 0;
> > + diff1.base.cmd = 0;
> > + diff1.base.link_mode_masks_nwords = 0;
> > +
> > + return !memcmp(&diff1.base, &diff2.base, sizeof(diff1.base)) &&
>
> linkmode_equal()
>
> > + bitmap_empty(diff1.link_modes.supported,
> > + __ETHTOOL_LINK_MODE_MASK_NBITS) &&
>
> linkmode_empty()
>
> Andrew
Please note that this series was sent to netdev mailing list twice and
there is also some discussion at the other copy (both are marked "v3").
I didn't check if the two submissions are identical, though.
Michal
Powered by blists - more mailing lists