aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2012-06-19 04:21:41 -0400
committerRoland Dreier <roland@purestorage.com>2012-07-10 12:57:06 -0400
commit2aca1172c2f5b27fbc37297574f716c1c15f4153 (patch)
tree8f6eb799bb0fa1c172ea45773d9d1c41ca934c87 /drivers/net
parent00f5ce99dc6ee46c3113393cc8fa12173f9bbcd7 (diff)
net/mlx4_core: Initialize IB port capabilities for all slaves
With IB SR-IOV, each slave has its own separate copy of the port capabilities flags. For example, the master can run a subnet manager (which causes the IsSM bit to be set in the master's port capabilities) without affecting the port capabilities seen by the slaves (the IsSM bit will be seen as cleared in the slaves). Also add a static inline mlx4_master_func_num() to enhance readability of the code. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index a0313de122d..83afb1541a7 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -1477,6 +1477,17 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
1477 "with caps = 0\n", port, err); 1477 "with caps = 0\n", port, err);
1478 dev->caps.ib_port_def_cap[port] = ib_port_default_caps; 1478 dev->caps.ib_port_def_cap[port] = ib_port_default_caps;
1479 1479
1480 /* initialize per-slave default ib port capabilities */
1481 if (mlx4_is_master(dev)) {
1482 int i;
1483 for (i = 0; i < dev->num_slaves; i++) {
1484 if (i == mlx4_master_func_num(dev))
1485 continue;
1486 priv->mfunc.master.slave_state[i].ib_cap_mask[port] =
1487 ib_port_default_caps;
1488 }
1489 }
1490
1480 if (mlx4_is_mfunc(dev)) 1491 if (mlx4_is_mfunc(dev))
1481 dev->caps.port_ib_mtu[port] = IB_MTU_2048; 1492 dev->caps.port_ib_mtu[port] = IB_MTU_2048;
1482 else 1493 else