• Willem de Bruijn's avatar
    packet: vnet_hdr support for tpacket_rcv · 58d19b19
    Willem de Bruijn authored
    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: default avatarWillem de Bruijn <willemb@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    58d19b19
af_packet.c 105 KB