aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2012-03-06 08:50:50 -0500
committerRoland Dreier <roland@purestorage.com>2012-03-06 20:25:18 -0500
commit8154c07fe14e387c5a7c7f2eb70534813634e45e (patch)
tree04a62c867cb09976b415e8d6e04d41f0c2e793e1
parent2e96691c31ecf749f48aa94ea837b95dd656f5c2 (diff)
mlx4_core: Get rid of redundant ext_port_cap flags
While doing the work for commit a6f7feae6d ("IB/mlx4: pass SMP vendor-specific attribute MADs to firmware") we realized that the firmware would respond on all sorts of vendor-specific MADs. Therefore commit 97285b7817 ("mlx4_core: Add extended port capabilities support") adds redundant code into the driver, since there's no real reaon to maintain the extended capabilities of the port, as they can be queried on demand (e.g the FDR10 capability). This patch reverts commit 97285b7817 and removes the check for extended caps from the mlx4_ib driver port query flow. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/hw/mlx4/main.c25
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c7
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4.h1
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/port.c43
-rw-r--r--include/linux/mlx4/device.h5
5 files changed, 11 insertions, 70 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 6ff6bdf28a3a..abce99ed565f 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -225,21 +225,18 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port,
225 225
226 /* If reported active speed is QDR, check if is FDR-10 */ 226 /* If reported active speed is QDR, check if is FDR-10 */
227 if (props->active_speed == IB_SPEED_QDR) { 227 if (props->active_speed == IB_SPEED_QDR) {
228 if (to_mdev(ibdev)->dev->caps.ext_port_cap[port] & 228 init_query_mad(in_mad);
229 MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO) { 229 in_mad->attr_id = MLX4_ATTR_EXTENDED_PORT_INFO;
230 init_query_mad(in_mad); 230 in_mad->attr_mod = cpu_to_be32(port);
231 in_mad->attr_id = MLX4_ATTR_EXTENDED_PORT_INFO;
232 in_mad->attr_mod = cpu_to_be32(port);
233
234 err = mlx4_MAD_IFC(to_mdev(ibdev), 1, 1, port,
235 NULL, NULL, in_mad, out_mad);
236 if (err)
237 return err;
238 231
239 /* Checking LinkSpeedActive for FDR-10 */ 232 err = mlx4_MAD_IFC(to_mdev(ibdev), 1, 1, port,
240 if (out_mad->data[15] & 0x1) 233 NULL, NULL, in_mad, out_mad);
241 props->active_speed = IB_SPEED_FDR10; 234 if (err)
242 } 235 return err;
236
237 /* Checking LinkSpeedActive for FDR-10 */
238 if (out_mad->data[15] & 0x1)
239 props->active_speed = IB_SPEED_FDR10;
243 } 240 }
244 241
245 return 0; 242 return 0;
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 678558b502fc..2f94d30ab12b 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -1361,13 +1361,6 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
1361 "with caps = 0\n", port, err); 1361 "with caps = 0\n", port, err);
1362 dev->caps.ib_port_def_cap[port] = ib_port_default_caps; 1362 dev->caps.ib_port_def_cap[port] = ib_port_default_caps;
1363 1363
1364 err = mlx4_check_ext_port_caps(dev, port);
1365 if (err)
1366 mlx4_warn(dev, "failed to get port %d extended "
1367 "port capabilities support info (%d)."
1368 " Assuming not supported\n",
1369 port, err);
1370
1371 err = mlx4_SET_PORT(dev, port); 1364 err = mlx4_SET_PORT(dev, port);
1372 if (err) { 1365 if (err) {
1373 mlx4_err(dev, "Failed to set port %d, aborting\n", 1366 mlx4_err(dev, "Failed to set port %d, aborting\n",
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index c92269f8c057..c34d30a5d77b 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -1025,7 +1025,6 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave,
1025 struct mlx4_cmd_mailbox *outbox, 1025 struct mlx4_cmd_mailbox *outbox,
1026 struct mlx4_cmd_info *cmd); 1026 struct mlx4_cmd_info *cmd);
1027int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps); 1027int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps);
1028int mlx4_check_ext_port_caps(struct mlx4_dev *dev, u8 port);
1029 1028
1030 1029
1031int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, 1030int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index f44ae555bf43..51708dd7c8b0 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -590,49 +590,6 @@ int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps)
590 return err; 590 return err;
591} 591}
592 592
593int mlx4_check_ext_port_caps(struct mlx4_dev *dev, u8 port)
594{
595 struct mlx4_cmd_mailbox *inmailbox, *outmailbox;
596 u8 *inbuf, *outbuf;
597 int err, packet_error;
598
599 inmailbox = mlx4_alloc_cmd_mailbox(dev);
600 if (IS_ERR(inmailbox))
601 return PTR_ERR(inmailbox);
602
603 outmailbox = mlx4_alloc_cmd_mailbox(dev);
604 if (IS_ERR(outmailbox)) {
605 mlx4_free_cmd_mailbox(dev, inmailbox);
606 return PTR_ERR(outmailbox);
607 }
608
609 inbuf = inmailbox->buf;
610 outbuf = outmailbox->buf;
611 memset(inbuf, 0, 256);
612 memset(outbuf, 0, 256);
613 inbuf[0] = 1;
614 inbuf[1] = 1;
615 inbuf[2] = 1;
616 inbuf[3] = 1;
617
618 *(__be16 *) (&inbuf[16]) = MLX4_ATTR_EXTENDED_PORT_INFO;
619 *(__be32 *) (&inbuf[20]) = cpu_to_be32(port);
620
621 err = mlx4_cmd_box(dev, inmailbox->dma, outmailbox->dma, port, 3,
622 MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C,
623 MLX4_CMD_NATIVE);
624
625 packet_error = be16_to_cpu(*(__be16 *) (outbuf + 4));
626
627 dev->caps.ext_port_cap[port] = (!err && !packet_error) ?
628 MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO
629 : 0;
630
631 mlx4_free_cmd_mailbox(dev, inmailbox);
632 mlx4_free_cmd_mailbox(dev, outmailbox);
633 return err;
634}
635
636static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, 593static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod,
637 u8 op_mod, struct mlx4_cmd_mailbox *inbox) 594 u8 op_mod, struct mlx4_cmd_mailbox *inbox)
638{ 595{
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index aea61905499b..be7f235c04c0 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -101,10 +101,6 @@ enum {
101#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) 101#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)
102 102
103enum { 103enum {
104 MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0
105};
106
107enum {
108 MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, 104 MLX4_BMME_FLAG_LOCAL_INV = 1 << 6,
109 MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, 105 MLX4_BMME_FLAG_REMOTE_INV = 1 << 7,
110 MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9, 106 MLX4_BMME_FLAG_TYPE_2_WIN = 1 << 9,
@@ -308,7 +304,6 @@ struct mlx4_caps {
308 u32 port_mask[MLX4_MAX_PORTS + 1]; 304 u32 port_mask[MLX4_MAX_PORTS + 1];
309 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; 305 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
310 u32 max_counters; 306 u32 max_counters;
311 u8 ext_port_cap[MLX4_MAX_PORTS + 1];
312}; 307};
313 308
314struct mlx4_buf_list { 309struct mlx4_buf_list {