[PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting

Laurent Vivier posted 3 patches 6 months, 3 weeks ago
drivers/net/virtio_net.c     | 14 ++++++++++----
drivers/virtio/virtio_ring.c |  8 ++++++--
2 files changed, 16 insertions(+), 6 deletions(-)
[PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Laurent Vivier 6 months, 3 weeks ago
This patch series contains two fixes and a cleanup for the virtio subsystem.

The first patch fixes an error reporting bug in virtio_ring's
virtqueue_resize() function. Previously, errors from internal resize
helpers could be masked if the subsequent re-enabling of the virtqueue
succeeded. This patch restores the correct error propagation, ensuring that
callers of virtqueue_resize() are properly informed of underlying resize
failures.

The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'

The third patch addresses a reliability issue in virtio_net where the TX
ring size could be configured too small, potentially leading to
persistently stopped queues and degraded performance. It enforces a
minimum TX ring size to ensure there's always enough space for at least one
maximally-fragmented packet plus an additional slot.

v2: clenup '2+MAX_SKB_FRAGS'

Laurent Vivier (3):
  virtio_ring: Fix error reporting in virtqueue_resize
  virtio_net: Cleanup '2+MAX_SKB_FRAGS'
  virtio_net: Enforce minimum TX ring size for reliability

 drivers/net/virtio_net.c     | 14 ++++++++++----
 drivers/virtio/virtio_ring.c |  8 ++++++--
 2 files changed, 16 insertions(+), 6 deletions(-)

-- 
2.49.0

Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Paolo Abeni 6 months, 2 weeks ago
On 5/21/25 11:22 AM, Laurent Vivier wrote:
> This patch series contains two fixes and a cleanup for the virtio subsystem.
> 
> The first patch fixes an error reporting bug in virtio_ring's
> virtqueue_resize() function. Previously, errors from internal resize
> helpers could be masked if the subsequent re-enabling of the virtqueue
> succeeded. This patch restores the correct error propagation, ensuring that
> callers of virtqueue_resize() are properly informed of underlying resize
> failures.
> 
> The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'
> 
> The third patch addresses a reliability issue in virtio_net where the TX
> ring size could be configured too small, potentially leading to
> persistently stopped queues and degraded performance. It enforces a
> minimum TX ring size to ensure there's always enough space for at least one
> maximally-fragmented packet plus an additional slot.

@Michael: it's not clear to me if you prefer take this series via your
tree or if it should go via net. Please LMK, thanks!

Paolo
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Michael S. Tsirkin 5 months, 2 weeks ago
On Wed, May 28, 2025 at 08:24:32AM +0200, Paolo Abeni wrote:
> On 5/21/25 11:22 AM, Laurent Vivier wrote:
> > This patch series contains two fixes and a cleanup for the virtio subsystem.
> > 
> > The first patch fixes an error reporting bug in virtio_ring's
> > virtqueue_resize() function. Previously, errors from internal resize
> > helpers could be masked if the subsequent re-enabling of the virtqueue
> > succeeded. This patch restores the correct error propagation, ensuring that
> > callers of virtqueue_resize() are properly informed of underlying resize
> > failures.
> > 
> > The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'
> > 
> > The third patch addresses a reliability issue in virtio_net where the TX
> > ring size could be configured too small, potentially leading to
> > persistently stopped queues and degraded performance. It enforces a
> > minimum TX ring size to ensure there's always enough space for at least one
> > maximally-fragmented packet plus an additional slot.
> 
> @Michael: it's not clear to me if you prefer take this series via your
> tree or if it should go via net. Please LMK, thanks!
> 
> Paolo

I take it back: given I am still not fully operational, I'd like it
to be merged through net please. Does it have to be resubmitted for
this?

Acked-by: Michael S. Tsirkin <mst@redhat.com>

-- 
MST
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Paolo Abeni 5 months, 2 weeks ago
On 7/3/25 11:31 AM, Michael S. Tsirkin wrote:
> On Wed, May 28, 2025 at 08:24:32AM +0200, Paolo Abeni wrote:
>> On 5/21/25 11:22 AM, Laurent Vivier wrote:
>>> This patch series contains two fixes and a cleanup for the virtio subsystem.
>>>
>>> The first patch fixes an error reporting bug in virtio_ring's
>>> virtqueue_resize() function. Previously, errors from internal resize
>>> helpers could be masked if the subsequent re-enabling of the virtqueue
>>> succeeded. This patch restores the correct error propagation, ensuring that
>>> callers of virtqueue_resize() are properly informed of underlying resize
>>> failures.
>>>
>>> The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'
>>>
>>> The third patch addresses a reliability issue in virtio_net where the TX
>>> ring size could be configured too small, potentially leading to
>>> persistently stopped queues and degraded performance. It enforces a
>>> minimum TX ring size to ensure there's always enough space for at least one
>>> maximally-fragmented packet plus an additional slot.
>>
>> @Michael: it's not clear to me if you prefer take this series via your
>> tree or if it should go via net. Please LMK, thanks!
>>
>> Paolo
> 
> I take it back: given I am still not fully operational, I'd like it
> to be merged through net please. Does it have to be resubmitted for
> this?
> 
> Acked-by: Michael S. Tsirkin <mst@redhat.com>

I just resurrected the series in PW, so no need to repost it.

Thanks,

Paolo
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Jakub Kicinski 5 months, 1 week ago
On Thu, 3 Jul 2025 11:34:55 +0200 Paolo Abeni wrote:
> On 7/3/25 11:31 AM, Michael S. Tsirkin wrote:
> > On Wed, May 28, 2025 at 08:24:32AM +0200, Paolo Abeni wrote:  
> >> @Michael: it's not clear to me if you prefer take this series via your
> >> tree or if it should go via net. Please LMK, thanks!
> > 
> > I take it back: given I am still not fully operational, I'd like it
> > to be merged through net please. Does it have to be resubmitted for
> > this?
> > 
> > Acked-by: Michael S. Tsirkin <mst@redhat.com>  
> 
> I just resurrected the series in PW, so no need to repost it.

This was merged by Paolo as b0727b0ccd907a in net/main.

No reply from pw-bot I presume because patchwork is aggressively
marking this series as Archived before the bot can get to it.
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Simon Horman 5 months, 1 week ago
On Mon, Jul 07, 2025 at 05:29:09PM -0700, Jakub Kicinski wrote:
> On Thu, 3 Jul 2025 11:34:55 +0200 Paolo Abeni wrote:
> > On 7/3/25 11:31 AM, Michael S. Tsirkin wrote:
> > > On Wed, May 28, 2025 at 08:24:32AM +0200, Paolo Abeni wrote:  
> > >> @Michael: it's not clear to me if you prefer take this series via your
> > >> tree or if it should go via net. Please LMK, thanks!
> > > 
> > > I take it back: given I am still not fully operational, I'd like it
> > > to be merged through net please. Does it have to be resubmitted for
> > > this?
> > > 
> > > Acked-by: Michael S. Tsirkin <mst@redhat.com>  
> > 
> > I just resurrected the series in PW, so no need to repost it.
> 
> This was merged by Paolo as b0727b0ccd907a in net/main.
> 
> No reply from pw-bot I presume because patchwork is aggressively
> marking this series as Archived before the bot can get to it.

The bots are fighting again :(
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Michael S. Tsirkin 6 months, 2 weeks ago
On Wed, May 28, 2025 at 08:24:32AM +0200, Paolo Abeni wrote:
> On 5/21/25 11:22 AM, Laurent Vivier wrote:
> > This patch series contains two fixes and a cleanup for the virtio subsystem.
> > 
> > The first patch fixes an error reporting bug in virtio_ring's
> > virtqueue_resize() function. Previously, errors from internal resize
> > helpers could be masked if the subsequent re-enabling of the virtqueue
> > succeeded. This patch restores the correct error propagation, ensuring that
> > callers of virtqueue_resize() are properly informed of underlying resize
> > failures.
> > 
> > The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'
> > 
> > The third patch addresses a reliability issue in virtio_net where the TX
> > ring size could be configured too small, potentially leading to
> > persistently stopped queues and degraded performance. It enforces a
> > minimum TX ring size to ensure there's always enough space for at least one
> > maximally-fragmented packet plus an additional slot.
> 
> @Michael: it's not clear to me if you prefer take this series via your
> tree or if it should go via net. Please LMK, thanks!
> 
> Paolo

Given 1/3 is in virtio I was going to take it. Just after rc1,
though.
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Laurent Vivier 5 months, 2 weeks ago
On 28/05/2025 09:20, Michael S. Tsirkin wrote:
> On Wed, May 28, 2025 at 08:24:32AM +0200, Paolo Abeni wrote:
>> On 5/21/25 11:22 AM, Laurent Vivier wrote:
>>> This patch series contains two fixes and a cleanup for the virtio subsystem.
>>>
>>> The first patch fixes an error reporting bug in virtio_ring's
>>> virtqueue_resize() function. Previously, errors from internal resize
>>> helpers could be masked if the subsequent re-enabling of the virtqueue
>>> succeeded. This patch restores the correct error propagation, ensuring that
>>> callers of virtqueue_resize() are properly informed of underlying resize
>>> failures.
>>>
>>> The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'
>>>
>>> The third patch addresses a reliability issue in virtio_net where the TX
>>> ring size could be configured too small, potentially leading to
>>> persistently stopped queues and degraded performance. It enforces a
>>> minimum TX ring size to ensure there's always enough space for at least one
>>> maximally-fragmented packet plus an additional slot.
>>
>> @Michael: it's not clear to me if you prefer take this series via your
>> tree or if it should go via net. Please LMK, thanks!
>>
>> Paolo
> 
> Given 1/3 is in virtio I was going to take it. Just after rc1,
> though.
> 

Michael, if you don't have time to merge this series, perhaps Paolo can?

Thanks,
Laurent
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Michael S. Tsirkin 5 months, 2 weeks ago
On Thu, Jul 03, 2025 at 09:43:46AM +0200, Laurent Vivier wrote:
> On 28/05/2025 09:20, Michael S. Tsirkin wrote:
> > On Wed, May 28, 2025 at 08:24:32AM +0200, Paolo Abeni wrote:
> > > On 5/21/25 11:22 AM, Laurent Vivier wrote:
> > > > This patch series contains two fixes and a cleanup for the virtio subsystem.
> > > > 
> > > > The first patch fixes an error reporting bug in virtio_ring's
> > > > virtqueue_resize() function. Previously, errors from internal resize
> > > > helpers could be masked if the subsequent re-enabling of the virtqueue
> > > > succeeded. This patch restores the correct error propagation, ensuring that
> > > > callers of virtqueue_resize() are properly informed of underlying resize
> > > > failures.
> > > > 
> > > > The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'
> > > > 
> > > > The third patch addresses a reliability issue in virtio_net where the TX
> > > > ring size could be configured too small, potentially leading to
> > > > persistently stopped queues and degraded performance. It enforces a
> > > > minimum TX ring size to ensure there's always enough space for at least one
> > > > maximally-fragmented packet plus an additional slot.
> > > 
> > > @Michael: it's not clear to me if you prefer take this series via your
> > > tree or if it should go via net. Please LMK, thanks!
> > > 
> > > Paolo
> > 
> > Given 1/3 is in virtio I was going to take it. Just after rc1,
> > though.
> > 
> 
> Michael, if you don't have time to merge this series, perhaps Paolo can?
> 
> Thanks,
> Laurent


Sorry I forgot I asked that netdev guys don't handle it.

-- 
MST
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Laurent Vivier 6 months ago
On 28/05/2025 09:20, Michael S. Tsirkin wrote:
> On Wed, May 28, 2025 at 08:24:32AM +0200, Paolo Abeni wrote:
>> On 5/21/25 11:22 AM, Laurent Vivier wrote:
>>> This patch series contains two fixes and a cleanup for the virtio subsystem.
>>>
>>> The first patch fixes an error reporting bug in virtio_ring's
>>> virtqueue_resize() function. Previously, errors from internal resize
>>> helpers could be masked if the subsequent re-enabling of the virtqueue
>>> succeeded. This patch restores the correct error propagation, ensuring that
>>> callers of virtqueue_resize() are properly informed of underlying resize
>>> failures.
>>>
>>> The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'
>>>
>>> The third patch addresses a reliability issue in virtio_net where the TX
>>> ring size could be configured too small, potentially leading to
>>> persistently stopped queues and degraded performance. It enforces a
>>> minimum TX ring size to ensure there's always enough space for at least one
>>> maximally-fragmented packet plus an additional slot.
>>
>> @Michael: it's not clear to me if you prefer take this series via your
>> tree or if it should go via net. Please LMK, thanks!
>>
>> Paolo
> 
> Given 1/3 is in virtio I was going to take it. Just after rc1,
> though.
> 

Hi Michael,

rc2 is out. Do you always plan to merge these fixes?

Thanks,
Laurent
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Laurent Vivier 5 months, 3 weeks ago
On 16/06/2025 15:07, Laurent Vivier wrote:
> On 28/05/2025 09:20, Michael S. Tsirkin wrote:
>> On Wed, May 28, 2025 at 08:24:32AM +0200, Paolo Abeni wrote:
>>> On 5/21/25 11:22 AM, Laurent Vivier wrote:
>>>> This patch series contains two fixes and a cleanup for the virtio subsystem.
>>>>
>>>> The first patch fixes an error reporting bug in virtio_ring's
>>>> virtqueue_resize() function. Previously, errors from internal resize
>>>> helpers could be masked if the subsequent re-enabling of the virtqueue
>>>> succeeded. This patch restores the correct error propagation, ensuring that
>>>> callers of virtqueue_resize() are properly informed of underlying resize
>>>> failures.
>>>>
>>>> The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'
>>>>
>>>> The third patch addresses a reliability issue in virtio_net where the TX
>>>> ring size could be configured too small, potentially leading to
>>>> persistently stopped queues and degraded performance. It enforces a
>>>> minimum TX ring size to ensure there's always enough space for at least one
>>>> maximally-fragmented packet plus an additional slot.
>>>
>>> @Michael: it's not clear to me if you prefer take this series via your
>>> tree or if it should go via net. Please LMK, thanks!
>>>
>>> Paolo
>>
>> Given 1/3 is in virtio I was going to take it. Just after rc1,
>> though.
>>
> 
> Hi Michael,
> 
> rc2 is out. Do you always plan to merge these fixes?
> 

Gently ping

Laurent
Re: [PATCH v2 0/3] virtio: Fixes for TX ring sizing and resize error reporting
Posted by Lei Yang 6 months, 3 weeks ago
Tested pass this series of patches with virtio-net regression tests,
everything works fine.

Tested-by: Lei Yang <leiyang@redhat.com>

On Wed, May 21, 2025 at 5:23 PM Laurent Vivier <lvivier@redhat.com> wrote:
>
> This patch series contains two fixes and a cleanup for the virtio subsystem.
>
> The first patch fixes an error reporting bug in virtio_ring's
> virtqueue_resize() function. Previously, errors from internal resize
> helpers could be masked if the subsequent re-enabling of the virtqueue
> succeeded. This patch restores the correct error propagation, ensuring that
> callers of virtqueue_resize() are properly informed of underlying resize
> failures.
>
> The second patch does a cleanup of the use of '2+MAX_SKB_FRAGS'
>
> The third patch addresses a reliability issue in virtio_net where the TX
> ring size could be configured too small, potentially leading to
> persistently stopped queues and degraded performance. It enforces a
> minimum TX ring size to ensure there's always enough space for at least one
> maximally-fragmented packet plus an additional slot.
>
> v2: clenup '2+MAX_SKB_FRAGS'
>
> Laurent Vivier (3):
>   virtio_ring: Fix error reporting in virtqueue_resize
>   virtio_net: Cleanup '2+MAX_SKB_FRAGS'
>   virtio_net: Enforce minimum TX ring size for reliability
>
>  drivers/net/virtio_net.c     | 14 ++++++++++----
>  drivers/virtio/virtio_ring.c |  8 ++++++--
>  2 files changed, 16 insertions(+), 6 deletions(-)
>
> --
> 2.49.0
>
>
>