[dpdk-dev] [PATCH v2 27/51] net/mlx4: simplify link update function

Adrien Mazarguil adrien.mazarguil at 6wind.com
Fri Sep 1 10:06:42 CEST 2017


Returning a different value when the current link status differs from the
previous one was probably useful at some point in the past but is now
meaningless; this value is ignored both internally (mlx4 PMD) and
externally (ethdev wrapper).

Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
---
 drivers/net/mlx4/mlx4.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 1208e7a..9694170 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -2476,13 +2476,8 @@ mlx4_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 				ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX);
 	dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
 			ETH_LINK_SPEED_FIXED);
-	if (memcmp(&dev_link, &dev->data->dev_link, sizeof(dev_link))) {
-		/* Link status changed. */
-		dev->data->dev_link = dev_link;
-		return 0;
-	}
-	/* Link status is still the same. */
-	return -1;
+	dev->data->dev_link = dev_link;
+	return 0;
 }
 
 /**
-- 
2.1.4



More information about the dev mailing list