aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx4
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2012-08-03 08:40:41 +0000
committerRoland Dreier <roland@purestorage.com>2012-09-30 20:33:31 -0700
commite2c76824ca16a3e8443cc7b26abcb21af7c27b10 (patch)
tree41d39111862e2e6faecb9ab356198e985c9bfe7d /include/linux/mlx4
parentIB/mlx4: SR-IOV IB context objects and proxy/tunnel SQP support (diff)
downloadlinux-dev-e2c76824ca16a3e8443cc7b26abcb21af7c27b10.tar.xz
linux-dev-e2c76824ca16a3e8443cc7b26abcb21af7c27b10.zip
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/linux/mlx4')
-rw-r--r--include/linux/mlx4/device.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 07aa8232e631..d5c82b7216de 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)