Re: [PATCH net v3 6/9] tun: Extract the vnet handling code
From: Willem de Bruijn
Date: Fri Jan 17 2025 - 05:42:49 EST
Akihiko Odaki wrote:
> The vnet handling code will be reused by tap.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@xxxxxxxxxx>
> ---
> MAINTAINERS | 2 +-
> drivers/net/Makefile | 3 +-
> drivers/net/tun.c | 174 +-----------------------------------------------
> drivers/net/tun_vnet.c | 175 +++++++++++++++++++++++++++++++++++++++++++++++++
> drivers/net/tun_vnet.h | 25 +++++++
> 5 files changed, 205 insertions(+), 174 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 910305c11e8a..bc32b7e23c79 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -23902,7 +23902,7 @@ W: http://vtun.sourceforge.net/tun
> 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*
>
> TURBOCHANNEL SUBSYSTEM
> M: "Maciej W. Rozycki" <macro@xxxxxxxxxxx>
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index 13743d0e83b5..bb8eb3053772 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -29,7 +29,8 @@ obj-y += mdio/
> obj-y += pcs/
> obj-$(CONFIG_RIONET) += rionet.o
> obj-$(CONFIG_NET_TEAM) += team/
> -obj-$(CONFIG_TUN) += tun.o
> +obj-$(CONFIG_TUN) += tun-drv.o
> +tun-drv-y := tun.o tun_vnet.o
> obj-$(CONFIG_TAP) += tap.o
> obj-$(CONFIG_VETH) += veth.o
> obj-$(CONFIG_VIRTIO_NET) += virtio_net.o
Let's figure out how to do this. See also comment in 9/9.
Otherwise the rest of the patch looks fine.