Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Mar 2024 18:33:25 +0100 (CET)
From:      freebsd@oldach.net (Helge Oldach)
To:        glebius@FreeBSD.org (Gleb Smirnoff)
Cc:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   Re: git: db4429d00f0d - stable/13 - linux: require vnet(9)  context in ifname_bsd_to_linux_name()
Message-ID:  <202403151733.42FHXPrI046235@nuc.oldach.net>
In-Reply-To: <202403111612.42BGCrZd000296@gitrepo.freebsd.org> from Gleb Smirnoff at "11 Mar 2024 16:12:53"

index | next in thread | previous in thread | raw e-mail

Gleb Smirnoff wrote on Mon, 11 Mar 2024 17:12:53 +0100 (CET):
> The branch stable/13 has been updated by glebius:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=db4429d00f0d95a1532f8707f8b828a744586dc7
> 
> commit db4429d00f0d95a1532f8707f8b828a744586dc7
> Author:     Gleb Smirnoff <glebius@FreeBSD.org>
> AuthorDate: 2024-03-03 20:56:58 +0000
> Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
> CommitDate: 2024-03-11 16:12:36 +0000
> 
>     linux: require vnet(9) context in ifname_bsd_to_linux_name()
>     
>     This function is used by netlink(9) only.  The netlink(9) taskqueue thread
>     runs in the vnet of the socket whose request the thread is processing
>     right now.  This is a correct vnet and resetting it to vnet0 is incorrect.
>     If the function is to be used by any other caller in addition to
>     netlink(9), it would be caller's responsiblity to provide correct vnet(9).
>     
>     Reviewed by:            melifaro, dchagin
>     Differential Revision:  https://reviews.freebsd.org/D44191
>     PR:                     277286
>     
>     (cherry picked from commit 2f5a315b307447f91891c96fb23c7333fa406f2f)
> ---
>  sys/compat/linux/linux.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c
> index 6191372b6312..141fa715c7c1 100644
> --- a/sys/compat/linux/linux.c
> +++ b/sys/compat/linux/linux.c
> @@ -250,14 +250,14 @@ ifname_bsd_to_linux_name(const char *bsdname, char *lxname, size_t len)
>  	struct ifnet *ifp;
>  	int ret;
>  
> +	CURVNET_ASSERT_SET();
> +
>  	ret = 0;
> -	CURVNET_SET(TD_TO_VNET(curthread));
>  	NET_EPOCH_ENTER(et);
>  	ifp = ifunit(bsdname);
>  	if (ifp != NULL)
>  		ret = ifname_bsd_to_linux_ifp(ifp, lxname, len);
>  	NET_EPOCH_EXIT(et);
> -	CURVNET_RESTORE();
>  	return (ret);
>  }

This bails out when option VIMAGE is not included:

===> linux (all)
===> linux64 (all)
===> linux_common (all)
cc -target x86_64-unknown-freebsd13.3 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin  -O2 -pipe -fno-common  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -DKLD_TIED -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/amd64.amd64/sys/HMO/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -I/usr/obj/usr/src/amd64.amd64/sys/HMO     -MD  -MF.depend.linux.o -MTlinux.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-error=array-parameter -Wno-error=deprecated-non-prototype -Wno-error=strict-prototypes -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-variable -Wno-format-zero-length   -mno-aes -mno-avx  -std=iso9899:1999 -c /usr/src/sys/compat/linux/linux.c -o linux.o
/usr/src/sys/compat/linux/linux.c:253:2: error: call to undeclared function 'CURVNET_ASSERT_SET'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
  253 |         CURVNET_ASSERT_SET();
      |         ^
1 error generated.
*** Error code 1

Stop.
make[4]: stopped in /usr/src/sys/modules/linux_common
*** Error code 1

Stop.
make[3]: stopped in /usr/src/sys/modules
*** Error code 1

Stop.
make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/HMO
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src


IMHO same behaviour with 14.

Kind regards
Helge


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403151733.42FHXPrI046235>