The tx data offset of packet mmap tx ring used to be : (TPACKET2_HDRLEN - sizeof(struct sockaddr_ll)) The problem is that, with SOCK_RAW socket, the payload (14 bytes after the beginning of the user data) is misaligned. This patch allows to let the user gives an offset for it's tx data if he desires. Set sock option PACKET_TX_HAS_OFF to 1, then specify in each frame of your tx ring tp_net for SOCK_DGRAM, or tp_mac for SOCK_RAW.
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -50,6 +50,7 @@ struct sockaddr_ll { · 49 unmodified lines | ||
| 50 | 50 | #define PACKET_TX_TIMESTAMP 16 |
| 51 | 51 | #define PACKET_TIMESTAMP 17 |
| 52 | 52 | #define PACKET_FANOUT 18 |
| 53 | +#define PACKET_TX_HAS_OFF 19 | |
| 53 | 54 | |
| 54 | 55 | #define PACKET_FANOUT_HASH 0 |
| 55 | 56 | #define PACKET_FANOUT_LB 1 |