summaryrefslogtreecommitdiffstats
path: root/include/rdma/ib_cache.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-06-05 07:40:20 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-06-18 19:09:05 +0200
commitc3d71b69a75cbbc03c8f43571b003ddadd40d056 (patch)
tree3eb21122ae12813cfb49e1fe8920011e4327316b /include/rdma/ib_cache.h
parentnet/smc: Replace ib_query_gid with rdma_get_gid_attr (diff)
downloadlinux-c3d71b69a75cbbc03c8f43571b003ddadd40d056.tar.xz
linux-c3d71b69a75cbbc03c8f43571b003ddadd40d056.zip
IB/core: Provide rdma_ versions of the gid cache API
These versions are functionally similar but all return gid_attrs and related information via reference instead of via copy. The old API is preserved, implemented as wrappers around the new, until all callers can be converted. Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma/ib_cache.h')
-rw-r--r--include/rdma/ib_cache.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/rdma/ib_cache.h b/include/rdma/ib_cache.h
index 00ccd00d0596..059f7d894939 100644
--- a/include/rdma/ib_cache.h
+++ b/include/rdma/ib_cache.h
@@ -54,6 +54,8 @@ int ib_get_cached_gid(struct ib_device *device,
int index,
union ib_gid *gid,
struct ib_gid_attr *attr);
+int rdma_query_gid(struct ib_device *device, u8 port_num, int index,
+ union ib_gid *gid);
int ib_find_cached_gid(struct ib_device *device,
const union ib_gid *gid,
@@ -61,6 +63,10 @@ int ib_find_cached_gid(struct ib_device *device,
struct net_device *ndev,
u8 *port_num,
u16 *index);
+const struct ib_gid_attr *rdma_find_gid(struct ib_device *device,
+ const union ib_gid *gid,
+ enum ib_gid_type gid_type,
+ struct net_device *ndev);
int ib_find_cached_gid_by_port(struct ib_device *device,
const union ib_gid *gid,
@@ -68,6 +74,11 @@ int ib_find_cached_gid_by_port(struct ib_device *device,
u8 port_num,
struct net_device *ndev,
u16 *index);
+const struct ib_gid_attr *rdma_find_gid_by_port(struct ib_device *ib_dev,
+ const union ib_gid *gid,
+ enum ib_gid_type gid_type,
+ u8 port,
+ struct net_device *ndev);
int ib_find_gid_by_filter(struct ib_device *device,
const union ib_gid *gid,
@@ -76,6 +87,12 @@ int ib_find_gid_by_filter(struct ib_device *device,
const struct ib_gid_attr *,
void *),
void *context, u16 *index);
+const struct ib_gid_attr *rdma_find_gid_by_filter(
+ struct ib_device *device, const union ib_gid *gid, u8 port_num,
+ bool (*filter)(const union ib_gid *gid, const struct ib_gid_attr *,
+ void *),
+ void *context);
+
/**
* ib_get_cached_pkey - Returns a cached PKey table entry
* @device: The device to query.