]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/rdma/ib_verbs.h
IB/core: add a helper to check for READ WITH INVALIDATE support
[mirror_ubuntu-bionic-kernel.git] / include / rdma / ib_verbs.h
index fb2cef4e97471bbeb67dc950f88736dd34a21b3c..9e8616af68993c38229c7afc9253343111941c61 100644 (file)
@@ -1827,7 +1827,8 @@ struct ib_device {
                                               u32 max_num_sg);
        int                        (*map_mr_sg)(struct ib_mr *mr,
                                                struct scatterlist *sg,
-                                               int sg_nents);
+                                               int sg_nents,
+                                               unsigned sg_offset);
        struct ib_mw *             (*alloc_mw)(struct ib_pd *pd,
                                               enum ib_mw_type type,
                                               struct ib_udata *udata);
@@ -2317,6 +2318,18 @@ static inline bool rdma_cap_roce_gid_table(const struct ib_device *device,
                device->add_gid && device->del_gid;
 }
 
+/*
+ * Check if the device supports READ W/ INVALIDATE.
+ */
+static inline bool rdma_cap_read_inv(struct ib_device *dev, u32 port_num)
+{
+       /*
+        * iWarp drivers must support READ W/ INVALIDATE.  No other protocol
+        * has support for it yet.
+        */
+       return rdma_protocol_iwarp(dev, port_num);
+}
+
 int ib_query_gid(struct ib_device *device,
                 u8 port_num, int index, union ib_gid *gid,
                 struct ib_gid_attr *attr);
@@ -3111,29 +3124,23 @@ struct net_device *ib_get_net_dev_by_params(struct ib_device *dev, u8 port,
                                            u16 pkey, const union ib_gid *gid,
                                            const struct sockaddr *addr);
 
-int ib_map_mr_sg(struct ib_mr *mr,
-                struct scatterlist *sg,
-                int sg_nents,
-                unsigned int page_size);
+int ib_map_mr_sg(struct ib_mr *mr, struct scatterlist *sg, int sg_nents,
+               unsigned int sg_offset, unsigned int page_size);
 
 static inline int
-ib_map_mr_sg_zbva(struct ib_mr *mr,
-                 struct scatterlist *sg,
-                 int sg_nents,
-                 unsigned int page_size)
+ib_map_mr_sg_zbva(struct ib_mr *mr, struct scatterlist *sg, int sg_nents,
+               unsigned int sg_offset, unsigned int page_size)
 {
        int n;
 
-       n = ib_map_mr_sg(mr, sg, sg_nents, page_size);
+       n = ib_map_mr_sg(mr, sg, sg_nents, sg_offset, page_size);
        mr->iova = 0;
 
        return n;
 }
 
-int ib_sg_to_pages(struct ib_mr *mr,
-                  struct scatterlist *sgl,
-                  int sg_nents,
-                  int (*set_page)(struct ib_mr *, u64));
+int ib_sg_to_pages(struct ib_mr *mr, struct scatterlist *sgl, int sg_nents,
+               unsigned int sg_offset, int (*set_page)(struct ib_mr *, u64));
 
 void ib_drain_rq(struct ib_qp *qp);
 void ib_drain_sq(struct ib_qp *qp);