aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx4
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 /include/linux/mlx4
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 'include/linux/mlx4')
-rw-r--r--include/linux/mlx4/cmd.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index e8e92814c8a0..ae62630a665e 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -173,6 +173,11 @@ enum {
173 MLX4_SET_PORT_GID_TABLE = 0x5, 173 MLX4_SET_PORT_GID_TABLE = 0x5,
174}; 174};
175 175
176enum {
177 MLX4_CMD_WRAPPED,
178 MLX4_CMD_NATIVE
179};
180
176struct mlx4_dev; 181struct mlx4_dev;
177 182
178struct mlx4_cmd_mailbox { 183struct mlx4_cmd_mailbox {
@@ -182,23 +187,24 @@ struct mlx4_cmd_mailbox {
182 187
183int __mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param, 188int __mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
184 int out_is_imm, u32 in_modifier, u8 op_modifier, 189 int out_is_imm, u32 in_modifier, u8 op_modifier,
185 u16 op, unsigned long timeout); 190 u16 op, unsigned long timeout, int native);
186 191
187/* Invoke a command with no output parameter */ 192/* Invoke a command with no output parameter */
188static inline int mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u32 in_modifier, 193static inline int mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u32 in_modifier,
189 u8 op_modifier, u16 op, unsigned long timeout) 194 u8 op_modifier, u16 op, unsigned long timeout,
195 int native)
190{ 196{
191 return __mlx4_cmd(dev, in_param, NULL, 0, in_modifier, 197 return __mlx4_cmd(dev, in_param, NULL, 0, in_modifier,
192 op_modifier, op, timeout); 198 op_modifier, op, timeout, native);
193} 199}
194 200
195/* Invoke a command with an output mailbox */ 201/* Invoke a command with an output mailbox */
196static inline int mlx4_cmd_box(struct mlx4_dev *dev, u64 in_param, u64 out_param, 202static inline int mlx4_cmd_box(struct mlx4_dev *dev, u64 in_param, u64 out_param,
197 u32 in_modifier, u8 op_modifier, u16 op, 203 u32 in_modifier, u8 op_modifier, u16 op,
198 unsigned long timeout) 204 unsigned long timeout, int native)
199{ 205{
200 return __mlx4_cmd(dev, in_param, &out_param, 0, in_modifier, 206 return __mlx4_cmd(dev, in_param, &out_param, 0, in_modifier,
201 op_modifier, op, timeout); 207 op_modifier, op, timeout, native);
202} 208}
203 209
204/* 210/*
@@ -208,10 +214,10 @@ static inline int mlx4_cmd_box(struct mlx4_dev *dev, u64 in_param, u64 out_param
208 */ 214 */
209static inline int mlx4_cmd_imm(struct mlx4_dev *dev, u64 in_param, u64 *out_param, 215static inline int mlx4_cmd_imm(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
210 u32 in_modifier, u8 op_modifier, u16 op, 216 u32 in_modifier, u8 op_modifier, u16 op,
211 unsigned long timeout) 217 unsigned long timeout, int native)
212{ 218{
213 return __mlx4_cmd(dev, in_param, out_param, 1, in_modifier, 219 return __mlx4_cmd(dev, in_param, out_param, 1, in_modifier,
214 op_modifier, op, timeout); 220 op_modifier, op, timeout, native);
215} 221}
216 222
217struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev); 223struct mlx4_cmd_mailbox *mlx4_alloc_cmd_mailbox(struct mlx4_dev *dev);