ethdev: fix link autonegotiation value
authorThomas Monjalon <thomas@monjalon.net>
Fri, 5 Jan 2018 17:38:55 +0000 (18:38 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
commit1e3a958f40b305d66e8d067121a30efbd2753f2a
tree5794e55dd82fb60946d166ca7aa2a44833f4935b
parent35906acbf34daa32469fa63d759846057f36e6fb
ethdev: fix link autonegotiation value

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>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
15 files changed:
drivers/net/af_packet/rte_eth_af_packet.c
drivers/net/e1000/em_ethdev.c
drivers/net/e1000/igb_ethdev.c
drivers/net/failsafe/failsafe.c
drivers/net/kni/rte_eth_kni.c
drivers/net/null/rte_eth_null.c
drivers/net/octeontx/octeontx_ethdev.c
drivers/net/pcap/rte_eth_pcap.c
drivers/net/ring/rte_eth_ring.c
drivers/net/softnic/rte_eth_softnic.c
drivers/net/szedata2/rte_eth_szedata2.c
drivers/net/tap/rte_eth_tap.c
drivers/net/thunderx/nicvf_ethdev.c
drivers/net/vmxnet3/vmxnet3_ethdev.c
lib/librte_ether/rte_ethdev.h