diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2012-08-03 08:40:41 +0000 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-09-30 20:33:31 -0700 |
commit | e2c76824ca16a3e8443cc7b26abcb21af7c27b10 (patch) | |
tree | 41d39111862e2e6faecb9ab356198e985c9bfe7d /include | |
parent | 1ffeb2eb8be9936e9dc1f9af2d5f4c14d69a0d36 (diff) |
mlx4_core: Add proxy and tunnel QPs to the reserved QP area
In addition, pass the proxy and tunnel QP numbers to slaves so the
driver can perform special QP paravirtualization.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mlx4/device.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 07aa8232e63..d5c82b7216d 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h @@ -693,7 +693,18 @@ static inline int mlx4_is_master(struct mlx4_dev *dev) static inline int mlx4_is_qp_reserved(struct mlx4_dev *dev, u32 qpn) { - return (qpn < dev->caps.sqp_start + 8); + return (qpn < dev->caps.base_sqpn + 8 + + 16 * MLX4_MFUNC_MAX * !!mlx4_is_master(dev)); +} + +static inline int mlx4_is_guest_proxy(struct mlx4_dev *dev, int slave, u32 qpn) +{ + int base = dev->caps.sqp_start + slave * 8; + + if (qpn >= base && qpn < base + 8) + return 1; + + return 0; } static inline int mlx4_is_mfunc(struct mlx4_dev *dev) |