Displaying 20 results from an estimated 25 matches for "mergeable_min_buf_len".
2017 May 31
1
remove function pointer casts and constify function tables
...few minutes of testing. Before that patch, my server keeps working.
> >
> > --b.
>
> Others complained about that too.
> I'm still trying to reproduce though.
>
> Meanwhile, could you please locate this line of code:
> + vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
>
> and add something like
> printk(KERN_ERR, "min buf = 0x%x expected 0x%x size 0x%x big %d\n",
> vi->rq[i].min_buf_len, GOOD_PACKET_LEN,
> virtqueue_get_vring_size(vi->rq[i].vq),
> (int)v...
2017 May 31
1
remove function pointer casts and constify function tables
...few minutes of testing. Before that patch, my server keeps working.
> >
> > --b.
>
> Others complained about that too.
> I'm still trying to reproduce though.
>
> Meanwhile, could you please locate this line of code:
> + vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
>
> and add something like
> printk(KERN_ERR, "min buf = 0x%x expected 0x%x size 0x%x big %d\n",
> vi->rq[i].min_buf_len, GOOD_PACKET_LEN,
> virtqueue_get_vring_size(vi->rq[i].vq),
> (int)v...
2017 Mar 29
1
[PATCH] virtio_net: fix support for small rings
...@@ -2086,6 +2090,21 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
virtnet_free_queues(vi);
}
+/* How large should a single buffer be so a queue full of these can fit at
+ * least one full packet?
+ * Logic below assumes the mergeable buffer header is used.
+ */
+static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq)
+{
+ const unsigned int hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
+ unsigned int rq_size = virtqueue_get_vring_size(vq);
+ unsigned int packet_len = vi->big_packets ? IP_MAX_MTU : vi->dev->max_mtu;
+ unsigned int buf_len = hdr_len + E...
2017 Mar 29
1
[PATCH] virtio_net: fix support for small rings
...@@ -2086,6 +2090,21 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
virtnet_free_queues(vi);
}
+/* How large should a single buffer be so a queue full of these can fit at
+ * least one full packet?
+ * Logic below assumes the mergeable buffer header is used.
+ */
+static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq)
+{
+ const unsigned int hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
+ unsigned int rq_size = virtqueue_get_vring_size(vq);
+ unsigned int packet_len = vi->big_packets ? IP_MAX_MTU : vi->dev->max_mtu;
+ unsigned int buf_len = hdr_len + E...
2017 Mar 29
1
[PATCH v2] virtio_net: fix support for small rings
...@@ -2086,6 +2091,21 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
virtnet_free_queues(vi);
}
+/* How large should a single buffer be so a queue full of these can fit at
+ * least one full packet?
+ * Logic below assumes the mergeable buffer header is used.
+ */
+static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq)
+{
+ const unsigned int hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
+ unsigned int rq_size = virtqueue_get_vring_size(vq);
+ unsigned int packet_len = vi->big_packets ? IP_MAX_MTU : vi->dev->max_mtu;
+ unsigned int buf_len = hdr_len + E...
2017 Mar 29
1
[PATCH v2] virtio_net: fix support for small rings
...@@ -2086,6 +2091,21 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
virtnet_free_queues(vi);
}
+/* How large should a single buffer be so a queue full of these can fit at
+ * least one full packet?
+ * Logic below assumes the mergeable buffer header is used.
+ */
+static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq)
+{
+ const unsigned int hdr_len = sizeof(struct virtio_net_hdr_mrg_rxbuf);
+ unsigned int rq_size = virtqueue_get_vring_size(vq);
+ unsigned int packet_len = vi->big_packets ? IP_MAX_MTU : vi->dev->max_mtu;
+ unsigned int buf_len = hdr_len + E...
2017 May 26
3
remove function pointer casts and constify function tables
Looks like the culprit is very likely d85b758f72b0 "virtio_net: fix
support for small rings".
After that patch, my NFS server VM stops responding to packets after a
few minutes of testing. Before that patch, my server keeps working.
--b.
2017 May 30
1
remove function pointer casts and constify function tables
...few minutes of testing. Before that patch, my server keeps working.
> >
> > --b.
>
> Others complained about that too.
> I'm still trying to reproduce though.
>
> Meanwhile, could you please locate this line of code:
> + vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
>
> and add something like
> printk(KERN_ERR, "min buf = 0x%x expected 0x%x size 0x%x big %d\n",
> vi->rq[i].min_buf_len, GOOD_PACKET_LEN,
> virtqueue_get_vring_size(vi->rq[i].vq),
> (int)v...
2017 May 30
1
remove function pointer casts and constify function tables
...few minutes of testing. Before that patch, my server keeps working.
> >
> > --b.
>
> Others complained about that too.
> I'm still trying to reproduce though.
>
> Meanwhile, could you please locate this line of code:
> + vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
>
> and add something like
> printk(KERN_ERR, "min buf = 0x%x expected 0x%x size 0x%x big %d\n",
> vi->rq[i].min_buf_len, GOOD_PACKET_LEN,
> virtqueue_get_vring_size(vi->rq[i].vq),
> (int)v...
2017 Jun 01
4
[PATCH] virtio_net: lower limit on buffer size
...eceive_queue *rq,
unsigned int len;
len = hdr_len + clamp_t(unsigned int, ewma_pkt_len_read(avg_pkt_len),
- rq->min_buf_len - hdr_len, PAGE_SIZE - hdr_len);
+ rq->min_buf_len, PAGE_SIZE - hdr_len);
return ALIGN(len, L1_CACHE_BYTES);
}
@@ -2039,7 +2039,8 @@ static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqu
unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len;
unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size);
- return max(min_buf_len, hdr_len);
+ return max(max(min_buf_len, hdr_len) - hdr_len,
+ (unsigned int)GOOD_PACKET_LEN);
}...
2017 Jun 01
4
[PATCH] virtio_net: lower limit on buffer size
...eceive_queue *rq,
unsigned int len;
len = hdr_len + clamp_t(unsigned int, ewma_pkt_len_read(avg_pkt_len),
- rq->min_buf_len - hdr_len, PAGE_SIZE - hdr_len);
+ rq->min_buf_len, PAGE_SIZE - hdr_len);
return ALIGN(len, L1_CACHE_BYTES);
}
@@ -2039,7 +2039,8 @@ static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqu
unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len;
unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size);
- return max(min_buf_len, hdr_len);
+ return max(max(min_buf_len, hdr_len) - hdr_len,
+ (unsigned int)GOOD_PACKET_LEN);
}...
2017 May 22
2
network performance degradation in virtio_net in 4.12-rc
Hi
I see severe network performance degradation with the kernels 4.12-rc1 and
4.12-rc2 in the network virtio driver. Download rate drops down to about
100kB/s.
I bisected it and it is caused by patch
d85b758f72b05a774045545f24d70980e3e9aac4 ("virtio_net: fix support for
small rings"). When I revert this patch, the problem goes away.
The host is Debian Jessie with kernel 4.4.62,
2017 May 22
2
network performance degradation in virtio_net in 4.12-rc
Hi
I see severe network performance degradation with the kernels 4.12-rc1 and
4.12-rc2 in the network virtio driver. Download rate drops down to about
100kB/s.
I bisected it and it is caused by patch
d85b758f72b05a774045545f24d70980e3e9aac4 ("virtio_net: fix support for
small rings"). When I revert this patch, the problem goes away.
The host is Debian Jessie with kernel 4.4.62,
2017 May 22
0
network performance degradation in virtio_net in 4.12-rc
...s Debian Jessie with kernel 4.4.62, the guest is Debian Sid with
> kernel 4.12-rc.
>
> Mikulas
Thanks for the report!
I'm not sure what causes it on this host. I'll try to reproduce.
Meanwhile, could you please locate this line of code:
+ vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
and add something like
printk(KERN_ERR, "min buf = 0x%x expected 0x%x size 0x%x big %d\n",
vi->rq[i].min_buf_len, GOOD_PACKET_LEN,
virtqueue_get_vring_size(vi->rq[i].vq),
(int)vi->big_packets);
after it?
Then boot and capture the o...
2017 May 30
0
remove function pointer casts and constify function tables
...tops responding to packets after a
> few minutes of testing. Before that patch, my server keeps working.
>
> --b.
Others complained about that too.
I'm still trying to reproduce though.
Meanwhile, could you please locate this line of code:
+ vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
and add something like
printk(KERN_ERR, "min buf = 0x%x expected 0x%x size 0x%x big %d\n",
vi->rq[i].min_buf_len, GOOD_PACKET_LEN,
virtqueue_get_vring_size(vi->rq[i].vq),
(int)vi->big_packets);
after it?...
2017 Jun 02
1
[PATCH v2] virtio_net: lower limit on buffer size
...eceive_queue *rq,
unsigned int len;
len = hdr_len + clamp_t(unsigned int, ewma_pkt_len_read(avg_pkt_len),
- rq->min_buf_len - hdr_len, PAGE_SIZE - hdr_len);
+ rq->min_buf_len, PAGE_SIZE - hdr_len);
return ALIGN(len, L1_CACHE_BYTES);
}
@@ -2039,7 +2039,8 @@ static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqu
unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len;
unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size);
- return max(min_buf_len, hdr_len);
+ return max(max(min_buf_len, hdr_len) - hdr_len,
+ (unsigned int)GOOD_PACKET_LEN);
}...
2017 Jun 02
1
[PATCH v2] virtio_net: lower limit on buffer size
...eceive_queue *rq,
unsigned int len;
len = hdr_len + clamp_t(unsigned int, ewma_pkt_len_read(avg_pkt_len),
- rq->min_buf_len - hdr_len, PAGE_SIZE - hdr_len);
+ rq->min_buf_len, PAGE_SIZE - hdr_len);
return ALIGN(len, L1_CACHE_BYTES);
}
@@ -2039,7 +2039,8 @@ static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqu
unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len;
unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size);
- return max(min_buf_len, hdr_len);
+ return max(max(min_buf_len, hdr_len) - hdr_len,
+ (unsigned int)GOOD_PACKET_LEN);
}...
2017 May 26
3
remove function pointer casts and constify function tables
Probably should have cc'd virtualization at lists.linux-foundation.org too.
On Fri, May 26, 2017 at 11:08:39AM -0400, bfields at fieldses.org wrote:
> On Tue, May 23, 2017 at 08:23:34AM -0400, bfields at fieldses.org wrote:
> > Unfortunately I can't get anything through testing. It's not your
> > patches, it's something in -rc1. My server VM stops responding to
2017 May 26
3
remove function pointer casts and constify function tables
Probably should have cc'd virtualization at lists.linux-foundation.org too.
On Fri, May 26, 2017 at 11:08:39AM -0400, bfields at fieldses.org wrote:
> On Tue, May 23, 2017 at 08:23:34AM -0400, bfields at fieldses.org wrote:
> > Unfortunately I can't get anything through testing. It's not your
> > patches, it's something in -rc1. My server VM stops responding to
2023 Apr 30
1
[RFC PATCH net 2/3] virtio-net: allow usage of vrings smaller than MAX_SKB_FRAGS + 2
...->mtu > ETH_DATA_LEN)
+ vi->dev->mtu = ETH_DATA_LEN;
+
+ /* Don't use big packets */
+ vi->big_packets = false;
+ vi->big_packets_num_skbfrags = 1;
+
+ /* Fix min_buf_len for receive virtqueues */
+ for (i = 0; i < vi->max_queue_pairs; i++)
+ vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq);
+
+ return 0;
+}
+
static int virtnet_probe(struct virtio_device *vdev)
{
int i, err = -ENOMEM;
@@ -4061,6 +4192,14 @@ static int virtnet_probe(struct virtio_device *vdev)
if (err)
goto free;
+ /* Do required fixups in case we are using small vrings */
+ err = virtn...