提交 83e9502d 编写于 作者: N Nir Muchtar 提交者: Roland Dreier

RDMA/cma: Save PID of ID's owner

Save the PID associated with an RDMA CM ID for reporting via netlink.
Signed-off-by: NNir Muchtar <nirm@voltaire.com>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 753f618a
...@@ -133,6 +133,7 @@ struct rdma_id_private { ...@@ -133,6 +133,7 @@ struct rdma_id_private {
u32 seq_num; u32 seq_num;
u32 qkey; u32 qkey;
u32 qp_num; u32 qp_num;
pid_t owner;
u8 srq; u8 srq;
u8 tos; u8 tos;
u8 reuseaddr; u8 reuseaddr;
...@@ -420,6 +421,7 @@ struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler, ...@@ -420,6 +421,7 @@ struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler,
if (!id_priv) if (!id_priv)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
id_priv->owner = task_pid_nr(current);
id_priv->state = RDMA_CM_IDLE; id_priv->state = RDMA_CM_IDLE;
id_priv->id.context = context; id_priv->id.context = context;
id_priv->id.event_handler = event_handler; id_priv->id.event_handler = event_handler;
...@@ -2746,6 +2748,9 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param) ...@@ -2746,6 +2748,9 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param)
int ret; int ret;
id_priv = container_of(id, struct rdma_id_private, id); id_priv = container_of(id, struct rdma_id_private, id);
id_priv->owner = task_pid_nr(current);
if (!cma_comp(id_priv, RDMA_CM_CONNECT)) if (!cma_comp(id_priv, RDMA_CM_CONNECT))
return -EINVAL; return -EINVAL;
...@@ -3385,6 +3390,7 @@ static int cma_get_id_stats(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -3385,6 +3390,7 @@ static int cma_get_id_stats(struct sk_buff *skb, struct netlink_callback *cb)
} }
} }
id_stats->pid = id_priv->owner;
id_stats->port_space = id->ps; id_stats->port_space = id->ps;
id_stats->cm_state = id_priv->state; id_stats->cm_state = id_priv->state;
id_stats->qp_num = id_priv->qp_num; id_stats->qp_num = id_priv->qp_num;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册