diff mbox series

[net-next,3/4] ipmr: use exit_batch_rtnl method

Message ID 20240208111646.535705-4-edumazet@google.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series inet: convert to exit_batch_rtnl | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 1052 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang fail Errors and warnings before: 1066 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 1069 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 23 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Eric Dumazet Feb. 8, 2024, 11:16 a.m. UTC
Using exit_batch_rtnl method instead of exit_batch avoids
one rtnl_lock()/rtnl_unlock() pair in netns dismantle.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/ipmr.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Eric Dumazet Feb. 8, 2024, 11:53 a.m. UTC | #1
On Thu, Feb 8, 2024 at 12:16 PM Eric Dumazet <edumazet@google.com> wrote:
>
> Using exit_batch_rtnl method instead of exit_batch avoids
> one rtnl_lock()/rtnl_unlock() pair in netns dismantle.
>



>
>  static struct pernet_operations ipmr_net_ops = {
>         .init = ipmr_net_init,
>         .exit = ipmr_net_exit,
> -       .exit_batch = ipmr_net_exit_batch,
> +       .exit_batch = ipmr_exit_batch_rtnl,
>  };

Oh well, I thought I fixed this error, I must have missed a step.
kernel test robot Feb. 9, 2024, 8:01 a.m. UTC | #2
Hi Eric,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/ip6mr-use-exit_batch_rtnl-method/20240208-192057
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240208111646.535705-4-edumazet%40google.com
patch subject: [PATCH net-next 3/4] ipmr: use exit_batch_rtnl method
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20240209/202402091528.IEa4ESwN-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240209/202402091528.IEa4ESwN-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402091528.IEa4ESwN-lkp@intel.com/

All errors (new ones prefixed by >>):

>> net/ipv4/ipmr.c:3134:23: error: initialization of 'void (*)(struct list_head *)' from incompatible pointer type 'void (*)(struct list_head *, struct list_head *)' [-Werror=incompatible-pointer-types]
    3134 |         .exit_batch = ipmr_exit_batch_rtnl,
         |                       ^~~~~~~~~~~~~~~~~~~~
   net/ipv4/ipmr.c:3134:23: note: (near initialization for 'ipmr_net_ops.exit_batch')
   cc1: some warnings being treated as errors


vim +3134 net/ipv4/ipmr.c

  3130	
  3131	static struct pernet_operations ipmr_net_ops = {
  3132		.init = ipmr_net_init,
  3133		.exit = ipmr_net_exit,
> 3134		.exit_batch = ipmr_exit_batch_rtnl,
  3135	};
  3136
kernel test robot Feb. 9, 2024, 12:26 p.m. UTC | #3
Hi Eric,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/ip6mr-use-exit_batch_rtnl-method/20240208-192057
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240208111646.535705-4-edumazet%40google.com
patch subject: [PATCH net-next 3/4] ipmr: use exit_batch_rtnl method
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240209/202402092023.Upwn6RGF-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240209/202402092023.Upwn6RGF-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402092023.Upwn6RGF-lkp@intel.com/

All errors (new ones prefixed by >>):

>> net/ipv4/ipmr.c:3134:16: error: incompatible function pointer types initializing 'void (*)(struct list_head *)' with an expression of type 'void (struct list_head *, struct list_head *)' [-Wincompatible-function-pointer-types]
    3134 |         .exit_batch = ipmr_exit_batch_rtnl,
         |                       ^~~~~~~~~~~~~~~~~~~~
   1 error generated.


vim +3134 net/ipv4/ipmr.c

  3130	
  3131	static struct pernet_operations ipmr_net_ops = {
  3132		.init = ipmr_net_init,
  3133		.exit = ipmr_net_exit,
> 3134		.exit_batch = ipmr_exit_batch_rtnl,
  3135	};
  3136
diff mbox series

Patch

diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 3622298365105d99c0277f1c1616fb5fc63cdc2d..708c79c465e7212d24d2eb74165b227b9bde1c5f 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -3119,20 +3119,19 @@  static void __net_exit ipmr_net_exit(struct net *net)
 	ipmr_notifier_exit(net);
 }
 
-static void __net_exit ipmr_net_exit_batch(struct list_head *net_list)
+static void __net_exit ipmr_exit_batch_rtnl(struct list_head *net_list,
+					    struct list_head *dev_to_kill)
 {
 	struct net *net;
 
-	rtnl_lock();
 	list_for_each_entry(net, net_list, exit_list)
 		ipmr_rules_exit(net);
-	rtnl_unlock();
 }
 
 static struct pernet_operations ipmr_net_ops = {
 	.init = ipmr_net_init,
 	.exit = ipmr_net_exit,
-	.exit_batch = ipmr_net_exit_batch,
+	.exit_batch = ipmr_exit_batch_rtnl,
 };
 
 int __init ip_mr_init(void)