Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316371
b: refs/heads/master
c: 2aca117
h: refs/heads/master
i:
  316369: 65dfc6d
  316367: d3bb684
v: v3
  • Loading branch information
Jack Morgenstein authored and Roland Dreier committed Jul 10, 2012
1 parent fa518b9 commit 75812de
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 00f5ce99dc6ee46c3113393cc8fa12173f9bbcd7
refs/heads/master: 2aca1172c2f5b27fbc37297574f716c1c15f4153
11 changes: 11 additions & 0 deletions trunk/drivers/net/ethernet/mellanox/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,17 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
"with caps = 0\n", port, err);
dev->caps.ib_port_def_cap[port] = ib_port_default_caps;

/* initialize per-slave default ib port capabilities */
if (mlx4_is_master(dev)) {
int i;
for (i = 0; i < dev->num_slaves; i++) {
if (i == mlx4_master_func_num(dev))
continue;
priv->mfunc.master.slave_state[i].ib_cap_mask[port] =
ib_port_default_caps;
}
}

if (mlx4_is_mfunc(dev))
dev->caps.port_ib_mtu[port] = IB_MTU_2048;
else
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/mlx4/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,11 @@ struct mlx4_init_port_param {

void handle_port_mgmt_change_event(struct work_struct *work);

static inline int mlx4_master_func_num(struct mlx4_dev *dev)
{
return dev->caps.function;
}

static inline int mlx4_is_master(struct mlx4_dev *dev)
{
return dev->flags & MLX4_FLAG_MASTER;
Expand Down

0 comments on commit 75812de

Please sign in to comment.