Displaying 12 results from an estimated 12 matches for "mergeable_receive_buf_ctx".
2014 Jan 07
0
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...e to short-term, transient changes in packet size.
+ */
+#define RECEIVE_AVG_WEIGHT 64
+
#define VIRTNET_DRIVER_VERSION "1.0.0"
struct virtnet_stats {
@@ -65,11 +70,30 @@ struct send_queue {
char name[40];
};
+/* Per-packet buffer context for mergeable receive buffers. */
+struct mergeable_receive_buf_ctx {
+ /* Packet buffer base address. */
+ void *buf;
+
+ /* Original size of the packet buffer for use in SKB truesize. Does not
+ * include any padding space used to avoid internal fragmentation.
+ */
+ unsigned int truesize;
+};
+
/* Internal representation of a receive virtqueue */
struct rece...
2014 Jan 08
3
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...> +#define RECEIVE_AVG_WEIGHT 64
> +
> #define VIRTNET_DRIVER_VERSION "1.0.0"
>
> struct virtnet_stats {
> @@ -65,11 +70,30 @@ struct send_queue {
> char name[40];
> };
>
> +/* Per-packet buffer context for mergeable receive buffers. */
> +struct mergeable_receive_buf_ctx {
> + /* Packet buffer base address. */
> + void *buf;
> +
> + /* Original size of the packet buffer for use in SKB truesize. Does not
> + * include any padding space used to avoid internal fragmentation.
> + */
> + unsigned int truesize;
> +};
> +
> /* Internal rep...
2014 Jan 08
3
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...> +#define RECEIVE_AVG_WEIGHT 64
> +
> #define VIRTNET_DRIVER_VERSION "1.0.0"
>
> struct virtnet_stats {
> @@ -65,11 +70,30 @@ struct send_queue {
> char name[40];
> };
>
> +/* Per-packet buffer context for mergeable receive buffers. */
> +struct mergeable_receive_buf_ctx {
> + /* Packet buffer base address. */
> + void *buf;
> +
> + /* Original size of the packet buffer for use in SKB truesize. Does not
> + * include any padding space used to avoid internal fragmentation.
> + */
> + unsigned int truesize;
> +};
> +
> /* Internal rep...
2014 Jan 09
3
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...> +#define RECEIVE_AVG_WEIGHT 64
> +
> #define VIRTNET_DRIVER_VERSION "1.0.0"
>
> struct virtnet_stats {
> @@ -65,11 +70,30 @@ struct send_queue {
> char name[40];
> };
>
> +/* Per-packet buffer context for mergeable receive buffers. */
> +struct mergeable_receive_buf_ctx {
> + /* Packet buffer base address. */
> + void *buf;
> +
> + /* Original size of the packet buffer for use in SKB truesize. Does not
> + * include any padding space used to avoid internal fragmentation.
> + */
> + unsigned int truesize;
Don't need full int really, it...
2014 Jan 09
3
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...> +#define RECEIVE_AVG_WEIGHT 64
> +
> #define VIRTNET_DRIVER_VERSION "1.0.0"
>
> struct virtnet_stats {
> @@ -65,11 +70,30 @@ struct send_queue {
> char name[40];
> };
>
> +/* Per-packet buffer context for mergeable receive buffers. */
> +struct mergeable_receive_buf_ctx {
> + /* Packet buffer base address. */
> + void *buf;
> +
> + /* Original size of the packet buffer for use in SKB truesize. Does not
> + * include any padding space used to avoid internal fragmentation.
> + */
> + unsigned int truesize;
Don't need full int really, it...
2014 Jan 07
10
[PATCH net-next v2 1/4] 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 07
10
[PATCH net-next v2 1/4] 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 08
0
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...rq->mrg_buf_ctx until we know the ring isn't full (otherwise, we
clobber an in-use entry). It is safe to modify rq->mrg_buf_ctx
after we know that virtqueue_add_inbuf has succeeded.
I can remove the rq_num_free check from try_fill_recv, and then
modify virtqueue_add_inbuf to use a local mergeable_receive_buf_ctx.
Once virtqueue_add_inbuf succeeds, the contents of the local variable
can be copied to rq->mrg_buf_ctx[rq->mrg_buf_ctx_head].
Best,
Mike
2014 Jan 09
0
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...s often(e.g., netperf benefiting from GSO/GRO), we would be
allocating 1 SKB per packet buffer instead of 1 SKB per MAX_SKB_FRAGS
buffers. How do you feel about any of the below alternatives:
(1) Modify the existing mrg_buf_ctx to chain together free entries
We can use the 'buf' pointer in mergeable_receive_buf_ctx to chain
together free entries so that we can support OOO completions. This would
be similar to how virtio-queue manages free sg entries.
(2) Combine the buffer pointer and truesize into a single void* value
Your point about there only being a byte needed to encode truesize is
spot on, and I think...
2014 Jan 08
1
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...we know the ring isn't full (otherwise, we
> clobber an in-use entry). It is safe to modify rq->mrg_buf_ctx
> after we know that virtqueue_add_inbuf has succeeded.
>
> I can remove the rq_num_free check from try_fill_recv, and then
> modify virtqueue_add_inbuf to use a local mergeable_receive_buf_ctx.
> Once virtqueue_add_inbuf succeeds, the contents of the local variable
> can be copied to rq->mrg_buf_ctx[rq->mrg_buf_ctx_head].
>
> Best,
>
> Mike
You don't have to fill in ctx before calling add_inbuf, do you?
Just fill it afterwards.
--
MST
2014 Jan 08
1
[PATCH net-next v2 3/4] virtio-net: auto-tune mergeable rx buffer size for improved performance
...we know the ring isn't full (otherwise, we
> clobber an in-use entry). It is safe to modify rq->mrg_buf_ctx
> after we know that virtqueue_add_inbuf has succeeded.
>
> I can remove the rq_num_free check from try_fill_recv, and then
> modify virtqueue_add_inbuf to use a local mergeable_receive_buf_ctx.
> Once virtqueue_add_inbuf succeeds, the contents of the local variable
> can be copied to rq->mrg_buf_ctx[rq->mrg_buf_ctx_head].
>
> Best,
>
> Mike
You don't have to fill in ctx before calling add_inbuf, do you?
Just fill it afterwards.
--
MST
2014 Jan 07
0
[PATCH net-next v2 4/4] virtio-net: initial debugfs support, export mergeable rx buffer size
...uf_mergeable(struct receive_queue *rq, gfp_t gfp)
{
const unsigned int ring_size = rq->mrg_buf_ctx_size;
- const size_t hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
struct page_frag *alloc_frag = &rq->alloc_frag;
+ struct virtnet_info *vi = rq->vq->vdev->priv;
struct mergeable_receive_buf_ctx *ctx;
int err;
unsigned int len, hole;
- len = hdr_len + clamp_t(unsigned int, ewma_read(&rq->mrg_avg_pkt_len),
- GOOD_PACKET_LEN, PAGE_SIZE - hdr_len);
- len = ALIGN(len, L1_CACHE_BYTES);
+ /* avg_pkt_len is written only in NAPI rx softirq context. We may
+ * read avg_pkt_len with...