Lines Matching refs:vnet_hdr

2096 	struct virtio_net_hdr vnet_hdr;  in packet_rcv_vnet()  local
2098 if (*len < sizeof(vnet_hdr)) in packet_rcv_vnet()
2100 *len -= sizeof(vnet_hdr); in packet_rcv_vnet()
2102 if (virtio_net_hdr_from_skb(skb, &vnet_hdr, vio_le(), true, 0)) in packet_rcv_vnet()
2105 return memcpy_to_msg(msg, (void *)&vnet_hdr, sizeof(vnet_hdr)); in packet_rcv_vnet()
2535 static int __packet_snd_vnet_parse(struct virtio_net_hdr *vnet_hdr, size_t len) in __packet_snd_vnet_parse() argument
2537 if ((vnet_hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) && in __packet_snd_vnet_parse()
2538 (__virtio16_to_cpu(vio_le(), vnet_hdr->csum_start) + in __packet_snd_vnet_parse()
2539 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_offset) + 2 > in __packet_snd_vnet_parse()
2540 __virtio16_to_cpu(vio_le(), vnet_hdr->hdr_len))) in __packet_snd_vnet_parse()
2541 vnet_hdr->hdr_len = __cpu_to_virtio16(vio_le(), in __packet_snd_vnet_parse()
2542 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_start) + in __packet_snd_vnet_parse()
2543 __virtio16_to_cpu(vio_le(), vnet_hdr->csum_offset) + 2); in __packet_snd_vnet_parse()
2545 if (__virtio16_to_cpu(vio_le(), vnet_hdr->hdr_len) > len) in __packet_snd_vnet_parse()
2552 struct virtio_net_hdr *vnet_hdr) in packet_snd_vnet_parse() argument
2554 if (*len < sizeof(*vnet_hdr)) in packet_snd_vnet_parse()
2556 *len -= sizeof(*vnet_hdr); in packet_snd_vnet_parse()
2558 if (!copy_from_iter_full(vnet_hdr, sizeof(*vnet_hdr), &msg->msg_iter)) in packet_snd_vnet_parse()
2561 return __packet_snd_vnet_parse(vnet_hdr, *len); in packet_snd_vnet_parse()
2716 struct virtio_net_hdr *vnet_hdr = NULL; in tpacket_snd() local
2810 vnet_hdr = data; in tpacket_snd()
2811 data += sizeof(*vnet_hdr); in tpacket_snd()
2812 tp_len -= sizeof(*vnet_hdr); in tpacket_snd()
2814 __packet_snd_vnet_parse(vnet_hdr, tp_len)) { in tpacket_snd()
2819 vnet_hdr->hdr_len); in tpacket_snd()
2857 if (virtio_net_hdr_to_skb(skb, vnet_hdr, vio_le())) { in tpacket_snd()
2861 virtio_net_hdr_set_proto(skb, vnet_hdr); in tpacket_snd()
2943 struct virtio_net_hdr vnet_hdr = { 0 }; in packet_snd() local
2991 err = packet_snd_vnet_parse(msg, &len, &vnet_hdr); in packet_snd()
3006 if (!vnet_hdr.gso_type && in packet_snd()
3013 linear = __virtio16_to_cpu(vio_le(), vnet_hdr.hdr_len); in packet_snd()
3047 if (!vnet_hdr.gso_type && (len > dev->mtu + reserve + extra_len) && in packet_snd()
3065 err = virtio_net_hdr_to_skb(skb, &vnet_hdr, vio_le()); in packet_snd()
3068 len += sizeof(vnet_hdr); in packet_snd()
3069 virtio_net_hdr_set_proto(skb, &vnet_hdr); in packet_snd()