[PATCH 0/2] virtio_net: add page_pool support

Vishwanath Seshagiri posted 2 patches 1 month ago
There is a newer version of this series
drivers/net/virtio_net.c                      | 246 +++++++++++++++---
.../drivers/net/virtio_net/basic_features.sh  |  70 +++++
2 files changed, 275 insertions(+), 41 deletions(-)
[PATCH 0/2] virtio_net: add page_pool support
Posted by Vishwanath Seshagiri 1 month ago
Introduce page_pool support in virtio_net driver in order to recycle
pages in RX buffer allocation and avoid reallocating through the page
allocator. This applies to mergeable and small buffer modes.

The patch has been tested using the included selftests and additional
edge case scripts covering device unbind/bind cycles, rapid interface
open/close, traffic during close, ethtool stress with feature toggling,
close with pending refill work, and data integrity verification.

Vishwanath Seshagiri (2):
  virtio_net: add page pool support for buffer allocation
  selftests: virtio_net: add buffer circulation test

 drivers/net/virtio_net.c                      | 246 +++++++++++++++---
 .../drivers/net/virtio_net/basic_features.sh  |  70 +++++
 2 files changed, 275 insertions(+), 41 deletions(-)

-- 
2.47.3
Re: [PATCH 0/2] virtio_net: add page_pool support
Posted by Michael S. Tsirkin 1 month ago
On Tue, Jan 06, 2026 at 02:19:22PM -0800, Vishwanath Seshagiri wrote:
> Introduce page_pool support in virtio_net driver in order to recycle
> pages in RX buffer allocation and avoid reallocating through the page
> allocator. This applies to mergeable and small buffer modes.
> 
> The patch has been tested using the included selftests and additional
> edge case scripts covering device unbind/bind cycles, rapid interface
> open/close, traffic during close, ethtool stress with feature toggling,
> close with pending refill work, and data integrity verification.


Yay! thanks for working on this!
Could you share perf data please?
After all, page pool is an optimization.


> Vishwanath Seshagiri (2):
>   virtio_net: add page pool support for buffer allocation
>   selftests: virtio_net: add buffer circulation test
> 
>  drivers/net/virtio_net.c                      | 246 +++++++++++++++---
>  .../drivers/net/virtio_net/basic_features.sh  |  70 +++++
>  2 files changed, 275 insertions(+), 41 deletions(-)
> 
> -- 
> 2.47.3
Re: [PATCH 0/2] virtio_net: add page_pool support
Posted by Vishwanath Seshagiri 1 month ago
On 1/7/26 12:28 AM, Michael S. Tsirkin wrote:
> On Tue, Jan 06, 2026 at 02:19:22PM -0800, Vishwanath Seshagiri wrote:
>> Introduce page_pool support in virtio_net driver in order to recycle
>> pages in RX buffer allocation and avoid reallocating through the page
>> allocator. This applies to mergeable and small buffer modes.
>>
>> The patch has been tested using the included selftests and additional
>> edge case scripts covering device unbind/bind cycles, rapid interface
>> open/close, traffic during close, ethtool stress with feature toggling,
>> close with pending refill work, and data integrity verification.
> 
> 
> Yay! thanks for working on this!
> Could you share perf data please?
> After all, page pool is an optimization.

Thanks! I'll add benchmark numbers in v2 of the patch.
Beyond performance, page pool support is pre requisite for enabling
memory provider based zero copy implementations in virtio_net such as
devmem TCP and io-uring ZCRX. These features require the driver to use
page pools for buffer management. I'll update the cover letter to make
this motivation clearer.

> 
> 
>> Vishwanath Seshagiri (2):
>>    virtio_net: add page pool support for buffer allocation
>>    selftests: virtio_net: add buffer circulation test
>>
>>   drivers/net/virtio_net.c                      | 246 +++++++++++++++---
>>   .../drivers/net/virtio_net/basic_features.sh  |  70 +++++
>>   2 files changed, 275 insertions(+), 41 deletions(-)
>>
>> -- 
>> 2.47.3
>
Re: [PATCH 0/2] virtio_net: add page_pool support
Posted by Michael S. Tsirkin 1 week, 2 days ago
On Wed, Jan 07, 2026 at 09:23:46PM -0800, Vishwanath Seshagiri wrote:
> On 1/7/26 12:28 AM, Michael S. Tsirkin wrote:
> > On Tue, Jan 06, 2026 at 02:19:22PM -0800, Vishwanath Seshagiri wrote:
> > > Introduce page_pool support in virtio_net driver in order to recycle
> > > pages in RX buffer allocation and avoid reallocating through the page
> > > allocator. This applies to mergeable and small buffer modes.
> > > 
> > > The patch has been tested using the included selftests and additional
> > > edge case scripts covering device unbind/bind cycles, rapid interface
> > > open/close, traffic during close, ethtool stress with feature toggling,
> > > close with pending refill work, and data integrity verification.
> > 
> > 
> > Yay! thanks for working on this!
> > Could you share perf data please?
> > After all, page pool is an optimization.
> 
> Thanks! I'll add benchmark numbers in v2 of the patch.

This never came, or did I miss it?

> Beyond performance, page pool support is pre requisite for enabling
> memory provider based zero copy implementations in virtio_net such as
> devmem TCP and io-uring ZCRX. These features require the driver to use
> page pools for buffer management. I'll update the cover letter to make
> this motivation clearer.
> 
> > 
> > 
> > > Vishwanath Seshagiri (2):
> > >    virtio_net: add page pool support for buffer allocation
> > >    selftests: virtio_net: add buffer circulation test
> > > 
> > >   drivers/net/virtio_net.c                      | 246 +++++++++++++++---
> > >   .../drivers/net/virtio_net/basic_features.sh  |  70 +++++
> > >   2 files changed, 275 insertions(+), 41 deletions(-)
> > > 
> > > -- 
> > > 2.47.3
> >
Re: [PATCH 0/2] virtio_net: add page_pool support
Posted by Vishwanath Seshagiri 1 week, 2 days ago

On 1/28/26 12:19 PM, Michael S. Tsirkin wrote:
> > 
> On Wed, Jan 07, 2026 at 09:23:46PM -0800, Vishwanath Seshagiri wrote:
>> On 1/7/26 12:28 AM, Michael S. Tsirkin wrote:
>>> On Tue, Jan 06, 2026 at 02:19:22PM -0800, Vishwanath Seshagiri wrote:
>>>> Introduce page_pool support in virtio_net driver in order to recycle
>>>> pages in RX buffer allocation and avoid reallocating through the page
>>>> allocator. This applies to mergeable and small buffer modes.
>>>>
>>>> The patch has been tested using the included selftests and additional
>>>> edge case scripts covering device unbind/bind cycles, rapid interface
>>>> open/close, traffic during close, ethtool stress with feature toggling,
>>>> close with pending refill work, and data integrity verification.
>>>
>>>
>>> Yay! thanks for working on this!
>>> Could you share perf data please?
>>> After all, page pool is an optimization.
>>
>> Thanks! I'll add benchmark numbers in v2 of the patch.
> 
> This never came, or did I miss it?

It is ready, I will send it today! Had some personal stuff come up in
the middle.

> 
>> Beyond performance, page pool support is pre requisite for enabling
>> memory provider based zero copy implementations in virtio_net such as
>> devmem TCP and io-uring ZCRX. These features require the driver to use
>> page pools for buffer management. I'll update the cover letter to make
>> this motivation clearer.
>>
>>>
>>>
>>>> Vishwanath Seshagiri (2):
>>>>     virtio_net: add page pool support for buffer allocation
>>>>     selftests: virtio_net: add buffer circulation test
>>>>
>>>>    drivers/net/virtio_net.c                      | 246 +++++++++++++++---
>>>>    .../drivers/net/virtio_net/basic_features.sh  |  70 +++++
>>>>    2 files changed, 275 insertions(+), 41 deletions(-)
>>>>
>>>> -- 
>>>> 2.47.3
>>>
>