Thread (167 messages) 167 messages, 19 authors, 2016-04-06

Re: [PATCH v8 3/4] ethdev: redesign link speed config API

From: Nélio Laranjeiro <hidden>
Date: 2016-02-15 08:46:57

On Sun, Feb 14, 2016 at 11:17:38PM +0100, Marc Sune wrote:
quoted hunk ↗ jump to hunk
This patch redesigns the API to set the link speed/s configure
for an ethernet port. Specifically:

- it allows to define a set of advertised speeds for
  auto-negociation.
- it allows to disable link auto-negociation (single fixed speed).
- default: auto-negociate all supported speeds.

[...]
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index c5688a7..01c3a5c 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -4265,8 +4265,8 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	if (priv_get_ifname(priv, &ifname) == 0)
 		info->if_index = if_nametoindex(ifname);
 
-	info->speed_capa = ETH_SPEED_CAP_10G |ETH_SPEED_CAP_40G |
-					ETH_SPEED_CAP_56G;
+	info->speed_capa = ETH_LINK_SPEED_10G |ETH_LINK_SPEED_40G |
+					ETH_LINK_SPEED_56G;
 
 	priv_unlock(priv);
 }
@@ -4636,6 +4636,8 @@ mlx4_link_update_unlocked(struct rte_eth_dev *dev, int wait_to_complete)
 		dev_link.link_speed = link_speed;
 	dev_link.link_duplex = ((edata.duplex == DUPLEX_HALF) ?
 				ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX);
+	dev_link.link_autoneg = ~(dev->data->dev_conf.link_speeds &
+						ETH_LINK_SPEED_NO_AUTONEG);
 	if (memcmp(&dev_link, &dev->data->dev_link, sizeof(dev_link))) {
 		/* Link status changed. */
 		dev->data->dev_link = dev_link;
[...]
The same modification are missing in mlx5.

-- 
Nélio Laranjeiro
6WIND
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help