From patchwork Tue Mar 18 23:31:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuniyuki Iwashima X-Patchwork-Id: 14021733 Received: from smtp-fw-52002.amazon.com (smtp-fw-52002.amazon.com [52.119.213.150]) (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 DE5A1224CC for ; Tue, 18 Mar 2025 23:32:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.119.213.150 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742340778; cv=none; b=pmU9wgK4ayRpnPDtH1qH3SxJJTReDgCOemf95tWHradvt1ZDvfYJyJi0gikE/dDJ07mbqp9lJfSZZsQ+Xv3/C7pZmZe1gNO3YXIgOKcAqcdtWlCQMMftxccq/3cyKsHFRU1UPRtSBgVMmBLNYr4qqhtllnUDH7qelYABJ8TmhgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742340778; c=relaxed/simple; bh=96UYYXOnpsBc07DkVwZad3vVXkFez4nUsv533xUkDNc=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=RS9OCEl7YahZuaFQ32Ygk7JevIND1wqiA/CWxHPp+j0At5nL1FIvb+3rDZgXEsEFoAVu3HhVT6BkmbK+dbEAQxoXYSq4tujXH1SoHkRd7POCeybqiSmXdYFx2c0ZaWZmZg0sd5LFupgW/nuuzBnEFnTSCzX+7bHtmcUnV1SBVmg= 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=Y3gLrlJm; arc=none smtp.client-ip=52.119.213.150 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="Y3gLrlJm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1742340777; x=1773876777; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=c0644+xIhkgt9GTTpY9lFJMmedgNi0t1FG7aI/uC990=; b=Y3gLrlJmiPscrBQHOGDJUVrDlXHGsGs5adLGW1R/st4H7CFSPaujSSKQ wyRCzEscgw/fBqiqTwVOh0mIL9Tm5gfonPKW6Nag5DDcB/A2NWi+CbVac SR6Agxxgj87mqIF1PJNqq3V/tqR6JRTuquPnHDdMLuaNfgkAuK4xZrRIH w=; X-IronPort-AV: E=Sophos;i="6.14,258,1736812800"; d="scan'208";a="706166306" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.43.8.6]) by smtp-border-fw-52002.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2025 23:32:53 +0000 Received: from EX19MTAUWC002.ant.amazon.com [10.0.21.151:62837] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.41.90:2525] with esmtp (Farcaster) id 818ed80a-3113-40a4-b9a4-b4f3bcee0481; Tue, 18 Mar 2025 23:32:52 +0000 (UTC) X-Farcaster-Flow-ID: 818ed80a-3113-40a4-b9a4-b4f3bcee0481 Received: from EX19D004ANA001.ant.amazon.com (10.37.240.138) by EX19MTAUWC002.ant.amazon.com (10.250.64.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Tue, 18 Mar 2025 23:32:52 +0000 Received: from 6c7e67bfbae3.amazon.com (10.135.212.115) 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; Tue, 18 Mar 2025 23:32:49 +0000 From: Kuniyuki Iwashima To: David Ahern , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" CC: Simon Horman , Kuniyuki Iwashima , Kuniyuki Iwashima , Subject: [PATCH v1 net-next 0/7] nexthop: Convert RTM_{NEW,DEL}NEXTHOP to per-netns RTNL. Date: Tue, 18 Mar 2025 16:31:43 -0700 Message-ID: <20250318233240.53946-1-kuniyu@amazon.com> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D046UWA004.ant.amazon.com (10.13.139.76) To EX19D004ANA001.ant.amazon.com (10.37.240.138) X-Patchwork-Delegate: kuba@kernel.org Patch 1 - 5 move some validation for RTM_NEWNEXTHOP so that it can be done without RTNL. Patch 6 & 7 converts RTM_NEWNEXTHOP and RTM_DELNEXTHOP to per-netns RTNL. Note that RTM_GETNEXTHOP and RTM_GETNEXTHOPBUCKET are not touched in this series. rtm_get_nexthop() can be easily converted to RCU, but rtm_dump_nexthop() needs more work due to the left-to-right rbtree walk, which looks prone to node deletion and tree rotation without a retry mechanism. Kuniyuki Iwashima (7): nexthop: Move nlmsg_parse() in rtm_to_nh_config() to rtm_new_nexthop(). nexthop: Split nh_check_attr_group(). nexthop: Move NHA_OIF validation to rtm_to_nh_config_rtnl(). nexthop: Check NLM_F_REPLACE and NHA_ID in rtm_new_nexthop(). nexthop: Remove redundant group len check in nexthop_create_group(). nexthop: Convert RTM_NEWNEXTHOP to per-netns RTNL. nexthop: Convert RTM_DELNEXTHOP to per-netns RTNL. net/ipv4/nexthop.c | 183 +++++++++++++++++++++++++++------------------ 1 file changed, 112 insertions(+), 71 deletions(-)