Skip to contentSkip to conversation

ib/mlx4: Add extended port capabilities support

PATCH New Marcel Apfelbaum 1 participant 1 message Oct 24, 2011

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

PATCH v2 3/5 ib/mlx4: Add extended port capabilities support

An Extended Port Info packet is sent to each hw port during HCA init and if returns without error it is assumed the port supports extended port capabilities.

---

Changes from v1
- method mlx4_get_ext_port_caps changed to mlx4_check_ext_port_caps
- extended port capabilities are assigned inside mlx4_check_ext_port_caps rather that in mlx4_setup_hca
- ext_port_cap field is u8 instead of u64
- minor warning notification change in mlx4_setup_hca

 drivers/net/mlx4/main.c     |    7 +++++++
 drivers/net/mlx4/mlx4.h     |    1 +
 drivers/net/mlx4/port.c     |   42 ++++++++++++++++++++++++++++++++++++++++++
 include/linux/mlx4/device.h |    7 +++++++
 4 files changed, 57 insertions(+)
drivers/net/mlx4/main.c +7 -0
@@ -998,6 +998,13 @@ static int mlx4_setup_hca(struct mlx4_de
 				  "ib capabilities (%d). Continuing with "
 				  "caps = 0\n", port, err);
 		dev->caps.ib_port_def_cap[port] = ib_port_default_caps;
+
+		err = mlx4_check_ext_port_caps(dev, port);
+		if (err)
+			mlx4_warn(dev, "failed to get port %d extended "
+				  "port capabilities support info (%d)."
+				  " Assuming not supported\n", port, err);
+
 		err = mlx4_SET_PORT(dev, port);
 		if (err) {
 			mlx4_err(dev, "Failed to set port %d, aborting\n",
drivers/net/mlx4/mlx4.h +1 -0
@@ -450,6 +450,7 @@ void mlx4_init_vlan_table(struct mlx4_de
 
 int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port);
 int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps);
+int mlx4_check_ext_port_caps(struct mlx4_dev *dev, u8 port);
 
 int mlx4_qp_detach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
 			  enum mlx4_protocol prot, enum mlx4_steer_type steer);
drivers/net/mlx4/port.c +42 -0

48 lines not on this page · raw message

include/linux/mlx4/device.h +7 -0
@@ -82,6 +82,12 @@ enum {
 	MLX4_DEV_CAP_FLAG_COUNTERS	= 1LL << 48
 };
 
+#define MLX4_ATTR_EXTENDED_PORT_INFO	cpu_to_be16(0xff90)
+
+enum {
+	MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO	= 1 <<  0
+};
+
 enum {
 	MLX4_BMME_FLAG_LOCAL_INV	= 1 <<  6,
 	MLX4_BMME_FLAG_REMOTE_INV	= 1 <<  7,
@@ -276,6 +282,7 @@ struct mlx4_caps {
 	u32			port_mask;
 	enum mlx4_port_type	possible_type[MLX4_MAX_PORTS + 1];
 	u32			max_counters;
+	u8			ext_port_cap[MLX4_MAX_PORTS + 1];
 };
 
 struct mlx4_buf_list {

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html