Re: [PATCH] datagram: Extend the datagram queue MSG_PEEK-ing |
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH] datagram: Extend the datagram queue MSG_PEEK-ing
- From: Pavel Emelyanov <xemul@xxxxxxxxxxxxx>
- Date: Fri, 10 Feb 2012 18:52:16 +0400
- Cc: David Miller <davem@xxxxxxxxxxxxx>, Tejun Heo <tj@xxxxxxxxxx>, Linux Netdev List <netdev@xxxxxxxxxxxxxxx>
- In-reply-to: <1328884902.2443.29.camel@edumazet-laptop>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0
On 02/10/2012 06:41 PM, Eric Dumazet wrote:
> Le vendredi 10 février 2012 à 17:54 +0400, Pavel Emelyanov a écrit :
>> We're working on the checkpoint-restore project. To checkpoint a unix socket
>> we need to read its skb queue. Analogous task for TCP sockets Tejun proposed
>> to solve with parasite + recvmsg + MSG_PEEK. That's nice, but doesn't work
>> for unix sockets, because for them MSG_PEEK always peeks a single skb from the
>> head of the queue.
>>
>> I propose to extend the MSG_PEEK functionality with two more flags that peek
>> either next not picked skb in queue or pick the last picked one. The latter
>> ability is required to make it possible to re-read a message if MSG_TRUNC
>> was reported on it.
>>
>> These two flags can be used for unix stream sockets, since making the MSG_PEEK
>> just report all data that fits the buffer length is bad -- we may have scms
>> in queue thus turning stream socket into dgram one.
>>
>> Signed-off-by: Pavel Emelyanov <xemul@xxxxxxxxxxxxx>
>>
>> ---
>
> Nice !
>
> So this CR stuff assumes an application wont use itself MSG_PEEK /
> MORE / AGAIN ?
:( Not exactly. MSG_PEEK will still work, but PEEK_MORE/PEEK_AGAIN will not.
Hm... This means that the state of "what was peek-ed already" should be on
the user side. Can we pass some "offset" (in bytes for stream and in packets
for datagram) to the recvmsg?
> (skb->peeked can only be set, never unset)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Kernel Discussion]
[Ethernet Bridging]
[Linux Wireless Networking]
[Linux Bluetooth Networking]
[Linux Networking Users]
[VLAN]
[Git]
[IETF Annouce]
[Linux Assembly]
[Security]
[Bugtraq]
[Photo]
[Singles Social Networking]
[Yosemite Information]
[MIPS Linux]
[ARM Linux Kernel]
[ARM Linux]
[Linux Virtualization]
[Linux Security]
[Linux IDE]
[Linux RAID]
[Linux SCSI]
[Free Dating]