From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DA98C4743E for ; Tue, 8 Jun 2021 04:55:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E04D861278 for ; Tue, 8 Jun 2021 04:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbhFHE5D (ORCPT ); Tue, 8 Jun 2021 00:57:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:50076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhFHE5C (ORCPT ); Tue, 8 Jun 2021 00:57:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C07646124C; Tue, 8 Jun 2021 04:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623128110; bh=nYeeIDdi9QN5u16CB56SK0EV0YRM4FeQvSHOaI7OmT0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PRder6upVyZ7rUqLSeN5SnheEusUuIOIWOkB8OFXWLJ6ASr2aHNajlCiYj8F/bwMg pfi6oF/6XiVM3/wz6jMaPy1a2LXLxo7lHXmECZPcQUCM/GQn8p+o3dyTNvLOS9ksXN Q6FRDhqtNiKCs/nk9L53GDur1FPlbE9OAMi1VuciLJDwehrvB6+vNNRCwqptSEVoea dYltTvLgvB437HFCVjQuaVnVmKRcaFKZZhQ3+rzYW1FZJ+gZbihryGUi+K3UOym2ly mzYOVQvE++m1ZqBXsb2jDo6u/1TzM32e7kqxtj+f9c3vro13TL2OS0DVtmAUlOzwS6 2AF0L+lWIwc5A== Date: Tue, 8 Jun 2021 07:55:06 +0300 From: Leon Romanovsky To: Parav Pandit Cc: Doug Ledford , Jason Gunthorpe , Greg KH , Kees Cook , Nathan Chancellor , Adit Ranadive , Ariel Elior , Christian Benvenuti , "clang-built-linux@googlegroups.com" , Dennis Dalessandro , Devesh Sharma , Gal Pressman , "linux-kernel@vger.kernel.org" , "linux-rdma@vger.kernel.org" , Michal Kalderon , Mike Marciniszyn , Mustafa Ismail , Naresh Kumar PBS , Nelson Escobar , Nick Desaulniers , Potnuri Bharat Teja , Selvin Xavier , Shiraz Saleem , VMware PV-Drivers , Yishai Hadas , Zhu Yanjun Subject: Re: [PATCH rdma-next v1 14/15] RDMA/core: Allow port_groups to be used with namespaces Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Mon, Jun 07, 2021 at 01:29:58PM +0000, Parav Pandit wrote: > > > > From: Leon Romanovsky > > Sent: Monday, June 7, 2021 1:48 PM > > > > From: Jason Gunthorpe > > > > Now that the port_groups data is being destroyed and managed by the core > > code this restriction is no longer needed. All the ib_port_attrs are compatible > > with the core's sysfs lifecycle. > > > > Signed-off-by: Jason Gunthorpe > > Signed-off-by: Leon Romanovsky > > --- > > drivers/infiniband/core/device.c | 10 ++++------ > > drivers/infiniband/core/sysfs.c | 17 ++++++----------- > > 2 files changed, 10 insertions(+), 17 deletions(-) <...> > > diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c > > index 09a2e1066df0..f42034fcf3d9 100644 > > --- a/drivers/infiniband/core/sysfs.c > > +++ b/drivers/infiniband/core/sysfs.c > > @@ -1236,11 +1236,9 @@ static struct ib_port *setup_port(struct > > ib_core_device *coredev, int port_num, > > ret = sysfs_create_groups(&p->kobj, p->groups_list); > > if (ret) > > goto err_del; > > - if (is_full_dev) { > > - ret = sysfs_create_groups(&p->kobj, device- > > >ops.port_groups); > > - if (ret) > > - goto err_groups; > > - } > > + ret = sysfs_create_groups(&p->kobj, device->ops.port_groups); > > + if (ret) > > + goto err_groups; > > > This will expose counters in all net namespaces in shared mode (default case). > Application running in one net namespace will be able to monitor counters of other net namespace. > This should be avoided. In shared mode, we are sharing sysfs anyway and have two options to deal with the port properties (counters): 1. Show them in all namespaces as being global to port which is shared anyway. 2. Show them in init_net namespace only and applications that were left in this namespace will see not their counters anyway. Why should we avoid "item 1"? Thanks