On Thu, Jul 28, 2016 at 03:02:26PM -0500, Shiraz Saleem wrote:
quoted hunk
From: Mustafa Ismail <redacted>
During connection establishment with a large number of
connections, it is possible that the connection requests
might fail. Adding flow control prevents this failure.
Change ibnl_unicast to use blocking to enable flow control.
Signed-off-by: Mustafa Ismail <redacted>
Signed-off-by: Faisal Latif <redacted>
Signed-off-by: Shiraz Saleem <redacted>
---
V3: update to use blocking ver. of netlink_unicast() in
ibnl_unicast(), instead of creating new function in
netlink header for this purpose; as was done in V1.
V2: update commit message with justification for flow control.
CC'ing linux-netdev mailing list.
drivers/infiniband/core/netlink.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c
index 9b8c20c..a6b3acb 100644
--- a/drivers/infiniband/core/netlink.c
+++ b/drivers/infiniband/core/netlink.c
@@ -229,7 +229,13 @@ static void ibnl_rcv(struct sk_buff *skb)
int ibnl_unicast(struct sk_buff *skb, struct nlmsghdr *nlh,
__u32 pid)
{
- return nlmsg_unicast(nls, skb, pid);
+ int err;
+
+ err = netlink_unicast(nls, skb, pid, 0);
+ if (err > 0)
+ err = 0;
+
+ return err;
It can be simplified a little bit to remove number of lines.
4 last lines can be replaced to be one in ANSI C.
return (err < 0)?:0;