Skip to contentSkip to conversation

Build Failure

revert 0d60d8df6f49 Tasmiya Nalatwad 5 participants 14 messages Feb 28, 2024 – Mar 4, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
    dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’ rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
         ^~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  AR      net/mpls/built-in.a
  AR      net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,
                 from ./include/linux/mm_types.h:11,
                 from ./include/linux/mmzone.h:22,
                 from ./include/linux/gfp.h:7,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:17,
                 from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’ rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
         ^~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1 make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2
make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                 from ./include/linux/compiler.h:251,
                 from ./include/linux/instrumented.h:10,
                 from ./include/linux/uaccess.h:6,
                 from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                    ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro ‘__WRITE_ONCE’ *(volatile typeof(x) *)&(x) = (val);    \
                                 ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro ‘WRITE_ONCE’ WRITE_ONCE(*p, v);      \
  ^~~~~~~~~~
./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’ #define smp_store_release(p, v) do { kcsan_release(); __smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
   ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro ‘RCU_INITIALIZER’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                         ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’ rcu_assign_pointer(dev->dpll_pin, dpll_pin);
  ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  AR      drivers/net/ethernet/built-in.a
  AR      drivers/net/built-in.a
  AR      net/dcb/built-in.a
  AR      net/netlabel/built-in.a
  AR      net/strparser/built-in.a
  AR      net/handshake/built-in.a
  GEN     lib/test_fortify.log
  AR      net/8021q/built-in.a
  AR      net/nsh/built-in.a
  AR      net/unix/built-in.a
  CC      lib/string.o
  AR      net/packet/built-in.a
  AR      net/switchdev/built-in.a
  AR      lib/lib.a
  AR      net/mptcp/built-in.a
  AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                 from ./include/linux/mm_types.h:11,
                 from ./include/linux/mmzone.h:22,
                 from ./include/linux/gfp.h:7,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:17,
                 from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’ rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
         ^~~~~~~~~~~~~~~~~~~~
In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void function [-Werror=return-type] }

Signature · 3 lines
Regards,
Tasmiya Nalatwad
IBM Linux Technology Center
#1 lore raw
Quoted 121 lines

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
    dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’ rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
         ^~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  AR      net/mpls/built-in.a
  AR      net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,
                 from ./include/linux/mm_types.h:11,
                 from ./include/linux/mmzone.h:22,
                 from ./include/linux/gfp.h:7,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:17,
                 from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’ rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
         ^~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1 make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2
make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                 from ./include/linux/compiler.h:251,
                 from ./include/linux/instrumented.h:10,
                 from ./include/linux/uaccess.h:6,
                 from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                    ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro ‘__WRITE_ONCE’ *(volatile typeof(x) *)&(x) = (val);    \
                                 ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro ‘WRITE_ONCE’ WRITE_ONCE(*p, v);      \
  ^~~~~~~~~~
./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’ #define smp_store_release(p, v) do { kcsan_release(); __smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
   ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro ‘RCU_INITIALIZER’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                         ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’ rcu_assign_pointer(dev->dpll_pin, dpll_pin);
  ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  AR      drivers/net/ethernet/built-in.a
  AR      drivers/net/built-in.a
  AR      net/dcb/built-in.a
  AR      net/netlabel/built-in.a
  AR      net/strparser/built-in.a
  AR      net/handshake/built-in.a
  GEN     lib/test_fortify.log
  AR      net/8021q/built-in.a
  AR      net/nsh/built-in.a
  AR      net/unix/built-in.a
  CC      lib/string.o
  AR      net/packet/built-in.a
  AR      net/switchdev/built-in.a
  AR      lib/lib.a
  AR      net/mptcp/built-in.a
  AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                 from ./include/linux/mm_types.h:11,
                 from ./include/linux/mmzone.h:22,
                 from ./include/linux/gfp.h:7,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:17,
                 from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’ rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
         ^~~~~~~~~~~~~~~~~~~~
In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void function [-Werror=return-type] }

Signature · 3 lines
Regards,
Tasmiya Nalatwad
IBM Linux Technology Center
maintainer
#2 lore raw
In reply to Tasmiya Nalatwad
Quoted 114 lines · Tasmiya Nalatwad

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
    dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’
  typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’
  __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’
  rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’
  return rcu_dereference_rtnl(dev->dpll_pin);
         ^~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  AR      net/mpls/built-in.a
  AR      net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,
                 from ./include/linux/mm_types.h:11,
                 from ./include/linux/mmzone.h:22,
                 from ./include/linux/gfp.h:7,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:17,
                 from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’
  typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’
  __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’
  rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’
  return rcu_dereference_rtnl(dev->dpll_pin);
         ^~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1 make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2
make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                 from ./include/linux/compiler.h:251,
                 from ./include/linux/instrumented.h:10,
                 from ./include/linux/uaccess.h:6,
                 from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to incomplete type ‘struct dpll_pin’
 #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                    ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro ‘__WRITE_ONCE’
  *(volatile typeof(x) *)&(x) = (val);    \
                                 ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro ‘WRITE_ONCE’
  WRITE_ONCE(*p, v);      \
  ^~~~~~~~~~
./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’
 #define smp_store_release(p, v) do { kcsan_release();
__smp_store_release(p, v); } while (0)
^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’
   smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
   ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro ‘RCU_INITIALIZER’
   smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                         ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
  rcu_assign_pointer(dev->dpll_pin, dpll_pin);
  ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  AR      drivers/net/ethernet/built-in.a
  AR      drivers/net/built-in.a
  AR      net/dcb/built-in.a
  AR      net/netlabel/built-in.a
  AR      net/strparser/built-in.a
  AR      net/handshake/built-in.a
  GEN     lib/test_fortify.log
  AR      net/8021q/built-in.a
  AR      net/nsh/built-in.a
  AR      net/unix/built-in.a
  CC      lib/string.o
  AR      net/packet/built-in.a
  AR      net/switchdev/built-in.a
  AR      lib/lib.a
  AR      net/mptcp/built-in.a
  AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                 from ./include/linux/mm_types.h:11,
                 from ./include/linux/mmzone.h:22,
                 from ./include/linux/gfp.h:7,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:17,
                 from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’
  typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’
  __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’

Quoted 9 lines

  rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’
  return rcu_dereference_rtnl(dev->dpll_pin);
         ^~~~~~~~~~~~~~~~~~~~
In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void function [-Werror=return-type]
 }

Hi, Eric!

Looks like we have to move struct dpll_pin definition to include/linux/dpll.h to have this fixed, right?

#3 lore raw
Quoted 146 lines · Vadim Fedorenko
Quoted 136 lines · Tasmiya Nalatwad

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’

   typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
          ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
   __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
   ^~~~~~~~~~~~~~~~~~~~~~~

./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’
rcu_dereference_check(p, lockdep_rtnl_is_held()) ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’

   return rcu_dereference_rtnl(dev->dpll_pin);
          ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1 make[4]: *** Waiting for unfinished jobs....
AR net/mpls/built-in.a
AR net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,

                  from ./include/linux/mm_types.h:11,
                  from ./include/linux/mmzone.h:22,
                  from ./include/linux/gfp.h:7,
                  from ./include/linux/umh.h:4,
                  from ./include/linux/kmod.h:9,
                  from ./include/linux/module.h:17,
                  from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
   typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
          ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
   __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
   ^~~~~~~~~~~~~~~~~~~~~~~

./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’
rcu_dereference_check(p, lockdep_rtnl_is_held()) ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’

   return rcu_dereference_rtnl(dev->dpll_pin);
          ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1
make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2 make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,

                  from ./include/linux/compiler.h:251,
                  from ./include/linux/instrumented.h:10,
                  from ./include/linux/uaccess.h:6,
                  from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
  #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                     ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro
‘__WRITE_ONCE’
   *(volatile typeof(x) *)&(x) = (val);    \
                                  ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro
‘WRITE_ONCE’
   WRITE_ONCE(*p, v);      \
   ^~~~~~~~~~

./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’
#define smp_store_release(p, v) do { kcsan_release();
__smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’

    smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
    ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro
‘RCU_INITIALIZER’
    smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                          ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
   rcu_assign_pointer(dev->dpll_pin, dpll_pin);
   ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
   AR      drivers/net/ethernet/built-in.a
   AR      drivers/net/built-in.a
   AR      net/dcb/built-in.a
   AR      net/netlabel/built-in.a
   AR      net/strparser/built-in.a
   AR      net/handshake/built-in.a
   GEN     lib/test_fortify.log
   AR      net/8021q/built-in.a
   AR      net/nsh/built-in.a
   AR      net/unix/built-in.a
   CC      lib/string.o
   AR      net/packet/built-in.a
   AR      net/switchdev/built-in.a
   AR      lib/lib.a
   AR      net/mptcp/built-in.a
   AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                  from ./include/linux/mm_types.h:11,
                  from ./include/linux/mmzone.h:22,
                  from ./include/linux/gfp.h:7,
                  from ./include/linux/umh.h:4,
                  from ./include/linux/kmod.h:9,
                  from ./include/linux/module.h:17,
                  from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
   typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
          ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
   __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
   ^~~~~~~~~~~~~~~~~~~~~~~

./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’
rcu_dereference_check(p, lockdep_rtnl_is_held()) ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’

Quoted 7 lines
   return rcu_dereference_rtnl(dev->dpll_pin);
          ^~~~~~~~~~~~~~~~~~~~

In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void function [-Werror=return-type]
}

Quoted 5 lines

Hi, Eric!

Looks like we have to move struct dpll_pin definition to include/linux/dpll.h to have this fixed, right?

No idea what is wrong. Is it powerpc specific ? Some compiler version ?

netdev_dpll_pin() could be moved to net/core/rtnetlink.c, this is the only user.

include/linux/dpll.h +0 -0
index 4ec2fe9caf5a3f284afd0cfe4fc7c2bf42cbbc60..72d21e710d7f201d2fc57bb3a32b4bc0ff2b1749

100644

include/linux/dpll.h +0 -9
@@ -169,13 +169,4 @@ int dpll_device_change_ntf(struct dpll_device *dpll);
 
 int dpll_pin_change_ntf(struct dpll_pin *pin);
 
-static inline struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
-{
-#if IS_ENABLED(CONFIG_DPLL)
-       return rcu_dereference_rtnl(dev->dpll_pin);
-#else
-       return NULL;
-#endif
-}
-
 #endif
net/core/rtnetlink.c +0 -0
index 9c4f427f3a5057b52ec05405e8b15b8ca2246b4b..32dc601fd8ca66dfcd3cb8f38b533314de02d1d2

100644

net/core/rtnetlink.c +0 -0
@@ -1053,6 +1053,15 @@ static size_t rtnl_devlink_port_size(const

struct net_device *dev)

        return size;

}

+static struct dpll_pin *netdev_dpll_pin(const struct net_device *dev) +{
+#if IS_ENABLED(CONFIG_DPLL)
+ return rcu_dereference_rtnl(dev->dpll_pin);
+#else
+ return NULL;
+#endif
+}
+
static size_t rtnl_dpll_pin_size(const struct net_device *dev) {
size_t size = nla_total_size(0); /* nest IFLA_DPLL_PIN */

#4 lore raw

Le 28/02/2024 à 15:43, Eric Dumazet a écrit :

Quoted 148 lines
Quoted 146 lines · Vadim Fedorenko
Quoted 143 lines · Tasmiya Nalatwad

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’

    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
    return rcu_dereference_rtnl(dev->dpll_pin);
           ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1 make[4]: *** Waiting for unfinished jobs....
AR net/mpls/built-in.a
AR net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,

                   from ./include/linux/mm_types.h:11,
                   from ./include/linux/mmzone.h:22,
                   from ./include/linux/gfp.h:7,
                   from ./include/linux/umh.h:4,
                   from ./include/linux/kmod.h:9,
                   from ./include/linux/module.h:17,
                   from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
    return rcu_dereference_rtnl(dev->dpll_pin);
           ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1
make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2 make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,

                   from ./include/linux/compiler.h:251,
                   from ./include/linux/instrumented.h:10,
                   from ./include/linux/uaccess.h:6,
                   from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
   #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                      ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro
‘__WRITE_ONCE’
    *(volatile typeof(x) *)&(x) = (val);    \
                                   ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro
‘WRITE_ONCE’
    WRITE_ONCE(*p, v);      \
    ^~~~~~~~~~

./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’
#define smp_store_release(p, v) do { kcsan_release();
__smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’

     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
     ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro
‘RCU_INITIALIZER’
     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                           ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
    rcu_assign_pointer(dev->dpll_pin, dpll_pin);
    ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
    AR      drivers/net/ethernet/built-in.a
    AR      drivers/net/built-in.a
    AR      net/dcb/built-in.a
    AR      net/netlabel/built-in.a
    AR      net/strparser/built-in.a
    AR      net/handshake/built-in.a
    GEN     lib/test_fortify.log
    AR      net/8021q/built-in.a
    AR      net/nsh/built-in.a
    AR      net/unix/built-in.a
    CC      lib/string.o
    AR      net/packet/built-in.a
    AR      net/switchdev/built-in.a
    AR      lib/lib.a
    AR      net/mptcp/built-in.a
    AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                   from ./include/linux/mm_types.h:11,
                   from ./include/linux/mmzone.h:22,
                   from ./include/linux/gfp.h:7,
                   from ./include/linux/umh.h:4,
                   from ./include/linux/kmod.h:9,
                   from ./include/linux/module.h:17,
                   from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
    return rcu_dereference_rtnl(dev->dpll_pin);
           ^~~~~~~~~~~~~~~~~~~~

In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void function [-Werror=return-type]
}

Quoted 7 lines
Quoted 5 lines

Hi, Eric!

Looks like we have to move struct dpll_pin definition to include/linux/dpll.h to have this fixed, right?

No idea what is wrong. Is it powerpc specific ? Some compiler version ?

Might be a circular header inclusion.

Christophe

#5 lore raw
In reply to Eric Dumazet

Greetings,

I have tried the patch provided below. Moving struct to file "net/core/rtnetlink.c" is not resolving the problem. Please find the below traces.

--- Traces ---

In file included from ./include/linux/rbtree.h:24,
                 from ./include/linux/mm_types.h:11,
                 from ./include/linux/mmzone.h:22,
                 from ./include/linux/gfp.h:7,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:9,
                 from ./include/linux/module.h:17,
                 from net/core/rtnetlink.c:17:
net/core/rtnetlink.c: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
         ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
  ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’ rcu_dereference_check(p, lockdep_rtnl_is_held())
  ^~~~~~~~~~~~~~~~~~~~~
net/core/rtnetlink.c:1059:15: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
               ^~~~~~~~~~~~~~~~~~~~
  CC      crypto/algboss.o
net/core/rtnetlink.c:1063:1: error: control reaches end of non-void function [-Werror=return-type] }
 ^
  CC      crypto/authenc.o
  CC      crypto/authencesn.o
  CC      crypto/af_alg.o
  CC      crypto/algif_hash.o
  CC      crypto/algif_skcipher.o
  CC      crypto/algif_rng.o
  CC      crypto/algif_aead.o
  AR      arch/powerpc/kernel/built-in.a
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:243: net/core/rtnetlink.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  CC      lib/kobject_uevent.o
  AR      drivers/net/mdio/built-in.a
  AR      net/802/built-in.a
  AR      drivers/connector/built-in.a
  CC      lib/vsprintf.o
  AR      ipc/built-in.a
  AR      net/nsh/built-in.a
  CC      lib/dynamic_debug.o
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                 from ./include/linux/compiler.h:251,
                 from ./include/linux/instrumented.h:10,
                 from ./include/linux/uaccess.h:6,
                 from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                    ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro ‘__WRITE_ONCE’ *(volatile typeof(x) *)&(x) = (val);    \
                                 ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro ‘WRITE_ONCE’ WRITE_ONCE(*p, v);      \
  ^~~~~~~~~~
./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’ #define smp_store_release(p, v) do { kcsan_release(); __smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
   ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro ‘RCU_INITIALIZER’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                         ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’ rcu_assign_pointer(dev->dpll_pin, dpll_pin);
  ^~~~~~~~~~~~~~~~~~

Quoted 196 lines · Eric Dumazet
Quoted 144 lines · Vadim Fedorenko
Quoted 138 lines · Tasmiya Nalatwad

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’

    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
    return rcu_dereference_rtnl(dev->dpll_pin);
           ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1 make[4]: *** Waiting for unfinished jobs....
AR net/mpls/built-in.a
AR net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,

                   from ./include/linux/mm_types.h:11,
                   from ./include/linux/mmzone.h:22,
                   from ./include/linux/gfp.h:7,
                   from ./include/linux/umh.h:4,
                   from ./include/linux/kmod.h:9,
                   from ./include/linux/module.h:17,
                   from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
    return rcu_dereference_rtnl(dev->dpll_pin);
           ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1
make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2 make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,

                   from ./include/linux/compiler.h:251,
                   from ./include/linux/instrumented.h:10,
                   from ./include/linux/uaccess.h:6,
                   from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
   #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                      ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro
‘__WRITE_ONCE’
    *(volatile typeof(x) *)&(x) = (val);    \
                                   ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro
‘WRITE_ONCE’
    WRITE_ONCE(*p, v);      \
    ^~~~~~~~~~

./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’
#define smp_store_release(p, v) do { kcsan_release();
__smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’

     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
     ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro
‘RCU_INITIALIZER’
     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                           ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
    rcu_assign_pointer(dev->dpll_pin, dpll_pin);
    ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
    AR      drivers/net/ethernet/built-in.a
    AR      drivers/net/built-in.a
    AR      net/dcb/built-in.a
    AR      net/netlabel/built-in.a
    AR      net/strparser/built-in.a
    AR      net/handshake/built-in.a
    GEN     lib/test_fortify.log
    AR      net/8021q/built-in.a
    AR      net/nsh/built-in.a
    AR      net/unix/built-in.a
    CC      lib/string.o
    AR      net/packet/built-in.a
    AR      net/switchdev/built-in.a
    AR      lib/lib.a
    AR      net/mptcp/built-in.a
    AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                   from ./include/linux/mm_types.h:11,
                   from ./include/linux/mmzone.h:22,
                   from ./include/linux/gfp.h:7,
                   from ./include/linux/umh.h:4,
                   from ./include/linux/kmod.h:9,
                   from ./include/linux/module.h:17,
                   from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
    return rcu_dereference_rtnl(dev->dpll_pin);
           ^~~~~~~~~~~~~~~~~~~~
Quoted 5 lines

In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void function [-Werror=return-type]
}

Quoted 5 lines

Hi, Eric!

Looks like we have to move struct dpll_pin definition to include/linux/dpll.h to have this fixed, right?

No idea what is wrong. Is it powerpc specific ? Some compiler version ?

netdev_dpll_pin() could be moved to net/core/rtnetlink.c, this is the only user.

include/linux/dpll.h +0 -0
index 4ec2fe9caf5a3f284afd0cfe4fc7c2bf42cbbc60..72d21e710d7f201d2fc57bb3a32b4bc0ff2b1749

100644

include/linux/dpll.h +0 -9
@@ -169,13 +169,4 @@ int dpll_device_change_ntf(struct dpll_device *dpll);
 
  int dpll_pin_change_ntf(struct dpll_pin *pin);
 
-static inline struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
-{
-#if IS_ENABLED(CONFIG_DPLL)
-       return rcu_dereference_rtnl(dev->dpll_pin);
-#else
-       return NULL;
-#endif
-}
-
  #endif
net/core/rtnetlink.c +0 -0
index 9c4f427f3a5057b52ec05405e8b15b8ca2246b4b..32dc601fd8ca66dfcd3cb8f38b533314de02d1d2

100644

net/core/rtnetlink.c +9 -0
@@ -1053,6 +1053,15 @@ static size_t rtnl_devlink_port_size(const
 struct net_device *dev)
         return size;
  }
 
+static struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
+{
+#if IS_ENABLED(CONFIG_DPLL)
+       return rcu_dereference_rtnl(dev->dpll_pin);
+#else
+       return NULL;
+#endif
+}
+
  static size_t rtnl_dpll_pin_size(const struct net_device *dev)
  {

size_t size = nla_total_size(0); /* nest IFLA_DPLL_PIN */

Signature · 3 lines
Regards,
Tasmiya Nalatwad
IBM Linux Technology Center
#6 lore raw
Quoted 93 lines · Tasmiya Nalatwad

Greetings,

I have tried the patch provided below. Moving struct to file "net/core/rtnetlink.c" is not resolving the problem. Please find the below traces.

--- Traces ---

In file included from ./include/linux/rbtree.h:24,

                  from ./include/linux/mm_types.h:11,
                  from ./include/linux/mmzone.h:22,
                  from ./include/linux/gfp.h:7,
                  from ./include/linux/umh.h:4,
                  from ./include/linux/kmod.h:9,
                  from ./include/linux/module.h:17,
                  from net/core/rtnetlink.c:17:
net/core/rtnetlink.c: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
   typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
          ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
   __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
   ^~~~~~~~~~~~~~~~~~~~~~~

./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’
rcu_dereference_check(p, lockdep_rtnl_is_held()) ^~~~~~~~~~~~~~~~~~~~~
net/core/rtnetlink.c:1059:15: note: in expansion of macro ‘rcu_dereference_rtnl’

         return rcu_dereference_rtnl(dev->dpll_pin);
                ^~~~~~~~~~~~~~~~~~~~

CC crypto/algboss.o
net/core/rtnetlink.c:1063:1: error: control reaches end of non-void function [-Werror=return-type]
}
^

   CC      crypto/authenc.o
   CC      crypto/authencesn.o
   CC      crypto/af_alg.o
   CC      crypto/algif_hash.o
   CC      crypto/algif_skcipher.o
   CC      crypto/algif_rng.o
   CC      crypto/algif_aead.o
   AR      arch/powerpc/kernel/built-in.a
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:243: net/core/rtnetlink.o] Error 1
make[4]: *** Waiting for unfinished jobs....
   CC      lib/kobject_uevent.o
   AR      drivers/net/mdio/built-in.a
   AR      net/802/built-in.a
   AR      drivers/connector/built-in.a
   CC      lib/vsprintf.o
   AR      ipc/built-in.a
   AR      net/nsh/built-in.a
   CC      lib/dynamic_debug.o
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                  from ./include/linux/compiler.h:251,
                  from ./include/linux/instrumented.h:10,
                  from ./include/linux/uaccess.h:6,
                  from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
  #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                     ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro
‘__WRITE_ONCE’
   *(volatile typeof(x) *)&(x) = (val);    \
                                  ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro
‘WRITE_ONCE’
   WRITE_ONCE(*p, v);      \
   ^~~~~~~~~~

./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’
#define smp_store_release(p, v) do { kcsan_release();
__smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’

    smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
    ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro
‘RCU_INITIALIZER’
    smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                          ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
   rcu_assign_pointer(dev->dpll_pin, dpll_pin);
   ^~~~~~~~~~~~~~~~~~
Quoted 155 lines
Quoted 154 lines · Eric Dumazet
Quoted 144 lines · Vadim Fedorenko
Quoted 138 lines · Tasmiya Nalatwad

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’

    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
    return rcu_dereference_rtnl(dev->dpll_pin);
           ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1 make[4]: *** Waiting for unfinished jobs....
AR net/mpls/built-in.a
AR net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,

                   from ./include/linux/mm_types.h:11,
                   from ./include/linux/mmzone.h:22,
                   from ./include/linux/gfp.h:7,
                   from ./include/linux/umh.h:4,
                   from ./include/linux/kmod.h:9,
                   from ./include/linux/module.h:17,
                   from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
    return rcu_dereference_rtnl(dev->dpll_pin);
           ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1
make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2 make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,

                   from ./include/linux/compiler.h:251,
                   from ./include/linux/instrumented.h:10,
                   from ./include/linux/uaccess.h:6,
                   from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
   #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                      ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro
‘__WRITE_ONCE’
    *(volatile typeof(x) *)&(x) = (val);    \
                                   ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro
‘WRITE_ONCE’
    WRITE_ONCE(*p, v);      \
    ^~~~~~~~~~

./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’
#define smp_store_release(p, v) do { kcsan_release();
__smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’

     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
     ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro
‘RCU_INITIALIZER’
     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                           ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
    rcu_assign_pointer(dev->dpll_pin, dpll_pin);
    ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
    AR      drivers/net/ethernet/built-in.a
    AR      drivers/net/built-in.a
    AR      net/dcb/built-in.a
    AR      net/netlabel/built-in.a
    AR      net/strparser/built-in.a
    AR      net/handshake/built-in.a
    GEN     lib/test_fortify.log
    AR      net/8021q/built-in.a
    AR      net/nsh/built-in.a
    AR      net/unix/built-in.a
    CC      lib/string.o
    AR      net/packet/built-in.a
    AR      net/switchdev/built-in.a
    AR      lib/lib.a
    AR      net/mptcp/built-in.a
    AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                   from ./include/linux/mm_types.h:11,
                   from ./include/linux/mmzone.h:22,
                   from ./include/linux/gfp.h:7,
                   from ./include/linux/umh.h:4,
                   from ./include/linux/kmod.h:9,
                   from ./include/linux/module.h:17,
                   from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
    return rcu_dereference_rtnl(dev->dpll_pin);
           ^~~~~~~~~~~~~~~~~~~~
Quoted 5 lines

In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void function [-Werror=return-type]
}

Quoted 5 lines

Hi, Eric!

Looks like we have to move struct dpll_pin definition to include/linux/dpll.h to have this fixed, right?

No idea what is wrong. Is it powerpc specific ? Some compiler version ?

netdev_dpll_pin() could be moved to net/core/rtnetlink.c, this is the only user.

OK, it seems netdev_dpll_pin() has to be moved in a place the structure is known,
because rcu_dereference() needs to know its size.

I do not see other solution than this, otherwise we have to add more pollution to include/linux/netdevice.h

include/linux/netdevice.h +0 -0
index a9c973b92294bb110cf3cd336485972127b01b58..40797ea80bc6273cae6b7773d0a3e47459a72150

100644

include/linux/netdevice.h +1 -1
@@ -2469,7 +2469,7 @@ struct net_device {
        struct devlink_port     *devlink_port;
 
 #if IS_ENABLED(CONFIG_DPLL)
-       struct dpll_pin __rcu   *dpll_pin;
+       void __rcu *dpll_pin;
 #endif
 #if IS_ENABLED(CONFIG_PAGE_POOL)
        /** @page_pools: page pools created for this netdevice */
author Tested-by
#7 lore raw

Latest changes suggested below works, and the issue is not seen.

Tested-by Tasmiya Nalatwad <tasmiya at linux.vnet.ibm.com>
Quoted 270 lines · Eric Dumazet
Quoted 92 lines · Tasmiya Nalatwad

Greetings,

I have tried the patch provided below. Moving struct to file "net/core/rtnetlink.c" is not resolving the problem. Please find the below traces.

--- Traces ---

In file included from ./include/linux/rbtree.h:24,

                   from ./include/linux/mm_types.h:11,
                   from ./include/linux/mmzone.h:22,
                   from ./include/linux/gfp.h:7,
                   from ./include/linux/umh.h:4,
                   from ./include/linux/kmod.h:9,
                   from ./include/linux/module.h:17,
                   from net/core/rtnetlink.c:17:
net/core/rtnetlink.c: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
net/core/rtnetlink.c:1059:15: note: in expansion of macro
‘rcu_dereference_rtnl’
          return rcu_dereference_rtnl(dev->dpll_pin);
                 ^~~~~~~~~~~~~~~~~~~~
    CC      crypto/algboss.o

net/core/rtnetlink.c:1063:1: error: control reaches end of non-void function [-Werror=return-type]
}
^

    CC      crypto/authenc.o
    CC      crypto/authencesn.o
    CC      crypto/af_alg.o
    CC      crypto/algif_hash.o
    CC      crypto/algif_skcipher.o
    CC      crypto/algif_rng.o
    CC      crypto/algif_aead.o
    AR      arch/powerpc/kernel/built-in.a
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:243: net/core/rtnetlink.o] Error 1
make[4]: *** Waiting for unfinished jobs....
    CC      lib/kobject_uevent.o
    AR      drivers/net/mdio/built-in.a
    AR      net/802/built-in.a
    AR      drivers/connector/built-in.a
    CC      lib/vsprintf.o
    AR      ipc/built-in.a
    AR      net/nsh/built-in.a
    CC      lib/dynamic_debug.o
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                   from ./include/linux/compiler.h:251,
                   from ./include/linux/instrumented.h:10,
                   from ./include/linux/uaccess.h:6,
                   from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
   #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                      ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro
‘__WRITE_ONCE’
    *(volatile typeof(x) *)&(x) = (val);    \
                                   ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro
‘WRITE_ONCE’
    WRITE_ONCE(*p, v);      \
    ^~~~~~~~~~

./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’
#define smp_store_release(p, v) do { kcsan_release();
__smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’

     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
     ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro
‘RCU_INITIALIZER’
     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                           ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
    rcu_assign_pointer(dev->dpll_pin, dpll_pin);
    ^~~~~~~~~~~~~~~~~~
Quoted 155 lines
Quoted 154 lines · Eric Dumazet
Quoted 144 lines · Vadim Fedorenko
Quoted 134 lines · Tasmiya Nalatwad

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’

     typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
            ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
     __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
     ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
     rcu_dereference_check(p, lockdep_rtnl_is_held())
     ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
     return rcu_dereference_rtnl(dev->dpll_pin);
            ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1 make[4]: *** Waiting for unfinished jobs....
AR net/mpls/built-in.a
AR net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,

                    from ./include/linux/mm_types.h:11,
                    from ./include/linux/mmzone.h:22,
                    from ./include/linux/gfp.h:7,
                    from ./include/linux/umh.h:4,
                    from ./include/linux/kmod.h:9,
                    from ./include/linux/module.h:17,
                    from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
     typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
            ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
     __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
     ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
     rcu_dereference_check(p, lockdep_rtnl_is_held())
     ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
     return rcu_dereference_rtnl(dev->dpll_pin);
            ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1
make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2 make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,

                    from ./include/linux/compiler.h:251,
                    from ./include/linux/instrumented.h:10,
                    from ./include/linux/uaccess.h:6,
                    from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                       ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro
‘__WRITE_ONCE’
     *(volatile typeof(x) *)&(x) = (val);    \
                                    ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro
‘WRITE_ONCE’
     WRITE_ONCE(*p, v);      \
     ^~~~~~~~~~
./include/asm-generic/barrier.h:172:55: note: in expansion of macro
‘__smp_store_release’
    #define smp_store_release(p, v) do { kcsan_release();

__smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~ ./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’

      smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
      ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro
‘RCU_INITIALIZER’
      smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                            ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
     rcu_assign_pointer(dev->dpll_pin, dpll_pin);
     ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
     AR      drivers/net/ethernet/built-in.a
     AR      drivers/net/built-in.a
     AR      net/dcb/built-in.a
     AR      net/netlabel/built-in.a
     AR      net/strparser/built-in.a
     AR      net/handshake/built-in.a
     GEN     lib/test_fortify.log
     AR      net/8021q/built-in.a
     AR      net/nsh/built-in.a
     AR      net/unix/built-in.a
     CC      lib/string.o
     AR      net/packet/built-in.a
     AR      net/switchdev/built-in.a
     AR      lib/lib.a
     AR      net/mptcp/built-in.a
     AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                    from ./include/linux/mm_types.h:11,
                    from ./include/linux/mmzone.h:22,
                    from ./include/linux/gfp.h:7,
                    from ./include/linux/umh.h:4,
                    from ./include/linux/kmod.h:9,
                    from ./include/linux/module.h:17,
                    from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
     typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
            ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
     __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
     ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
     rcu_dereference_check(p, lockdep_rtnl_is_held())
     ^~~~~~~~~~~~~~~~~~~~~
Quoted 9 lines

./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’

     return rcu_dereference_rtnl(dev->dpll_pin);
            ^~~~~~~~~~~~~~~~~~~~
In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void
function [-Werror=return-type]
    }
Quoted 5 lines

Hi, Eric!

Looks like we have to move struct dpll_pin definition to include/linux/dpll.h to have this fixed, right?

No idea what is wrong. Is it powerpc specific ? Some compiler version ?

netdev_dpll_pin() could be moved to net/core/rtnetlink.c, this is the only user.

OK, it seems netdev_dpll_pin() has to be moved in a place the structure is known,
because rcu_dereference() needs to know its size.

I do not see other solution than this, otherwise we have to add more pollution to include/linux/netdevice.h

include/linux/netdevice.h +0 -0
index a9c973b92294bb110cf3cd336485972127b01b58..40797ea80bc6273cae6b7773d0a3e47459a72150

100644

include/linux/netdevice.h +1 -1
@@ -2469,7 +2469,7 @@ struct net_device {
         struct devlink_port     *devlink_port;
 
  #if IS_ENABLED(CONFIG_DPLL)
-       struct dpll_pin __rcu   *dpll_pin;
+       void __rcu *dpll_pin;
  #endif
  #if IS_ENABLED(CONFIG_PAGE_POOL)
         /** @page_pools: page pools created for this netdevice */
Signature · 3 lines
Regards,
Tasmiya Nalatwad
IBM Linux Technology Center
maintainer Reviewed-by
#8 lore raw
In reply to Eric Dumazet
Quoted 264 lines · Eric Dumazet
Quoted 93 lines · Tasmiya Nalatwad

Greetings,

I have tried the patch provided below. Moving struct to file "net/core/rtnetlink.c" is not resolving the problem. Please find the below traces.

--- Traces ---

In file included from ./include/linux/rbtree.h:24,

                   from ./include/linux/mm_types.h:11,
                   from ./include/linux/mmzone.h:22,
                   from ./include/linux/gfp.h:7,
                   from ./include/linux/umh.h:4,
                   from ./include/linux/kmod.h:9,
                   from ./include/linux/module.h:17,
                   from net/core/rtnetlink.c:17:
net/core/rtnetlink.c: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
           ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
    __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
    ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
    rcu_dereference_check(p, lockdep_rtnl_is_held())
    ^~~~~~~~~~~~~~~~~~~~~
net/core/rtnetlink.c:1059:15: note: in expansion of macro
‘rcu_dereference_rtnl’
          return rcu_dereference_rtnl(dev->dpll_pin);
                 ^~~~~~~~~~~~~~~~~~~~
    CC      crypto/algboss.o

net/core/rtnetlink.c:1063:1: error: control reaches end of non-void function [-Werror=return-type]
}
^

    CC      crypto/authenc.o
    CC      crypto/authencesn.o
    CC      crypto/af_alg.o
    CC      crypto/algif_hash.o
    CC      crypto/algif_skcipher.o
    CC      crypto/algif_rng.o
    CC      crypto/algif_aead.o
    AR      arch/powerpc/kernel/built-in.a
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:243: net/core/rtnetlink.o] Error 1
make[4]: *** Waiting for unfinished jobs....
    CC      lib/kobject_uevent.o
    AR      drivers/net/mdio/built-in.a
    AR      net/802/built-in.a
    AR      drivers/connector/built-in.a
    CC      lib/vsprintf.o
    AR      ipc/built-in.a
    AR      net/nsh/built-in.a
    CC      lib/dynamic_debug.o
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                   from ./include/linux/compiler.h:251,
                   from ./include/linux/instrumented.h:10,
                   from ./include/linux/uaccess.h:6,
                   from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
   #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                      ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro
‘__WRITE_ONCE’
    *(volatile typeof(x) *)&(x) = (val);    \
                                   ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro
‘WRITE_ONCE’
    WRITE_ONCE(*p, v);      \
    ^~~~~~~~~~

./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’
#define smp_store_release(p, v) do { kcsan_release();
__smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’

     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
     ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro
‘RCU_INITIALIZER’
     smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                           ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
    rcu_assign_pointer(dev->dpll_pin, dpll_pin);
    ^~~~~~~~~~~~~~~~~~
Quoted 155 lines
Quoted 154 lines · Eric Dumazet
Quoted 144 lines · Vadim Fedorenko
Quoted 134 lines · Tasmiya Nalatwad

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’

     typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
            ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
     __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
     ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
     rcu_dereference_check(p, lockdep_rtnl_is_held())
     ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
     return rcu_dereference_rtnl(dev->dpll_pin);
            ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1 make[4]: *** Waiting for unfinished jobs....
AR net/mpls/built-in.a
AR net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,

                    from ./include/linux/mm_types.h:11,
                    from ./include/linux/mmzone.h:22,
                    from ./include/linux/gfp.h:7,
                    from ./include/linux/umh.h:4,
                    from ./include/linux/kmod.h:9,
                    from ./include/linux/module.h:17,
                    from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
     typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
            ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
     __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
     ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
     rcu_dereference_check(p, lockdep_rtnl_is_held())
     ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro
‘rcu_dereference_rtnl’
     return rcu_dereference_rtnl(dev->dpll_pin);
            ^~~~~~~~~~~~~~~~~~~~

make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1
make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2 make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,

                    from ./include/linux/compiler.h:251,
                    from ./include/linux/instrumented.h:10,
                    from ./include/linux/uaccess.h:6,
                    from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
    #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                       ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro
‘__WRITE_ONCE’
     *(volatile typeof(x) *)&(x) = (val);    \
                                    ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro
‘WRITE_ONCE’
     WRITE_ONCE(*p, v);      \
     ^~~~~~~~~~
./include/asm-generic/barrier.h:172:55: note: in expansion of macro
‘__smp_store_release’
    #define smp_store_release(p, v) do { kcsan_release();

__smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~ ./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’

      smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
      ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro
‘RCU_INITIALIZER’
      smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                            ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’
     rcu_assign_pointer(dev->dpll_pin, dpll_pin);
     ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
     AR      drivers/net/ethernet/built-in.a
     AR      drivers/net/built-in.a
     AR      net/dcb/built-in.a
     AR      net/netlabel/built-in.a
     AR      net/strparser/built-in.a
     AR      net/handshake/built-in.a
     GEN     lib/test_fortify.log
     AR      net/8021q/built-in.a
     AR      net/nsh/built-in.a
     AR      net/unix/built-in.a
     CC      lib/string.o
     AR      net/packet/built-in.a
     AR      net/switchdev/built-in.a
     AR      lib/lib.a
     AR      net/mptcp/built-in.a
     AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                    from ./include/linux/mm_types.h:11,
                    from ./include/linux/mmzone.h:22,
                    from ./include/linux/gfp.h:7,
                    from ./include/linux/umh.h:4,
                    from ./include/linux/kmod.h:9,
                    from ./include/linux/module.h:17,
                    from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to
incomplete type ‘struct dpll_pin’
     typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
            ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro
‘__rcu_dereference_check’
     __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
     ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro
‘rcu_dereference_check’
     rcu_dereference_check(p, lockdep_rtnl_is_held())
     ^~~~~~~~~~~~~~~~~~~~~
Quoted 9 lines

./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’

     return rcu_dereference_rtnl(dev->dpll_pin);
            ^~~~~~~~~~~~~~~~~~~~
In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void
function [-Werror=return-type]
    }
Quoted 5 lines

Hi, Eric!

Looks like we have to move struct dpll_pin definition to include/linux/dpll.h to have this fixed, right?

No idea what is wrong. Is it powerpc specific ? Some compiler version ?

netdev_dpll_pin() could be moved to net/core/rtnetlink.c, this is the only user.

OK, it seems netdev_dpll_pin() has to be moved in a place the structure is known,
because rcu_dereference() needs to know its size.

I do not see other solution than this, otherwise we have to add more pollution to include/linux/netdevice.h

include/linux/netdevice.h +0 -0
index a9c973b92294bb110cf3cd336485972127b01b58..40797ea80bc6273cae6b7773d0a3e47459a72150

100644

include/linux/netdevice.h struct net_device { · line 2475

Quoted 8 lines
include/linux/netdevice.h +1 -1
@@ -2469,7 +2469,7 @@ struct net_device {
         struct devlink_port     *devlink_port;
 
  #if IS_ENABLED(CONFIG_DPLL)
-       struct dpll_pin __rcu   *dpll_pin;
+       void __rcu *dpll_pin;
  #endif
  #if IS_ENABLED(CONFIG_PAGE_POOL)
         /** @page_pools: page pools created for this netdevice */

I agree, this is the easiest solution.

maintainer
#9 lore raw
In reply to Eric Dumazet
Quoted 2 lines · On Thu, 29 Feb 2024 09:55:22 +0100 Eric Dumazet wrote:

I do not see other solution than this, otherwise we have to add more pollution to include/linux/netdevice.h

Right :(

include/linux/netdevice.h struct net_device { · line 2473

Quoted 12 lines
include/linux/netdevice.h +0 -0
index a9c973b92294bb110cf3cd336485972127b01b58..40797ea80bc6273cae6b7773d0a3e47459a72150

100644

include/linux/netdevice.h +1 -1
@@ -2469,7 +2469,7 @@ struct net_device {
        struct devlink_port     *devlink_port;
 
 #if IS_ENABLED(CONFIG_DPLL)
-       struct dpll_pin __rcu   *dpll_pin;
+       void __rcu *dpll_pin;
 #endif

If DPLL wants to hide its type definitions the helpers must live in dpll? IOW move netdev_dpll_pin() to drivers/dpll/dpll_core.c

BTW Tasmiya, please do tell us what compiler you're using.

#10 lore raw
Quoted 15 lines · Jakub Kicinski
Quoted 2 lines · On Thu, 29 Feb 2024 09:55:22 +0100 Eric Dumazet wrote:

I do not see other solution than this, otherwise we have to add more pollution to include/linux/netdevice.h

Right :(

Quoted 8 lines
include/linux/netdevice.h +0 -0
index a9c973b92294bb110cf3cd336485972127b01b58..40797ea80bc6273cae6b7773d0a3e47459a72150

100644

include/linux/netdevice.h +0 -0
@@ -2469,7 +2469,7 @@ struct net_device {
        struct devlink_port     *devlink_port;
 
Quoted 7 lines

include/linux/netdevice.h struct net_device { · line 2473

Quoted 4 lines
include/linux/netdevice.h +1 -1
 #if IS_ENABLED(CONFIG_DPLL)
-       struct dpll_pin __rcu   *dpll_pin;
+       void __rcu *dpll_pin;
 #endif

If DPLL wants to hide its type definitions the helpers must live in dpll? IOW move netdev_dpll_pin() to drivers/dpll/dpll_core.c

Oh for some reason I thought this stuff was a module.

Otherwise, why having dpll 'core' helpers in net/core/dev.c

#11 lore raw
Quoted 25 lines · Eric Dumazet
Quoted 15 lines · Jakub Kicinski
Quoted 2 lines · On Thu, 29 Feb 2024 09:55:22 +0100 Eric Dumazet wrote:

I do not see other solution than this, otherwise we have to add more pollution to include/linux/netdevice.h

Right :(

Quoted 8 lines
include/linux/netdevice.h +0 -0
index a9c973b92294bb110cf3cd336485972127b01b58..40797ea80bc6273cae6b7773d0a3e47459a72150

100644

include/linux/netdevice.h +0 -0
@@ -2469,7 +2469,7 @@ struct net_device {
        struct devlink_port     *devlink_port;
 
Quoted 7 lines

include/linux/netdevice.h struct net_device { · line 2473

Quoted 4 lines
include/linux/netdevice.h +1 -1
 #if IS_ENABLED(CONFIG_DPLL)
-       struct dpll_pin __rcu   *dpll_pin;
+       void __rcu *dpll_pin;
 #endif

If DPLL wants to hide its type definitions the helpers must live in dpll? IOW move netdev_dpll_pin() to drivers/dpll/dpll_core.c

Quoted 3 lines

Oh for some reason I thought this stuff was a module.

Otherwise, why having dpll 'core' helpers in net/core/dev.c

So, we would have something a bit convoluted like :

drivers/dpll/dpll_core.c +0 -0
index 4c2bb27c99fe4e517b0d92c4ae3db83a679c7d11..241db366b2c74ae749f49612d86176b2f8f479c1

100644

drivers/dpll/dpll_core.c +5 -0
@@ -42,6 +42,11 @@ struct dpll_pin_registration {
        void *priv;
 };
 
+struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
+{
+       return rcu_dereference_rtnl(dev->dpll_pin);
+}
+
 struct dpll_device *dpll_device_get_by_id(int id)
 {
        if (xa_get_mark(&dpll_device_xa, id, DPLL_REGISTERED))
include/linux/dpll.h +0 -0
index 4ec2fe9caf5a3f284afd0cfe4fc7c2bf42cbbc60..c60591308ae80fb99aa5abb5832b9a228473a916

100644

include/linux/dpll.h +4 -4
@@ -169,13 +169,13 @@ int dpll_device_change_ntf(struct dpll_device *dpll);
 
 int dpll_pin_change_ntf(struct dpll_pin *pin);
 
+#if !IS_ENABLED(CONFIG_DPLL)
 static inline struct dpll_pin *netdev_dpll_pin(const struct net_device *dev)
 {
-#if IS_ENABLED(CONFIG_DPLL)
-       return rcu_dereference_rtnl(dev->dpll_pin);
-#else
        return NULL;
-#endif
 }
+#else
+struct dpll_pin *netdev_dpll_pin(const struct net_device *dev);
+#endif
 
 #endif
#12 lore raw
In reply to Jakub Kicinski

Greetings,

This is tied to gcc version. Build failure is seen while using gcc-8.5.x

Quoted 22 lines · Jakub Kicinski
Quoted 2 lines · On Thu, 29 Feb 2024 09:55:22 +0100 Eric Dumazet wrote:

I do not see other solution than this, otherwise we have to add more pollution to include/linux/netdevice.h

Right :(

include/linux/netdevice.h struct net_device { · line 2473

Quoted 12 lines
include/linux/netdevice.h +0 -0
index a9c973b92294bb110cf3cd336485972127b01b58..40797ea80bc6273cae6b7773d0a3e47459a72150

100644

include/linux/netdevice.h +1 -1
@@ -2469,7 +2469,7 @@ struct net_device {
         struct devlink_port     *devlink_port;
 
  #if IS_ENABLED(CONFIG_DPLL)
-       struct dpll_pin __rcu   *dpll_pin;
+       void __rcu *dpll_pin;
  #endif

If DPLL wants to hide its type definitions the helpers must live in dpll? IOW move netdev_dpll_pin() to drivers/dpll/dpll_core.c

BTW Tasmiya, please do tell us what compiler you're using.

Signature · 3 lines
Regards,
Tasmiya Nalatwad
IBM Linux Technology Center
#13 lore raw
In reply to Vadim Fedorenko

Greetings,

The build error is seen on linux-next and mainline also

Mainline : 6.8.0-rc7

linux-next : 6.8.0-rc7-next-20240304

--- Traces ---

net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                    ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro ‘__WRITE_ONCE’ *(volatile typeof(x) *)&(x) = (val);    \
                                 ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro ‘WRITE_ONCE’ WRITE_ONCE(*p, v);      \
  ^~~~~~~~~~
./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’ #define smp_store_release(p, v) do { kcsan_release(); __smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
   ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro ‘RCU_INITIALIZER’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                         ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’ rcu_assign_pointer(dev->dpll_pin, dpll_pin);

Quoted 129 lines · Vadim Fedorenko
Quoted 113 lines · Tasmiya Nalatwad

Greetings,

[revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

Reverting below commit fixes the issue

commit 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e
     dpll: rely on rcu for netdev_dpll_pin()

--- Traces ---

./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
          ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
   ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’ rcu_dereference_check(p, lockdep_rtnl_is_held())
   ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
          ^~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_core.o] Error 1
make[4]: *** Waiting for unfinished jobs....
   AR      net/mpls/built-in.a
   AR      net/l3mdev/built-in.a
In file included from ./include/linux/rbtree.h:24,
                  from ./include/linux/mm_types.h:11,
                  from ./include/linux/mmzone.h:22,
                  from ./include/linux/gfp.h:7,
                  from ./include/linux/umh.h:4,
                  from ./include/linux/kmod.h:9,
                  from ./include/linux/module.h:17,
                  from drivers/dpll/dpll_netlink.c:9:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
          ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
   ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’ rcu_dereference_check(p, lockdep_rtnl_is_held())
   ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
          ^~~~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: drivers/dpll/dpll_netlink.o] Error 1 make[3]: *** [scripts/Makefile.build:481: drivers/dpll] Error 2
make[3]: *** Waiting for unfinished jobs....
In file included from ./arch/powerpc/include/generated/asm/rwonce.h:1,
                  from ./include/linux/compiler.h:251,
                  from ./include/linux/instrumented.h:10,
                  from ./include/linux/uaccess.h:6,
                  from net/core/dev.c:71:
net/core/dev.c: In function ‘netdev_dpll_pin_assign’:
./include/linux/rcupdate.h:462:36: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ #define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
                                     ^~~~
./include/asm-generic/rwonce.h:55:33: note: in definition of macro ‘__WRITE_ONCE’ *(volatile typeof(x) *)&(x) = (val);    \
                                  ^~~
./arch/powerpc/include/asm/barrier.h:76:2: note: in expansion of macro ‘WRITE_ONCE’ WRITE_ONCE(*p, v);      \
   ^~~~~~~~~~
./include/asm-generic/barrier.h:172:55: note: in expansion of macro ‘__smp_store_release’ #define smp_store_release(p, v) do { kcsan_release(); __smp_store_release(p, v); } while (0) ^~~~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:3: note: in expansion of macro ‘smp_store_release’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
    ^~~~~~~~~~~~~~~~~
./include/linux/rcupdate.h:503:25: note: in expansion of macro ‘RCU_INITIALIZER’ smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
                          ^~~~~~~~~~~~~~~
net/core/dev.c:9081:2: note: in expansion of macro ‘rcu_assign_pointer’ rcu_assign_pointer(dev->dpll_pin, dpll_pin);
   ^~~~~~~~~~~~~~~~~~
make[4]: *** [scripts/Makefile.build:243: net/core/dev.o] Error 1
make[4]: *** Waiting for unfinished jobs....
   AR      drivers/net/ethernet/built-in.a
   AR      drivers/net/built-in.a
   AR      net/dcb/built-in.a
   AR      net/netlabel/built-in.a
   AR      net/strparser/built-in.a
   AR      net/handshake/built-in.a
   GEN     lib/test_fortify.log
   AR      net/8021q/built-in.a
   AR      net/nsh/built-in.a
   AR      net/unix/built-in.a
   CC      lib/string.o
   AR      net/packet/built-in.a
   AR      net/switchdev/built-in.a
   AR      lib/lib.a
   AR      net/mptcp/built-in.a
   AR      net/devlink/built-in.a
In file included from ./include/linux/rbtree.h:24,
                  from ./include/linux/mm_types.h:11,
                  from ./include/linux/mmzone.h:22,
                  from ./include/linux/gfp.h:7,
                  from ./include/linux/umh.h:4,
                  from ./include/linux/kmod.h:9,
                  from ./include/linux/module.h:17,
                  from net/core/rtnetlink.c:17:
./include/linux/dpll.h: In function ‘netdev_dpll_pin’:
./include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type ‘struct dpll_pin’ typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
          ^
./include/linux/rcupdate.h:587:2: note: in expansion of macro ‘__rcu_dereference_check’ __rcu_dereference_check((p), __UNIQUE_ID(rcu), \
   ^~~~~~~~~~~~~~~~~~~~~~~
./include/linux/rtnetlink.h:70:2: note: in expansion of macro ‘rcu_dereference_check’

Quoted 9 lines

   rcu_dereference_check(p, lockdep_rtnl_is_held())
   ^~~~~~~~~~~~~~~~~~~~~
./include/linux/dpll.h:175:9: note: in expansion of macro ‘rcu_dereference_rtnl’ return rcu_dereference_rtnl(dev->dpll_pin);
          ^~~~~~~~~~~~~~~~~~~~
In file included from net/core/rtnetlink.c:60:
./include/linux/dpll.h:179:1: error: control reaches end of non-void function [-Werror=return-type] }

Hi, Eric!

Looks like we have to move struct dpll_pin definition to include/linux/dpll.h to have this fixed, right?

Signature · 3 lines
Regards,
Tasmiya Nalatwad
IBM Linux Technology Center