diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2012-06-19 04:21:43 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-07-11 14:51:37 -0400 |
commit | 105c320f6ac37af30252577d419e47b39edb5843 (patch) | |
tree | 4b1b6ebaebf4eaf5c76d47d4a565d75a4f3399ec /drivers/net/ethernet/mellanox/mlx4/main.c | |
parent | 396f2feb05d7cc5549c611c05abfb4108cd1c6d6 (diff) |
mlx4_core: Allow guests to have IB ports
Modify mlx4_dev_cap to allow IB support when SR-IOV is active. Modify
mlx4_slave_cap to set the "rdma-supported" bit in its flags area, and
pass that to the guests (this is done in QUERY_FUNC_CAP and its
wrapper).
However, we don't activate IB support quite yet -- we leave the error
return at the start of mlx4_ib_add in the mlx4_ib driver.
In addition, set "protected fmr supported" bit to zero in the
QUERY_FUNC_CAP wrapper.
Finally, in the QUERY_FUNC_CAP wrapper, we needed to add code which
checks for the port type (IB or Ethernet). Previously, this was not
an issue, since only Ethernet ports were supported.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/main.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 81154a16d6b8..58544b72bacb 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -288,29 +288,19 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
288 | /* if only ETH is supported - assign ETH */ | 288 | /* if only ETH is supported - assign ETH */ |
289 | if (dev->caps.supported_type[i] == MLX4_PORT_TYPE_ETH) | 289 | if (dev->caps.supported_type[i] == MLX4_PORT_TYPE_ETH) |
290 | dev->caps.port_type[i] = MLX4_PORT_TYPE_ETH; | 290 | dev->caps.port_type[i] = MLX4_PORT_TYPE_ETH; |
291 | /* if only IB is supported, | 291 | /* if only IB is supported, assign IB */ |
292 | * assign IB only if SRIOV is off*/ | ||
293 | else if (dev->caps.supported_type[i] == | 292 | else if (dev->caps.supported_type[i] == |
294 | MLX4_PORT_TYPE_IB) { | 293 | MLX4_PORT_TYPE_IB) |
295 | if (dev->flags & MLX4_FLAG_SRIOV) | 294 | dev->caps.port_type[i] = MLX4_PORT_TYPE_IB; |
296 | dev->caps.port_type[i] = | ||
297 | MLX4_PORT_TYPE_NONE; | ||
298 | else | ||
299 | dev->caps.port_type[i] = | ||
300 | MLX4_PORT_TYPE_IB; | ||
301 | /* if IB and ETH are supported, | ||
302 | * first of all check if SRIOV is on */ | ||
303 | } else if (dev->flags & MLX4_FLAG_SRIOV) | ||
304 | dev->caps.port_type[i] = MLX4_PORT_TYPE_ETH; | ||
305 | else { | 295 | else { |
306 | /* In non-SRIOV mode, we set the port type | 296 | /* if IB and ETH are supported, we set the port |
307 | * according to user selection of port type, | 297 | * type according to user selection of port type; |
308 | * if usere selected none, take the FW hint */ | 298 | * if user selected none, take the FW hint */ |
309 | if (port_type_array[i-1] == MLX4_PORT_TYPE_NONE) | 299 | if (port_type_array[i - 1] == MLX4_PORT_TYPE_NONE) |
310 | dev->caps.port_type[i] = dev->caps.suggested_type[i] ? | 300 | dev->caps.port_type[i] = dev->caps.suggested_type[i] ? |
311 | MLX4_PORT_TYPE_ETH : MLX4_PORT_TYPE_IB; | 301 | MLX4_PORT_TYPE_ETH : MLX4_PORT_TYPE_IB; |
312 | else | 302 | else |
313 | dev->caps.port_type[i] = port_type_array[i-1]; | 303 | dev->caps.port_type[i] = port_type_array[i - 1]; |
314 | } | 304 | } |
315 | } | 305 | } |
316 | /* | 306 | /* |