public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] RDMA/core: Fixes for port mapper client registration
@ 2014-10-16 16:19 Tatyana Nikolova
  2014-10-16 19:46 ` Steve Wise
  0 siblings, 1 reply; 4+ messages in thread
From: Tatyana Nikolova @ 2014-10-16 16:19 UTC (permalink / raw)
  To: Roland Dreier
  Cc: john.s.lacombe-ral2JQCrhuEAvxtiuMwx3w,
	swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

IWPM_REG_CLIENT and IWPM_PREV_REG_CLIENT are added:

IWPM_REG_CLIENT is a client, registered with the user
space port mapper daemon, available at the time of the
client register pid request.
IWPM_PREV_REG_CLIENT is a client, which has been IWPM_REG_CLIENT
before the user space port mapper daemon is stopped.
After restarting the port mapper, IWPM_PREV_REG_CLIENTs provide
their mapping info to the port mapper daemon and
they are allowed to send remove mapping requests aftewards.

Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/core/iwpm_msg.c  |   13 +++++++------
 drivers/infiniband/core/iwpm_util.c |    1 +
 drivers/infiniband/core/iwpm_util.h |    3 +++
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/core/iwpm_msg.c b/drivers/infiniband/core/iwpm_msg.c
index ab08170..2aca295 100644
--- a/drivers/infiniband/core/iwpm_msg.c
+++ b/drivers/infiniband/core/iwpm_msg.c
@@ -67,7 +67,9 @@ int iwpm_register_pid(struct iwpm_dev_data *pm_msg, u8 nl_client)
 		err_str = "Invalid port mapper client";
 		goto pid_query_error;
 	}
-	if (iwpm_registered_client(nl_client))
+	if (iwpm_registered_client(nl_client) == IWPM_REG_CLIENT)
+		return 0;
+	if (iwpm_user_pid == IWPM_PID_UNAVAILABLE)
 		return 0;
 	skb = iwpm_create_nlmsg(RDMA_NL_IWPM_REG_PID, &nlh, nl_client);
 	if (!skb) {
@@ -106,7 +108,6 @@ int iwpm_register_pid(struct iwpm_dev_data *pm_msg, u8 nl_client)
 	ret = ibnl_multicast(skb, nlh, RDMA_NL_GROUP_IWPM, GFP_KERNEL);
 	if (ret) {
 		skb = NULL; /* skb is freed in the netlink send-op handling */
-		iwpm_set_registered(nl_client, 1);
 		iwpm_user_pid = IWPM_PID_UNAVAILABLE;
 		err_str = "Unable to send a nlmsg";
 		goto pid_query_error;
@@ -144,7 +145,7 @@ int iwpm_add_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client)
 		err_str = "Invalid port mapper client";
 		goto add_mapping_error;
 	}
-	if (!iwpm_registered_client(nl_client)) {
+	if (iwpm_registered_client(nl_client) != IWPM_REG_CLIENT) {
 		err_str = "Unregistered port mapper client";
 		goto add_mapping_error;
 	}
@@ -214,7 +215,7 @@ int iwpm_add_and_query_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client)
 		err_str = "Invalid port mapper client";
 		goto query_mapping_error;
 	}
-	if (!iwpm_registered_client(nl_client)) {
+	if (iwpm_registered_client(nl_client) != IWPM_REG_CLIENT) {
 		err_str = "Unregistered port mapper client";
 		goto query_mapping_error;
 	}
@@ -388,7 +389,7 @@ int iwpm_register_pid_cb(struct sk_buff *skb, struct netlink_callback *cb)
 	pr_debug("%s: iWarp Port Mapper (pid = %d) is available!\n",
 			__func__, iwpm_user_pid);
 	if (iwpm_valid_client(nl_client))
-		iwpm_set_registered(nl_client, 1);
+		iwpm_set_registered(nl_client, IWPM_REG_CLIENT);
 register_pid_response_exit:
 	nlmsg_request->request_done = 1;
 	/* always for found nlmsg_request */
@@ -669,7 +670,7 @@ int iwpm_mapping_info_cb(struct sk_buff *skb, struct netlink_callback *cb)
 				__func__, nl_client);
 		return ret;
 	}
-	iwpm_set_registered(nl_client, 0);
+	iwpm_set_registered(nl_client, IWPM_PREV_REG_CLIENT);
 	atomic_set(&echo_nlmsg_seq, cb->nlh->nlmsg_seq);
 	if (!iwpm_mapinfo_available())
 		return 0;
diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c
index a626795..7a20a1b 100644
--- a/drivers/infiniband/core/iwpm_util.c
+++ b/drivers/infiniband/core/iwpm_util.c
@@ -106,6 +106,7 @@ int iwpm_exit(u8 nl_client)
 	}
 	mutex_unlock(&iwpm_admin_lock);
 	iwpm_set_valid(nl_client, 0);
+	iwpm_set_registered(nl_client, 0);
 	return 0;
 }
 EXPORT_SYMBOL(iwpm_exit);
diff --git a/drivers/infiniband/core/iwpm_util.h b/drivers/infiniband/core/iwpm_util.h
index ee2d9ff..b1dfd1a 100644
--- a/drivers/infiniband/core/iwpm_util.h
+++ b/drivers/infiniband/core/iwpm_util.h
@@ -58,6 +58,9 @@
 #define IWPM_PID_UNDEFINED     -1
 #define IWPM_PID_UNAVAILABLE   -2
 
+#define IWPM_REG_CLIENT         1
+#define IWPM_PREV_REG_CLIENT    2
+
 struct iwpm_nlmsg_request {
 	struct list_head    inprocess_list;
 	__u32               nlmsg_seq;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] RDMA/core: Fixes for port mapper client registration
  2014-10-16 16:19 [PATCH 1/1] RDMA/core: Fixes for port mapper client registration Tatyana Nikolova
@ 2014-10-16 19:46 ` Steve Wise
  2014-10-16 22:19   ` Nikolova, Tatyana E
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Wise @ 2014-10-16 19:46 UTC (permalink / raw)
  To: 'Tatyana Nikolova', 'Roland Dreier'
  Cc: john.s.lacombe-ral2JQCrhuEAvxtiuMwx3w,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA



> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Tatyana Nikolova
> Sent: Thursday, October 16, 2014 11:20 AM
> To: Roland Dreier
> Cc: john.s.lacombe-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org; swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: [PATCH 1/1] RDMA/core: Fixes for port mapper client registration
> 
> IWPM_REG_CLIENT and IWPM_PREV_REG_CLIENT are added:
> 
> IWPM_REG_CLIENT is a client, registered with the user
> space port mapper daemon, available at the time of the
> client register pid request.
> IWPM_PREV_REG_CLIENT is a client, which has been IWPM_REG_CLIENT
> before the user space port mapper daemon is stopped.
> After restarting the port mapper, IWPM_PREV_REG_CLIENTs provide
> their mapping info to the port mapper daemon and
> they are allowed to send remove mapping requests aftewards.
> 


Hey Tatyana,

Nit:  "aftewards" is misspelled.

Doesn't this feature require provider support?  It seems like this patch really doesn't do anything yet.

Steve.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/1] RDMA/core: Fixes for port mapper client registration
  2014-10-16 19:46 ` Steve Wise
@ 2014-10-16 22:19   ` Nikolova, Tatyana E
       [not found]     ` <13AA599688F47243B14FCFCCC2C803BB0D97D2CF-96pTJSsuoYQ64kNsxIetb7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolova, Tatyana E @ 2014-10-16 22:19 UTC (permalink / raw)
  To: Steve Wise, 'Roland Dreier'
  Cc: Lacombe, John S,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Hello Steve,

>>Doesn't this feature require provider support?  It seems like this patch really doesn't do anything yet.
It is a fix for the client registration logic. When the user space port mapper is restarted, the IWPM_PREV_REG_CLIENTs send their mapping information to the port mapper, afterwards they are allowed to send remove mapping requests and they should be. 

If you look at the remove mapping request logic, you see that only registered clients are allowed to make a remove mapping request. 
In other words, without this fix there are just registered and non-registered clients. IWPM_PREV_REG_CLIENTs are handled like non-registered clients, so their remove mapping requests aren't allowed to go the port mapper, when the rdma application closes the connections in use.

No provider support is necessary.

Thanks,
Tatyana

-----Original Message-----
From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Steve Wise
Sent: Thursday, October 16, 2014 2:47 PM
To: Nikolova, Tatyana E; 'Roland Dreier'
Cc: Lacombe, John S; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: RE: [PATCH 1/1] RDMA/core: Fixes for port mapper client registration



> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org 
> [mailto:linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Tatyana 
> Nikolova
> Sent: Thursday, October 16, 2014 11:20 AM
> To: Roland Dreier
> Cc: john.s.lacombe-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org; swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org; 
> linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: [PATCH 1/1] RDMA/core: Fixes for port mapper client 
> registration
> 
> IWPM_REG_CLIENT and IWPM_PREV_REG_CLIENT are added:
> 
> IWPM_REG_CLIENT is a client, registered with the user space port 
> mapper daemon, available at the time of the client register pid 
> request.
> IWPM_PREV_REG_CLIENT is a client, which has been IWPM_REG_CLIENT 
> before the user space port mapper daemon is stopped.
> After restarting the port mapper, IWPM_PREV_REG_CLIENTs provide their 
> mapping info to the port mapper daemon and they are allowed to send 
> remove mapping requests aftewards.
> 


Hey Tatyana,

Nit:  "aftewards" is misspelled.

Doesn't this feature require provider support?  It seems like this patch really doesn't do anything yet.

Steve.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] RDMA/core: Fixes for port mapper client registration
       [not found]     ` <13AA599688F47243B14FCFCCC2C803BB0D97D2CF-96pTJSsuoYQ64kNsxIetb7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2014-10-16 23:18       ` Steve Wise
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Wise @ 2014-10-16 23:18 UTC (permalink / raw)
  To: Nikolova, Tatyana E, 'Roland Dreier'
  Cc: Lacombe, John S,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On 10/16/2014 5:19 PM, Nikolova, Tatyana E wrote:
> Hello Steve,
>
>>> Doesn't this feature require provider support?  It seems like this patch really doesn't do anything yet.
> It is a fix for the client registration logic. When the user space port mapper is restarted, the IWPM_PREV_REG_CLIENTs send their mapping information to the port mapper, afterwards they are allowed to send remove mapping requests and they should be.
>
> If you look at the remove mapping request logic, you see that only registered clients are allowed to make a remove mapping request.
> In other words, without this fix there are just registered and non-registered clients. IWPM_PREV_REG_CLIENTs are handled like non-registered clients, so their remove mapping requests aren't allowed to go the port mapper, when the rdma application closes the connections in use.
>
> No provider support is necessary.

Thanks for clarifying.

Steve.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-16 23:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16 16:19 [PATCH 1/1] RDMA/core: Fixes for port mapper client registration Tatyana Nikolova
2014-10-16 19:46 ` Steve Wise
2014-10-16 22:19   ` Nikolova, Tatyana E
     [not found]     ` <13AA599688F47243B14FCFCCC2C803BB0D97D2CF-96pTJSsuoYQ64kNsxIetb7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-10-16 23:18       ` Steve Wise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox