We've made the silly mistake of writing several bpf programs (each group wrote one) to later figure out we cannot attach more than one at the same time. Now we want to redesign and make each group have their own AF_XDP socket and the eBPF program will send data to the right one based on destination ip&port (we're talking UDP RX only).
So my question is how would you go about it? we figured using BPF_MAP_TYPE_HASH to keep the (ip,port) as key and the value will be a key to the BPF_MAP_TYPE_XSKMAP map. Are there other better ways? would you stick with one AF_XDP socket and let the user-space make the distinguish between ports or would you let each user define their own socket with their own umem limitations?
Thanks and sorry for the strange question. the whole XDP and AF_XDP is a bit.. overwhelming.. so want to make sure we're not doing another silly mistake that it might be harder to find.