packet: tx_ring: allow the user to choose tx data offset
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. Signed-off-by: Paul Chavent <paul.chavent@onera.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
7da716aee2
commit
5920cd3a41
@ -109,6 +109,7 @@ struct packet_sock {
|
||||
unsigned int tp_hdrlen;
|
||||
unsigned int tp_reserve;
|
||||
unsigned int tp_loss:1;
|
||||
unsigned int tp_tx_has_off:1;
|
||||
unsigned int tp_tstamp;
|
||||
struct packet_type prot_hook ____cacheline_aligned_in_smp;
|
||||
};
|
||||
|
Reference in New Issue
Block a user