search for: virtnet_build_xdp_buff_mrg

Displaying 16 results from an estimated 16 matches for "virtnet_build_xdp_buff_mrg".

2023 Mar 28
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
virtnet_build_xdp_buff_mrg() and virtnet_xdp_handler() auto release xdp shinfo then the caller no need to careful the xdp shinfo. Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com> --- drivers/net/virtio_net.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/dr...
2023 Apr 03
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
? 2023/3/28 20:04, Xuan Zhuo ??: > virtnet_build_xdp_buff_mrg() and virtnet_xdp_handler() auto I think you meant virtnet_xdp_handler() actually? > release xdp shinfo then the caller no need to careful the xdp shinfo. > > Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com> > --- > drivers/net/virtio_net.c | 29 +++++++++++++++++-...
2023 Mar 30
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...d int frame_sz; > + struct xdp_buff xdp; > + void *data; > + u32 act; > + int err; > + > + data = mergeable_xdp_prepare(vi, rq, xdp_prog, ctx, &frame_sz, &num_buf, &page, > + offset, &len, hdr); > + if (!data) > + goto err_xdp; > + > + err = virtnet_build_xdp_buff_mrg(dev, vi, rq, &xdp, data, len, frame_sz, > + &num_buf, &xdp_frags_truesz, stats); > + if (unlikely(err)) > + goto err_xdp; > + > + act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); > + > + switch (act) { > + case VIRTNET_XDP_RES_PASS: >...
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
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
2023 Mar 28
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...| 135 ++++++++++++++++++++++----------------- 1 file changed, 77 insertions(+), 58 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 4d2bf1ce0730..bb426958cdd4 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1162,6 +1162,79 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev, return 0; } +static void *mergeable_xdp_prepare(struct virtnet_info *vi, + struct receive_queue *rq, + struct bpf_prog *xdp_prog, + void *ctx, + unsigned int *frame_sz, + int *num_buf, + struct page **page, + int offset, +...
2023 Mar 31
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...----------- > 1 file changed, 77 insertions(+), 58 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 4d2bf1ce0730..bb426958cdd4 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -1162,6 +1162,79 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev, > return 0; > } > > +static void *mergeable_xdp_prepare(struct virtnet_info *vi, > + struct receive_queue *rq, > + struct bpf_prog *xdp_prog, > + void *ctx, > + unsigned int *frame_sz, > + int *num_buf, > +...
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
2023 Mar 22
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...frags_truesz = 0; + struct sk_buff *head_skb; + unsigned int frame_sz; + struct xdp_buff xdp; + void *data; + u32 act; + int err; + + data = mergeable_xdp_prepare(vi, rq, xdp_prog, ctx, &frame_sz, &num_buf, &page, + offset, &len, hdr); + if (!data) + goto err_xdp; + + err = virtnet_build_xdp_buff_mrg(dev, vi, rq, &xdp, data, len, frame_sz, + &num_buf, &xdp_frags_truesz, stats); + if (unlikely(err)) + goto err_xdp; + + act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); + + switch (act) { + case VIRTNET_XDP_RES_PASS: + head_skb = build_skb_from_xdp_buff(dev, v...
2023 Apr 30
1
[RFC PATCH net 2/3] virtio-net: allow usage of vrings smaller than MAX_SKB_FRAGS + 2
...ee them then recheck. */ free_old_xmit_skbs(sq, false); - if (sq->vq->num_free >= 2+MAX_SKB_FRAGS) { + if (sq->vq->num_free >= vi->single_pkt_max_descs) { netif_start_subqueue(dev, qnum); virtqueue_disable_cb(sq->vq); } @@ -1108,6 +1120,10 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev, return 0; if (*num_buf > 1) { + /* Small vring - can't be more than 1 buffer */ + if (unlikely(vi->svring)) + return -EINVAL; + /* If we want to build multi-buffer xdp, we need * to specify that the flags of xdp_buff have the * XDP_FLAGS_HAS_F...
2023 Jun 22
1
[PATCH vhost v10 10/10] virtio_net: support dma premapped
...*xdp_linearize_page(struct receive_queue *rq, > void *buf; > int off; > > - buf = virtqueue_get_buf(rq->vq, &buflen); > + buf = virtnet_rq_get_buf(rq, &buflen, NULL); > if (unlikely(!buf)) > goto err_buf; > > @@ -1119,7 +1224,7 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev, > return -EINVAL; > > while (--*num_buf > 0) { > - buf = virtqueue_get_buf_ctx(rq->vq, &len, &ctx); > + buf = virtnet_rq_get_buf(rq, &len, &ctx); > if (unlikely(!buf)) { > pr_debug("%s: rx error: %d buffers out...
2023 Apr 30
1
[RFC PATCH net 2/3] virtio-net: allow usage of vrings smaller than MAX_SKB_FRAGS + 2
...ree_old_xmit_skbs(sq, false); > - if (sq->vq->num_free >= 2+MAX_SKB_FRAGS) { > + if (sq->vq->num_free >= vi->single_pkt_max_descs) { > netif_start_subqueue(dev, qnum); > virtqueue_disable_cb(sq->vq); > } > @@ -1108,6 +1120,10 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev, > return 0; > > if (*num_buf > 1) { > + /* Small vring - can't be more than 1 buffer */ > + if (unlikely(vi->svring)) > + return -EINVAL; > + > /* If we want to build multi-buffer xdp, we need > * to specify that the fla...
2023 Apr 30
5
[RFC PATCH net 0/3] virtio-net: allow usage of small vrings
At the moment, if a virtio network device uses vrings with less than MAX_SKB_FRAGS + 2 entries, the device won't be functional. The following condition vq->num_free >= 2 + MAX_SKB_FRAGS will always evaluate to false, leading to TX timeouts. This patchset attempts this fix this bug, and to allow small rings down to 4 entries. The first patch introduces a new mechanism in virtio core -
2023 Jul 10
10
[PATCH vhost v11 00/10] virtio core prepares for AF_XDP
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address from virtio-net driver as the dma address. But the maintainers of xsk may want to use
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address from virtio-net driver as the dma address. But the maintainers of xsk may want to use
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address from virtio-net driver as the dma address. But the maintainers of xsk may want to use