From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, stephen@networkplumber.org
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix link autonegotiation value
Date: Mon, 08 Jan 2018 16:25:58 +0100 [thread overview]
Message-ID: <10754669.Ct3CSZPRVh@xps> (raw)
In-Reply-To: <1506673b-52b0-cf16-38c4-6e55420e22f9@intel.com>
08/01/2018 13:31, Ferruh Yigit:
> On 1/5/2018 5:38 PM, Thomas Monjalon wrote:
> > There are 3 kind of link data in ethdev:
> > - capabilities (rte_eth_dev_info)
> > - configuration (rte_eth_conf)
> > - status (rte_eth_link)
> >
> > A bit-field is used for capabilities (rte_eth_dev_info.speed_capa) and
> > configuration (rte_eth_conf.link_speeds).
> > Bits are defined in ETH_LINK_SPEED_*.
> >
> > Some numerical (ETH_SPEED_NUM_*) and boolean (ETH_LINK_*) values
> > are used for the link status (rte_eth_link.*).
> >
> > There was a mistake in the comment of rte_eth_link.link_autoneg,
> > suggesting ETH_LINK_SPEED_[AUTONEG/FIXED] which are 0/1,
> > instead of ETH_LINK_[AUTONEG/FIXED] which are 1/0.
> >
> > The drivers are fixed to use ETH_LINK_[AUTONEG/FIXED].
> >
> > Fixes: 82113036e4e5 ("ethdev: redesign link speed config")
> >
> > Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>
> <...>
>
> > diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
> > index 5a86752f9..3efb451a2 100644
> > --- a/drivers/net/pcap/rte_eth_pcap.c
> > +++ b/drivers/net/pcap/rte_eth_pcap.c
> > @@ -124,7 +124,7 @@ static struct rte_eth_link pmd_link = {
> > .link_speed = ETH_SPEED_NUM_10G,
> > .link_duplex = ETH_LINK_FULL_DUPLEX,
> > .link_status = ETH_LINK_DOWN,
> > - .link_autoneg = ETH_LINK_SPEED_FIXED,
> > + .link_autoneg = ETH_LINK_AUTONEG,
> > };
> >
> > static int
> <...>
> > diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
> > index c21c29e79..5c5464c8d 100644
> > --- a/drivers/net/softnic/rte_eth_softnic.c
> > +++ b/drivers/net/softnic/rte_eth_softnic.c
> > @@ -522,7 +522,7 @@ pmd_ethdev_register(struct rte_vdev_device *vdev,
> > soft_dev->data->dev_private = dev_private;
> > soft_dev->data->dev_link.link_speed = hard_speed;
> > soft_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
> > - soft_dev->data->dev_link.link_autoneg = ETH_LINK_SPEED_FIXED;
> > + soft_dev->data->dev_link.link_autoneg = ETH_LINK_AUTONEG;
> > soft_dev->data->dev_link.link_status = ETH_LINK_DOWN;
> > soft_dev->data->mac_addrs = ð_addr;
> > soft_dev->data->promiscuous = 1;
> > static void
> <...>
> > diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > index b988d1b41..fa1206c26 100644
> > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> > @@ -1143,7 +1143,7 @@ __vmxnet3_dev_link_update(struct rte_eth_dev *dev,
> > link.link_status = ETH_LINK_UP;
> > link.link_duplex = ETH_LINK_FULL_DUPLEX;
> > link.link_speed = ETH_SPEED_NUM_10G;
> > - link.link_autoneg = ETH_LINK_SPEED_FIXED;
> > + link.link_autoneg = ETH_LINK_AUTONEG;
> > }
> >
> > vmxnet3_dev_atomic_write_link_status(dev, &link);
>
> These three drivers changes from "fixed" to "autoneg", intentional?
Yes.
These are virtual ports, so fixed/autoneg does not really makes sense.
I think autoneg is more fuzzy so more appropriate :)
Anyway, the value is not changed, because
ETH_LINK_SPEED_FIXED = ETH_LINK_AUTONEG = 1
prev parent reply other threads:[~2018-01-08 15:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-05 17:38 Thomas Monjalon
2018-01-05 20:47 ` Stephen Hemminger
2018-01-10 20:54 ` Ferruh Yigit
2018-01-08 12:31 ` Ferruh Yigit
2018-01-08 15:25 ` Thomas Monjalon [this message]
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=10754669.Ct3CSZPRVh@xps \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=stephen@networkplumber.org \
/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).