search for: frame_sz

Displaying 15 results from an estimated 15 matches for "frame_sz".

Did you mean: frame_size
2023 Mar 28
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...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, + unsigned int *len, + struct virtio_net_hdr_mrg_rxbuf *hdr) +{ + unsigned int truesize = mergeable_ctx_to_truesize(ctx); + unsigned int headroom = mergeable_ctx_to_headroom(ctx); + struct page *xdp_page; + unsigned...
2023 Mar 31
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...,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, > + unsigned int *len, > + struct virtio_net_hdr_mrg_rxbuf *hdr) > +{ > + unsigned int truesize = mergeable_ctx_to_truesize(ctx); > + unsigned int headroom = mergeable_ctx_to_headroom(ct...
2023 Mar 30
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...irtio_net_hdr_mrg_rxbuf *hdr = buf; > + int num_buf = virtio16_to_cpu(vi->vdev, hdr->num_buffers); > + struct page *page = virt_to_head_page(buf); > + int offset = buf - page_address(page); > + unsigned int 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_...
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 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()
...rq_stats *stats) +{ + struct virtio_net_hdr_mrg_rxbuf *hdr = buf; + int num_buf = virtio16_to_cpu(vi->vdev, hdr->num_buffers); + struct page *page = virt_to_head_page(buf); + int offset = buf - page_address(page); + unsigned int 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...
2023 Mar 28
1
[PATCH net-next 4/8] virtio_net: separate the logic of freeing xdp shinfo
...device *dev, xdp_prog = rcu_dereference(rq->xdp_prog); if (xdp_prog) { unsigned int xdp_frags_truesz = 0; - struct skb_shared_info *shinfo; - struct page *xdp_page; struct xdp_buff xdp; void *data; u32 act; - int i; data = mergeable_xdp_prepare(vi, rq, xdp_prog, ctx, &frame_sz, &num_buf, &page, offset, &len, hdr); @@ -1348,14 +1360,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, goto err_xdp_frags; } err_xdp_frags: - if (xdp_buff_has_frags(&xdp)) { - shinfo = xdp_get_shared_info_from_buff(&xdp); - for (i =...
2023 Mar 28
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...e; } else if (unlikely(headroom < virtnet_get_headroom(vi))) { xdp_room = SKB_DATA_ALIGN(VIRTIO_XDP_HEADROOM + sizeof(struct skb_shared_info)); @@ -1259,6 +1262,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, page_address(page) + offset, len); frame_sz = PAGE_SIZE; offset = VIRTIO_XDP_HEADROOM; + + put_page(page); + page = xdp_page; } else { xdp_page = page; } @@ -1278,8 +1284,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, if (unlikely(!head_skb)) goto err_xdp_frags; - if (unlikely(xdp_page !=...
2023 Mar 28
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...dp_frags_truesz; return 0; + +err: + put_xdp_frags(xdp); + return -EINVAL; } static void *mergeable_xdp_prepare(struct virtnet_info *vi, @@ -1361,7 +1369,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, 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_frags; + goto err_xdp; act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); @@ -1369,7 +1377,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, case VIRTNET_XD...
2023 Mar 31
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...RTIO_XDP_HEADROOM + > sizeof(struct skb_shared_info)); > @@ -1259,6 +1262,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > page_address(page) + offset, len); > frame_sz = PAGE_SIZE; > offset = VIRTIO_XDP_HEADROOM; > + > + put_page(page); > + page = xdp_page; > } else { > xdp_page = page; > } While at this I would go a li...
2023 Apr 03
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...t; + put_xdp_frags(xdp); > + return -EINVAL; > } > > static void *mergeable_xdp_prepare(struct virtnet_info *vi, > @@ -1361,7 +1369,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > 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_frags; > + goto err_xdp; > > act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); > > @@ -1369,7 +1377,7 @@ static struct sk_buff *receive_mergeab...
2023 Mar 23
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...t_headroom(vi))) { > > xdp_room = SKB_DATA_ALIGN(VIRTIO_XDP_HEADROOM + > > sizeof(struct skb_shared_info)); > > @@ -1259,6 +1262,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > > page_address(page) + offset, len); > > frame_sz = PAGE_SIZE; > > offset = VIRTIO_XDP_HEADROOM; > > + > > + put_page(page); > > + page = xdp_page; > > It seems we can limit the scope of xdp_page in this "else if" block. > > > } else { > > xdp_page = page; > > } > &g...
2023 Mar 23
0
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...xdp_room = SKB_DATA_ALIGN(VIRTIO_XDP_HEADROOM + > >>> sizeof(struct skb_shared_info)); > >>> @@ -1259,6 +1262,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > >>> page_address(page) + offset, len); > >>> frame_sz = PAGE_SIZE; > >>> offset = VIRTIO_XDP_HEADROOM; > >>> + > >>> + put_page(page); > >>> + page = xdp_page; > >> > >> It seems we can limit the scope of xdp_page in this "else if" block. > >> > >>&gt...
2020 Sep 25
20
[RFC PATCH 00/19] vhost-user-rpmb (Replay Protected Memory Block)
Hi, This is an initial implementation of a vhost-user backend for the VirtIO RPMB device. The device is currently in the draft of the next VirtIO specification and describes block device which uses combination of a key, nonce, hashing and a persistent write counter to prevent replay attacks (hence Replay Protected Memory Block). It is implemented as a vhost-user device because we want to