[CRIU] [PATCH 00/12] Support for packet's msg_name in receive queue of promiscous DGRAM sockets

Kirill Tkhai ktkhai at virtuozzo.com
Wed May 4 03:37:01 PDT 2016


Compilation and test issues are the tenth business.

I better would be happy to hear comments about algorithm of senders resolving,
searching an unique of them (patches 5-7), and choosing the right socket to
send a packet (patch 12).

Does anybody have ideas about optimizations here?

Thanks

On 29.04.2016 17:34, Kirill Tkhai wrote:
> DGRAM packet, received using recvmsg, have msghdr populated:
> 
> recvmsg(int sockfd, struct msghdr *msg, int flags)
> 
> struct msghdr {
> 	void		*msg_name;
> 	int		msg_namelen;
> 	...
> };
> 
> msg_name and msg_namelen contain the name of the sender of packet,
> which it's bound to.
> 
> Currently, we do not support this. We restore the whole queue with
> the only sender (the receiver is peer for it, but there may be several
> senders), or with empty sender.
> 
> This series add a support for "promiscous" receive queues and restore
> them correct.
> 
> To do that, we determine sockets, which queue has several senders, and
> senders, who are involved it there. Sender's fds are sent to receives,
> and receivers restore their queues it correct order and with correct
> msg_names.
> 
> This patchset should have a sequel, which introduces "ghost sockets",
> that are not supported there. Their packets are restored as having
> noname senders now.
> 
> ---
> 
> Kirill Tkhai (12):
>       unix: Link all sockets in unix_sockets list
>       unix: Add find_unix_sk_by_name()
>       unix: Add sender_ino of packets and socket
>       sk-queue: Allow to dump a skb sender
>       unix: Dump DGRAM packets and sockets senders
>       unix: Fixup queuer of promiscuous DGRAM receivers
>       unix: Resolve senders of packets in receive queue of DGRAM socket
>       files: Add file_desc_ops::receive method
>       files: Add get_unused_fd() helper
>       unix: Send senders fds of packets in receive queue to receiver
>       sk-queue: Allow to use several file descriptors to restore a queue
>       unix: Add a method for choosing sender of packet in promiscous DGRAM queue
> 
> 
>  criu/cr-restore.c       |    2 
>  criu/files.c            |  102 +++++++++++++++
>  criu/include/files.h    |   12 ++
>  criu/include/image.h    |    2 
>  criu/include/pstree.h   |    1 
>  criu/include/sk-queue.h |   15 ++
>  criu/sk-queue.c         |  146 ++++++++++++++++++++-
>  criu/sk-unix.c          |  322 ++++++++++++++++++++++++++++++++++++++++++++---
>  images/sk-packet.proto  |    1 
>  images/sk-unix.proto    |    2 
>  10 files changed, 567 insertions(+), 38 deletions(-)
> 
> --
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> 


More information about the CRIU mailing list