From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 96E663DE44E for ; Mon, 13 Jul 2026 09:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783935260; cv=none; b=Rx9OXRXvzsuNu7SUgHdrQ+v3s+0pqC7kIBOua97fTkgdWTDcQCZjImEhpjt0b2nkocb6Mh1UY0xXq+ruRrl2YDT0KCf1AZryI4/ZkD8T8JsdpkzUQHN5Lj5fSChTLOMzOTyn5uLqViec/U5UbICnKCDxhopbVWk5iWwOJ/udW/I= 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.45 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-f45.google.com with SMTP id 2adb3069b0e04-5b0f19bea2fso1528493e87.1 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=VBHI9Iu21rFSd8oII1AGJaMhb2mOus66lq5zkvFI5PCpOihw27Cjcl1/3yk7JsE4CO kXhbo0aqYbN2mQ5/d3SpEyX5FlHUxyR7p2XmZKL0fLPXkieVI/uzwnmPI7wQzdGkhZWg NodBRXABXRUq+0oD+Q5S53lYrdQjm3tka2wzySR4e9dGtJNNP5SZy+Z68jV9b2rieYz7 FDsKNCj2NDH3j2JqYThmgtHnSPvyrFmZe6EzIcaSIwEdKCUHTME0ktvLh78dQnY22+la yIRjxWBwJ6fiL1uHUbp5viaweNw0hdiib/YSNSJkh0Nj6gjdiNBu+o729CVUcAfvZ728 yJSg== X-Forwarded-Encrypted: i=1; AHgh+RrbEU1SdMR4lQVBWmjApvOad0WUokqq8Zi2qstVVjaHSQ9AWzu55Q8EMABw1BlzrvRqB6Snh3vhofiI@vger.kernel.org X-Gm-Message-State: AOJu0YwccGTMzlmFfWIT8W9keScc+4G2zjKrOnboJWHnR/YFOjJ5U28L 4URM+EL8/Us0/cAgJNStecRSm7yytn7Gdg9Kh9nVn5fVMkbaSyZV1i2PXryY/VukCgw= X-Gm-Gg: AfdE7cmGwVavLkWXV4anAUf1AIfrOywKAZ6TnPep/GJPgLqBesB1/rCFDtaYpJ1PEO3 M+QZ1nZf/cpE5l9L5U5uK4sy04RPzvhgQ7HzYINHbEtzGIDjQsxbgyN1049COAwgXhFM7ZQ7Bae nrt1wRcjjhcVVJbF4dYbKA/TYrATBnlGVPr3PN7w/GmChBBTT81G/XaqQkytd4DGIfYukP925iC x60FvLt26R93libNQ62yKRUYq+LdCjrss0/PUxBVGLv9K420q09/NWPPGHcdyKyOH6C0YrtsmLS t3Pd7Ftpv42cNNMLtedOfBJEOuJXOCCWisLBPugitTnHMK6a7UYASlY26d+liWQUOX4VgCmz5w+ ePsF35by53A599avAM2YD5VhEWEHAi65PMNUto/ApwiY1Dro4YCFMmRnyrSTHvLa0a454GinPs9 k1wZKd9eULpxEmTEqla3in0A== 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: linux-s390@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