Lines Matching refs:vnet_hdr
2047 struct virtio_net_hdr vnet_hdr; in packet_rcv_vnet() local
2049 if (*len < sizeof(vnet_hdr)) in packet_rcv_vnet()
2051 *len -= sizeof(vnet_hdr); in packet_rcv_vnet()
2053 if (virtio_net_hdr_from_skb(skb, &vnet_hdr, vio_le(), true, 0)) in packet_rcv_vnet()
2056 return memcpy_to_msg(msg, (void *)&vnet_hdr, sizeof(vnet_hdr)); in packet_rcv_vnet()
2484 static int __packet_snd_vnet_parse(struct virtio_net_hdr *vnet_hdr, size_t len) in __packet_snd_vnet_parse() argument
2486 if ((vnet_hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) && in __packet_snd_vnet_parse()
2487 (__virtio16_to_cpu(vio_le(), vnet_hdr->csum_start) + in __packet_snd_vnet_parse()
2488 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_offset) + 2 > in __packet_snd_vnet_parse()
2489 __virtio16_to_cpu(vio_le(), vnet_hdr->hdr_len))) in __packet_snd_vnet_parse()
2490 vnet_hdr->hdr_len = __cpu_to_virtio16(vio_le(), in __packet_snd_vnet_parse()
2491 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_start) + in __packet_snd_vnet_parse()
2492 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_offset) + 2); in __packet_snd_vnet_parse()
2494 if (__virtio16_to_cpu(vio_le(), vnet_hdr->hdr_len) > len) in __packet_snd_vnet_parse()
2501 struct virtio_net_hdr *vnet_hdr) in packet_snd_vnet_parse() argument
2503 if (*len < sizeof(*vnet_hdr)) in packet_snd_vnet_parse()
2505 *len -= sizeof(*vnet_hdr); in packet_snd_vnet_parse()
2507 if (!copy_from_iter_full(vnet_hdr, sizeof(*vnet_hdr), &msg->msg_iter)) in packet_snd_vnet_parse()
2510 return __packet_snd_vnet_parse(vnet_hdr, *len); in packet_snd_vnet_parse()
2665 struct virtio_net_hdr *vnet_hdr = NULL; in tpacket_snd() local
2759 vnet_hdr = data; in tpacket_snd()
2760 data += sizeof(*vnet_hdr); in tpacket_snd()
2761 tp_len -= sizeof(*vnet_hdr); in tpacket_snd()
2763 __packet_snd_vnet_parse(vnet_hdr, tp_len)) { in tpacket_snd()
2768 vnet_hdr->hdr_len); in tpacket_snd()
2806 if (virtio_net_hdr_to_skb(skb, vnet_hdr, vio_le())) { in tpacket_snd()
2810 virtio_net_hdr_set_proto(skb, vnet_hdr); in tpacket_snd()
2892 struct virtio_net_hdr vnet_hdr = { 0 }; in packet_snd() local
2940 err = packet_snd_vnet_parse(msg, &len, &vnet_hdr); in packet_snd()
2955 if (!vnet_hdr.gso_type && in packet_snd()
2962 linear = __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len); in packet_snd()
2996 if (!vnet_hdr.gso_type && (len > dev->mtu + reserve + extra_len) && in packet_snd()
3009 err = virtio_net_hdr_to_skb(skb, &vnet_hdr, vio_le()); in packet_snd()
3012 len += sizeof(vnet_hdr); in packet_snd()
3013 virtio_net_hdr_set_proto(skb, &vnet_hdr); in packet_snd()