All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chrissie Caulfield <ccaulfie@redhat.com>
To: Steven Whitehouse <swhiteho@redhat.com>
Cc: netdev@vger.kernel.org
Subject: Re: decnet: Use data ready call back, rather than hand coding it
Date: Mon, 11 May 2009 09:33:54 +0100	[thread overview]
Message-ID: <4A07E2F2.6050807@redhat.com> (raw)
In-Reply-To: <1241800225.29604.282.camel@localhost.localdomain>

Steven Whitehouse wrote:
> Chrissie, can you test this? I don't have a suitable set up at the
> moment. This should be correct though since its taken directly from
> sock_queue_rcv_skb from whence the original code was also take in times
> past. I did compile test it though.
> 
> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
> 
> 
> diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
> index 5d8a2a5..932408d 100644
> --- a/net/decnet/dn_nsp_in.c
> +++ b/net/decnet/dn_nsp_in.c
> @@ -578,6 +578,7 @@ out:
>  static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig, struct sk_buff_head *queue)
>  {
>  	int err;
> +	int skb_len;
>  
>  	/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
>  	   number of warnings when compiling with -W --ANK
> @@ -592,22 +593,12 @@ static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig
>  	if (err)
>  		goto out;
>  
> +	skb_len = skb->len;
>  	skb_set_owner_r(skb, sk);
>  	skb_queue_tail(queue, skb);
>  
> -	/* This code only runs from BH or BH protected context.
> -	 * Therefore the plain read_lock is ok here. -DaveM
> -	 */
> -	read_lock(&sk->sk_callback_lock);
> -	if (!sock_flag(sk, SOCK_DEAD)) {
> -		struct socket *sock = sk->sk_socket;
> -		wake_up_interruptible(sk->sk_sleep);
> -		if (sock && sock->fasync_list &&
> -		    !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags))
> -			__kill_fasync(sock->fasync_list, sig,
> -				    (sig == SIGURG) ? POLL_PRI : POLL_IN);
> -	}
> -	read_unlock(&sk->sk_callback_lock);
> +	if (!sock_flag(sk, SOCK_DEAD))
> +		sk->sk_data_ready(sk, skb_len);
>  out:
>  	return err;
>  }


ACK

The patch works fine for me.

Chrissie

      parent reply	other threads:[~2009-05-11  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-08 16:30 decnet: Use data ready call back, rather than hand coding it Steven Whitehouse
2009-05-09 20:18 ` David Miller
2009-05-11  8:33 ` Chrissie Caulfield [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=4A07E2F2.6050807@redhat.com \
    --to=ccaulfie@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=swhiteho@redhat.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.