From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
e1000-rdma-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Mustafa Ismail
<mustafa.ismail-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] Add flow control to the portmapper
Date: Sat, 16 Jul 2016 09:37:12 +0300 [thread overview]
Message-ID: <20160716063712.GC10556@leon.nu> (raw)
In-Reply-To: <1468601997-63396-1-git-send-email-shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2688 bytes --]
On Fri, Jul 15, 2016 at 11:59:57AM -0500, Shiraz Saleem wrote:
> From: Mustafa Ismail <mustafa.ismail-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> Add flow control to port-mapper by changing ibnl unicast
> to use netlink messaging with blocking.
Please add justification why you need it, what the problem you are
solving and why it deserves adding new inline function to
include/net/netlink.h file.
>
> Signed-off-by: Faisal Latif <faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Mustafa Ismail <mustafa.ismail-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Shiraz Saleem <shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> drivers/infiniband/core/netlink.c | 4 ++--
> include/net/netlink.h | 17 +++++++++++++++++
> 2 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c
> index 9b8c20c..6b09580 100644
> --- a/drivers/infiniband/core/netlink.c
> +++ b/drivers/infiniband/core/netlink.c
> @@ -229,7 +229,7 @@ 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);
> + return nlmsg_unicast_block(nls, skb, pid);
> }
> EXPORT_SYMBOL(ibnl_unicast);
>
> @@ -251,7 +251,7 @@ int __init ibnl_init(void)
> pr_warn("Failed to create netlink socket\n");
> return -ENOMEM;
> }
> -
> + nls->sk_sndtimeo = 10 * HZ;
> return 0;
> }
>
> diff --git a/include/net/netlink.h b/include/net/netlink.h
> index 254a0fc..5434279 100644
> --- a/include/net/netlink.h
> +++ b/include/net/netlink.h
> @@ -598,6 +598,23 @@ static inline int nlmsg_unicast(struct sock *sk, struct sk_buff *skb, u32 portid
> }
>
> /**
> + * nlmsg_unicast_block - unicast a netlink message with blocking
> + * @sk: netlink socket to spread message to
> + * @skb: netlink message as socket buffer
> + * @portid: netlink portid of the destination socket
> + */
> +static inline int nlmsg_unicast_block(struct sock *sk, struct sk_buff *skb, u32 portid)
> +{
> + int err;
> +
> + err = netlink_unicast(sk, skb, portid, 0);
> + if (err > 0)
> + err = 0;
> +
> + return err;
> +}
> +
> +/**
> * nlmsg_for_each_msg - iterate over a stream of messages
> * @pos: loop counter, set to current message
> * @head: head of message stream
> --
> 2.8.0
>
> --
> 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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2016-07-16 6:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 16:59 [PATCH] Add flow control to the portmapper Shiraz Saleem
[not found] ` <1468601997-63396-1-git-send-email-shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-07-16 6:37 ` Leon Romanovsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160716063712.GC10556@leon.nu \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=e1000-rdma-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mustafa.ismail-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=shiraz.saleem-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.