Skip to contentSkip to conversation

mlx4: Performing SENSE_PORT command only when supported

PATCH New Yevgeny Petrilin 1 participant 1 message May 4, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mlx4: Performing SENSE_PORT command only when supported

Not all HW supports this functionality, and in this case FW would report command error.
This patch checks this capability before trying to sense link partner.

---
 drivers/net/mlx4/main.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/mlx4/main.c +6 -4
index 3814fc9..f47ac5a 100644
@@ -944,10 +944,12 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
 	}
 
 	for (port = 1; port <= dev->caps.num_ports; port++) {
-		enum mlx4_port_type port_type = 0;
-		mlx4_SENSE_PORT(dev, port, &port_type);
-		if (port_type)
-			dev->caps.port_type[port] = port_type;
+		if (dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP) {
+			enum mlx4_port_type port_type = 0;
+			mlx4_SENSE_PORT(dev, port, &port_type);
+			if (port_type)
+				dev->caps.port_type[port] = port_type;
+		}
 		ib_port_default_caps = 0;
 		err = mlx4_get_port_ib_caps(dev, port, &ib_port_default_caps);
 		if (err)
Signature · 1 line
1.6.0.2