mbox series

[net-next,v2,00/12] virtnet_net: prepare for af-xdp

Message ID 20240530112406.94452-1-xuanzhuo@linux.alibaba.com (mailing list archive)
Headers show
Series virtnet_net: prepare for af-xdp | expand

Message

Xuan Zhuo May 30, 2024, 11:23 a.m. UTC
This patch set prepares for supporting af-xdp zerocopy.
There is no feature change in this patch set.
I just want to reduce the patch num of the final patch set,
so I split the patch set.

Thanks.

v2:
    1. Add five commits. That provides some helper for sq to support premapped
       mode. And the last one refactors distinguishing xmit types.

v1:
    1. resend for the new net-next merge window



Xuan Zhuo (12):
  virtio_net: independent directory
  virtio_net: move core structures to virtio_net.h
  virtio_net: add prefix virtnet to all struct inside virtio_net.h
  virtio_net: separate virtnet_rx_resize()
  virtio_net: separate virtnet_tx_resize()
  virtio_net: separate receive_mergeable
  virtio_net: separate receive_buf
  virtio_ring: introduce vring_need_unmap_buffer
  virtio_ring: introduce dma map api for page
  virtio_ring: introduce virtqueue_dma_map_sg_attrs
  virtio_ring: virtqueue_set_dma_premapped() support to disable
  virtio_net: refactor the xmit type

 MAINTAINERS                                   |   2 +-
 drivers/net/Kconfig                           |   9 +-
 drivers/net/Makefile                          |   2 +-
 drivers/net/virtio/Kconfig                    |  12 +
 drivers/net/virtio/Makefile                   |   8 +
 drivers/net/virtio/virtnet.h                  | 248 ++++++++
 .../{virtio_net.c => virtio/virtnet_main.c}   | 596 +++++++-----------
 drivers/virtio/virtio_ring.c                  | 118 +++-
 include/linux/virtio.h                        |  12 +-
 9 files changed, 606 insertions(+), 401 deletions(-)
 create mode 100644 drivers/net/virtio/Kconfig
 create mode 100644 drivers/net/virtio/Makefile
 create mode 100644 drivers/net/virtio/virtnet.h
 rename drivers/net/{virtio_net.c => virtio/virtnet_main.c} (93%)

--
2.32.0.3.g01195cf9f

Comments

Michael S. Tsirkin May 30, 2024, 11:53 a.m. UTC | #1
On Thu, May 30, 2024 at 07:23:54PM +0800, Xuan Zhuo wrote:
> This patch set prepares for supporting af-xdp zerocopy.
> There is no feature change in this patch set.
> I just want to reduce the patch num of the final patch set,
> so I split the patch set.
> 
> Thanks.
> 
> v2:
>     1. Add five commits. That provides some helper for sq to support premapped
>        mode. And the last one refactors distinguishing xmit types.
> 
> v1:
>     1. resend for the new net-next merge window
> 


It's great that you are working on this but
I'd like to see the actual use of this first.

> 
> Xuan Zhuo (12):
>   virtio_net: independent directory
>   virtio_net: move core structures to virtio_net.h
>   virtio_net: add prefix virtnet to all struct inside virtio_net.h
>   virtio_net: separate virtnet_rx_resize()
>   virtio_net: separate virtnet_tx_resize()
>   virtio_net: separate receive_mergeable
>   virtio_net: separate receive_buf
>   virtio_ring: introduce vring_need_unmap_buffer
>   virtio_ring: introduce dma map api for page
>   virtio_ring: introduce virtqueue_dma_map_sg_attrs
>   virtio_ring: virtqueue_set_dma_premapped() support to disable
>   virtio_net: refactor the xmit type
> 
>  MAINTAINERS                                   |   2 +-
>  drivers/net/Kconfig                           |   9 +-
>  drivers/net/Makefile                          |   2 +-
>  drivers/net/virtio/Kconfig                    |  12 +
>  drivers/net/virtio/Makefile                   |   8 +
>  drivers/net/virtio/virtnet.h                  | 248 ++++++++
>  .../{virtio_net.c => virtio/virtnet_main.c}   | 596 +++++++-----------
>  drivers/virtio/virtio_ring.c                  | 118 +++-
>  include/linux/virtio.h                        |  12 +-
>  9 files changed, 606 insertions(+), 401 deletions(-)
>  create mode 100644 drivers/net/virtio/Kconfig
>  create mode 100644 drivers/net/virtio/Makefile
>  create mode 100644 drivers/net/virtio/virtnet.h
>  rename drivers/net/{virtio_net.c => virtio/virtnet_main.c} (93%)
> 
> --
> 2.32.0.3.g01195cf9f
Xuan Zhuo May 30, 2024, 11:54 a.m. UTC | #2
On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> On Thu, May 30, 2024 at 07:23:54PM +0800, Xuan Zhuo wrote:
> > This patch set prepares for supporting af-xdp zerocopy.
> > There is no feature change in this patch set.
> > I just want to reduce the patch num of the final patch set,
> > so I split the patch set.
> >
> > Thanks.
> >
> > v2:
> >     1. Add five commits. That provides some helper for sq to support premapped
> >        mode. And the last one refactors distinguishing xmit types.
> >
> > v1:
> >     1. resend for the new net-next merge window
> >
>
>
> It's great that you are working on this but
> I'd like to see the actual use of this first.


For me, that is easy. But how should we do, if we use one patch set,
then the commit number maybe 26, that exceeds 15 (limit of the net next).

Thanks.


>
> >
> > Xuan Zhuo (12):
> >   virtio_net: independent directory
> >   virtio_net: move core structures to virtio_net.h
> >   virtio_net: add prefix virtnet to all struct inside virtio_net.h
> >   virtio_net: separate virtnet_rx_resize()
> >   virtio_net: separate virtnet_tx_resize()
> >   virtio_net: separate receive_mergeable
> >   virtio_net: separate receive_buf
> >   virtio_ring: introduce vring_need_unmap_buffer
> >   virtio_ring: introduce dma map api for page
> >   virtio_ring: introduce virtqueue_dma_map_sg_attrs
> >   virtio_ring: virtqueue_set_dma_premapped() support to disable
> >   virtio_net: refactor the xmit type
> >
> >  MAINTAINERS                                   |   2 +-
> >  drivers/net/Kconfig                           |   9 +-
> >  drivers/net/Makefile                          |   2 +-
> >  drivers/net/virtio/Kconfig                    |  12 +
> >  drivers/net/virtio/Makefile                   |   8 +
> >  drivers/net/virtio/virtnet.h                  | 248 ++++++++
> >  .../{virtio_net.c => virtio/virtnet_main.c}   | 596 +++++++-----------
> >  drivers/virtio/virtio_ring.c                  | 118 +++-
> >  include/linux/virtio.h                        |  12 +-
> >  9 files changed, 606 insertions(+), 401 deletions(-)
> >  create mode 100644 drivers/net/virtio/Kconfig
> >  create mode 100644 drivers/net/virtio/Makefile
> >  create mode 100644 drivers/net/virtio/virtnet.h
> >  rename drivers/net/{virtio_net.c => virtio/virtnet_main.c} (93%)
> >
> > --
> > 2.32.0.3.g01195cf9f
>
Xuan Zhuo May 31, 2024, 1:40 a.m. UTC | #3
On Thu, 30 May 2024 19:54:44 +0800, Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > On Thu, May 30, 2024 at 07:23:54PM +0800, Xuan Zhuo wrote:
> > > This patch set prepares for supporting af-xdp zerocopy.
> > > There is no feature change in this patch set.
> > > I just want to reduce the patch num of the final patch set,
> > > so I split the patch set.
> > >
> > > Thanks.
> > >
> > > v2:
> > >     1. Add five commits. That provides some helper for sq to support premapped
> > >        mode. And the last one refactors distinguishing xmit types.
> > >
> > > v1:
> > >     1. resend for the new net-next merge window
> > >
> >
> >
> > It's great that you are working on this but
> > I'd like to see the actual use of this first.
>
>
> For me, that is easy. But how should we do, if we use one patch set,
> then the commit number maybe 26, that exceeds 15 (limit of the net next).


Hi, Jakub

There will be a huge patch set (about 25) to support AF-XDP for virtio-net.
Can I just post this huge patch set if the maintainers of virtio-net agree?

Thanks.



>
> Thanks.
>
>
> >
> > >
> > > Xuan Zhuo (12):
> > >   virtio_net: independent directory
> > >   virtio_net: move core structures to virtio_net.h
> > >   virtio_net: add prefix virtnet to all struct inside virtio_net.h
> > >   virtio_net: separate virtnet_rx_resize()
> > >   virtio_net: separate virtnet_tx_resize()
> > >   virtio_net: separate receive_mergeable
> > >   virtio_net: separate receive_buf
> > >   virtio_ring: introduce vring_need_unmap_buffer
> > >   virtio_ring: introduce dma map api for page
> > >   virtio_ring: introduce virtqueue_dma_map_sg_attrs
> > >   virtio_ring: virtqueue_set_dma_premapped() support to disable
> > >   virtio_net: refactor the xmit type
> > >
> > >  MAINTAINERS                                   |   2 +-
> > >  drivers/net/Kconfig                           |   9 +-
> > >  drivers/net/Makefile                          |   2 +-
> > >  drivers/net/virtio/Kconfig                    |  12 +
> > >  drivers/net/virtio/Makefile                   |   8 +
> > >  drivers/net/virtio/virtnet.h                  | 248 ++++++++
> > >  .../{virtio_net.c => virtio/virtnet_main.c}   | 596 +++++++-----------
> > >  drivers/virtio/virtio_ring.c                  | 118 +++-
> > >  include/linux/virtio.h                        |  12 +-
> > >  9 files changed, 606 insertions(+), 401 deletions(-)
> > >  create mode 100644 drivers/net/virtio/Kconfig
> > >  create mode 100644 drivers/net/virtio/Makefile
> > >  create mode 100644 drivers/net/virtio/virtnet.h
> > >  rename drivers/net/{virtio_net.c => virtio/virtnet_main.c} (93%)
> > >
> > > --
> > > 2.32.0.3.g01195cf9f
> >
>
Jakub Kicinski May 31, 2024, 1:55 a.m. UTC | #4
On Fri, 31 May 2024 09:40:14 +0800 Xuan Zhuo wrote:
> On Thu, 30 May 2024 19:54:44 +0800, Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> > On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin" <mst@redhat.com> wrote:  
> > > It's great that you are working on this but
> > > I'd like to see the actual use of this first.  
> >
> >
> > For me, that is easy. But how should we do, if we use one patch set,
> > then the commit number maybe 26, that exceeds 15 (limit of the net next).  
> 
> Hi, Jakub
> 
> There will be a huge patch set (about 25) to support AF-XDP for virtio-net.
> Can I just post this huge patch set if the maintainers of virtio-net agree?

First of all, I see you posted v2 within 4 hours of v1, without really
waiting for Michael to reply. So I guess that 15 patch rule is not the
only one you intend to break?

On v1 Michael asked you to not do the rename, and start with AF_XDP
support. Why don't you do that instead of asking me if you can break
more rules?
Xuan Zhuo May 31, 2024, 1:57 a.m. UTC | #5
On Thu, 30 May 2024 18:55:17 -0700, Jakub Kicinski <kuba@kernel.org> wrote:
> On Fri, 31 May 2024 09:40:14 +0800 Xuan Zhuo wrote:
> > On Thu, 30 May 2024 19:54:44 +0800, Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> > > On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > > > It's great that you are working on this but
> > > > I'd like to see the actual use of this first.
> > >
> > >
> > > For me, that is easy. But how should we do, if we use one patch set,
> > > then the commit number maybe 26, that exceeds 15 (limit of the net next).
> >
> > Hi, Jakub
> >
> > There will be a huge patch set (about 25) to support AF-XDP for virtio-net.
> > Can I just post this huge patch set if the maintainers of virtio-net agree?
>
> First of all, I see you posted v2 within 4 hours of v1, without really
> waiting for Michael to reply.

Because I was checking the code, I found some commits need to be prepared also.

> So I guess that 15 patch rule is not the
> only one you intend to break?

Actually, that is the only one rule.

>
> On v1 Michael asked you to not do the rename, and start with AF_XDP
> support. Why don't you do that instead of asking me if you can break
> more rules?

Because if I don't rename the files, there will still be about 21 commits. For
me, I don't think this is the key. If I release everything in one patch set,
then I think Michael can understand why I want to rename the files.

Thanks.


> --
> pw-bot: cr
Xuan Zhuo June 1, 2024, 1:01 a.m. UTC | #6
On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> On Thu, May 30, 2024 at 07:23:54PM +0800, Xuan Zhuo wrote:
> > This patch set prepares for supporting af-xdp zerocopy.
> > There is no feature change in this patch set.
> > I just want to reduce the patch num of the final patch set,
> > so I split the patch set.
> >
> > Thanks.
> >
> > v2:
> >     1. Add five commits. That provides some helper for sq to support premapped
> >        mode. And the last one refactors distinguishing xmit types.
> >
> > v1:
> >     1. resend for the new net-next merge window
> >
>
>
> It's great that you are working on this but
> I'd like to see the actual use of this first.

I want to finish this work quickly. I don't have a particular preference for
whether to use a separate directory; as an engineer, I think it makes sense. I
don't want to keep dwelling on this issue. I also hope that as a maintainer, you
can help me complete this work as soon as possible. You should know that I have
been working on this for about three years now.

I can completely follow your suggestion regarding splitting the directory.
However, there will still be many patches, so I hope that these patches in this
patch set can be merged first.

   virtio_net: separate virtnet_rx_resize()
   virtio_net: separate virtnet_tx_resize()
   virtio_net: separate receive_mergeable
   virtio_net: separate receive_buf
   virtio_net: refactor the xmit type

I will try to compress the subsequent patch sets, hoping to reduce them to about 15.

Thanks.


>
> >
> > Xuan Zhuo (12):
> >   virtio_net: independent directory
> >   virtio_net: move core structures to virtio_net.h
> >   virtio_net: add prefix virtnet to all struct inside virtio_net.h
> >   virtio_net: separate virtnet_rx_resize()
> >   virtio_net: separate virtnet_tx_resize()
> >   virtio_net: separate receive_mergeable
> >   virtio_net: separate receive_buf
> >   virtio_ring: introduce vring_need_unmap_buffer
> >   virtio_ring: introduce dma map api for page
> >   virtio_ring: introduce virtqueue_dma_map_sg_attrs
> >   virtio_ring: virtqueue_set_dma_premapped() support to disable
> >   virtio_net: refactor the xmit type
> >
> >  MAINTAINERS                                   |   2 +-
> >  drivers/net/Kconfig                           |   9 +-
> >  drivers/net/Makefile                          |   2 +-
> >  drivers/net/virtio/Kconfig                    |  12 +
> >  drivers/net/virtio/Makefile                   |   8 +
> >  drivers/net/virtio/virtnet.h                  | 248 ++++++++
> >  .../{virtio_net.c => virtio/virtnet_main.c}   | 596 +++++++-----------
> >  drivers/virtio/virtio_ring.c                  | 118 +++-
> >  include/linux/virtio.h                        |  12 +-
> >  9 files changed, 606 insertions(+), 401 deletions(-)
> >  create mode 100644 drivers/net/virtio/Kconfig
> >  create mode 100644 drivers/net/virtio/Makefile
> >  create mode 100644 drivers/net/virtio/virtnet.h
> >  rename drivers/net/{virtio_net.c => virtio/virtnet_main.c} (93%)
> >
> > --
> > 2.32.0.3.g01195cf9f
>
Michael S. Tsirkin June 2, 2024, 7:49 p.m. UTC | #7
On Sat, Jun 01, 2024 at 09:01:29AM +0800, Xuan Zhuo wrote:
> On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > On Thu, May 30, 2024 at 07:23:54PM +0800, Xuan Zhuo wrote:
> > > This patch set prepares for supporting af-xdp zerocopy.
> > > There is no feature change in this patch set.
> > > I just want to reduce the patch num of the final patch set,
> > > so I split the patch set.
> > >
> > > Thanks.
> > >
> > > v2:
> > >     1. Add five commits. That provides some helper for sq to support premapped
> > >        mode. And the last one refactors distinguishing xmit types.
> > >
> > > v1:
> > >     1. resend for the new net-next merge window
> > >
> >
> >
> > It's great that you are working on this but
> > I'd like to see the actual use of this first.
> 
> I want to finish this work quickly. I don't have a particular preference for
> whether to use a separate directory; as an engineer, I think it makes sense. I
> don't want to keep dwelling on this issue. I also hope that as a maintainer, you
> can help me complete this work as soon as possible. You should know that I have
> been working on this for about three years now.
> 
> I can completely follow your suggestion regarding splitting the directory.
> However, there will still be many patches, so I hope that these patches in this
> patch set can be merged first.
> 
>    virtio_net: separate virtnet_rx_resize()
>    virtio_net: separate virtnet_tx_resize()
>    virtio_net: separate receive_mergeable
>    virtio_net: separate receive_buf
>    virtio_net: refactor the xmit type
> 
> I will try to compress the subsequent patch sets, hoping to reduce them to about 15.
> 
> Thanks.


You can also post an RFC even if it's bigger than 15. If I see the use
I can start merging some of the patches.

> 
> >
> > >
> > > Xuan Zhuo (12):
> > >   virtio_net: independent directory
> > >   virtio_net: move core structures to virtio_net.h
> > >   virtio_net: add prefix virtnet to all struct inside virtio_net.h
> > >   virtio_net: separate virtnet_rx_resize()
> > >   virtio_net: separate virtnet_tx_resize()
> > >   virtio_net: separate receive_mergeable
> > >   virtio_net: separate receive_buf
> > >   virtio_ring: introduce vring_need_unmap_buffer
> > >   virtio_ring: introduce dma map api for page
> > >   virtio_ring: introduce virtqueue_dma_map_sg_attrs
> > >   virtio_ring: virtqueue_set_dma_premapped() support to disable
> > >   virtio_net: refactor the xmit type
> > >
> > >  MAINTAINERS                                   |   2 +-
> > >  drivers/net/Kconfig                           |   9 +-
> > >  drivers/net/Makefile                          |   2 +-
> > >  drivers/net/virtio/Kconfig                    |  12 +
> > >  drivers/net/virtio/Makefile                   |   8 +
> > >  drivers/net/virtio/virtnet.h                  | 248 ++++++++
> > >  .../{virtio_net.c => virtio/virtnet_main.c}   | 596 +++++++-----------
> > >  drivers/virtio/virtio_ring.c                  | 118 +++-
> > >  include/linux/virtio.h                        |  12 +-
> > >  9 files changed, 606 insertions(+), 401 deletions(-)
> > >  create mode 100644 drivers/net/virtio/Kconfig
> > >  create mode 100644 drivers/net/virtio/Makefile
> > >  create mode 100644 drivers/net/virtio/virtnet.h
> > >  rename drivers/net/{virtio_net.c => virtio/virtnet_main.c} (93%)
> > >
> > > --
> > > 2.32.0.3.g01195cf9f
> >