I'm playing with F-stack and DPDK. It seems to me that the DPDK driver (igb_uio) doesn't strip the ethernet padding bytes when they are present. The F-stack glue code also doesn't seem to strip them. As a result the FreeBSD stack "thinks" that it receives data and reports them to the application layer. Just for a context: The padding bytes are needed when the ethernet frame is smaller than 64 bytes (https://wiki.wireshark.org/Ethernet).
Here is an example which happens to me:
I'm running F-stack epoll based server.
The client is running on Linux machine but with all TCP options turned off. Most importantly the
TCP timestamps are turned off. This important for the situation to be reproduced because this way
the packets become with the smallest possible size.
The clients sends request to the server and receives the response. So far so good. The size of the pure TCP ACK packets is smaller than the minumum ethernet size but due to the specific code in freebsd/netinet/tcp_input.c the padding bytes don't cause problems.
However when the client closes the connection it sends FIN+ACK packet. This packet looks in the following way
<Ethernet header 14 bytes><IP header 20 bytes><TCP header 20 bytes><Ethernet padding bytes 6 bytes>
and the FreeBSD stack "sees" m->m_len equal to 6 bytes after all headers are stripped and appends these bytes as received data and reports them to the application layer.
I'm not sure where is the best place these bytes to be stripped. Probably somewhere in ff_dpdk_if.c or ff_veth.c before the packet is given to the FreeBSD stack. What do you think?
Hi there,
I'm playing with F-stack and DPDK. It seems to me that the DPDK driver (igb_uio) doesn't strip the ethernet padding bytes when they are present. The F-stack glue code also doesn't seem to strip them. As a result the FreeBSD stack "thinks" that it receives data and reports them to the application layer. Just for a context: The padding bytes are needed when the ethernet frame is smaller than 64 bytes (https://wiki.wireshark.org/Ethernet).
Here is an example which happens to me:
m->m_len
equal to 6 bytes after all headers are stripped and appends these bytes as received data and reports them to the application layer.I'm not sure where is the best place these bytes to be stripped. Probably somewhere in ff_dpdk_if.c or ff_veth.c before the packet is given to the FreeBSD stack. What do you think?
Regards, Pavel.