Hello Toke, thanks for the response. I do not think that it is the case.The interface I am trying to share is outgoing for xdpbridge and incoming for xdp_bridge_map.
xdpbridge does not load xdp program for outgoing interface (while loads for incoming).
xdp_bridge_map loads dummy XDP program for outgoing redirect, while it is Ok if it is already exists.
It seems that if I use different queues for incoming and outgoing packets, everything is Ok, while I am not 100% sure yet. Does it look realistic?
On 10.09.2019 17:21, Toke Høiland-Jørgensen wrote:
Ilya Goslhtein <ilejn@xxxxxxxxx> writes:Hello, I am trying to use a network interface to (1) send packets via AF_XDP (2) receive packets and redirect to another interface via xdp_redirect_map Basically, I am making xdpbridge https://github.com/ilejn/xdpbridge. bidirectional. My goal is to process packets in one direction in kernelspace (xdp_redirect_map) and to pass packets in opposite direction via userspace (recieve via AF_XDP then send via AF_XDP, rings are not shared, so I perform memcpy). For test purposes I ran two applications: my xdpbridge and xdp_redirect_map bpf sample. It does not work. Only few packets are received, then the thing stops. Redirecting works until xdpbridge does 'bind' against the interface.This is because the AF_XDP application loads another XDP program on the interface that redirects the traffic into the socket. It is possible to write an XDP program that can do both (i.e., for each packet, decide whether to redirect it into the AF_XDP socket, or to another interface), but obviously none of the example programs know how to do this, so they end up stepping on each other's toes... -Toke
-- Best regards, Ilya Golshtein