Lines Matching refs:vnet_hdr
2004 struct virtio_net_hdr vnet_hdr; in packet_rcv_vnet() local
2006 if (*len < sizeof(vnet_hdr)) in packet_rcv_vnet()
2008 *len -= sizeof(vnet_hdr); in packet_rcv_vnet()
2010 if (virtio_net_hdr_from_skb(skb, &vnet_hdr, vio_le(), true, 0)) in packet_rcv_vnet()
2013 return memcpy_to_msg(msg, (void *)&vnet_hdr, sizeof(vnet_hdr)); in packet_rcv_vnet()
2416 static int __packet_snd_vnet_parse(struct virtio_net_hdr *vnet_hdr, size_t len) in __packet_snd_vnet_parse() argument
2418 if ((vnet_hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) && in __packet_snd_vnet_parse()
2419 (__virtio16_to_cpu(vio_le(), vnet_hdr->csum_start) + in __packet_snd_vnet_parse()
2420 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_offset) + 2 > in __packet_snd_vnet_parse()
2421 __virtio16_to_cpu(vio_le(), vnet_hdr->hdr_len))) in __packet_snd_vnet_parse()
2422 vnet_hdr->hdr_len = __cpu_to_virtio16(vio_le(), in __packet_snd_vnet_parse()
2423 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_start) + in __packet_snd_vnet_parse()
2424 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_offset) + 2); in __packet_snd_vnet_parse()
2426 if (__virtio16_to_cpu(vio_le(), vnet_hdr->hdr_len) > len) in __packet_snd_vnet_parse()
2433 struct virtio_net_hdr *vnet_hdr) in packet_snd_vnet_parse() argument
2435 if (*len < sizeof(*vnet_hdr)) in packet_snd_vnet_parse()
2437 *len -= sizeof(*vnet_hdr); in packet_snd_vnet_parse()
2439 if (!copy_from_iter_full(vnet_hdr, sizeof(*vnet_hdr), &msg->msg_iter)) in packet_snd_vnet_parse()
2442 return __packet_snd_vnet_parse(vnet_hdr, *len); in packet_snd_vnet_parse()
2599 struct virtio_net_hdr *vnet_hdr = NULL; in tpacket_snd() local
2672 vnet_hdr = data; in tpacket_snd()
2673 data += sizeof(*vnet_hdr); in tpacket_snd()
2674 tp_len -= sizeof(*vnet_hdr); in tpacket_snd()
2676 __packet_snd_vnet_parse(vnet_hdr, tp_len)) { in tpacket_snd()
2681 vnet_hdr->hdr_len); in tpacket_snd()
2719 if (virtio_net_hdr_to_skb(skb, vnet_hdr, vio_le())) { in tpacket_snd()
2723 virtio_net_hdr_set_proto(skb, vnet_hdr); in tpacket_snd()
2804 struct virtio_net_hdr vnet_hdr = { 0 }; in packet_snd() local
2848 err = packet_snd_vnet_parse(msg, &len, &vnet_hdr); in packet_snd()
2863 if (!vnet_hdr.gso_type && in packet_snd()
2870 linear = __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len); in packet_snd()
2903 if (!vnet_hdr.gso_type && (len > dev->mtu + reserve + extra_len) && in packet_snd()
2916 err = virtio_net_hdr_to_skb(skb, &vnet_hdr, vio_le()); in packet_snd()
2919 len += sizeof(vnet_hdr); in packet_snd()
2920 virtio_net_hdr_set_proto(skb, &vnet_hdr); in packet_snd()