Merge branch 'devx-async' into k.o/for-next
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 29 Jan 2019 20:49:31 +0000 (13:49 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 29 Jan 2019 20:49:31 +0000 (13:49 -0700)
Yishai Hadas says:

Enable DEVX asynchronous query commands

This series enables querying a DEVX object in an asynchronous mode.

The userspace application won't block when calling the firmware and it will be
able to get the response back once that it will be ready.

To enable the above functionality:

- DEVX asynchronous command completion FD object was introduced.
- The applicable file operations were implemented to enable using it by
  the user application.
- Query asynchronous method was added to the DEVX object, it will call the
  firmware asynchronously and manages the response on the given input FD.
- Hot unplug support was added for the FD to work properly upon
  unbind/disassociate.
- mlx5 core fence for asynchronous commands was implemented and used to
  prevent racing upon unbind/disassociate.

This branch is based on mlx5-next & v5.0-rc2 due to dependencies, from
git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux

* branch 'devx-async':
  IB/mlx5: Implement DEVX hot unplug for async command FD
  IB/mlx5: Implement the file ops of DEVX async command FD
  IB/mlx5: Introduce async DEVX obj query API
  IB/mlx5: Introduce MLX5_IB_OBJECT_DEVX_ASYNC_CMD_FD

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1  2 
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
drivers/infiniband/hw/cxgb4/qp.c
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
drivers/infiniband/hw/mlx5/devx.c
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/mr.c
drivers/infiniband/hw/ocrdma/ocrdma_stats.c
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
drivers/infiniband/hw/qedr/verbs.c
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
include/linux/mlx5/driver.h

Simple merge
  #define UVERBS_MODULE_NAME mlx5_ib
  #include <rdma/uverbs_named_ioctl.h>
  
 +enum devx_obj_flags {
 +      DEVX_OBJ_FLAGS_INDIRECT_MKEY = 1 << 0,
 +};
 +
+ struct devx_async_data {
+       struct mlx5_ib_dev *mdev;
+       struct list_head list;
+       struct ib_uobject *fd_uobj;
+       struct mlx5_async_work cb_work;
+       u16 cmd_out_len;
+       /* must be last field in this structure */
+       struct mlx5_ib_uapi_devx_async_cmd_hdr hdr;
+ };
  #define MLX5_MAX_DESTROY_INBOX_SIZE_DW MLX5_ST_SZ_DW(delete_fte_in)
  struct devx_obj {
        struct mlx5_core_dev    *mdev;
@@@ -588,14 -587,9 +588,15 @@@ struct mlx5_ib_mr 
        struct mlx5_ib_mr      *parent;
        atomic_t                num_leaf_free;
        wait_queue_head_t       q_leaf_free;
+       struct mlx5_async_work  cb_work;
  };
  
 +static inline bool is_odp_mr(struct mlx5_ib_mr *mr)
 +{
 +      return IS_ENABLED(CONFIG_INFINIBAND_ON_DEMAND_PAGING) && mr->umem &&
 +             mr->umem->is_odp;
 +}
 +
  struct mlx5_ib_mw {
        struct ib_mw            ibmw;
        struct mlx5_core_mkey   mmkey;
@@@ -119,10 -121,12 +119,11 @@@ static void update_odp_mr(struct mlx5_i
                smp_wmb();
        }
  }
 -#endif
  
- static void reg_mr_callback(int status, void *context)
+ static void reg_mr_callback(int status, struct mlx5_async_work *context)
  {
-       struct mlx5_ib_mr *mr = context;
+       struct mlx5_ib_mr *mr =
+               container_of(context, struct mlx5_ib_mr, cb_work);
        struct mlx5_ib_dev *dev = mr->dev;
        struct mlx5_mr_cache *cache = &dev->cache;
        int c = order2idx(dev, mr->order);
Simple merge
Simple merge