All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevich@gmail.com>
To: Neil Horman <nhorman@tuxdriver.com>, linux-sctp@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Daniel Borkmann <dborkman@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] sctp: add support for busy polling to sctp protocol
Date: Thu, 17 Apr 2014 21:37:29 +0000	[thread overview]
Message-ID: <53504999.4080709@gmail.com> (raw)
In-Reply-To: <1397762811-2989-1-git-send-email-nhorman@tuxdriver.com>

On 04/17/2014 03:26 PM, Neil Horman wrote:
> The busy polling socket option adds support for sockets to busy wait on data
> arriving on the napi queue from which they have most recently received a frame.
> Currently only tcp and udp support this feature, but theres no reason sctp can't
> do so as well.  Add it in so appliations can take advantage of it
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Vlad Yasevich <vyasevich@gmail.com>
> CC: "David S. Miller" <davem@davemloft.net>
> CC: Daniel Borkmann <dborkman@redhat.com>
> CC: netdev@vger.kernel.org

Hi Neil

Do we gain anything by polling?
This is probably more appropriate for net-next...

Acked-by: Vlad Yasevich <vyasevich@gmail.com>

Thanks
-vlad

> ---
>  net/sctp/socket.c   | 5 +++++
>  net/sctp/ulpqueue.c | 4 ++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 981aaf8..9788e07 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -71,6 +71,7 @@
>  #include <net/route.h>
>  #include <net/ipv6.h>
>  #include <net/inet_common.h>
> +#include <net/busy_poll.h>
>  
>  #include <linux/socket.h> /* for sa_family_t */
>  #include <linux/export.h>
> @@ -6553,6 +6554,10 @@ static struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags,
>  		if (sk->sk_shutdown & RCV_SHUTDOWN)
>  			break;
>  
> +		if (sk_can_busy_loop(sk) &&
> +		    sk_busy_loop(sk, noblock))
> +			continue;
> +
>  		/* User doesn't want to wait.  */
>  		error = -EAGAIN;
>  		if (!timeo)
> diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
> index 5dc9411..a4df012 100644
> --- a/net/sctp/ulpqueue.c
> +++ b/net/sctp/ulpqueue.c
> @@ -38,6 +38,7 @@
>  #include <linux/types.h>
>  #include <linux/skbuff.h>
>  #include <net/sock.h>
> +#include <net/busy_poll.h>
>  #include <net/sctp/structs.h>
>  #include <net/sctp/sctp.h>
>  #include <net/sctp/sm.h>
> @@ -204,6 +205,9 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
>  	if (sock_flag(sk, SOCK_DEAD) || (sk->sk_shutdown & RCV_SHUTDOWN))
>  		goto out_free;
>  
> +	if (!sctp_ulpevent_is_notification(event))
> +		sk_mark_napi_id(sk, skb);
> +
>  	/* Check if the user wishes to receive this event.  */
>  	if (!sctp_ulpevent_is_enabled(event, &sctp_sk(sk)->subscribe))
>  		goto out_free;
> 


WARNING: multiple messages have this Message-ID (diff)
From: Vlad Yasevich <vyasevich@gmail.com>
To: Neil Horman <nhorman@tuxdriver.com>, linux-sctp@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Daniel Borkmann <dborkman@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] sctp: add support for busy polling to sctp protocol
Date: Thu, 17 Apr 2014 17:37:29 -0400	[thread overview]
Message-ID: <53504999.4080709@gmail.com> (raw)
In-Reply-To: <1397762811-2989-1-git-send-email-nhorman@tuxdriver.com>

On 04/17/2014 03:26 PM, Neil Horman wrote:
> The busy polling socket option adds support for sockets to busy wait on data
> arriving on the napi queue from which they have most recently received a frame.
> Currently only tcp and udp support this feature, but theres no reason sctp can't
> do so as well.  Add it in so appliations can take advantage of it
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Vlad Yasevich <vyasevich@gmail.com>
> CC: "David S. Miller" <davem@davemloft.net>
> CC: Daniel Borkmann <dborkman@redhat.com>
> CC: netdev@vger.kernel.org

Hi Neil

Do we gain anything by polling?
This is probably more appropriate for net-next...

Acked-by: Vlad Yasevich <vyasevich@gmail.com>

Thanks
-vlad

> ---
>  net/sctp/socket.c   | 5 +++++
>  net/sctp/ulpqueue.c | 4 ++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 981aaf8..9788e07 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -71,6 +71,7 @@
>  #include <net/route.h>
>  #include <net/ipv6.h>
>  #include <net/inet_common.h>
> +#include <net/busy_poll.h>
>  
>  #include <linux/socket.h> /* for sa_family_t */
>  #include <linux/export.h>
> @@ -6553,6 +6554,10 @@ static struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags,
>  		if (sk->sk_shutdown & RCV_SHUTDOWN)
>  			break;
>  
> +		if (sk_can_busy_loop(sk) &&
> +		    sk_busy_loop(sk, noblock))
> +			continue;
> +
>  		/* User doesn't want to wait.  */
>  		error = -EAGAIN;
>  		if (!timeo)
> diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
> index 5dc9411..a4df012 100644
> --- a/net/sctp/ulpqueue.c
> +++ b/net/sctp/ulpqueue.c
> @@ -38,6 +38,7 @@
>  #include <linux/types.h>
>  #include <linux/skbuff.h>
>  #include <net/sock.h>
> +#include <net/busy_poll.h>
>  #include <net/sctp/structs.h>
>  #include <net/sctp/sctp.h>
>  #include <net/sctp/sm.h>
> @@ -204,6 +205,9 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
>  	if (sock_flag(sk, SOCK_DEAD) || (sk->sk_shutdown & RCV_SHUTDOWN))
>  		goto out_free;
>  
> +	if (!sctp_ulpevent_is_notification(event))
> +		sk_mark_napi_id(sk, skb);
> +
>  	/* Check if the user wishes to receive this event.  */
>  	if (!sctp_ulpevent_is_enabled(event, &sctp_sk(sk)->subscribe))
>  		goto out_free;
> 

  reply	other threads:[~2014-04-17 21:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 19:26 [PATCH] sctp: add support for busy polling to sctp protocol Neil Horman
2014-04-17 19:26 ` Neil Horman
2014-04-17 21:37 ` Vlad Yasevich [this message]
2014-04-17 21:37   ` Vlad Yasevich
2014-04-18 11:53   ` Neil Horman
2014-04-18 11:53     ` Neil Horman
2014-04-18  9:39 ` Daniel Borkmann
2014-04-18  9:39   ` Daniel Borkmann
2014-04-20 22:20 ` David Miller
2014-04-20 22:20   ` David Miller

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=53504999.4080709@gmail.com \
    --to=vyasevich@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    /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.