virtio_net: lower limit on buffer size
Subsystems (4)
Michael S. Tsirkin
maintainerPATCH 1/1 virtio_net: lower limit on buffer size
commit d85b758f72b0 "virtio_net: fix support for small rings" was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
---
Can reporters please confirm whether the following helps?
If it does I think we should queue it even though I expect I'll need to investigate the exact reasons for the failure down the road - probably a hypervisor bug.
drivers/net/virtio_net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/virtio_net.c +3 -2
@@ -842,7 +842,7 @@ static unsigned int get_mergeable_buf_len(struct receive_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 virtquunsigned 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 ); }static int virtnet_find_vqs (struct virtnet_info *vi)
Signature · 1 line
MST
Quoted 7 lines · Michael S. Tsirkin
commit
d85b758f72b0"virtio_net: fix support for small rings" was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
Quoted 7 lines
Fixes d85b758f72b0 "virtio_net: fix support for small rings"Reported-by Mikulas Patocka <[email protected]>Reported-by "J. Bruce Fields" <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Can reporters please confirm whether the following helps?
Works for me.
--b.
Quoted 32 lines
If it does I think we should queue it even though I expect I'll need to investigate the exact reasons for the failure down the road - probably a hypervisor bug.
drivers/net/virtio_net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/virtio_net.c +3
-2@@ -842,7 +842,7 @@ static unsigned int get_mergeable_buf_len(struct receive_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 virtquunsigned 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 ); }static int virtnet_find_vqs (struct virtnet_info *vi)Signature · 1 line
MST
Quoted 7 lines · Michael S. Tsirkin
commit
d85b758f72b0"virtio_net: fix support for small rings" was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
Quoted 7 lines
Fixes d85b758f72b0 "virtio_net: fix support for small rings"Reported-by Mikulas Patocka <[email protected]>Reported-by "J. Bruce Fields" <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Can reporters please confirm whether the following helps?
Works for me.
--b.
Quoted 32 lines
If it does I think we should queue it even though I expect I'll need to investigate the exact reasons for the failure down the road - probably a hypervisor bug.
drivers/net/virtio_net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/virtio_net.c +3
-2@@ -842,7 +842,7 @@ static unsigned int get_mergeable_buf_len(struct receive_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 virtquunsigned 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 ); }static int virtnet_find_vqs (struct virtnet_info *vi)Signature · 1 line
MST
Hello!
Quoted 1 line · Michael S. Tsirkin
commit
d85b758f72b0"virtio_net: fix support for small rings"
Commit d85b758f72b0 ("virtio_net: fix support for small rings")
Quoted 7 lines
was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
Fixes d85b758f72b0 "virtio_net: fix support for small rings"
Quoted 3 lines
Reported-by Mikulas Patocka <[email protected]>Reported-by "J. Bruce Fields" <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
[...]
MBR, Sergei
Quoted 11 lines · Michael S. Tsirkin
commit
d85b758f72b0"virtio_net: fix support for small rings" was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.Fixes d85b758f72b0 "virtio_net: fix support for small rings"Reported-by Mikulas Patocka <[email protected]>Reported-by "J. Bruce Fields" <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
Quoted 6 lines
---
Can reporters please confirm whether the following helps?
If it does I think we should queue it even though I expect I'll need to investigate the exact reasons for the failure down the road - probably a hypervisor bug.
Hi
This patch fixes the problem for me.
Mikulas
Quoted 29 lines
drivers/net/virtio_net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/virtio_net.c +3
-2@@ -842,7 +842,7 @@ static unsigned int get_mergeable_buf_len(struct receive_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 virtquunsigned 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 ); }static int virtnet_find_vqs (struct virtnet_info *vi)Signature · 1 line
MST
Quoted 11 lines · Michael S. Tsirkin
commit
d85b758f72b0"virtio_net: fix support for small rings" was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.Fixes d85b758f72b0 "virtio_net: fix support for small rings"Reported-by Mikulas Patocka <[email protected]>Reported-by "J. Bruce Fields" <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
Quoted 6 lines
---
Can reporters please confirm whether the following helps?
If it does I think we should queue it even though I expect I'll need to investigate the exact reasons for the failure down the road - probably a hypervisor bug.
Hi
This patch fixes the problem for me.
Mikulas
Quoted 29 lines
drivers/net/virtio_net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/net/virtio_net.c +3
-2@@ -842,7 +842,7 @@ static unsigned int get_mergeable_buf_len(struct receive_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 virtquunsigned 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 ); }static int virtnet_find_vqs (struct virtnet_info *vi)Signature · 1 line
MST
Quoted 14 lines · Sergei Shtylyov
Hello!
Quoted 1 line · Michael S. Tsirkin
commit
d85b758f72b0"virtio_net: fix support for small rings"Commit
d85b758f72b0("virtio_net: fix support for small rings")Quoted 6 lines
was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
Quoted 3 lines
Quoted 1 line
Fixes d85b758f72b0 "virtio_net: fix support for small rings"Fixes d85b758f72b0 ("virtio_net: fix support for small rings")
I may be bikeshedding, but, personally I never do the parens--they're redundant given the quotes, and space is often tight.
--b.
Quoted 7 lines
Quoted 4 lines
Reported-by Mikulas Patocka <[email protected]>Reported-by "J. Bruce Fields" <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>[...]
MBR, Sergei
Quoted 14 lines · Sergei Shtylyov
Hello!
Quoted 1 line · Michael S. Tsirkin
commit
d85b758f72b0"virtio_net: fix support for small rings"Commit
d85b758f72b0("virtio_net: fix support for small rings")Quoted 6 lines
was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
Quoted 3 lines
Quoted 1 line
Fixes d85b758f72b0 "virtio_net: fix support for small rings"Fixes d85b758f72b0 ("virtio_net: fix support for small rings")
I may be bikeshedding, but, personally I never do the parens--they're redundant given the quotes, and space is often tight.
--b.
Quoted 7 lines
Quoted 4 lines
Reported-by Mikulas Patocka <[email protected]>Reported-by "J. Bruce Fields" <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>[...]
MBR, Sergei
Quoted 10 lines · J. Bruce Fields
Quoted 10 lines
Quoted 1 line
commit
d85b758f72b0"virtio_net: fix support for small rings"Commit
d85b758f72b0("virtio_net: fix support for small rings")Quoted 6 lines
was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Fixes d85b758f72b0 "virtio_net: fix support for small rings"Fixes d85b758f72b0 ("virtio_net: fix support for small rings")I may be bikeshedding, but, personally I never do the parens--they're redundant given the quotes, and space is often tight.
Just see Documetation/process/submitting-patches.rst.
MBR, Sergei
Quoted 10 lines · J. Bruce Fields
Quoted 10 lines
Quoted 1 line
commit
d85b758f72b0"virtio_net: fix support for small rings"Commit
d85b758f72b0("virtio_net: fix support for small rings")Quoted 6 lines
was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Fixes d85b758f72b0 "virtio_net: fix support for small rings"Fixes d85b758f72b0 ("virtio_net: fix support for small rings")I may be bikeshedding, but, personally I never do the parens--they're redundant given the quotes, and space is often tight.
Just see Documetation/process/submitting-patches.rst.
MBR, Sergei
Quoted 12 lines · Sergei Shtylyov
Quoted 10 lines · J. Bruce Fields
Quoted 10 lines
Quoted 1 line
commit
d85b758f72b0"virtio_net: fix support for small rings"Commit
d85b758f72b0("virtio_net: fix support for small rings")Quoted 6 lines
was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Fixes d85b758f72b0 "virtio_net: fix support for small rings"Fixes d85b758f72b0 ("virtio_net: fix support for small rings")I may be bikeshedding, but, personally I never do the parens--they're redundant given the quotes, and space is often tight.
Just see
Documetation/process/submitting-patches.rst.
Yeah, I know, I claim it's a bad rule (but I'm too lazy to send a patch, so, weight my opinion accordingly).
--b.
Quoted 12 lines · Sergei Shtylyov
Quoted 10 lines · J. Bruce Fields
Quoted 10 lines
Quoted 1 line
commit
d85b758f72b0"virtio_net: fix support for small rings"Commit
d85b758f72b0("virtio_net: fix support for small rings")Quoted 6 lines
was supposed to increase the buffer size for small rings but had an unintentional side effect of decreasing it for large rings. This seems to break some setups - it's not yet clear why, but increasing buffer size back to what it was before helps.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Fixes d85b758f72b0 "virtio_net: fix support for small rings"Fixes d85b758f72b0 ("virtio_net: fix support for small rings")I may be bikeshedding, but, personally I never do the parens--they're redundant given the quotes, and space is often tight.
Just see
Documetation/process/submitting-patches.rst.
Yeah, I know, I claim it's a bad rule (but I'm too lazy to send a patch, so, weight my opinion accordingly).
--b.