Lines Matching refs:vnet_hdr
2063 struct virtio_net_hdr vnet_hdr; in packet_rcv_vnet() local
2065 if (*len < sizeof(vnet_hdr)) in packet_rcv_vnet()
2067 *len -= sizeof(vnet_hdr); in packet_rcv_vnet()
2069 if (virtio_net_hdr_from_skb(skb, &vnet_hdr, vio_le(), true, 0)) in packet_rcv_vnet()
2072 return memcpy_to_msg(msg, (void *)&vnet_hdr, sizeof(vnet_hdr)); in packet_rcv_vnet()
2500 static int __packet_snd_vnet_parse(struct virtio_net_hdr *vnet_hdr, size_t len) in __packet_snd_vnet_parse() argument
2502 if ((vnet_hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) && in __packet_snd_vnet_parse()
2503 (__virtio16_to_cpu(vio_le(), vnet_hdr->csum_start) + in __packet_snd_vnet_parse()
2504 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_offset) + 2 > in __packet_snd_vnet_parse()
2505 __virtio16_to_cpu(vio_le(), vnet_hdr->hdr_len))) in __packet_snd_vnet_parse()
2506 vnet_hdr->hdr_len = __cpu_to_virtio16(vio_le(), in __packet_snd_vnet_parse()
2507 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_start) + in __packet_snd_vnet_parse()
2508 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_offset) + 2); in __packet_snd_vnet_parse()
2510 if (__virtio16_to_cpu(vio_le(), vnet_hdr->hdr_len) > len) in __packet_snd_vnet_parse()
2517 struct virtio_net_hdr *vnet_hdr) in packet_snd_vnet_parse() argument
2519 if (*len < sizeof(*vnet_hdr)) in packet_snd_vnet_parse()
2521 *len -= sizeof(*vnet_hdr); in packet_snd_vnet_parse()
2523 if (!copy_from_iter_full(vnet_hdr, sizeof(*vnet_hdr), &msg->msg_iter)) in packet_snd_vnet_parse()
2526 return __packet_snd_vnet_parse(vnet_hdr, *len); in packet_snd_vnet_parse()
2681 struct virtio_net_hdr *vnet_hdr = NULL; in tpacket_snd() local
2775 vnet_hdr = data; in tpacket_snd()
2776 data += sizeof(*vnet_hdr); in tpacket_snd()
2777 tp_len -= sizeof(*vnet_hdr); in tpacket_snd()
2779 __packet_snd_vnet_parse(vnet_hdr, tp_len)) { in tpacket_snd()
2784 vnet_hdr->hdr_len); in tpacket_snd()
2822 if (virtio_net_hdr_to_skb(skb, vnet_hdr, vio_le())) { in tpacket_snd()
2826 virtio_net_hdr_set_proto(skb, vnet_hdr); in tpacket_snd()
2909 struct virtio_net_hdr vnet_hdr = { 0 }; in packet_snd() local
2957 err = packet_snd_vnet_parse(msg, &len, &vnet_hdr); in packet_snd()
2972 if (!vnet_hdr.gso_type && in packet_snd()
2979 linear = __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len); in packet_snd()
3013 if (!vnet_hdr.gso_type && (len > dev->mtu + reserve + extra_len) && in packet_snd()
3031 err = virtio_net_hdr_to_skb(skb, &vnet_hdr, vio_le()); in packet_snd()
3034 len += sizeof(vnet_hdr); in packet_snd()
3035 virtio_net_hdr_set_proto(skb, &vnet_hdr); in packet_snd()