I have written an application using AF_XDP sockets on eth0, currently all packets are received on the interface are received by the AF_XDP application (single queue nic). The application filters packet of specific port number all other packet are reinjected into linux network stack using a tap interface tap0. I am pushing the packets back in with tap, but finding that nothing gets delivered to other applications. The tcpdump shows that packet are received at the tap interface. I am assuming the packet received at the tap interface will be handled by the network stack and they will go through regular network stack to reach regular AF_INET socket created on eth0.
I also tried disabling rp_filter but got no success. Any suggestions what I am doing wrong here.
The problem with my case was that after receiving packet from AF_XDP socket I was writting it to TAP interface assuming that the packet will be injected into the kernel. But in my case the kernel was dropping the packet since the MAC address of packet is not same as the MAC address of TAP interface.
There were two solution to this problem. One to modify to packet eth_dst to broadcast address or set the TAP interface in promiscious mode. Things worked fine after that.
Also the rp_filter also needs to disabled otherwise packet will dropped at IP layer.