From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 684BE212F04 for ; Fri, 4 Oct 2024 13:56:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728050210; cv=none; b=BMFtmRF8VnY7vPz6AXxI4fDdEG8mwk+7c8nZc0riP2OqhHA+Jk1Z3//EiglrW8sTF6OGj7C7+JTodp9BHMCqkePwqOcWyIMai/3Lx/DGlNkPn3h8it+qHqfq3YqWtbT/suLXP7ufYcU9lXP+dCFfUZ8DXK6WEC4atGjFpGqPegE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728050210; c=relaxed/simple; bh=N1C818eBlvE4sv6He9cJ9ekrXjXZ4zgfAiLcULwa9Xc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iPH8fQ4HrsReXVBxmDBYVn6Q7LrtUk63YFs0GF+IVd9n530AkbPdZR9CHCHdOxigsd/vU1zpXis5scisxBTIBVSFXvtQAjaKVH8rl3UQLAd3xSy7VWQMueQ2N/L6aeP7Dno/AjDsMFbc0e+e1Ai1nEfL00jPBSu2tFMpmKdvRE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1swinL-0005ji-1g; Fri, 04 Oct 2024 15:56:35 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1swinJ-003aES-87; Fri, 04 Oct 2024 15:56:33 +0200 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1swinJ-00AhVa-0T; Fri, 04 Oct 2024 15:56:33 +0200 Date: Fri, 4 Oct 2024 15:56:33 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Kory Maincent , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Donald Hunter , Thomas Petazzoni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org, Kyle Swenson , Dent Project , kernel@pengutronix.de Subject: Re: [PATCH net-next 11/12] net: pse-pd: Add support for event reporting using devm_regulator_irq_helper Message-ID: References: <20241002-feature_poe_port_prio-v1-0-787054f74ed5@bootlin.com> <20241002-feature_poe_port_prio-v1-11-787054f74ed5@bootlin.com> <20241003102806.084367ba@kmaincent-XPS-13-7390> <20241003153303.7cc6dba8@kmaincent-XPS-13-7390> <4b9d1adf-e9bd-47c0-ac69-5da77fcf8d0b@lunn.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4b9d1adf-e9bd-47c0-ac69-5da77fcf8d0b@lunn.ch> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Thu, Oct 03, 2024 at 05:22:58PM +0200, Andrew Lunn wrote: > > Indeed, but regulator API already provide such events, which will even be sent > > when we enable or disable the PSE. Should we write a second event management. > > Using regulator event API allows to report over current internal events to the > > parents regulator the power supply of the PSE which could also do something to > > avoid smoke. > > > > Or maybe we should add another wrapper which will send PSE ethtool netlink > > notification alongside the regulator notifications supported by this patch. > > > > > Also, how do regulator events work in combination with network > > > namespaces? If you move the interface into a different network > > > namespace, do the regulator events get delivered to the root namespace > > > or the namespace the interface is in? > > > > regulator events are sent in root namespace. > > I think we will need two event, the base regulator event, and a > networking event. Since it is a regulator, sending a normal regulator > event makes a lot of sense. But mapping that regulator event to a > netns:ifnam is going to be hard. Anything wanting to take an action is > probably going to want to use ethtool, and so needs to be in the > correct netns, etc. But it does get messy if there is some sort of > software driven prioritisation going on, some daemon needs to pick a > victim to reduce power to, and the interfaces are spread over multiple > network namespaces. > > What i don't know is if we can use an existing event, or we should add > a new one. Often rtnetlink_event() is used: > > https://elixir.bootlin.com/linux/v6.12-rc1/source/net/core/rtnetlink.c#L6679 > > but without some PSE information in it, it would be hard to know why > it was sent. So we probably either want a generic ethtool event, or a > PSE event. Hm... assuming we have following scenario: .--------- PI 1 / .--------- PI 2 .========= PSE /----------( PI 3 ) NNS red // \----------( PI 4 ) NNS blue Main supply // `---------( PI 5 ) NNS blue o================ยด--- System, CPU In this case we seems to have a new challenge: On one side, a system wide power manager should see and mange all ports. On other side, withing a name space, we should be able to play in a isolated sand box. There is a reason why it is isolated. So, we should be able to sandbox power delivery and port prios too. Means, by creating network names space, we will need a power names space. I can even imagine a use case: an admin limited access to a switch for developer. A developer name space is created with PSE budget and max prios available for this name space. This will prevent users from DoSing system critical ports. At this point, creating a power name space will an overkill for this patch set, so it should be enough to allow controlling prios over ethtool per port and isolation support if needed. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |