aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2011-12-12 23:10:51 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-13 13:56:05 -0500
commitf9baff509f8a05a79626defdbdf4f4aa4efd373b (patch)
treed4f0e425cd8c8999775f0f135c9825e3bbdc180c /drivers/infiniband
parent65dab25deb8da7dba4b6dd0145a9143be7f8369f (diff)
mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed)
For SRIOV, some Hypervisor commands can be executed directly (native = 1). Others should go through the command wrapper flow (for tracking resource usage, for example, or for changing some HCA configurations that slaves need to be notified of). This patch sets the groundwork for this capability -- adding the correct value of "native" in each case. Note that if SRIOV is not activated, this parameter has no effect. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mlx4/mad.c6
-rw-r--r--drivers/infiniband/hw/mlx4/main.c7
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index f36da994a85a..95c94d8f0254 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -109,7 +109,8 @@ int mlx4_MAD_IFC(struct mlx4_ib_dev *dev, int ignore_mkey, int ignore_bkey,
109 109
110 err = mlx4_cmd_box(dev->dev, inmailbox->dma, outmailbox->dma, 110 err = mlx4_cmd_box(dev->dev, inmailbox->dma, outmailbox->dma,
111 in_modifier, op_modifier, 111 in_modifier, op_modifier,
112 MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C); 112 MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C,
113 MLX4_CMD_NATIVE);
113 114
114 if (!err) 115 if (!err)
115 memcpy(response_mad, outmailbox->buf, 256); 116 memcpy(response_mad, outmailbox->buf, 256);
@@ -330,7 +331,8 @@ static int iboe_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
330 return IB_MAD_RESULT_FAILURE; 331 return IB_MAD_RESULT_FAILURE;
331 332
332 err = mlx4_cmd_box(dev->dev, 0, mailbox->dma, inmod, 0, 333 err = mlx4_cmd_box(dev->dev, 0, mailbox->dma, inmod, 0,
333 MLX4_CMD_QUERY_IF_STAT, MLX4_CMD_TIME_CLASS_C); 334 MLX4_CMD_QUERY_IF_STAT, MLX4_CMD_TIME_CLASS_C,
335 MLX4_CMD_WRAPPED);
334 if (err) 336 if (err)
335 err = IB_MAD_RESULT_FAILURE; 337 err = IB_MAD_RESULT_FAILURE;
336 else { 338 else {
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 6128b2940c49..34f8a5d9da75 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -434,7 +434,7 @@ static int mlx4_ib_modify_device(struct ib_device *ibdev, int mask,
434 memset(mailbox->buf, 0, 256); 434 memset(mailbox->buf, 0, 256);
435 memcpy(mailbox->buf, props->node_desc, 64); 435 memcpy(mailbox->buf, props->node_desc, 64);
436 mlx4_cmd(to_mdev(ibdev)->dev, mailbox->dma, 1, 0, 436 mlx4_cmd(to_mdev(ibdev)->dev, mailbox->dma, 1, 0,
437 MLX4_CMD_SET_NODE, MLX4_CMD_TIME_CLASS_A); 437 MLX4_CMD_SET_NODE, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);
438 438
439 mlx4_free_cmd_mailbox(to_mdev(ibdev)->dev, mailbox); 439 mlx4_free_cmd_mailbox(to_mdev(ibdev)->dev, mailbox);
440 440
@@ -463,7 +463,7 @@ static int mlx4_SET_PORT(struct mlx4_ib_dev *dev, u8 port, int reset_qkey_viols,
463 } 463 }
464 464
465 err = mlx4_cmd(dev->dev, mailbox->dma, port, is_eth, MLX4_CMD_SET_PORT, 465 err = mlx4_cmd(dev->dev, mailbox->dma, port, is_eth, MLX4_CMD_SET_PORT,
466 MLX4_CMD_TIME_CLASS_B); 466 MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE);
467 467
468 mlx4_free_cmd_mailbox(dev->dev, mailbox); 468 mlx4_free_cmd_mailbox(dev->dev, mailbox);
469 return err; 469 return err;
@@ -899,7 +899,8 @@ static void update_gids_task(struct work_struct *work)
899 memcpy(gids, gw->gids, sizeof gw->gids); 899 memcpy(gids, gw->gids, sizeof gw->gids);
900 900
901 err = mlx4_cmd(dev, mailbox->dma, MLX4_SET_PORT_GID_TABLE << 8 | gw->port, 901 err = mlx4_cmd(dev, mailbox->dma, MLX4_SET_PORT_GID_TABLE << 8 | gw->port,
902 1, MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B); 902 1, MLX4_CMD_SET_PORT, MLX4_CMD_TIME_CLASS_B,
903 MLX4_CMD_NATIVE);
903 if (err) 904 if (err)
904 printk(KERN_WARNING "set port command failed\n"); 905 printk(KERN_WARNING "set port command failed\n");
905 else { 906 else {