Hi
I have narrowed down the problem of sending packets via the AF_PACKET/SOCK_RAW interface, which might be what DPDK does in coressonding PMD drivers. The problem does not seem to be related to DPDK codebase directly, but still can be interesting for the users who are trying to use DPDK with AF_PACKET driver inside a dockerized environment.
To reiterate the issue: Any UDP message sent via AF_PACKET/SOCK_RAW socket on one interface on virtual bridge, is not received by application listening on the other interface attached to the same bridge, however strangely enough it can be seen in tcpdump listening on the receiving interface. The application I used based on the example here [
https://www.kernel.org/doc/html/latest/_sources/networking/packet_mmap.rst.txt] but instead of receiving I added a loop for sending 5 pre-recorded L2 frames.
I am attaching the small project to easily reproduce the issue (assuming the MAC addresses are preserved between machines by the docker because the L2 packet is pre-recorded) .
------
The environment is two dockers (basic AlmaOS 8.5 having only network utils installed) attached to the same bridge. The environment is set up with docker-compose.
To reproduce the issue:
- make dockers and applications using Makefile and start the dockers.
make
docker-compose up
- in other window set up server in first docker:
docker exec -it client /bin/bash
nc -l -4 -u 192.168.2.1 5997
- in other window set up tcpdump to see the incoming packets on 5997 port:
docker exec -it client /bin/bash
tcpdump -vneA -i eth0 port 5997
- in other window send 5 messages via application then via netcat:
docker exec -it server /bin/bash
/share/a.out eth0 hash
printf "ok1\r\n" | nc -s 192.168.2.5 -p 5998 -u -4 192.168.2.1 5997
Observe that only packets sent by nc are received. Though there's no difference in L2 frame structure apart from identification and checksum (wrong for both cases).
The question is how can I debug the kernel to understand what makes it drop the packet and not to pass it to the application (netcat in this case).