diff options
author | Sridhar Samudrala <sri@us.ibm.com> | 2010-02-04 23:24:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-04 23:24:10 -0500 |
commit | bfd5f4a3d605e0f6054df0b59fe0907ff7e696d3 (patch) | |
tree | 63d19326b491b507f246ea4c3ef410d62602e794 /include | |
parent | 746079dabcf74be2a16dc983ac597156e3d2e051 (diff) |
packet: Add GSO/csum offload support.
This patch adds GSO/checksum offload to af_packet sockets using
virtio_net_hdr. Based on Rusty's patch to add this support to tun.
It allows GSO/checksum offload to be enabled when using raw socket
backend with virtio_net.
Adds PACKET_VNET_HDR socket option to prepend virtio_net_hdr in the
receive path and process/skip virtio_net_hdr in the send path. This
option is only allowed with SOCK_RAW sockets attached to ethernet
type devices.
v2 updates
----------
Michael's Comments
- Perform length check in packet_snd() when GSO is off even when
vnet_hdr is present.
- Check for SKB_GSO_FCOE type and return -EINVAL
- don't allow tx/rx ring when vnet_hdr is enabled.
Herbert's Comments
- Removed ethernet specific code.
- protocol value is assumed to be passed in by the caller.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if_packet.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index 4021d47cc437..aa57a5f993fc 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
@@ -46,6 +46,7 @@ struct sockaddr_ll { | |||
46 | #define PACKET_RESERVE 12 | 46 | #define PACKET_RESERVE 12 |
47 | #define PACKET_TX_RING 13 | 47 | #define PACKET_TX_RING 13 |
48 | #define PACKET_LOSS 14 | 48 | #define PACKET_LOSS 14 |
49 | #define PACKET_VNET_HDR 15 | ||
49 | 50 | ||
50 | struct tpacket_stats { | 51 | struct tpacket_stats { |
51 | unsigned int tp_packets; | 52 | unsigned int tp_packets; |