lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 20 Mar 2017 22:42:07 +0100
From:   Philippe Reynes <tremyfr@...il.com>
To:     Xin Long <lucien.xin@...il.com>
Cc:     davem <davem@...emloft.net>, jarod@...hat.com,
        Stephen Hemminger <stephen@...workplumber.org>,
        dsa@...ulusnetworks.com, aduyck@...antis.com,
        network dev <netdev@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: veth: use new api ethtool_{get|set}_link_ksettings

Hi Xin Long,

On 3/20/17, Xin Long <lucien.xin@...il.com> wrote:
> On Sat, Mar 18, 2017 at 7:13 PM, Philippe Reynes <tremyfr@...il.com> wrote:
>> The ethtool api {get|set}_settings is deprecated.
>> We move this driver to new api {get|set}_link_ksettings.
>>
>> Signed-off-by: Philippe Reynes <tremyfr@...il.com>
>> ---
>>  drivers/net/veth.c |   22 ++++++++++------------
>>  1 files changed, 10 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
>> index 8c39d6d..730b133 100644
>> --- a/drivers/net/veth.c
>> +++ b/drivers/net/veth.c
>> @@ -45,18 +45,16 @@ struct veth_priv {
>>         { "peer_ifindex" },
>>  };
>>
>> -static int veth_get_settings(struct net_device *dev, struct ethtool_cmd
>> *cmd)
>> +static int veth_get_link_ksettings(struct net_device *dev,
>> +                                  struct ethtool_link_ksettings *cmd)
>>  {
>> -       cmd->supported          = 0;
>> -       cmd->advertising        = 0;
>> -       ethtool_cmd_speed_set(cmd, SPEED_10000);
>> -       cmd->duplex             = DUPLEX_FULL;
>> -       cmd->port               = PORT_TP;
>> -       cmd->phy_address        = 0;
>> -       cmd->transceiver        = XCVR_INTERNAL;
>> -       cmd->autoneg            = AUTONEG_DISABLE;
>> -       cmd->maxtxpkt           = 0;
>> -       cmd->maxrxpkt           = 0;
>> +       ethtool_link_ksettings_zero_link_mode(cmd, supported);
>> +       ethtool_link_ksettings_zero_link_mode(cmd, advertising);
>> +       cmd->base.speed = SPEED_10000;
>> +       cmd->base.duplex        = DUPLEX_FULL;
>> +       cmd->base.port          = PORT_TP;
>> +       cmd->base.phy_address   = 0;
> It seem always:
>         memset(&link_ksettings, 0, sizeof(link_ksettings));
>         err = dev->ethtool_ops->get_link_ksettings(dev, &link_ksettings);

You're right.

> do we really need:
>        ethtool_link_ksettings_zero_link_mode(cmd, supported);
>        ethtool_link_ksettings_zero_link_mode(cmd, advertising);
>        cmd->base.phy_address   = 0;
> ?

As this code is just an api change, I prefer to keep this code.
Of course, if David prefer to remove this code, I'll remove it.

But you're right, there is a lot of function "get_link_ksettings"
that set to 0 some variable. It's useless as done just before
calling the callback.



Regards,
Philippe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ