diff options
author | Nir Muchtar <nirm@voltaire.com> | 2011-01-13 08:56:04 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-05-25 16:46:23 -0400 |
commit | 83e9502d8db142822f3302e6a46a45082d3a27b7 (patch) | |
tree | 9c2888434fa1dd50c360de637bb902961476705b /drivers/infiniband | |
parent | 753f618ae03a699cc30044d64eea84165016dc6e (diff) |
RDMA/cma: Save PID of ID's owner
Save the PID associated with an RDMA CM ID for reporting via netlink.
Signed-off-by: Nir Muchtar <nirm@voltaire.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/cma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 5dd9acb92c3a..b6a33b3c516d 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -133,6 +133,7 @@ struct rdma_id_private { | |||
133 | u32 seq_num; | 133 | u32 seq_num; |
134 | u32 qkey; | 134 | u32 qkey; |
135 | u32 qp_num; | 135 | u32 qp_num; |
136 | pid_t owner; | ||
136 | u8 srq; | 137 | u8 srq; |
137 | u8 tos; | 138 | u8 tos; |
138 | u8 reuseaddr; | 139 | u8 reuseaddr; |
@@ -420,6 +421,7 @@ struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler, | |||
420 | if (!id_priv) | 421 | if (!id_priv) |
421 | return ERR_PTR(-ENOMEM); | 422 | return ERR_PTR(-ENOMEM); |
422 | 423 | ||
424 | id_priv->owner = task_pid_nr(current); | ||
423 | id_priv->state = RDMA_CM_IDLE; | 425 | id_priv->state = RDMA_CM_IDLE; |
424 | id_priv->id.context = context; | 426 | id_priv->id.context = context; |
425 | id_priv->id.event_handler = event_handler; | 427 | 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 | int ret; | 2748 | int ret; |
2747 | 2749 | ||
2748 | id_priv = container_of(id, struct rdma_id_private, id); | 2750 | id_priv = container_of(id, struct rdma_id_private, id); |
2751 | |||
2752 | id_priv->owner = task_pid_nr(current); | ||
2753 | |||
2749 | if (!cma_comp(id_priv, RDMA_CM_CONNECT)) | 2754 | if (!cma_comp(id_priv, RDMA_CM_CONNECT)) |
2750 | return -EINVAL; | 2755 | return -EINVAL; |
2751 | 2756 | ||
@@ -3385,6 +3390,7 @@ static int cma_get_id_stats(struct sk_buff *skb, struct netlink_callback *cb) | |||
3385 | } | 3390 | } |
3386 | } | 3391 | } |
3387 | 3392 | ||
3393 | id_stats->pid = id_priv->owner; | ||
3388 | id_stats->port_space = id->ps; | 3394 | id_stats->port_space = id->ps; |
3389 | id_stats->cm_state = id_priv->state; | 3395 | id_stats->cm_state = id_priv->state; |
3390 | id_stats->qp_num = id_priv->qp_num; | 3396 | id_stats->qp_num = id_priv->qp_num; |