Open lstipakov opened 1 week ago
How does Unix-DCO deal with this? Send CC messages directly over the socket, hand over peer ID, or sockaddr? @schwabe?
My understanding is that in Linux socket descriptor is shared between user/kernel. For instance, userspace calls recvfrom()
in link_socket_read_udp_posix()
and gets both UDP payload and sockaddr, which it copies to c->c2.from
. In Windows sockets cannot be shared, so we prepend payload with sockaddr instead. @ordex
Correct: Linux userspace does not even know there is DCO when reading/writing CC packets. Everything happens over the socket as usual. It's DCO in kernel that does some magic to make this happen transparently. (Originally we used netlink, but we dropped that approach)
@lstipakov why not using just the peer ID instead of the whole sockaddr?
Because there might be no peers yet when CC messages are exchanged.
In that case there is only the server socket open. Is that under win-dco control?
Yep, the socket exist only in the driver and is controlled by the driver via Winsock Kernel API. Userspace can read/write by using standard IO API on the driver handle. The driver handles IO requests and proxies them to the socket.
Ok, I thought this happened only for peer sockets, but in UDP it's just the same
In MP mode, the driver doesn't know to which peer it should send CC message. For that, userspace prepends the write payload with the sockaddr, containing the address of the remote peer. DCO passes this to WskSendMessages/WskSendTo.