From patchwork Fri Feb 28 04:23:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 13995666 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp-fw-9106.amazon.com (smtp-fw-9106.amazon.com [207.171.188.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39A7D819 for ; Fri, 28 Feb 2025 04:24:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.171.188.206 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740716655; cv=none; b=rIgwrZe3wFt3EdSrZVnzgYhOBAazY0ZFs83B79k7C/0a+JBQProCPZ0jgnz/rWTwbyFTIFl7vGvl30y1lJLp/Ziutd1SWOwmn6AEU2ZHL/6fzIoBoH0LNldcWD0pPmEmDj+m003PC3B63VcHAIqNouVRRA+i5tRUZjAPQNtchsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740716655; c=relaxed/simple; bh=iAVUBpQ+jbWf97omJNdLKxwAIoDuxoYswIG0LDNW/DE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qrLGVg9bQ3TxgUU7vFeS/iDeMUR62gapea4qawJMxNE3N1t6hH/JmxYGWKufPgwwnclGdAwKiN54RMbdxwKOU/+0oecvcJquXvzNBq8AAEx5jWwrmRucsixBG72bHVDL/pqiqD1QHZlnADRjq22HDhQYd3sfZ9DT5PicsMK6qrw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.jp; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=KXHBgFPp; arc=none smtp.client-ip=207.171.188.206 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="KXHBgFPp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1740716655; x=1772252655; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OFS52OUXP616a1y29divC0YGpdp2orGv+IkMx8RVeS0=; b=KXHBgFPpKSnlrhocitf3G9OePXG2WCjWuGnL9G3z7yYVhF57dXqhZ9Q0 eiCE/6gGyOG6eKbv7RXlxpLDAoHb/zBH9f0TJ5t9Bj8sCXYo4hfvx5vtG kBQjX1JDGTWCLCfFhnPrYyr5E2YyUurAhGXuoyBOj1XaXSbJ0Qb4YRTHw 4=; X-IronPort-AV: E=Sophos;i="6.13,321,1732579200"; d="scan'208";a="802802666" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.25.36.210]) by smtp-border-fw-9106.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2025 04:24:09 +0000 Received: from EX19MTAUWC001.ant.amazon.com [10.0.21.151:23690] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.35.58:2525] with esmtp (Farcaster) id ff8717d5-1971-4da3-8e8e-60e31bf7c6e4; Fri, 28 Feb 2025 04:24:08 +0000 (UTC) X-Farcaster-Flow-ID: ff8717d5-1971-4da3-8e8e-60e31bf7c6e4 Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWC001.ant.amazon.com (10.250.64.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Fri, 28 Feb 2025 04:24:06 +0000 Received: from 6c7e67bfbae3.amazon.com (10.106.101.51) by EX19D004ANA001.ant.amazon.com (10.37.240.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Fri, 28 Feb 2025 04:24:03 +0000 From: Kuniyuki Iwashima To: "David S. Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , Simon Horman CC: Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v3 net-next 01/12] ipv4: fib: Use cached net in fib_inetaddr_event(). Date: Thu, 27 Feb 2025 20:23:17 -0800 Message-ID: <20250228042328.96624-2-kuniyu@amazon.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250228042328.96624-1-kuniyu@amazon.com> References: <20250228042328.96624-1-kuniyu@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D036UWC004.ant.amazon.com (10.13.139.205) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Patchwork-Delegate: kuba@kernel.org net is available in fib_inetaddr_event(), let's use it. Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Reviewed-by: David Ahern --- net/ipv4/fib_frontend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 272e42d81323..6730e2034cf8 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -1450,7 +1450,7 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, fib_sync_up(dev, RTNH_F_DEAD); #endif atomic_inc(&net->ipv4.dev_addr_genid); - rt_cache_flush(dev_net(dev)); + rt_cache_flush(net); break; case NETDEV_DOWN: fib_del_ifaddr(ifa, NULL); @@ -1461,7 +1461,7 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, */ fib_disable_ip(dev, event, true); } else { - rt_cache_flush(dev_net(dev)); + rt_cache_flush(net); } break; }