search for: virtnet_rx_pad

Displaying 20 results from an estimated 37 matches for "virtnet_rx_pad".

2020 May 06
6
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
...git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 11f722460513..98dd75b665a5 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, page = xdp_page; } - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; - xdp.data = xdp.data_hard_start + xdp_headroom; + xdp.data_hard_start = buf + VIRTNET_RX_PAD; + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; xdp.data_end = xdp.data + len; xdp.data_meta = xdp.data; xdp.rxq = &rq->xdp_rxq; @@ -845,7 +845,7 @@...
2020 May 06
6
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
...git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 11f722460513..98dd75b665a5 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, page = xdp_page; } - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; - xdp.data = xdp.data_hard_start + xdp_headroom; + xdp.data_hard_start = buf + VIRTNET_RX_PAD; + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; xdp.data_end = xdp.data + len; xdp.data_meta = xdp.data; xdp.rxq = &rq->xdp_rxq; @@ -845,7 +845,7 @@...
2023 Mar 31
1
[PATCH net-next 8/8] virtio_net: introduce receive_small_xdp()
...0, Xuan Zhuo wrote: > > @@ -949,15 +1042,11 @@ static struct sk_buff *receive_small(struct net_device *dev, > > { > > struct sk_buff *skb; > > struct bpf_prog *xdp_prog; > > - unsigned int xdp_headroom = (unsigned long)ctx; > > - unsigned int header_offset = VIRTNET_RX_PAD + xdp_headroom; > > + unsigned int header_offset = VIRTNET_RX_PAD; > > unsigned int headroom = vi->hdr_len + header_offset; > > This changes (reduces) the headroom for non-xpd-pass skbs. > > [...] > > + buf += header_offset; > > + memcpy(skb_vnet_hdr(skb), b...
2020 May 06
2
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
...f722460513..98dd75b665a5 100644 >> --- a/drivers/net/virtio_net.c >> +++ b/drivers/net/virtio_net.c >> @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, >> page = xdp_page; >> } >> >> - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; >> - xdp.data = xdp.data_hard_start + xdp_headroom; >> + xdp.data_hard_start = buf + VIRTNET_RX_PAD; >> + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; >> xdp.data_end = xdp.data + len; >> xdp.data_meta = xdp.data; >&gt...
2020 May 06
2
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
...f722460513..98dd75b665a5 100644 >> --- a/drivers/net/virtio_net.c >> +++ b/drivers/net/virtio_net.c >> @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, >> page = xdp_page; >> } >> >> - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; >> - xdp.data = xdp.data_hard_start + xdp_headroom; >> + xdp.data_hard_start = buf + VIRTNET_RX_PAD; >> + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; >> xdp.data_end = xdp.data + len; >> xdp.data_meta = xdp.data; >&gt...
2017 Jul 18
1
[PATCH net-next 3/5] virtio-net: switch to use new ctx API for small buffer
...*/ as an alternative, reuse the same format as mergeable buffers. > struct page_frag *alloc_frag = &rq->alloc_frag; > char *buf; > unsigned int xdp_headroom = virtnet_get_headroom(vi); > + void *ctx = (void *)(unsigned long)xdp_headroom; > int len = vi->hdr_len + VIRTNET_RX_PAD + GOOD_PACKET_LEN + xdp_headroom; > int err; > > @@ -825,7 +827,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, struct receive_queue *rq, > alloc_frag->offset += len; > sg_init_one(rq->sg, buf + VIRTNET_RX_PAD + xdp_headroom, > vi->hdr_len + GOOD...
2017 Jul 18
1
[PATCH net-next 3/5] virtio-net: switch to use new ctx API for small buffer
...*/ as an alternative, reuse the same format as mergeable buffers. > struct page_frag *alloc_frag = &rq->alloc_frag; > char *buf; > unsigned int xdp_headroom = virtnet_get_headroom(vi); > + void *ctx = (void *)(unsigned long)xdp_headroom; > int len = vi->hdr_len + VIRTNET_RX_PAD + GOOD_PACKET_LEN + xdp_headroom; > int err; > > @@ -825,7 +827,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, struct receive_queue *rq, > alloc_frag->offset += len; > sg_init_one(rq->sg, buf + VIRTNET_RX_PAD + xdp_headroom, > vi->hdr_len + GOOD...
2020 May 06
2
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
...f722460513..98dd75b665a5 100644 >> --- a/drivers/net/virtio_net.c >> +++ b/drivers/net/virtio_net.c >> @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, >> page = xdp_page; >> } >> >> - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; >> - xdp.data = xdp.data_hard_start + xdp_headroom; >> + xdp.data_hard_start = buf + VIRTNET_RX_PAD; >> + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; >> xdp.data_end = xdp.data + len; >> xdp.data_meta = xdp.data; >&gt...
2020 May 06
2
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
...f722460513..98dd75b665a5 100644 >> --- a/drivers/net/virtio_net.c >> +++ b/drivers/net/virtio_net.c >> @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, >> page = xdp_page; >> } >> >> - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; >> - xdp.data = xdp.data_hard_start + xdp_headroom; >> + xdp.data_hard_start = buf + VIRTNET_RX_PAD; >> + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; >> xdp.data_end = xdp.data + len; >> xdp.data_meta = xdp.data; >&gt...
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
2017 Jul 17
0
[PATCH net-next 3/5] virtio-net: switch to use new ctx API for small buffer
...2,6 +813,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, struct receive_queue *rq, struct page_frag *alloc_frag = &rq->alloc_frag; char *buf; unsigned int xdp_headroom = virtnet_get_headroom(vi); + void *ctx = (void *)(unsigned long)xdp_headroom; int len = vi->hdr_len + VIRTNET_RX_PAD + GOOD_PACKET_LEN + xdp_headroom; int err; @@ -825,7 +827,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, struct receive_queue *rq, alloc_frag->offset += len; sg_init_one(rq->sg, buf + VIRTNET_RX_PAD + xdp_headroom, vi->hdr_len + GOOD_PACKET_LEN); - err = virtqueu...
2020 May 06
0
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
.../net/virtio_net.c > index 11f722460513..98dd75b665a5 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, > page = xdp_page; > } > > - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; > - xdp.data = xdp.data_hard_start + xdp_headroom; > + xdp.data_hard_start = buf + VIRTNET_RX_PAD; > + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; > xdp.data_end = xdp.data + len; > xdp.data_meta = xdp.data; > xdp.rxq = &rq-&gt...
2020 May 06
0
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
...100644 > > > --- a/drivers/net/virtio_net.c > > > +++ b/drivers/net/virtio_net.c > > > @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, > > > page = xdp_page; > > > } > > > - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; > > > - xdp.data = xdp.data_hard_start + xdp_headroom; > > > + xdp.data_hard_start = buf + VIRTNET_RX_PAD; > > > + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; > > > xdp.data_end = xdp.data + len; > > > xdp...
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
2020 May 06
0
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
.../net/virtio_net.c > index 11f722460513..98dd75b665a5 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, > page = xdp_page; > } > > - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; > - xdp.data = xdp.data_hard_start + xdp_headroom; > + xdp.data_hard_start = buf + VIRTNET_RX_PAD; > + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; > xdp.data_end = xdp.data + len; > xdp.data_meta = xdp.data; > xdp.rxq = &rq-&gt...
2023 Mar 15
10
[RFC 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
2020 May 06
0
[PATCH net-next 1/2] virtio-net: don't reserve space for vnet header for XDP
...100644 > > > --- a/drivers/net/virtio_net.c > > > +++ b/drivers/net/virtio_net.c > > > @@ -684,8 +684,8 @@ static struct sk_buff *receive_small(struct net_device *dev, > > > page = xdp_page; > > > } > > > - xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len; > > > - xdp.data = xdp.data_hard_start + xdp_headroom; > > > + xdp.data_hard_start = buf + VIRTNET_RX_PAD; > > > + xdp.data = xdp.data_hard_start + xdp_headroom + vi->hdr_len; > > > xdp.data_end = xdp.data + len; > > > xdp...
2017 Jul 17
13
[PATCH net-next 0/5] refine virtio-net XDP
Hi: This series brings two optimizations for virtio-net XDP: - avoid reset during XDP set - turn off offloads on demand Please review. Thanks Jason Wang (5): virtio_ring: allow to store zero as the ctx virtio-net: pack headroom into ctx for mergeable buffer virtio-net: switch to use new ctx API for small buffer virtio-net: do not reset during XDP set virtio-net: switch off offloads
2017 Jul 17
13
[PATCH net-next 0/5] refine virtio-net XDP
Hi: This series brings two optimizations for virtio-net XDP: - avoid reset during XDP set - turn off offloads on demand Please review. Thanks Jason Wang (5): virtio_ring: allow to store zero as the ctx virtio-net: pack headroom into ctx for mergeable buffer virtio-net: switch to use new ctx API for small buffer virtio-net: do not reset during XDP set virtio-net: switch off offloads
2017 Jul 18
1
[PATCH net-next 4/5] virtio-net: do not reset during XDP set
...15,12 +476,14 @@ static struct sk_buff *receive_small(struct net_device *dev, > { > struct sk_buff *skb; > struct bpf_prog *xdp_prog; > - unsigned int xdp_headroom = virtnet_get_headroom(vi); > + unsigned int xdp_headroom = (unsigned long)ctx; > unsigned int header_offset = VIRTNET_RX_PAD + xdp_headroom; > unsigned int headroom = vi->hdr_len + header_offset; > unsigned int buflen = SKB_DATA_ALIGN(GOOD_PACKET_LEN + headroom) + > SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); > + struct page *page = virt_to_head_page(buf); > unsigned int delta = 0; &...