Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217751
b: refs/heads/master
c: d0d68b8
h: refs/heads/master
i:
  217749: af7b9a0
  217747: e7a78ed
  217743: f778c1f
v: v3
  • Loading branch information
Jack Morgenstein authored and Roland Dreier committed Oct 23, 2010
1 parent 8ab3ed0 commit 12f12f4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a0fd09428e47fb08d5a887515d92bb2447f4b65
refs/heads/master: d0d68b8693bd16bfbbc93b89f1d9f3351723307c
28 changes: 23 additions & 5 deletions trunk/drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,32 @@ static int mlx4_ib_query_pkey(struct ib_device *ibdev, u8 port, u16 index,
static int mlx4_ib_modify_device(struct ib_device *ibdev, int mask,
struct ib_device_modify *props)
{
struct mlx4_cmd_mailbox *mailbox;

if (mask & ~IB_DEVICE_MODIFY_NODE_DESC)
return -EOPNOTSUPP;

if (mask & IB_DEVICE_MODIFY_NODE_DESC) {
spin_lock(&to_mdev(ibdev)->sm_lock);
memcpy(ibdev->node_desc, props->node_desc, 64);
spin_unlock(&to_mdev(ibdev)->sm_lock);
}
if (!(mask & IB_DEVICE_MODIFY_NODE_DESC))
return 0;

spin_lock(&to_mdev(ibdev)->sm_lock);
memcpy(ibdev->node_desc, props->node_desc, 64);
spin_unlock(&to_mdev(ibdev)->sm_lock);

/*
* If possible, pass node desc to FW, so it can generate
* a 144 trap. If cmd fails, just ignore.
*/
mailbox = mlx4_alloc_cmd_mailbox(to_mdev(ibdev)->dev);
if (IS_ERR(mailbox))
return 0;

memset(mailbox->buf, 0, 256);
memcpy(mailbox->buf, props->node_desc, 64);
mlx4_cmd(to_mdev(ibdev)->dev, mailbox->dma, 1, 0,
MLX4_CMD_SET_NODE, MLX4_CMD_TIME_CLASS_A);

mlx4_free_cmd_mailbox(to_mdev(ibdev)->dev, mailbox);

return 0;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mlx4/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ enum {
MLX4_CMD_QUERY_PORT = 0x43,
MLX4_CMD_SENSE_PORT = 0x4d,
MLX4_CMD_SET_PORT = 0xc,
MLX4_CMD_SET_NODE = 0x5a,
MLX4_CMD_ACCESS_DDR = 0x2e,
MLX4_CMD_MAP_ICM = 0xffa,
MLX4_CMD_UNMAP_ICM = 0xff9,
Expand Down

0 comments on commit 12f12f4

Please sign in to comment.