Open thediveo opened 1 year ago
Hi @thediveo The little purple square on the diagram is not a UDS client, it's just representing the actual UDS socket file.
The uds
package is just for basic read/write/dial/listen functions. The udsserver
imports uds
and implements the little server we have for handing over the XSK Map file descriptor to the containerised workload, allowing the workload to go on and create the AF_XDP socket. This handover involves a little "handshake" across the UDS.
I think what you're asking for is a udsclient
that you can import into your code and would it perform the "handshake" for you. I'm afraid this does not exist, though it's a really nice idea, I like it.
So, at least for the moment, without such client, your workload has to perform the "handshake" itself. This entire list of calls in the handshake can be found here.
Not all calls are necessary. The main ones are:
/connect, hostname
where hostname is the name of your pod - $HOSTNAME within your pod/host_ok
response/xsk_map_fd, dev
where dev is the network device you want the FD for. This can be called multiple times for pods with multiple netdevs attached./fd_ack
and the XSK FD will be contained in the control buffer part of this message./fin
will close the uds connectionYou can see some of this implemented in our little end-to-end test here and the CNDP project implement it (in C code) in the uds files here.
KR, Gary
@patrickog11 @davecremins @maryamtahhan thoughts on the client idea? A package that folks could import into their code and it would do the handshake for them.
Thanks for the responses!
@garyloug the client package idea makes sense to help out folks that aren't using c based solutions for sure.
@thediveo the fd passed is the fd for the xskmap. The pod owns the whole netdev once it's in the Pod network namespace and there's one xskmap per device. So if it (the pod) needs to create and open multiple af_xdp sockets it's free to do so once it has reference to the map.
actually, I was looking to the C client to use as I would suspect many people to head for C when dealing with XSKs on the data plane.
I've browsed a little bit through the repo source code and I've seen the internal
udsserver
anduds
packages. Theuds
package seems to be the part I've marked in the above illustration, taken from the documentation in this repository.What I don't understand yet and haven't found any explicit documentation or examples (if I'm not mistaken): how do I now use this in my container workload, how do I integrate the UDS client into my own workload code?