RDMA/nldev: provide detailed CM_ID information
Implement RDMA nldev netlink interface to get detailed CM_ID information. Because cm_id's are attached to rdma devices in various work queue contexts, the pid and task information at restrak_add() time is sometimes not useful. For example, an nvme/f host connection cm_id ends up being bound to a device in a work queue context and the resulting pid at attach time no longer exists after connection setup. So instead we mark all cm_id's created via the rdma_ucm as "user", and all others as "kernel". This required tweaking the restrack code a little. It also required wrapping some rdma_cm functions to allow passing the module name string. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
@@ -157,6 +157,11 @@ struct rdma_cm_id {
|
||||
u8 port_num;
|
||||
};
|
||||
|
||||
struct rdma_cm_id *__rdma_create_id(struct net *net,
|
||||
rdma_cm_event_handler event_handler,
|
||||
void *context, enum rdma_port_space ps,
|
||||
enum ib_qp_type qp_type, const char *caller);
|
||||
|
||||
/**
|
||||
* rdma_create_id - Create an RDMA identifier.
|
||||
*
|
||||
@@ -169,10 +174,9 @@ struct rdma_cm_id {
|
||||
*
|
||||
* The id holds a reference on the network namespace until it is destroyed.
|
||||
*/
|
||||
struct rdma_cm_id *rdma_create_id(struct net *net,
|
||||
rdma_cm_event_handler event_handler,
|
||||
void *context, enum rdma_port_space ps,
|
||||
enum ib_qp_type qp_type);
|
||||
#define rdma_create_id(net, event_handler, context, ps, qp_type) \
|
||||
__rdma_create_id((net), (event_handler), (context), (ps), (qp_type), \
|
||||
KBUILD_MODNAME)
|
||||
|
||||
/**
|
||||
* rdma_destroy_id - Destroys an RDMA identifier.
|
||||
@@ -284,6 +288,9 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param);
|
||||
*/
|
||||
int rdma_listen(struct rdma_cm_id *id, int backlog);
|
||||
|
||||
int __rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param,
|
||||
const char *caller);
|
||||
|
||||
/**
|
||||
* rdma_accept - Called to accept a connection request or response.
|
||||
* @id: Connection identifier associated with the request.
|
||||
@@ -299,7 +306,8 @@ int rdma_listen(struct rdma_cm_id *id, int backlog);
|
||||
* state of the qp associated with the id is modified to error, such that any
|
||||
* previously posted receive buffers would be flushed.
|
||||
*/
|
||||
int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param);
|
||||
#define rdma_accept(id, conn_param) \
|
||||
__rdma_accept((id), (conn_param), KBUILD_MODNAME)
|
||||
|
||||
/**
|
||||
* rdma_notify - Notifies the RDMA CM of an asynchronous event that has
|
||||
|
Reference in New Issue
Block a user