diff options
author | Paul Chavent <Paul.Chavent@onera.fr> | 2012-11-06 23:10:47 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-07 18:54:30 -0500 |
commit | 5920cd3a41f1aefc30e9ce86384fc2fe9f5fe0c0 (patch) | |
tree | cecc965a19e1ffe6957d8dcf2e55566562f93e0c /include | |
parent | 7da716aee2532399e213a14f656d304098f67a11 (diff) | |
download | linux-5920cd3a41f1aefc30e9ce86384fc2fe9f5fe0c0.tar.bz2 |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/uapi/linux/if_packet.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h index f3799295d231..f9a60375f0d0 100644 --- a/include/uapi/linux/if_packet.h +++ b/include/uapi/linux/if_packet.h @@ -50,6 +50,7 @@ struct sockaddr_ll { #define PACKET_TX_TIMESTAMP 16 #define PACKET_TIMESTAMP 17 #define PACKET_FANOUT 18 +#define PACKET_TX_HAS_OFF 19 #define PACKET_FANOUT_HASH 0 #define PACKET_FANOUT_LB 1 |