search for: skb_shared_info

Displaying 20 results from an estimated 162 matches for "skb_shared_info".

2018 Mar 02
6
[PATCH net V2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
XDP_REDIRECT support for mergeable buffer was removed since commit 7324f5399b06 ("virtio_net: disable XDP_REDIRECT in receive_mergeable() case"). This is because we don't reserve enough tailroom for struct skb_shared_info which breaks XDP assumption. So this patch fixes this by reserving enough tailroom and using fixed size of rx buffer. Signed-off-by: Jason Wang <jasowang at redhat.com> --- Changes from V1: - do not add duplicated tracepoint when redirection fails --- drivers/net/virtio_net.c | 54 +++++++++...
2018 Mar 02
6
[PATCH net V2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
XDP_REDIRECT support for mergeable buffer was removed since commit 7324f5399b06 ("virtio_net: disable XDP_REDIRECT in receive_mergeable() case"). This is because we don't reserve enough tailroom for struct skb_shared_info which breaks XDP assumption. So this patch fixes this by reserving enough tailroom and using fixed size of rx buffer. Signed-off-by: Jason Wang <jasowang at redhat.com> --- Changes from V1: - do not add duplicated tracepoint when redirection fails --- drivers/net/virtio_net.c | 54 +++++++++...
2015 Jan 27
3
[PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
...ct sk_buff { > > > __u8 ipvs_property:1; > > > __u8 inner_protocol_type:1; > > > __u8 remcsum_offload:1; > > > - /* 3 or 5 bit hole */ > > > + __u8 ufo_fragid_set:1; > > [...] > > > > Doesn't the flag belong in struct skb_shared_info, rather than struct > > sk_buff? Otherwise this looks fine. > > > > Ben. > > Hmm we seem to be out of tx flags. > Maybe ip6_frag_id == 0 should mean "not set". Maybe that is the best idea. Definitely the ufo_fragid_set bit should move into the skb_shared_inf...
2015 Jan 27
3
[PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
...ct sk_buff { > > > __u8 ipvs_property:1; > > > __u8 inner_protocol_type:1; > > > __u8 remcsum_offload:1; > > > - /* 3 or 5 bit hole */ > > > + __u8 ufo_fragid_set:1; > > [...] > > > > Doesn't the flag belong in struct skb_shared_info, rather than struct > > sk_buff? Otherwise this looks fine. > > > > Ben. > > Hmm we seem to be out of tx flags. > Maybe ip6_frag_id == 0 should mean "not set". Maybe that is the best idea. Definitely the ufo_fragid_set bit should move into the skb_shared_inf...
2023 Apr 13
1
[PATCH net] virtio_net: bugfix overflow inside xdp_linearize_page()
...--- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -814,8 +814,13 @@ static struct page *xdp_linearize_page(struct receive_queue *rq, int page_off, unsigned int *len) { - struct page *page = alloc_page(GFP_ATOMIC); + int tailroom = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); + struct page *page; + + if (page_off + *len + tailroom > PAGE_SIZE) + return NULL; + page = alloc_page(GFP_ATOMIC); if (!page) return NULL; @@ -823,7 +828,6 @@ static struct page *xdp_linearize_page(struct receive_queue *rq, page_off += *len; while (--*num_buf) { - int tailr...
2023 Apr 14
1
[PATCH net v1] virtio_net: bugfix overflow inside xdp_linearize_page()
...--- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -814,8 +814,13 @@ static struct page *xdp_linearize_page(struct receive_queue *rq, int page_off, unsigned int *len) { - struct page *page = alloc_page(GFP_ATOMIC); + int tailroom = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); + struct page *page; + + if (page_off + *len + tailroom > PAGE_SIZE) + return NULL; + page = alloc_page(GFP_ATOMIC); if (!page) return NULL; @@ -823,7 +828,6 @@ static struct page *xdp_linearize_page(struct receive_queue *rq, page_off += *len; while (--*num_buf) { - int tailroom...
2023 Mar 28
1
[PATCH net-next 4/8] virtio_net: separate the logic of freeing xdp shinfo
.../net/virtio_net.c b/drivers/net/virtio_net.c index 72b9d6ee4024..09aed60e2f51 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -798,6 +798,21 @@ static int virtnet_xdp_xmit(struct net_device *dev, return ret; } +static void put_xdp_frags(struct xdp_buff *xdp) +{ + struct skb_shared_info *shinfo; + struct page *xdp_page; + int i; + + if (xdp_buff_has_frags(xdp)) { + shinfo = xdp_get_shared_info_from_buff(xdp); + for (i = 0; i < shinfo->nr_frags; i++) { + xdp_page = skb_frag_page(&shinfo->frags[i]); + put_page(xdp_page); + } + } +} + static int virtnet_xdp_handl...
2015 Jan 27
3
[PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
...1; > >>>> __u8 inner_protocol_type:1; > >>>> __u8 remcsum_offload:1; > >>>> - /* 3 or 5 bit hole */ > >>>> + __u8 ufo_fragid_set:1; > >>> [...] > >>> > >>> Doesn't the flag belong in struct skb_shared_info, rather than struct > >>> sk_buff? Otherwise this looks fine. > >>> > >>> Ben. > >> > >> Hmm we seem to be out of tx flags. > >> Maybe ip6_frag_id == 0 should mean "not set". > > > > Maybe that is the best idea....
2015 Jan 27
3
[PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
...1; > >>>> __u8 inner_protocol_type:1; > >>>> __u8 remcsum_offload:1; > >>>> - /* 3 or 5 bit hole */ > >>>> + __u8 ufo_fragid_set:1; > >>> [...] > >>> > >>> Doesn't the flag belong in struct skb_shared_info, rather than struct > >>> sk_buff? Otherwise this looks fine. > >>> > >>> Ben. > >> > >> Hmm we seem to be out of tx flags. > >> Maybe ip6_frag_id == 0 should mean "not set". > > > > Maybe that is the best idea....
2023 Mar 28
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...+ xdp_page = xdp_linearize_page(rq, num_buf, + *page, offset, + VIRTIO_XDP_HEADROOM, + len); + + if (!xdp_page) + return NULL; + } else if (unlikely(headroom < virtnet_get_headroom(vi))) { + xdp_room = SKB_DATA_ALIGN(VIRTIO_XDP_HEADROOM + + sizeof(struct skb_shared_info)); + if (*len + xdp_room > PAGE_SIZE) + return NULL; + + xdp_page = alloc_page(GFP_ATOMIC); + if (!xdp_page) + return NULL; + + memcpy(page_address(xdp_page) + VIRTIO_XDP_HEADROOM, + page_address(*page) + offset, *len); + } else { + return page_address(*page) + offset; + } + + *...
2018 May 21
2
[RFC PATCH net-next 10/12] vhost_net: build xdp buff
...r *from, > + struct xdp_buff *xdp) > +{ > + struct vhost_virtqueue *vq = &nvq->vq; > + struct page_frag *alloc_frag = &current->task_frag; > + struct virtio_net_hdr *gso; > + size_t len = iov_iter_count(from); > + int buflen = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); > + int pad = SKB_DATA_ALIGN(VHOST_NET_RX_PAD + VHOST_NET_HEADROOM > + + nvq->sock_hlen); > + int sock_hlen = nvq->sock_hlen; > + void *buf; > + int copied; > + > + if (len < nvq->sock_hlen) > + return -EFAULT; > + > + if (SKB_DATA_ALIGN(len + pad)...
2023 Mar 31
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
..., > + *page, offset, > + VIRTIO_XDP_HEADROOM, > + len); > + > + if (!xdp_page) > + return NULL; > + } else if (unlikely(headroom < virtnet_get_headroom(vi))) { > + xdp_room = SKB_DATA_ALIGN(VIRTIO_XDP_HEADROOM + > + sizeof(struct skb_shared_info)); > + if (*len + xdp_room > PAGE_SIZE) > + return NULL; > + > + xdp_page = alloc_page(GFP_ATOMIC); > + if (!xdp_page) > + return NULL; > + > + memcpy(page_address(xdp_page) + VIRTIO_XDP_HEADROOM, > + page_address(*page) + offset, *len); > + } else {...
2018 Mar 02
0
[PATCH net V2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
On Fri, Mar 02, 2018 at 05:29:14PM +0800, Jason Wang wrote: > XDP_REDIRECT support for mergeable buffer was removed since commit > 7324f5399b06 ("virtio_net: disable XDP_REDIRECT in receive_mergeable() > case"). This is because we don't reserve enough tailroom for struct > skb_shared_info which breaks XDP assumption. So this patch fixes this > by reserving enough tailroom and using fixed size of rx buffer. > > Signed-off-by: Jason Wang <jasowang at redhat.com> Acked-by: Michael S. Tsirkin <mst at redhat.com> I think the next incremental step is to look at spl...
2015 Jan 28
2
[PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
...>>>>>>>> - /* 3 or 5 bit hole */ > >>>>>>>>>> + __u8 ufo_fragid_set:1; > >>>>>>>>> [...] > >>>>>>>>> > >>>>>>>>> Doesn't the flag belong in struct skb_shared_info, rather than struct > >>>>>>>>> sk_buff? Otherwise this looks fine. > >>>>>>>>> > >>>>>>>>> Ben. > >>>>>>>> > >>>>>>>> Hmm we seem to be out of tx flags....
2015 Jan 28
2
[PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
...>>>>>>>> - /* 3 or 5 bit hole */ > >>>>>>>>>> + __u8 ufo_fragid_set:1; > >>>>>>>>> [...] > >>>>>>>>> > >>>>>>>>> Doesn't the flag belong in struct skb_shared_info, rather than struct > >>>>>>>>> sk_buff? Otherwise this looks fine. > >>>>>>>>> > >>>>>>>>> Ben. > >>>>>>>> > >>>>>>>> Hmm we seem to be out of tx flags....
2023 Mar 28
8
[PATCH net-next 0/8] virtio_net: refactor xdp codes
Due to historical reasons, the implementation of XDP in virtio-net is relatively chaotic. For example, the processing of XDP actions has two copies of similar code. Such as page, xdp_page processing, etc. The purpose of this patch set is to refactor these code. Reduce the difficulty of subsequent maintenance. Subsequent developers will not introduce new bugs because of some complex logical
2018 Mar 02
2
[PATCH net] virtio-net: re enable XDP_REDIRECT for mergeable buffer
XDP_REDIRECT support for mergeable buffer was removed since commit 7324f5399b06 ("virtio_net: disable XDP_REDIRECT in receive_mergeable() case"). This is because we don't reserve enough tailroom for struct skb_shared_info which breaks XDP assumption. So this patch fixes this by reserving enough tailroom and using fixed size of rx buffer. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 55 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 12 d...
2018 Mar 02
2
[PATCH net] virtio-net: re enable XDP_REDIRECT for mergeable buffer
XDP_REDIRECT support for mergeable buffer was removed since commit 7324f5399b06 ("virtio_net: disable XDP_REDIRECT in receive_mergeable() case"). This is because we don't reserve enough tailroom for struct skb_shared_info which breaks XDP assumption. So this patch fixes this by reserving enough tailroom and using fixed size of rx buffer. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 55 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 12 d...
2023 Mar 22
9
[PATCH net-next 0/8] virtio_net: refactor xdp codes
Due to historical reasons, the implementation of XDP in virtio-net is relatively chaotic. For example, the processing of XDP actions has two copies of similar code. Such as page, xdp_page processing, etc. The purpose of this patch set is to refactor these code. Reduce the difficulty of subsequent maintenance. Subsequent developers will not introduce new bugs because of some complex logical
2015 Jan 27
3
[PATCH 1/3] ipv6: Select fragment id during UFO/GSO segmentation if not set.
...e/linux/skbuff.h > +++ b/include/linux/skbuff.h > @@ -605,7 +605,8 @@ struct sk_buff { > __u8 ipvs_property:1; > __u8 inner_protocol_type:1; > __u8 remcsum_offload:1; > - /* 3 or 5 bit hole */ > + __u8 ufo_fragid_set:1; [...] Doesn't the flag belong in struct skb_shared_info, rather than struct sk_buff? Otherwise this looks fine. Ben. -- Ben Hutchings When in doubt, use brute force. - Ken Thompson -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 811 bytes Desc: This is a digitall...