From: Willem de Bruijn <will...@google.com> Extend PACKET_VNET_HDR socket option support to packet sockets with memory mapped rings.
Patches 2 and 4 add support to tpacket_rcv and tpacket_snd. Patch 1 prepares for this by moving the relevant virtio_net_hdr logic out of packet_snd and packet_rcv into helper functions. GSO transmission requires all headers in the skb linear section. Patch 3 moves parsing of tx_ring slot headers before skb allocation to enable allocation with sufficient linear size. Changes v1->v2: - fix bounds checks: - subtract sizeof(vnet_hdr) before comparing tp_len to size_max - compare tp_len to size_max also with GSO, just do not truncate to MTU Willem de Bruijn (4): packet: move vnet_hdr code to helper functions packet: vnet_hdr support for tpacket_rcv packet: parse tpacket header before skb alloc packet: tpacket_snd gso and checksum offload net/packet/af_packet.c | 440 +++++++++++++++++++++++++++++-------------------- 1 file changed, 263 insertions(+), 177 deletions(-) -- 2.7.0.rc3.207.g0ac5344