aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/qp.c
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/net/ethernet/mellanox/mlx4/qp.c
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/net/ethernet/mellanox/mlx4/qp.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/qp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/qp.c b/drivers/net/ethernet/mellanox/mlx4/qp.c
index 15f870cb2590..e721f4cd34f8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/qp.c
+++ b/drivers/net/ethernet/mellanox/mlx4/qp.c
@@ -119,7 +119,8 @@ int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
119 119
120 if (op[cur_state][new_state] == MLX4_CMD_2RST_QP) 120 if (op[cur_state][new_state] == MLX4_CMD_2RST_QP)
121 return mlx4_cmd(dev, 0, qp->qpn, 2, 121 return mlx4_cmd(dev, 0, qp->qpn, 2,
122 MLX4_CMD_2RST_QP, MLX4_CMD_TIME_CLASS_A); 122 MLX4_CMD_2RST_QP, MLX4_CMD_TIME_CLASS_A,
123 MLX4_CMD_WRAPPED);
123 124
124 mailbox = mlx4_alloc_cmd_mailbox(dev); 125 mailbox = mlx4_alloc_cmd_mailbox(dev);
125 if (IS_ERR(mailbox)) 126 if (IS_ERR(mailbox))
@@ -140,7 +141,8 @@ int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
140 141
141 ret = mlx4_cmd(dev, mailbox->dma, qp->qpn | (!!sqd_event << 31), 142 ret = mlx4_cmd(dev, mailbox->dma, qp->qpn | (!!sqd_event << 31),
142 new_state == MLX4_QP_STATE_RST ? 2 : 0, 143 new_state == MLX4_QP_STATE_RST ? 2 : 0,
143 op[cur_state][new_state], MLX4_CMD_TIME_CLASS_C); 144 op[cur_state][new_state], MLX4_CMD_TIME_CLASS_C,
145 MLX4_CMD_WRAPPED);
144 146
145 mlx4_free_cmd_mailbox(dev, mailbox); 147 mlx4_free_cmd_mailbox(dev, mailbox);
146 return ret; 148 return ret;
@@ -265,7 +267,7 @@ EXPORT_SYMBOL_GPL(mlx4_qp_free);
265static int mlx4_CONF_SPECIAL_QP(struct mlx4_dev *dev, u32 base_qpn) 267static int mlx4_CONF_SPECIAL_QP(struct mlx4_dev *dev, u32 base_qpn)
266{ 268{
267 return mlx4_cmd(dev, 0, base_qpn, 0, MLX4_CMD_CONF_SPECIAL_QP, 269 return mlx4_cmd(dev, 0, base_qpn, 0, MLX4_CMD_CONF_SPECIAL_QP,
268 MLX4_CMD_TIME_CLASS_B); 270 MLX4_CMD_TIME_CLASS_B, MLX4_CMD_NATIVE);
269} 271}
270 272
271int mlx4_init_qp_table(struct mlx4_dev *dev) 273int mlx4_init_qp_table(struct mlx4_dev *dev)
@@ -342,7 +344,8 @@ int mlx4_qp_query(struct mlx4_dev *dev, struct mlx4_qp *qp,
342 return PTR_ERR(mailbox); 344 return PTR_ERR(mailbox);
343 345
344 err = mlx4_cmd_box(dev, 0, mailbox->dma, qp->qpn, 0, 346 err = mlx4_cmd_box(dev, 0, mailbox->dma, qp->qpn, 0,
345 MLX4_CMD_QUERY_QP, MLX4_CMD_TIME_CLASS_A); 347 MLX4_CMD_QUERY_QP, MLX4_CMD_TIME_CLASS_A,
348 MLX4_CMD_WRAPPED);
346 if (!err) 349 if (!err)
347 memcpy(context, mailbox->buf + 8, sizeof *context); 350 memcpy(context, mailbox->buf + 8, sizeof *context);
348 351