packet: vnet_hdr support for tpacket_rcv
authorWillem de Bruijn <willemb@google.com>
Wed, 3 Feb 2016 23:02:15 +0000 (18:02 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Feb 2016 11:43:50 +0000 (06:43 -0500)
commit58d19b19cd99b438541eea4cdbf5c171900b25e5
treeb138b60ee1048ad9c03900d97a6ca87b7d3cce64
parent16cc1400456a4d5d6df9f5e7f1b2c7cb8c50404b
packet: vnet_hdr support for tpacket_rcv

Support socket option PACKET_VNET_HDR together with PACKET_RX_RING.
When enabled, a struct virtio_net_hdr will precede the data in the
packet ring slots.

Verified with test program at
github.com/wdebruij/kerneltools/blob/master/tests/psock_rxring_vnet.c

  pkt: 1454269209.798420 len=5066
  vnet: gso_type=tcpv4 gso_size=1448 hlen=66 ecn=off
  csum: start=34 off=16
  eth: proto=0x800
  ip: src=<masked> dst=<masked> proto=6 len=5052

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c