Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Pavel Emelyanov <xemul@parallels.com>
Cc: David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH 4/6] sock: Introduce the SO_PEEK_OFF sock option
Date: Tue, 21 Feb 2012 18:45:50 +0100	[thread overview]
Message-ID: <1329846350.18384.25.camel@edumazet-laptop> (raw)
In-Reply-To: <4F43D4F6.6030104@parallels.com>

Le mardi 21 février 2012 à 21:31 +0400, Pavel Emelyanov a écrit :
> This one specifies where to start MSG_PEEK-ing queue data from. When
> set to negative value means that MSG_PEEK works as ususally -- peeks
> from the head of the queue always.
> 
> When some bytes are peeked from queue and the peeking offset is non
> negative it is moved forward so that the next peek will return next
> portion of data.
> 
> When non-peeking recvmsg occurs and the peeking offset is non negative
> is is moved backward so that the next peek will still peek the proper
> data (i.e. the one that would have been picked if there were no non
> peeking recv in between).
> 
> The offset is set using per-proto opteration to let the protocol handle
> the locking issues and to check whether the peeking offset feature is
> supported by the protocol the socket belongs to.
> 
> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
> 
> ---
>  include/asm-generic/socket.h |    1 +
>  include/linux/net.h          |    1 +
>  include/net/sock.h           |   25 +++++++++++++++++++++++++
>  net/core/sock.c              |   13 +++++++++++++
>  4 files changed, 40 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h
> index 49c1704..832c270 100644
> --- a/include/asm-generic/socket.h
> +++ b/include/asm-generic/socket.h
> @@ -66,5 +66,6 @@
>  #define SO_RXQ_OVFL             40
>  
>  #define SO_WIFI_STATUS		41
> +#define SO_PEEK_OFF		42
>  #define SCM_WIFI_STATUS	SO_WIFI_STATUS

small note : should be moved down by one line, after SCM_WIFI_STATUS

Other than that, 

  reply	other threads:[~2012-02-21 17:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 17:30 [PATCH net-next 0/6] Ability to peek full socket queue Pavel Emelyanov
2012-02-21 17:30 ` [PATCH 1/6] datagram: Factor out sk queue referencing Pavel Emelyanov
2012-02-21 17:39   ` Eric Dumazet
2012-02-21 20:04     ` David Miller
2012-02-21 17:30 ` [PATCH 2/6] datagram: Add offset argument to __skb_recv_datagram Pavel Emelyanov
2012-02-21 17:40   ` Eric Dumazet
2012-02-21 20:04     ` David Miller
2012-02-21 17:31 ` [PATCH 3/6] skb: Add skb_peek_next helper Pavel Emelyanov
2012-02-21 17:43   ` Eric Dumazet
2012-02-21 20:04     ` David Miller
2012-02-21 17:31 ` [PATCH 4/6] sock: Introduce the SO_PEEK_OFF sock option Pavel Emelyanov
2012-02-21 17:45   ` Eric Dumazet [this message]
2012-02-21 20:05     ` David Miller
2012-02-21 17:31 ` [PATCH 5/6] unix: Support peeking offset for datagram and seqpacket sockets Pavel Emelyanov
2012-02-21 17:49   ` Eric Dumazet
2012-02-21 20:05     ` David Miller
2012-02-21 17:32 ` [PATCH 6/6] unix: Support peeking offset for stream sockets Pavel Emelyanov
2012-02-21 17:51   ` Eric Dumazet
2012-02-21 20:05     ` 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=1329846350.18384.25.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@parallels.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox