linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-next] Revert "IB/core: Add flow control to the portmapper netlink calls"
@ 2017-05-29  8:26 Leon Romanovsky
  0 siblings, 0 replies; 29+ messages in thread
From: Leon Romanovsky @ 2017-05-29  8:26 UTC (permalink / raw)
  To: Doug Ledford, Mustafa Ismail, Faisal Latif, Shiraz Saleem
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

The commit cea05eadded0 ("IB/core: Add flow control to the portmapper netlink calls")
changed netlink to be blocked for all RDMA clients. This workaround
worked perfectly for portmapper, but is not correct for the whole
NETLINK_RDMA family.

The request/response should always be blocking and asynchronous
notification should always be non-blocking.

It is library and user-space application to chose how to handle recvmgs,
as an example see nl_recvmsgs() and nl_socket_set_nonblocking() calls of
libnl library.

Send timeout is not needed too and can be configured with SO_SNDTIMEO socket
option.

This reverts commit cea05eadded0d4eb59f7be6e1f1560eb6bfde2bf.

Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/core/netlink.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c
index b784055423c8..fcc9702efd38 100644
--- a/drivers/infiniband/core/netlink.c
+++ b/drivers/infiniband/core/netlink.c
@@ -230,10 +230,7 @@ static void ibnl_rcv(struct sk_buff *skb)
 int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh,
 			__u32 pid)
 {
-	int err;
-
-	err = netlink_unicast(nls, skb, pid, 0);
-	return (err < 0) ? err : 0;
+	return nlmsg_unicast(nls, skb, pid);
 }
 EXPORT_SYMBOL(ibnl_unicast);

@@ -256,7 +253,6 @@ int __init ibnl_init(void)
 		return -ENOMEM;
 	}

-	nls->sk_sndtimeo = 10 * HZ;
 	return 0;
 }

--
2.12.2

--
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] 29+ messages in thread
* [PATCH rdma-next] Revert "IB/core: Add flow control to the portmapper netlink calls"
@ 2017-05-29  8:24 Leon Romanovsky
       [not found] ` <20170529082423.1180-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 29+ messages in thread
From: Leon Romanovsky @ 2017-05-29  8:24 UTC (permalink / raw)
  To: Doug Ledford, Mustafa Ismail, Faisal Latif, Shiraz Saleem
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky,
	Leon Romanovsky

From: Leon Romanovsky <leonro-Nfu5REtnQAJWk0Htik3J/w@public.gmane.org>

The commit cea05eadded0 ("IB/core: Add flow control to the portmapper netlink calls")
changed netlink to be blocked for all RDMA clients. This workaround
worked perfectly for portmapper, but is not correct for the whole
NETLINK_RDMA family.

The request/response should always be blocking and asynchronous
notification should always be non-blocking.

It is library and user-space application to chose how to handle recvmgs,
as an example see nl_recvmsgs() and nl_socket_set_nonblocking() calls of
libnl library.

Send timeout is not needed too and can be configured with SO_SNDTIMEO socket
option.

This reverts commit cea05eadded0d4eb59f7be6e1f1560eb6bfde2bf.

Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/core/netlink.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c
index b784055423c8..fcc9702efd38 100644
--- a/drivers/infiniband/core/netlink.c
+++ b/drivers/infiniband/core/netlink.c
@@ -230,10 +230,7 @@ static void ibnl_rcv(struct sk_buff *skb)
 int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh,
 			__u32 pid)
 {
-	int err;
-
-	err = netlink_unicast(nls, skb, pid, 0);
-	return (err < 0) ? err : 0;
+	return nlmsg_unicast(nls, skb, pid);
 }
 EXPORT_SYMBOL(ibnl_unicast);

@@ -256,7 +253,6 @@ int __init ibnl_init(void)
 		return -ENOMEM;
 	}

-	nls->sk_sndtimeo = 10 * HZ;
 	return 0;
 }

--
2.12.2

--
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] 29+ messages in thread

end of thread, other threads:[~2017-06-06 18:17 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-29  8:26 [PATCH rdma-next] Revert "IB/core: Add flow control to the portmapper netlink calls" Leon Romanovsky
  -- strict thread matches above, loose matches on Subject: below --
2017-05-29  8:24 Leon Romanovsky
     [not found] ` <20170529082423.1180-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-05-30 21:24   ` Shiraz Saleem
     [not found]     ` <20170530212431.GA21008-GOXS9JX10wfOxmVO0tvppfooFf0ArEBIu+b9c/7xato@public.gmane.org>
2017-05-31  4:04       ` Leon Romanovsky
     [not found]         ` <20170531040437.GE5406-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-05-31 17:42           ` Shiraz Saleem
     [not found]             ` <20170531174245.GA16304-GOXS9JX10wfOxmVO0tvppfooFf0ArEBIu+b9c/7xato@public.gmane.org>
2017-05-31 17:46               ` Steve Wise
2017-05-31 18:20                 ` Leon Romanovsky
     [not found]                   ` <20170531182050.GL5406-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-05-31 18:34                     ` Steve Wise
2017-05-31 20:06                       ` Bart Van Assche
2017-05-31 20:10               ` Bart Van Assche
     [not found]                 ` <1496261429.2608.15.camel-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2017-06-02 16:28                   ` Shiraz Saleem
     [not found]                     ` <20170602162849.GA28660-GOXS9JX10wfOxmVO0tvppfooFf0ArEBIu+b9c/7xato@public.gmane.org>
2017-06-03 13:02                       ` Bart Van Assche
2017-06-04  5:36                       ` Leon Romanovsky
     [not found]                         ` <20170604053635.GD6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-05  2:23                           ` Chien Tin Tung
     [not found]                             ` <20170605022313.GB18172-TZeIlv3TuzOfrEmaQUPKxl95YUYmaKo1UNDiOz3kqAs@public.gmane.org>
2017-06-05  4:00                               ` Leon Romanovsky
     [not found]                                 ` <20170605040030.GG6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-05  4:20                                   ` Chien Tin Tung
     [not found]                                     ` <20170605042007.GA19068-TZeIlv3TuzOfrEmaQUPKxl95YUYmaKo1UNDiOz3kqAs@public.gmane.org>
2017-06-05  4:50                                       ` Chien Tin Tung
     [not found]                                         ` <20170605045043.GA17148-TZeIlv3TuzOfrEmaQUPKxl95YUYmaKo1UNDiOz3kqAs@public.gmane.org>
2017-06-05  6:03                                           ` Leon Romanovsky
     [not found]                                             ` <20170605060318.GH6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-05 15:08                                               ` Doug Ledford
     [not found]                                                 ` <1496675296.7171.179.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-06-06 18:17                                                   ` Chien Tin Tung
2017-06-05 14:30                               ` Doug Ledford
2017-06-05 14:29                           ` Doug Ledford
2017-06-05 14:27                       ` Doug Ledford
2017-06-01  4:10               ` Leon Romanovsky
     [not found]                 ` <20170601041022.GM5406-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-02 16:21                   ` Chien Tin Tung
     [not found]                     ` <20170602162103.GA12468-TZeIlv3TuzOfrEmaQUPKxl95YUYmaKo1UNDiOz3kqAs@public.gmane.org>
2017-06-04  5:31                       ` Leon Romanovsky
     [not found]                         ` <20170604053123.GC6868-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-06-05  2:21                           ` Chien Tin Tung
2017-06-05 14:55               ` Doug Ledford
     [not found]                 ` <1496674541.7171.168.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-06-05 17:32                   ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).