search for: virtio_net_hdr_to_skb

Displaying 20 results from an estimated 38 matches for "virtio_net_hdr_to_skb".

2020 Jun 05
0
[PATCH AUTOSEL 5.6 06/17] net: check untrusted gso_size at kernel entry
...inux/virtio_net.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 6f6ade63b04c..88997022a4b5 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -31,6 +31,7 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, { unsigned int gso_type = 0; unsigned int thlen = 0; + unsigned int p_off = 0; unsigned int ip_proto; if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { @@ -68,7 +69,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, if (!skb_partial_csum_set(skb, s...
2020 Jun 05
0
[PATCH AUTOSEL 5.4 05/14] net: check untrusted gso_size at kernel entry
...inux/virtio_net.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 6f6ade63b04c..88997022a4b5 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -31,6 +31,7 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, { unsigned int gso_type = 0; unsigned int thlen = 0; + unsigned int p_off = 0; unsigned int ip_proto; if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { @@ -68,7 +69,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, if (!skb_partial_csum_set(skb, s...
2020 Jun 05
0
[PATCH AUTOSEL 4.19 4/9] net: check untrusted gso_size at kernel entry
...inux/virtio_net.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index f36727098df8..1c296f370e46 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -31,6 +31,7 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, { unsigned int gso_type = 0; unsigned int thlen = 0; + unsigned int p_off = 0; unsigned int ip_proto; if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { @@ -68,7 +69,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, if (!skb_partial_csum_set(skb, s...
2020 Jun 05
0
[PATCH AUTOSEL 4.14 3/8] net: check untrusted gso_size at kernel entry
...inux/virtio_net.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 44e20c4b5141..a16e0bdf7751 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -31,6 +31,7 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, { unsigned int gso_type = 0; unsigned int thlen = 0; + unsigned int p_off = 0; unsigned int ip_proto; if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { @@ -68,7 +69,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, if (!skb_partial_csum_set(skb, s...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...1_hash *)hdr, skb); + virtio_skb_set_hash(&common_hdr->hash_v1_hdr, skb); - if (hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) + mrg_hdr = &common_hdr->mrg_hdr; + if (mrg_hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) skb->ip_summed = CHECKSUM_UNNECESSARY; - if (virtio_net_hdr_to_skb(skb, &hdr->hdr, + if (virtio_net_hdr_to_skb(skb, &mrg_hdr->hdr, virtio_is_little_endian(vi->vdev))) { net_warn_ratelimited("%s: bad gso: type: %u, size: %u\n", - dev->name, hdr->hdr.gso_type, - hdr->hdr.gso_size); + dev->name,...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...r.flags & VIRTIO_NET_HDR_F_DATA_VALID) > >> + mrg_hdr = &common_hdr->mrg_hdr; > >> + if (mrg_hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) > >> skb->ip_summed = CHECKSUM_UNNECESSARY; > >> > >> - if (virtio_net_hdr_to_skb(skb, &hdr->hdr, > >> + if (virtio_net_hdr_to_skb(skb, &mrg_hdr->hdr, > >> virtio_is_little_endian(vi->vdev))) { > >> net_warn_ratelimited("%s: bad gso: type: %u, size: %u\n", > >&gt...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...v1_hdr, skb); > > - if (hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) > + mrg_hdr = &common_hdr->mrg_hdr; > + if (mrg_hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) > skb->ip_summed = CHECKSUM_UNNECESSARY; > > - if (virtio_net_hdr_to_skb(skb, &hdr->hdr, > + if (virtio_net_hdr_to_skb(skb, &mrg_hdr->hdr, > virtio_is_little_endian(vi->vdev))) { > net_warn_ratelimited("%s: bad gso: type: %u, size: %u\n", > -...
2023 Aug 17
1
[PATCH net-next v2] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...t; - if (hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) >> + mrg_hdr = &common_hdr->mrg_hdr; >> + if (mrg_hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) >> skb->ip_summed = CHECKSUM_UNNECESSARY; >> >> - if (virtio_net_hdr_to_skb(skb, &hdr->hdr, >> + if (virtio_net_hdr_to_skb(skb, &mrg_hdr->hdr, >> virtio_is_little_endian(vi->vdev))) { >> net_warn_ratelimited("%s: bad gso: type: %u, size: %u\n", >> -...
2017 Jan 20
4
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
...+ virtio_is_little_endian(vi->vdev), false)) BUG(); if (vi->mergeable_rx_bufs) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 5643647..5209b5e 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -56,7 +56,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb, struct virtio_net_hdr *hdr, - bool little_endian) + bool little_endian, + bool has_data_valid) { memset(hdr, 0, sizeof(*hdr)); /* no info leak */ @@ -91,6 +92,9 @@ static in...
2017 Jan 20
4
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
...+ virtio_is_little_endian(vi->vdev), false)) BUG(); if (vi->mergeable_rx_bufs) diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 5643647..5209b5e 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -56,7 +56,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb, struct virtio_net_hdr *hdr, - bool little_endian) + bool little_endian, + bool has_data_valid) { memset(hdr, 0, sizeof(*hdr)); /* no info leak */ @@ -91,6 +92,9 @@ static in...
2017 Jan 22
2
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
...>> >> if (vi->mergeable_rx_bufs) >> diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h >> index 5643647..5209b5e 100644 >> --- a/include/linux/virtio_net.h >> +++ b/include/linux/virtio_net.h >> @@ -56,7 +56,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, >> >> static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb, >> struct virtio_net_hdr *hdr, >> - bool little_endian) >> + bool little_endian, >> + bool has_data_valid) >> { >> mem...
2017 Jan 22
2
[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving
...>> >> if (vi->mergeable_rx_bufs) >> diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h >> index 5643647..5209b5e 100644 >> --- a/include/linux/virtio_net.h >> +++ b/include/linux/virtio_net.h >> @@ -56,7 +56,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, >> >> static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb, >> struct virtio_net_hdr *hdr, >> - bool little_endian) >> + bool little_endian, >> + bool has_data_valid) >> { >> mem...
2018 Apr 11
3
[PATCH net-next 1/5] virtio: Add support for SCTP checksum offloading
...IRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \ > diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h > index f144216..2e7a64a 100644 > --- a/include/linux/virtio_net.h > +++ b/include/linux/virtio_net.h > @@ -39,6 +39,9 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, > > if (!skb_partial_csum_set(skb, start, off)) > return -EINVAL; > + > + if (hdr->flags & VIRTIO_NET_HDR_F_CSUM_NOT_INET) > + skb->csum_not_inet = 1; > } > > if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { > @@ -96,6...
2018 Apr 11
3
[PATCH net-next 1/5] virtio: Add support for SCTP checksum offloading
...IRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \ > diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h > index f144216..2e7a64a 100644 > --- a/include/linux/virtio_net.h > +++ b/include/linux/virtio_net.h > @@ -39,6 +39,9 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, > > if (!skb_partial_csum_set(skb, start, off)) > return -EINVAL; > + > + if (hdr->flags & VIRTIO_NET_HDR_F_CSUM_NOT_INET) > + skb->csum_not_inet = 1; > } > > if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { > @@ -96,6...
2016 Jun 08
7
[PATCH 0/6] virtio_net: use common code for virtio_net_hdr and skb GSO conversion
Hi, This patches introduce virtio_net_hdr_{from,to}_skb functions for conversion of GSO information between skb and virtio_net_hdr. Mike Rapoport (6): virtio_net: add _UAPI prefix to virtio_net header guards virtio_net: introduce virtio_net_hdr_{from,to}_skb macvtap: use common code for virtio_net_hdr and skb GSO conversion tuntap: use common code for virtio_net_hdr and skb GSO
2016 Jun 08
7
[PATCH 0/6] virtio_net: use common code for virtio_net_hdr and skb GSO conversion
Hi, This patches introduce virtio_net_hdr_{from,to}_skb functions for conversion of GSO information between skb and virtio_net_hdr. Mike Rapoport (6): virtio_net: add _UAPI prefix to virtio_net header guards virtio_net: introduce virtio_net_hdr_{from,to}_skb macvtap: use common code for virtio_net_hdr and skb GSO conversion tuntap: use common code for virtio_net_hdr and skb GSO
2018 Sep 06
1
[PATCH net-next 10/11] tap: accept an array of XDP buffs through sendmsg()
...skb_reserve(skb, xdp->data - xdp->data_hard_start); > + skb_put(skb, xdp->data_end - xdp->data); > + > + skb_set_network_header(skb, ETH_HLEN); > + skb_reset_mac_header(skb); > + skb->protocol = eth_hdr(skb)->h_proto; > + > + if (vnet_hdr_len) { > + err = virtio_net_hdr_to_skb(skb, gso, tap_is_little_endian(q)); > + if (err) > + goto err_kfree; > + } > + > + skb_probe_transport_header(skb, ETH_HLEN); > + > + /* Move network header to the right position for VLAN tagged packets */ > + if ((skb->protocol == htons(ETH_P_8021Q) || > + skb...
2018 Apr 16
1
[PATCH net-next 1/5] virtio: Add support for SCTP checksum offloading
..., VIRTIO_NET_F_GUEST_TSO6, \ > >> diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h > >> index f144216..2e7a64a 100644 > >> --- a/include/linux/virtio_net.h > >> +++ b/include/linux/virtio_net.h > >> @@ -39,6 +39,9 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, > >> > >> if (!skb_partial_csum_set(skb, start, off)) > >> return -EINVAL; > >> + > >> + if (hdr->flags & VIRTIO_NET_HDR_F_CSUM_NOT_INET) > >> + skb->csum_not_inet = 1; > >> } > >>...
2023 Aug 15
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...ET_HDR_F_DATA_VALID) > > > > + mrg_hdr = &common_hdr->mrg_hdr; > > > > + if (mrg_hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) > > > > skb->ip_summed = CHECKSUM_UNNECESSARY; > > > > > > > > - if (virtio_net_hdr_to_skb(skb, &hdr->hdr, > > > > + if (virtio_net_hdr_to_skb(skb, &mrg_hdr->hdr, > > > > virtio_is_little_endian(vi->vdev))) { > > > > net_warn_ratelimited("%s: bad gso: type: %u, size: %u\n",...
2023 Aug 15
1
[PATCH net v1] virtio_net: Introduce skb_vnet_common_hdr to avoid typecasting
...ET_HDR_F_DATA_VALID) > > > > + mrg_hdr = &common_hdr->mrg_hdr; > > > > + if (mrg_hdr->hdr.flags & VIRTIO_NET_HDR_F_DATA_VALID) > > > > skb->ip_summed = CHECKSUM_UNNECESSARY; > > > > > > > > - if (virtio_net_hdr_to_skb(skb, &hdr->hdr, > > > > + if (virtio_net_hdr_to_skb(skb, &mrg_hdr->hdr, > > > > virtio_is_little_endian(vi->vdev))) { > > > > net_warn_ratelimited("%s: bad gso: type: %u, size: %u\n",...