search for: mrg_ctx

Displaying 20 results from an estimated 63 matches for "mrg_ctx".

Did you mean: irq_ctx
2017 Jul 18
1
[PATCH net-next 2/5] virtio-net: pack headroom into ctx for mergeable buffer
...tio_net.c b/drivers/net/virtio_net.c > index 1f8c15c..8fae9a8 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -270,6 +270,23 @@ static void skb_xmit_done(struct virtqueue *vq) > netif_wake_subqueue(vi->dev, vq2txq(vq)); > } > > +#define MRG_CTX_HEADER_SHIFT 22 > +static void *mergeable_len_to_ctx(unsigned int truesize, > + unsigned int headroom) > +{ > + return (void *)(unsigned long)((headroom << MRG_CTX_HEADER_SHIFT) | truesize); > +} > + > +static unsigned int mergeable_ctx_to_headroom(void *mrg_ctx) &gt...
2017 Jul 18
1
[PATCH net-next 2/5] virtio-net: pack headroom into ctx for mergeable buffer
...tio_net.c b/drivers/net/virtio_net.c > index 1f8c15c..8fae9a8 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -270,6 +270,23 @@ static void skb_xmit_done(struct virtqueue *vq) > netif_wake_subqueue(vi->dev, vq2txq(vq)); > } > > +#define MRG_CTX_HEADER_SHIFT 22 > +static void *mergeable_len_to_ctx(unsigned int truesize, > + unsigned int headroom) > +{ > + return (void *)(unsigned long)((headroom << MRG_CTX_HEADER_SHIFT) | truesize); > +} > + > +static unsigned int mergeable_ctx_to_headroom(void *mrg_ctx) &gt...
2017 Jul 17
0
[PATCH net-next 2/5] virtio-net: pack headroom into ctx for mergeable buffer
...letions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 1f8c15c..8fae9a8 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -270,6 +270,23 @@ static void skb_xmit_done(struct virtqueue *vq) netif_wake_subqueue(vi->dev, vq2txq(vq)); } +#define MRG_CTX_HEADER_SHIFT 22 +static void *mergeable_len_to_ctx(unsigned int truesize, + unsigned int headroom) +{ + return (void *)(unsigned long)((headroom << MRG_CTX_HEADER_SHIFT) | truesize); +} + +static unsigned int mergeable_ctx_to_headroom(void *mrg_ctx) +{ + return (unsigned long)mrg_ctx &gt...
2017 Jan 23
1
[PATCH] virtio_net: fix PAGE_SIZE > 64k
I don't have any guests with PAGE_SIZE > 64k but the code seems to be clearly broken in that case as PAGE_SIZE / MERGEABLE_BUFFER_ALIGN will need more than 8 bit and so the code in mergeable_ctx_to_buf_address does not give us the actual true size. Cc: John Fastabend <john.fastabend at gmail.com> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- Lightly tested on x86
2017 Jan 23
1
[PATCH] virtio_net: fix PAGE_SIZE > 64k
I don't have any guests with PAGE_SIZE > 64k but the code seems to be clearly broken in that case as PAGE_SIZE / MERGEABLE_BUFFER_ALIGN will need more than 8 bit and so the code in mergeable_ctx_to_buf_address does not give us the actual true size. Cc: John Fastabend <john.fastabend at gmail.com> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- Lightly tested on x86
2017 Mar 29
0
[PATCH 5/6] virtio_net: rework mergeable buffer handling
...vers/net/virtio_net.c index 340f737..94f94f3 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -250,24 +250,6 @@ static void skb_xmit_done(struct virtqueue *vq) netif_wake_subqueue(vi->dev, vq2txq(vq)); } -static unsigned int mergeable_ctx_to_buf_truesize(unsigned long mrg_ctx) -{ - unsigned int truesize = mrg_ctx & (MERGEABLE_BUFFER_ALIGN - 1); - return (truesize + 1) * MERGEABLE_BUFFER_ALIGN; -} - -static void *mergeable_ctx_to_buf_address(unsigned long mrg_ctx) -{ - return (void *)(mrg_ctx & -MERGEABLE_BUFFER_ALIGN); - -} - -static unsigned long mergeable_buf_...
2017 Mar 29
0
[PATCH 5/6] virtio_net: rework mergeable buffer handling
...vers/net/virtio_net.c index 340f737..94f94f3 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -250,24 +250,6 @@ static void skb_xmit_done(struct virtqueue *vq) netif_wake_subqueue(vi->dev, vq2txq(vq)); } -static unsigned int mergeable_ctx_to_buf_truesize(unsigned long mrg_ctx) -{ - unsigned int truesize = mrg_ctx & (MERGEABLE_BUFFER_ALIGN - 1); - return (truesize + 1) * MERGEABLE_BUFFER_ALIGN; -} - -static void *mergeable_ctx_to_buf_address(unsigned long mrg_ctx) -{ - return (void *)(mrg_ctx & -MERGEABLE_BUFFER_ALIGN); - -} - -static unsigned long mergeable_buf_...
2014 Jan 16
0
[PATCH net-next v4 3/6] virtio-net: auto-tune mergeable rx buffer size for improved performance
...+ struct ewma mrg_avg_pkt_len; + /* Page frag for packet buffer allocation. */ struct page_frag alloc_frag; @@ -219,6 +230,23 @@ static void skb_xmit_done(struct virtqueue *vq) netif_wake_subqueue(vi->dev, vq2txq(vq)); } +static unsigned int mergeable_ctx_to_buf_truesize(unsigned long mrg_ctx) +{ + unsigned int truesize = mrg_ctx & (MERGEABLE_BUFFER_ALIGN - 1); + return truesize * MERGEABLE_BUFFER_ALIGN; +} + +static void *mergeable_ctx_to_buf_address(unsigned long mrg_ctx) +{ + return (void *)(mrg_ctx & -MERGEABLE_BUFFER_ALIGN); + +} + +static unsigned long mergeable_buf_to_ctx...
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
2014 Oct 15
2
[RFC PATCH net-next 5/6] virtio-net: enable tx interrupt
...;> > - netif_wake_subqueue(vi->dev, vq2txq(vq)); >> > + if (napi_schedule_prep(&sq->napi)) { >> > + __napi_schedule(&sq->napi); >> > + } >> > } >> > >> > static unsigned int mergeable_ctx_to_buf_truesize(unsigned long mrg_ctx) >> > @@ -774,7 +801,39 @@ again: >> > return received; >> > } >> > >> > +static int virtnet_poll_tx(struct napi_struct *napi, int budget) >> > +{ >> > + struct send_queue *sq = >> > + container_of(napi, struct send_queue...
2014 Oct 15
2
[RFC PATCH net-next 5/6] virtio-net: enable tx interrupt
...;> > - netif_wake_subqueue(vi->dev, vq2txq(vq)); >> > + if (napi_schedule_prep(&sq->napi)) { >> > + __napi_schedule(&sq->napi); >> > + } >> > } >> > >> > static unsigned int mergeable_ctx_to_buf_truesize(unsigned long mrg_ctx) >> > @@ -774,7 +801,39 @@ again: >> > return received; >> > } >> > >> > +static int virtnet_poll_tx(struct napi_struct *napi, int budget) >> > +{ >> > + struct send_queue *sq = >> > + container_of(napi, struct send_queue...
2014 Oct 14
4
[PATCH RFC] virtio_net: enable tx interrupt
...ts. */ - virtqueue_disable_cb(vq); - - /* We were probably waiting for more output buffers. */ - netif_wake_subqueue(vi->dev, vq2txq(vq)); + if (napi_schedule_prep(&sq->napi)) { + __napi_schedule(&sq->napi); + } } static unsigned int mergeable_ctx_to_buf_truesize(unsigned long mrg_ctx) @@ -766,6 +791,37 @@ again: return received; } +static int virtnet_poll_tx(struct napi_struct *napi, int budget) +{ + struct send_queue *sq = + container_of(napi, struct send_queue, napi); + struct virtnet_info *vi = sq->vq->vdev->priv; + struct netdev_queue *txq = netdev_get_tx_que...
2014 Oct 14
4
[PATCH RFC] virtio_net: enable tx interrupt
...ts. */ - virtqueue_disable_cb(vq); - - /* We were probably waiting for more output buffers. */ - netif_wake_subqueue(vi->dev, vq2txq(vq)); + if (napi_schedule_prep(&sq->napi)) { + __napi_schedule(&sq->napi); + } } static unsigned int mergeable_ctx_to_buf_truesize(unsigned long mrg_ctx) @@ -766,6 +791,37 @@ again: return received; } +static int virtnet_poll_tx(struct napi_struct *napi, int budget) +{ + struct send_queue *sq = + container_of(napi, struct send_queue, napi); + struct virtnet_info *vi = sq->vq->vdev->priv; + struct netdev_queue *txq = netdev_get_tx_que...
2014 Jan 16
13
[PATCH net-next v4 1/6] net: allow > 0 order atomic page alloc in skb_page_frag_refill
skb_page_frag_refill currently permits only order-0 page allocs unless GFP_WAIT is used. Change skb_page_frag_refill to attempt higher-order page allocations whether or not GFP_WAIT is used. If memory cannot be allocated, the allocator will fall back to successively smaller page allocs (down to order-0 page allocs). This change brings skb_page_frag_refill in line with the existing page allocation
2014 Jan 16
13
[PATCH net-next v4 1/6] net: allow > 0 order atomic page alloc in skb_page_frag_refill
skb_page_frag_refill currently permits only order-0 page allocs unless GFP_WAIT is used. Change skb_page_frag_refill to attempt higher-order page allocations whether or not GFP_WAIT is used. If memory cannot be allocated, the allocator will fall back to successively smaller page allocs (down to order-0 page allocs). This change brings skb_page_frag_refill in line with the existing page allocation
2014 Jan 17
7
[PATCH net-next v5 0/6] virtio-net: mergeable rx buffer size auto-tuning
The virtio-net device currently uses aligned MTU-sized mergeable receive packet buffers. Network throughput for workloads with large average packet size can be improved by posting larger receive packet buffers. However, due to SKB truesize effects, posting large (e.g, PAGE_SIZE) buffers reduces the throughput of workloads that do not benefit from GRO and have no large inbound packets. This
2014 Jan 17
7
[PATCH net-next v5 0/6] virtio-net: mergeable rx buffer size auto-tuning
The virtio-net device currently uses aligned MTU-sized mergeable receive packet buffers. Network throughput for workloads with large average packet size can be improved by posting larger receive packet buffers. However, due to SKB truesize effects, posting large (e.g, PAGE_SIZE) buffers reduces the throughput of workloads that do not benefit from GRO and have no large inbound packets. This
2014 Oct 14
0
[PATCH RFC] virtio_net: enable tx interrupt
...; - /* We were probably waiting for more output buffers. */ > - netif_wake_subqueue(vi->dev, vq2txq(vq)); > + if (napi_schedule_prep(&sq->napi)) { > + __napi_schedule(&sq->napi); > + } > } > > static unsigned int mergeable_ctx_to_buf_truesize(unsigned long mrg_ctx)
2017 Jul 19
9
[PATCH net-next V2 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 Changes from V1: - Various tweaks on commit logs and comments - Use virtnet_napi_enable() when enabling NAPI on XDP set - Copy the small buffer packet only if xdp_headroom is smaller than required Please review. Thanks Jason Wang (5): virtio_ring: allow to store zero as