From: Xin Long <lucien.xin@gmail.com>
To: Philippe Reynes <tremyfr@gmail.com>
Cc: davem <davem@davemloft.net>,
jarod@redhat.com, Stephen Hemminger <stephen@networkplumber.org>,
dsa@cumulusnetworks.com, aduyck@mirantis.com,
network dev <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] net: veth: use new api ethtool_{get|set}_link_ksettings
Date: Wed, 29 Mar 2017 19:06:19 +0800 [thread overview]
Message-ID: <CADvbK_f7FkjCz4A_ZRwsED4A=imOkwioNACi2__8kVD2TMudOA@mail.gmail.com> (raw)
In-Reply-To: <1490768661-12467-1-git-send-email-tremyfr@gmail.com>
On Wed, Mar 29, 2017 at 2:24 PM, Philippe Reynes <tremyfr@gmail.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@gmail.com>
> ---
> Changelog:
> v2:
> - avoid useless initiazation to zero (thanks Xin Long)
>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
> drivers/net/veth.c | 19 +++++++------------
> 1 files changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 8c39d6d..3171036 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -45,18 +45,13 @@ 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;
> + cmd->base.speed = SPEED_10000;
> + cmd->base.duplex = DUPLEX_FULL;
> + cmd->base.port = PORT_TP;
> + cmd->base.autoneg = AUTONEG_DISABLE;
> return 0;
> }
>
> @@ -95,12 +90,12 @@ static void veth_get_ethtool_stats(struct net_device *dev,
> }
>
> static const struct ethtool_ops veth_ethtool_ops = {
> - .get_settings = veth_get_settings,
> .get_drvinfo = veth_get_drvinfo,
> .get_link = ethtool_op_get_link,
> .get_strings = veth_get_strings,
> .get_sset_count = veth_get_sset_count,
> .get_ethtool_stats = veth_get_ethtool_stats,
> + .get_link_ksettings = veth_get_link_ksettings,
> };
>
> static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
> --
> 1.7.4.4
>
next prev parent reply other threads:[~2017-03-29 11:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-29 6:24 [PATCH v2] net: veth: use new api ethtool_{get|set}_link_ksettings Philippe Reynes
2017-03-29 11:06 ` Xin Long [this message]
2017-03-29 21:07 ` David Miller
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='CADvbK_f7FkjCz4A_ZRwsED4A=imOkwioNACi2__8kVD2TMudOA@mail.gmail.com' \
--to=lucien.xin@gmail.com \
--cc=aduyck@mirantis.com \
--cc=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=jarod@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=tremyfr@gmail.com \
/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).