Re: [PATCH v2 1/3] tun: Unify vnet implementation

From: Jason Wang
Date: Thu Jan 09 2025 - 22:25:20 EST


On Thu, Jan 9, 2025 at 2:59 PM Akihiko Odaki <akihiko.odaki@xxxxxxxxxx> wrote:
>
> Both tun and tap exposes the same set of virtio-net-related features.
> Unify their implementations to ease future changes.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@xxxxxxxxxx>
> ---
> MAINTAINERS | 1 +
> drivers/net/Kconfig | 5 ++
> drivers/net/Makefile | 1 +
> drivers/net/tap.c | 172 ++++++----------------------------------
> drivers/net/tun.c | 208 ++++++++-----------------------------------------
> drivers/net/tun_vnet.c | 186 +++++++++++++++++++++++++++++++++++++++++++
> drivers/net/tun_vnet.h | 24 ++++++
> 7 files changed, 273 insertions(+), 324 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 910305c11e8a..1be8a452d11f 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -23903,6 +23903,7 @@ F: Documentation/networking/tuntap.rst
> F: arch/um/os-Linux/drivers/
> F: drivers/net/tap.c
> F: drivers/net/tun.c
> +F: drivers/net/tun_vnet.h
>
> TURBOCHANNEL SUBSYSTEM
> M: "Maciej W. Rozycki" <macro@xxxxxxxxxxx>
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 1fd5acdc73c6..255c8f9f1d7c 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -395,6 +395,7 @@ config TUN
> tristate "Universal TUN/TAP device driver support"
> depends on INET
> select CRC32
> + select TUN_VNET

I don't think we need a dedicated Kconfig option here.

Btw, fixes should come first as it simplifies the backporting.

Thanks