From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 8E5E23E16A5 for ; Mon, 13 Jul 2026 09:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783935260; cv=none; b=rgl7B1iNrK3OrfKkjve3jthlAnrPvbEQm6uSps0cAfGbvzxWf5wCuNOxVHvor8omH3WFsab0Y0srzzuXaiAFiHrl4P+WZ9UXll3srXyw2ZVyQdX/Sir8hZUzNmebS+Iw2dXf76jCffQaMxWRYCQRFoB72jTgB96rI8Xflhw79jo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783935260; c=relaxed/simple; bh=/T6nGTlY9/Sd8116vHsTUgpGQQf+hD3A6HYvzjdH4E0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CZctQN1Ex/mLDe7e4+oSsbKNJ0bWMsPbN+TpZ9eJkVaCGpIl1a09PzeJSI6BO+DJKs4/fd5GFvpGn5qvGwtZHiMw19rABfh0i58w4KT0CW7WX8bAYGI1VIZ3pweZWFnuOUZaIYiXnXEdqbDHHpc8/KsODGThsTaEuuzMo+1BYGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us; spf=none smtp.mailfrom=resnulli.us; dkim=pass (2048-bit key) header.d=resnulli-us.20251104.gappssmtp.com header.i=@resnulli-us.20251104.gappssmtp.com header.b=jK3b4xZu; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=resnulli.us Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20251104.gappssmtp.com header.i=@resnulli-us.20251104.gappssmtp.com header.b="jK3b4xZu" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5b013084dc2so2322036e87.0 for ; Mon, 13 Jul 2026 02:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20251104.gappssmtp.com; s=20251104; t=1783935255; x=1784540055; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=JO+WCMaAc1ZEkPF4Q2mmZ3+RjhHJAnIrQtg7/j50Rd8=; b=jK3b4xZuqPyzHx3pRi1OBVkyNbBxF721SyuQkKQZ4lsI0ymUF0PC99M6/kVcYeyy5O uf0mqWJ7g3pWcaW+S+cvotn/Ml94T4Ax8DxEfAdzv266YoT1pvKja3gjs3g7R6f3qJwi 5VSR/NfEODcueUMVixXaU0BGP7xc8Jrp/cOvN7ip1DIeqFCwWQK78If5FKAahUR2OZJ7 +TYmqJpthqralDYs2bSltZVWk85MQhu8WgjKDBaQH418HNtSIMwPghtnk3UOOZmLnme/ gs1ua3FWUCHTy8y0CPDBF9alsyHpcDcDf8ti/Q0Dkl9kQ25Ar+TF+qq0zhZL5/bIK9rg GpCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783935255; x=1784540055; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=JO+WCMaAc1ZEkPF4Q2mmZ3+RjhHJAnIrQtg7/j50Rd8=; b=Vvvk5BRpnQES7AZiFfEoVNXRgsQgW1DGTOnaz3nzkUp5luJu/3d/0aypSPG5L6pgwQ ckeabYEouFr6Q5LPIqtKWTM/neP3BwdcGz7+U47dtNrK0uMqZ1nuGIPq2EPznoksnFV5 COeoOJOFRoaOB+8pSt1aQKvCYwvfMVKA0x6fTx0xObsmOCQjmr/8Tvh2gRhh+0zExpOG veQNUZEgYFUD0Or0pMtgCV15zk1Auj6pWEJG//Dc+Exd7MN0gd5osm8F5dujaKniRZqN E9jwhizg2WCN7RsDSHGAG2UqVbSiA3cIPiVPfK5Ambs2Q++QEHPmkOgxzCLlY9O9AfoY dvyg== X-Forwarded-Encrypted: i=1; AHgh+RrTJEch7LoYB0StWlu72zumAPzbUmNlRg+a8B3YVd+3eyeaCvCxeV0ApwvMtBs94MbuM68Ro/A=@vger.kernel.org X-Gm-Message-State: AOJu0YypnN1ig2TDRXFJhpJYY4W1Ynvi/r9vxD1ZaUS3HIQI7+M3MFmI AZgTSW8k26ulnmP0ZXSqEz+gQH5jsqFQp2sIv3ruU/ymSWeTqYWBgBd5h0vhHt5rxGA= X-Gm-Gg: AfdE7cns7hW6wkMY+i6ll2fgCHtkIvnJ2AiftKjLyX5TgBJ1JWgm0m2Y6zD7k5IgCDR a+k9ipDb2ELWb5ed6JvteFx7WhyQQgQvI9bjS+n1yKDYo5YLhyifjZffAGZ9vmd53pGKSxEfsgE mlqdjBoN8NXamfW5k0iyO69TWA969ZnSdUwINJC3QwtebsQUq3QcDfD+spVP3DqL8BleXHPSTnW +AU6+ORxTLc0lQNFW+k143j0Bl2pTcsAxe0jGcmkMx2mUBmeJ116HCrvXf13pKMUsdJJsbBWXks 4qRbNVOHA/BGdECyDJ8OZ/Dd7f7tf7VaagbAiTM/CtEPWdpiX5s5QubhkQMYIvaej1RxDZiaPUI y692nyfCeFnk6rj8xfXfbkdmIlRnOPHwWvRcTpoYRVF+K9FBMcIiIYX0r/9PLIBOhcUFf0fCYFy mVIzNtKIhjaVqRgjMTzF8mPQ== X-Received: by 2002:a05:6512:519:b0:5b0:1af0:2a2a with SMTP id 2adb3069b0e04-5b0236bd3a7mr1125113e87.61.1783935255328; Mon, 13 Jul 2026 02:34:15 -0700 (PDT) Received: from localhost ([140.209.217.211]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b01ca4a572sm2679126e87.2.2026.07.13.02.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 02:34:14 -0700 (PDT) Date: Mon, 13 Jul 2026 11:34:10 +0200 From: Jiri Pirko To: Michal =?utf-8?Q?Koutn=C3=BD?= Cc: linux-rdma@vger.kernel.org, cgroups@vger.kernel.org, netdev@vger.kernel.org, linux-s390@vger.kernel.org, linux-kselftest@vger.kernel.org, jgg@ziepe.ca, leon@kernel.org, parav@nvidia.com, mbloch@nvidia.com, cmeiohas@nvidia.com, roman.gushchin@linux.dev, bvanassche@acm.org, zyjzyj2000@gmail.com, shuah@kernel.org, tj@kernel.org, hannes@cmpxchg.org, alibuda@linux.alibaba.com, dust.li@linux.alibaba.com, sidraya@linux.ibm.com, wenjia@linux.ibm.com Subject: Re: [PATCH rdma-next 08/13] RDMA/cgroup: Scope rdma cgroup device visibility to the net namespace Message-ID: References: <20260709095532.855647-1-jiri@resnulli.us> <20260709095532.855647-9-jiri@resnulli.us> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Thu, Jul 09, 2026 at 03:04:23PM +0200, mkoutny@suse.com wrote: >Hi. > >On Thu, Jul 09, 2026 at 11:55:27AM +0200, Jiri Pirko wrote: >> index 993446ab66d0..4523c1884d67 100644 >> --- a/Documentation/admin-guide/cgroup-v2.rst >> +++ b/Documentation/admin-guide/cgroup-v2.rst >> @@ -2752,6 +2752,13 @@ RDMA >> The "rdma" controller regulates the distribution and accounting of >> RDMA resources. >> >> +When RDMA devices are isolated per network namespace (exclusive mode), >> +device names are unique only within a network namespace. The device lines >> +below are therefore scoped to the reading or writing process's network >> +namespace: only devices accessible from that namespace are listed, and a >> +limit is applied to the device of that name in that namespace. Configure >> +limits from the same network namespace as the workloads. > >OK. > >> --- a/include/linux/cgroup_rdma.h >> +++ b/include/linux/cgroup_rdma.h >> @@ -7,6 +7,7 @@ >> #define _CGROUP_RDMA_H >> >> #include >> +#include >> >> enum rdmacg_resource_type { >> RDMACG_RESOURCE_HCA_HANDLE, >> @@ -34,6 +35,15 @@ struct rdmacg_device { >> struct list_head dev_node; >> struct list_head rpools; >> char *name; >> + /* >> + * Net namespace the device belongs to. @netns_shared mirrors >> + * ib_devices_shared_netns: when true the device is visible from every >> + * net namespace (shared mode); otherwise @net is the only namespace >> + * that may see and configure it. @netns_shared is updated when the >> + * sharing mode changes, so use {READ,WRITE}_ONCE() to access it. >> + */ >> + possible_net_t net; >> + bool netns_shared; > >Any reason to store the netns_shared split per device? (IIUC, it's a >global parameter.) No reason, changed. Thanks! > >Thanks, >Michal