summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/mlx5/mlx5_ib.h
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@mellanox.com>2017-12-24 17:31:35 +0300
committerJason Gunthorpe <jgg@mellanox.com>2017-12-28 21:37:46 +0300
commit4ed131d0bb1597ce12fff22d9d7fc9720a6e8cf0 (patch)
tree1fa66369ee11cfd3ed87bb7dccf8e909830119e9 /drivers/infiniband/hw/mlx5/mlx5_ib.h
parent31a78a5a7983141c17852d31eb3a1f70d8161225 (diff)
downloadlinux-4ed131d0bb1597ce12fff22d9d7fc9720a6e8cf0.tar.xz
IB/mlx5: Expose dynamic mmap allocation
This patch exposes the option to dynamic allocates a UAR, this functionality will be used in downstream patch in this series as part of QP creation. Specifically, the user space driver asks for a UAR allocation in a given page index, upon success this UAR and its bfregs can be used as part of QP creation by the user space driver. To enable allocating more than 256 UARs the page index is encoded in an extra one byte just after the command byte. Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/mlx5_ib.h')
-rw-r--r--drivers/infiniband/hw/mlx5/mlx5_ib.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index 330c69cb87df..6c0bdc9a92c4 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -77,6 +77,7 @@ enum mlx5_ib_mmap_cmd {
MLX5_IB_MMAP_NC_PAGE = 3,
/* 5 is chosen in order to be compatible with old versions of libmlx5 */
MLX5_IB_MMAP_CORE_CLOCK = 5,
+ MLX5_IB_MMAP_ALLOC_WC = 6,
};
enum {
@@ -112,6 +113,10 @@ enum {
MLX5_TM_MAX_SGE = 1,
};
+enum {
+ MLX5_IB_INVALID_UAR_INDEX = BIT(31),
+};
+
struct mlx5_ib_vma_private_data {
struct list_head list;
struct vm_area_struct *vma;
@@ -1021,6 +1026,9 @@ void mlx5_ib_gsi_pkey_change(struct mlx5_ib_gsi_qp *gsi);
int mlx5_ib_generate_wc(struct ib_cq *ibcq, struct ib_wc *wc);
+void mlx5_ib_free_bfreg(struct mlx5_ib_dev *dev, struct mlx5_bfreg_info *bfregi,
+ int bfregn);
+
static inline void init_query_mad(struct ib_smp *mad)
{
mad->base_version = 1;