[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAF=yD-JehTcskgPO53k=SgLr1AxQ7Ymx5DcF7vHqoOvN-rsGFA@mail.gmail.com>
Date: Tue, 7 Jan 2020 14:09:44 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Cristobal Forno <cforno12@...ux.vnet.ibm.com>
Cc: Network Development <netdev@...r.kernel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>, haiyangz@...rosoft.com,
sthemmin@...rosoft.com, Sasha Levin <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 Tue, Jan 7, 2020 at 12:46 PM Cristobal Forno
<cforno12@...ux.vnet.ibm.com> wrote:
>
> Thanks for your suggestions Willlem. I have a question on one of your
> suggestions for the ethtool_virtdev_get_link_ksettings function below.
> >> +static int
> >> +ethtool_virtdev_get_link_ksettings(struct net_device *dev,
> >> + struct ethtool_link_ksettings *cmd,
> >> + u32 *speed, u8 *duplex)
> > No need to pass by reference, really. Indeed, the virtio_net caller
> > passes vi->speed and vi->duplex instead of &vi->speed and &vi->duplex.
> Agreed.
> >
> > More fundamentally, these three assignments are simple enough that I
> > don't think a helper actually simplifies anything here.
>
> Although the function is simple, it does achieve the goal of this
> version of the patch series which is to eliminate duplication of code
> throughout the virtual devices. I think it's best to leave it like this,
> but I am open to more suggestions.
As said, I don't think three assignments warrant the effort of adding
a new callback.
Powered by blists - more mailing lists