From patchwork Thu Feb 8 11:16:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 13549648 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E2F86DD07 for ; Thu, 8 Feb 2024 11:16:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391011; cv=none; b=Vhydavp3zfXhk37tzDfyF5Rlrtd6NOxjpkuCNB6eBYxOuDFBTXrI1WQzdJQddN370xR1VioZL4OJdKEkyOZOSMTse/2H2dAeXtxUYKvZX/89PGmz28o1uWcepSYepRUVizq0bcNLjFMnVatQd0NsQRM6TMvRsUpPCMCEsHZOjWY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391011; c=relaxed/simple; bh=r8ZYW3Rs3MiAzsJ4L/3/9ecJJDEkvN8B1tc/IdQ9uz0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=d+QS8Adn5nCWbKNLEMPUrbMw95QUey9E1D8ailwwWvnX69aB7nSSHSITTvRRrCS7iYVhLc/9fljLLJqTisQg4op1r2t4g1GbsTwsrh5ouwr1LGqiQx91k/Cqb+lkuj1DytXZFFTHwPWGfMRuMsaE76Yjn4+08BlkEZXyxY8V1lI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tjeVER1b; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tjeVER1b" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc6b5d1899eso1024155276.0 for ; Thu, 08 Feb 2024 03:16:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707391009; x=1707995809; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Vc5YgK7GXN8DRY5LrBnuYTzTOxzNC1mLjrSzYg9HA/U=; b=tjeVER1bWzuWxbCdE3lSYQTJ/oU5dlaxVKGAs42rH/y88fsAcZqmxx4JMx8ofH3qzj vAg1xRnU1CYLGAbBL/L33ZbBDWdxgU50Jnkl4etrsnRXCghAVrjTn2wnJnWMAzh9tjZA THy1oQ3/bI/AqC/z0wOLFcBxR9aVgbHUuYmLmig/4t1/F9JvtcMUB3vBmkVvj1HIAtNP cMoceXhy9jY3C3jhxD+LyLm99hC4lNqt/xmq9npMeiI7FsY7vPMrZdbeIYxunn3yZg+f SRBUHT5ghBp0x6fhzdmCOMZUqrzMeaecHWtAeZaLlD2N+jkCd5NFoJ6q7Mx2rGH7+t/G PubQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707391009; x=1707995809; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Vc5YgK7GXN8DRY5LrBnuYTzTOxzNC1mLjrSzYg9HA/U=; b=ZtD/0y3AqjxbrsCfdARvyAzommwdRyjyctUzRqWDKKd3/D7MC/VOmALaK4Mgta9XIg 1ctGNje5UT5WxYYz3cGEHCL7RU0Sp/eqO3HlXCBGtaALQ0+O6rB9q1my6aK39Ta780f8 RAa9iFk+lhYPKnHO1shRJ7eM1EBOhAsKuX8etOf795w4WIE+YetfuJ6mz1JNFqg3eiNn rE4pYCF9R/Fd5d5RSvumo2MESkZRSwscnTwrYRt0RVhdc1p/g1C4hIZMPBoW7kE5LNM1 6RdLcxL6b1My7QP3LirxuDesonbgzCYFdpzjBAgIK8iNYX09R9+QfNBMLQMeJCm3YXW2 QInw== X-Gm-Message-State: AOJu0YySaz2nQHubCEr6j8yFjI8RqTzeT8Qm16CQVbX18jlC0dpZZjUr 918FgLMMNSHad6SknwZ7qOZJ6qepJJ4rBYhRn4il/yfo5o+j2wCkZ5uFFX301QMGSw7b4ogAY8R oZ6/Rx/KZNQ== X-Google-Smtp-Source: AGHT+IGn0b4TXQJdGWFjuP/ppyu7OHaeoONOto2BaKy4YN0HPUfSM3EgcuaMQDkqvM5TjG1SknqZmT41iBBztg== X-Received: from edumazet1.c.googlers.com ([fda3:e722:ac3:cc00:2b:7d90:c0a8:395a]) (user=edumazet job=sendgmr) by 2002:a05:6902:100b:b0:dc6:e884:2342 with SMTP id w11-20020a056902100b00b00dc6e8842342mr608611ybt.5.1707391009174; Thu, 08 Feb 2024 03:16:49 -0800 (PST) Date: Thu, 8 Feb 2024 11:16:43 +0000 In-Reply-To: <20240208111646.535705-1-edumazet@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240208111646.535705-1-edumazet@google.com> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog Message-ID: <20240208111646.535705-2-edumazet@google.com> Subject: [PATCH net-next 1/4] ip6mr: use exit_batch_rtnl method From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: David Ahern , netdev@vger.kernel.org, eric.dumazet@gmail.com, Eric Dumazet X-Patchwork-Delegate: kuba@kernel.org Using exit_batch_rtnl method instead of exit_batch avoids one rtnl_lock()/rtnl_unlock() pair in netns dismantle. Signed-off-by: Eric Dumazet --- net/ipv6/ip6mr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 9782c180fee646ab0fad7f0f911254b4b3a592c4..ed2cf29bc9d1bcddbf325860769138ce970f7f18 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -1353,20 +1353,19 @@ static void __net_exit ip6mr_net_exit(struct net *net) ip6mr_notifier_exit(net); } -static void __net_exit ip6mr_net_exit_batch(struct list_head *net_list) +static void __net_exit ip6mr_net_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) ip6mr_rules_exit(net); - rtnl_unlock(); } static struct pernet_operations ip6mr_net_ops = { .init = ip6mr_net_init, .exit = ip6mr_net_exit, - .exit_batch = ip6mr_net_exit_batch, + .exit_batch_rtnl = ip6mr_net_exit_batch_rtnl, }; int __init ip6_mr_init(void) From patchwork Thu Feb 8 11:16:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 13549649 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEA9B6EB56 for ; Thu, 8 Feb 2024 11:16:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391013; cv=none; b=gMtLtFLFms/BFuu81wvGryNWNJ+Zxf0IrW+U2CcEoD8Ef75TFPd7YwffrjlJ/iBALHUJWikWxKTQV6BaDZkxI67hlkKYmm+01UezFB+S3cf2ZXWK3UQu3Q4VO33HOPGyHJ5gSnR9tA29w3+xTbdkjOHX6kVAsm2K3/mS9NVlobg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391013; c=relaxed/simple; bh=7mz87wY0j23imRQ6QFVIdhb3tG1hg6idztU7a/rsL00=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=rCTrGCHCnwXlrwJu1xX3uanDjYc+Lj6AU2A3iWe6nEJf36uB2JfcYrYNajPa5SC3vStoC6hge4/snZaVonEvxfn4M/UYDJgN5TVqu3i0wA0+AfwDg50L2RDHMqgpbWb/nh+FhroEiCw/wV5JJwcQXI4xJWb/Nb2V/2aEtseLbBU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=PZDoPRY3; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="PZDoPRY3" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-604ab15463aso4729147b3.3 for ; Thu, 08 Feb 2024 03:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707391010; x=1707995810; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=lxxA6UvNfV7hUeEnldPFFLLQTuouWFZjT82OWNibbxE=; b=PZDoPRY3NtN467qDZUBHQ0MMYOpUz5SIQKxRzI+fEVYOerCUQnWbST/ntS35NsDmhj o4gVTk4JroVE9/P2kOzxNVlPq5201wB5vCJqyV3h1tNNIOUDbGaPySbw/3kgTxPHQjxQ Kok0rM/SItODjgenqI8gOGNM/DLAW805QpXeQ9Kbii7PJ1cw4z7dQi9HfW5DYs7Eohhn GblvhDAQQ65Bom7URC2bDabnF89Yh3MvOTe4eK6zis55tpu5ysyb13KWQ7acGWqBp7RL v3TXkcUnmWIp+PNDZ78nvRIC5g2nne4xVtGwUbs//PALRVMUkB8AQjq3wM7BJpZL543W kP+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707391010; x=1707995810; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lxxA6UvNfV7hUeEnldPFFLLQTuouWFZjT82OWNibbxE=; b=Il+DEyHl4i5dUCcMZkS4aOtXb67i32Z2ATrRo7pBhsAZ+w5KzCB7J57jtk82eJtsVR tVpv4ZwQUnnF9Me55rmeWUpf9Rg7O0TGdw6jbycRXkeb70GI+YRy0E5A9sKWjyqbs+l4 u2LZvYzLA+V7qIm4AslAhpfiY1Ng++/PPnQ8kR6xo+dczsJMTV3GGfSuGT4n8OPAKKW5 H7wbEXftpEzQkNqQUpQU+ajQo5nqsAom72WhttkifFY/MH30yPFvaKPmbeeW1fRakqXd OTVAcXXJ8V65LZ/JF910vS9ZyjeByEI3iyl3UKXtmgwLm1q5iA+9gqrmo7fE2fCYm/xi TscA== X-Forwarded-Encrypted: i=1; AJvYcCW1MWFBDW0sXVQgav3EwBApcQbaFVWPL4Kqv7xTZYj+u6+2PVmM501lD7j6ro8SwvunCpYt0xvuCrhR64eF3swmDl+xU+Vh X-Gm-Message-State: AOJu0YxVBNY/JBPv9nSbuODgqu3zO0FRV9TP4ApSflxIkNdh0gVjdjkB obY+0Ll4Fw+NWUBAwWfgO3lh5pkxh3nE3NlSe5z4sqeXTC7DhQKO4nDUriCq0YNw7adas9lzMoq JA9WLEXD4yg== X-Google-Smtp-Source: AGHT+IEUg88PAL8oKvRK9TK0ramiGqN8SiVbAHc6Bx5UoGigHPTYGOpeYRNxHQEjk4bCjT4aODDwyMLMobPs8Q== X-Received: from edumazet1.c.googlers.com ([fda3:e722:ac3:cc00:2b:7d90:c0a8:395a]) (user=edumazet job=sendgmr) by 2002:a81:4f87:0:b0:604:9a6e:5c9c with SMTP id d129-20020a814f87000000b006049a6e5c9cmr568933ywb.10.1707391010699; Thu, 08 Feb 2024 03:16:50 -0800 (PST) Date: Thu, 8 Feb 2024 11:16:44 +0000 In-Reply-To: <20240208111646.535705-1-edumazet@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240208111646.535705-1-edumazet@google.com> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog Message-ID: <20240208111646.535705-3-edumazet@google.com> Subject: [PATCH net-next 2/4] ipv6: fib6: use exit_batch_rtnl method From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: David Ahern , netdev@vger.kernel.org, eric.dumazet@gmail.com, Eric Dumazet X-Patchwork-Delegate: kuba@kernel.org Using exit_batch_rtnl method instead of exit_batch avoids one rtnl_lock()/rtnl_unlock() pair in netns dismantle. Signed-off-by: Eric Dumazet --- net/ipv6/fib6_rules.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index 7523c4baef35e23d39e9537943593107a79ff551..44194332ee09f673d993271f2e1f278bd6f2c5a2 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c @@ -493,21 +493,20 @@ static int __net_init fib6_rules_net_init(struct net *net) goto out; } -static void __net_exit fib6_rules_net_exit_batch(struct list_head *net_list) +static void __net_exit fib6_rules_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) { fib_rules_unregister(net->ipv6.fib6_rules_ops); cond_resched(); } - rtnl_unlock(); } static struct pernet_operations fib6_rules_net_ops = { .init = fib6_rules_net_init, - .exit_batch = fib6_rules_net_exit_batch, + .exit_batch_rtnl = fib6_rules_exit_batch_rtnl, }; int __init fib6_rules_init(void) From patchwork Thu Feb 8 11:16:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 13549650 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-qk1-f201.google.com (mail-qk1-f201.google.com [209.85.222.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 892D96F07E for ; Thu, 8 Feb 2024 11:16:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391015; cv=none; b=lM9Ql+l9WXz+YNeVFoBDod0erM7FQhqw0CWDbAJQ+bIB+8B9sUS+GHUNFqbznNvZ4XnoPABuCovYw+n8tIlREfszwOq+w4Hew3Y29SO466becSVaBHFlixkkGhc5mTZ7D0/SvDZIlFkuSuqcb+qIufUm4nT+mWqxFvq7W39zkgo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391015; c=relaxed/simple; bh=CbQN6xcbU0b/bO5BcxS8jUDfGEhVbCo/V9vFS/KWTdg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=kKLyHyuR0Kks7eXhYIeAyTSUZhxMSMyL1X03s7hUIIXiBB0dxNotFZaH7OyWDTXF6+6SdN4/UNX9q4RacidHEfymU8122/xrTtchM7PCsJ6W+AKpi0ajxdQjE5RI0I2KRcCxq6ocN33ZOScaQXaP0ObK/zGAlIicuhcuLLyNsyw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=pmE5wkGy; arc=none smtp.client-ip=209.85.222.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="pmE5wkGy" Received: by mail-qk1-f201.google.com with SMTP id af79cd13be357-785a91f4c28so36917685a.2 for ; Thu, 08 Feb 2024 03:16:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707391012; x=1707995812; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=X4sN2AtdWoAwYAK9RlB7jQ6bQLlakZmg/ZTHp++Hfmg=; b=pmE5wkGyHbOtoW9qg6rHIdpHyNDMSnAiZQHh79WTFdmJPOL/e88aVX0gwixdDCswH7 9/E8erBO2RMIBbmkwhL+PIPaT5CwwYMzV9huQCgm99VAR3JzmbxOUwfUEzZS3iotxqRb BYy9RGJ4QC4kGvs3HBzuj2g4JWdFmfOUYQhuEcFK3ffAWPBd2su5YfcNpeLsefBRT3aK oD90n4uSIdPpWHw7FG3MZQnehwrQ/FSg8Ix5Sl0A6EuhzcbX1ckv7TxqiXoX4SHVddsA 9sqZa6sYziZOGcSAWZE22jIRBT51d10FXIQT5jN5djjUu12ll7asKmXJ4CA9RW+jZkPo AXzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707391012; x=1707995812; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X4sN2AtdWoAwYAK9RlB7jQ6bQLlakZmg/ZTHp++Hfmg=; b=svki08FnrG1X01p3cqtH8oaSjn7wfthF9dXibLOOdJL6gBVEu/iTp3zrIQLd7LwnzD zCiTpbg3Kuhb2y4gd+cEbEhukVvlHMarWdfr44WDoI6Lx/tgqnSpd2/2UPzzYNc/VlJu pRlF9puqoOGFP75cLHxDLkJimQMKodihxXVN+3H6shS4foWZpU2TLMGHMvighjV1OXpo UAjQIXYniTiiLDodoxodnvRxffIFioSd/vGsKlwgPBAugMgGQc9CQo7G/0EL4iLpA6wj i72a1eEAGdLCldHBm7zoAgTDQlaYmyEsCf4/9QO/i7n2hBg0YNFvfLO4r1vP95TsA81R fstw== X-Forwarded-Encrypted: i=1; AJvYcCWHNwxePLsRHdnat4a4bY84dGvLGd0gVYvVeRCjayudp2+0gMlV2Zsaxpj4ABc6QW+B6t8iVerzO/JT1kcKHqimiRdQhmS1 X-Gm-Message-State: AOJu0YxTtQ4f3HWM4UwzLQjJIC4ozqZ5T4vJEmB4mcc7ONV0l/fjMg5y oIPrdFIhZTXq3I9HYbp+JDRbxesFkkf7Y0DrzoXuc5XNpRG6J1f1VU9YlxiuR5w+Ims28rnP8NM H4Ak1ddXxmg== X-Google-Smtp-Source: AGHT+IEg+6xWGELdbDDafeqbhlAvL3fhxYLPY3nPlVOHpUqG58h34I2ZJxvjnCMTkOUrCsjVVsDIQ4PltVc7Hw== X-Received: from edumazet1.c.googlers.com ([fda3:e722:ac3:cc00:2b:7d90:c0a8:395a]) (user=edumazet job=sendgmr) by 2002:a05:620a:2112:b0:785:9e3c:2097 with SMTP id l18-20020a05620a211200b007859e3c2097mr23940qkl.11.1707391012439; Thu, 08 Feb 2024 03:16:52 -0800 (PST) Date: Thu, 8 Feb 2024 11:16:45 +0000 In-Reply-To: <20240208111646.535705-1-edumazet@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240208111646.535705-1-edumazet@google.com> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog Message-ID: <20240208111646.535705-4-edumazet@google.com> Subject: [PATCH net-next 3/4] ipmr: use exit_batch_rtnl method From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: David Ahern , netdev@vger.kernel.org, eric.dumazet@gmail.com, Eric Dumazet X-Patchwork-Delegate: kuba@kernel.org Using exit_batch_rtnl method instead of exit_batch avoids one rtnl_lock()/rtnl_unlock() pair in netns dismantle. Signed-off-by: Eric Dumazet --- net/ipv4/ipmr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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) From patchwork Thu Feb 8 11:16:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 13549651 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3B576F098 for ; Thu, 8 Feb 2024 11:16:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391017; cv=none; b=mMw3RxIlDKs5aBElvvbu2500eluhBMHskQO8EXGuB7jY+U9m2hUmTnvd7+rZz9Nrx1nBSUdsIYStd7X8eujRPbFjPaBx1KNn3ztmd6BtTY/swl01bc7nbgR4Eplq9TKpAE2yinbxDtiG2uMRdnvlcvLuCyA9NkULkNkiNel9FXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707391017; c=relaxed/simple; bh=/3ile9WIt0dmfqHoIsphjClQ0qXXs68F2dYdRh3eV1M=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=fF62RAA9wPH/mZlEeJu8GrG5MwB6jCN4/k6tcdaA6K/eTfHmt9ttr7G3isaXlkJFvAEMJAoVrpo850zFH8MkyXJps2a3iZWFQ95c8WVp+Kf3YIL0xhGyN0iRGKXHoRuGAibcKoHhl9IOg06u0bfF11JYqRfwXw0XJThXQSKIdJc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=MKGtToXj; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MKGtToXj" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-5fc6463b0edso31594927b3.0 for ; Thu, 08 Feb 2024 03:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707391015; x=1707995815; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Ng8UKvTPF/Wm8z4LvHUKLMWB0woQ3y9NZ3MydoTfnlw=; b=MKGtToXjHlpU3NRiv40OjfbE60XW7biRv6S1JisYY2nEccz03m0iQzqvOrQeQEKKNk eWra09sHGDB8iyKaWebswcGUfViyCxSEPeEdNVd5kuYK+HSuf0v057oNPUjN1UQ9whPl QpXsGXBkREr/2q5d5nAVw11OXbpLtZcrYUKZSI41fxy2Y1c4jv9zEtRnWpL/bKQgcOvq FfyVAMc8WMaEG1Op5a/saPF7Om4nDBNXj4VQIMYNwI6rlJ9ChwN8mME3clwuGnPO0NlG C/+NLIlNj/0zmGE8IYeJANIB5V2TF00fnGSWwrSZDmPkLLX/xz5dQEt9QHRrbyFp9Emt VpLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707391015; x=1707995815; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ng8UKvTPF/Wm8z4LvHUKLMWB0woQ3y9NZ3MydoTfnlw=; b=h3PnkkKn6PQPv+xHRbmZHFZ6m1Y+BQNHi1d+8s9LB5xj43dnwKnjvXay4nZSKKurJC sRlqHYzdykYyBwePVFtnTpDfXCW7Em7VzV/a6cpskTuOkwBiegTWoJce+ybepwh3n0KN 3oxqkDs1hxZNJMYcmWBzSCX9IjXl47AyDdMsY1+4H9unw5/h73VYwv24F7vOn+GV3wem Bd95FLkXinwKSkhbWKiBqG2bFY/Rlq79H9qLVSVQBK2q6gI63KAlIzUDHl0VrzeTEZe2 yzAv5c+Js76M5BOjEVrSq3yUr2bbh3sxiGYuX9tcSCS/bBn/YLcviGSdHl46mKUZXGNB rJLQ== X-Gm-Message-State: AOJu0YyoF/AP+i/ioDq/8v4SyhjMhdPiKj5Oe0YeTDKskOGbohCOQhxL Pq/JL1Y0wt+VTOFsLt0EAZMf1KQjD72ygTC/HUTXokThvukBEjAziVEpJojavs3c7WuvEkqlscf Y95CqGU44hw== X-Google-Smtp-Source: AGHT+IHs5Zcp8NnhyNsJ6vua57t5DnUHqXM6b968U6lhaNKbyi0k9ClVFEHolviCeb3A21rLwcDnN0cgTrPbaA== X-Received: from edumazet1.c.googlers.com ([fda3:e722:ac3:cc00:2b:7d90:c0a8:395a]) (user=edumazet job=sendgmr) by 2002:a05:6902:240d:b0:dc6:e20f:80cb with SMTP id dr13-20020a056902240d00b00dc6e20f80cbmr326070ybb.3.1707391014827; Thu, 08 Feb 2024 03:16:54 -0800 (PST) Date: Thu, 8 Feb 2024 11:16:46 +0000 In-Reply-To: <20240208111646.535705-1-edumazet@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240208111646.535705-1-edumazet@google.com> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog Message-ID: <20240208111646.535705-5-edumazet@google.com> Subject: [PATCH net-next 4/4] ipv4: fib: use exit_batch_rtnl method From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: David Ahern , netdev@vger.kernel.org, eric.dumazet@gmail.com, Eric Dumazet X-Patchwork-Delegate: kuba@kernel.org Using exit_batch_rtnl method instead of exit_batch avoids one rtnl_lock()/rtnl_unlock() pair in netns dismantle. Signed-off-by: Eric Dumazet --- net/ipv4/fib_frontend.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 390f4be7f7bec20f33aa80e9bf12d5e2f3760562..b5f52639aeda382ac959d3207a18d0d088bcb297 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -1631,21 +1631,19 @@ static void __net_exit fib_net_exit(struct net *net) nl_fib_lookup_exit(net); } -static void __net_exit fib_net_exit_batch(struct list_head *net_list) +static void __net_exit fib_net_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) ip_fib_net_exit(net); - - rtnl_unlock(); } static struct pernet_operations fib_net_ops = { .init = fib_net_init, .exit = fib_net_exit, - .exit_batch = fib_net_exit_batch, + .exit_batch_rtnl = fib_net_exit_batch_rtnl, }; void __init ip_fib_init(void)