lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250324173907.3afa58d2@kmaincent-XPS-13-7390>
Date: Mon, 24 Mar 2025 17:39:07 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Andrew Lunn <andrew@...n.ch>, "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
 Abeni <pabeni@...hat.com>, Jonathan Corbet <corbet@....net>, Donald Hunter
 <donald.hunter@...il.com>, Rob Herring <robh@...nel.org>, Andrew Lunn
 <andrew+netdev@...n.ch>, Simon Horman <horms@...nel.org>, Heiner Kallweit
 <hkallweit1@...il.com>, Russell King <linux@...linux.org.uk>, Krzysztof
 Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Liam
 Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, Thomas
 Petazzoni <thomas.petazzoni@...tlin.com>, netdev@...r.kernel.org,
 linux-doc@...r.kernel.org, Kyle Swenson <kyle.swenson@....tech>, Dent
 Project <dentproject@...uxfoundation.org>, kernel@...gutronix.de, Maxime
 Chevallier <maxime.chevallier@...tlin.com>, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v6 06/12] net: pse-pd: Add support for budget
 evaluation strategies

Hello Kyle, Oleksij,

On Thu, 20 Mar 2025 17:35:35 +0100
Kory Maincent <kory.maincent@...tlin.com> wrote:

> On Mon, 17 Mar 2025 13:40:45 +0100
> Oleksij Rempel <o.rempel@...gutronix.de> wrote:
> 
> > On Tue, Mar 04, 2025 at 11:18:55AM +0100, Kory Maincent wrote:  
> > > From: Kory Maincent (Dent Project) <kory.maincent@...tlin.com>

> > > +int pse_ethtool_set_prio(struct pse_control *psec,
> > > +			 struct netlink_ext_ack *extack,
> > > +			 unsigned int prio)
> > > +{
> > > +	struct pse_controller_dev *pcdev = psec->pcdev;
> > > +	const struct pse_controller_ops *ops;
> > > +	int ret = 0;
> > > +
> > > +	if (!pcdev->pi[psec->id].pw_d) {
> > > +		NL_SET_ERR_MSG(extack, "no power domain attached");
> > > +		return -EOPNOTSUPP;
> > > +	}
> > > +
> > > +	/* We don't want priority change in the middle of an
> > > +	 * enable/disable call or a priority mode change
> > > +	 */
> > > +	mutex_lock(&pcdev->lock);
> > > +	switch (pcdev->pi[psec->id].pw_d->budget_eval_strategy) {
> > > +	case ETHTOOL_PSE_BUDGET_EVAL_STRAT_STATIC:
> > > +		if (prio > pcdev->nr_lines) {
> > > +			NL_SET_ERR_MSG_FMT(extack,
> > > +					   "priority %d exceed priority
> > > max %d",
> > > +					   prio, pcdev->nr_lines);
> > > +			ret = -ERANGE;
> > > +			goto out;
> > > +		}
> > > +
> > > +		pcdev->pi[psec->id].prio = prio;    
> > 
> > In case we already out of the budget, we will need to re-evaluate the
> > prios. New configuration may affect state of ports.
> >
> > Potentially we may need a bulk interface to assign prios, to speed-up
> > reconfiguration. But it is not needed right now.  
> 
> Oh indeed, I missed that. /o\
> I will try to add something but lets keep it not too complex! ^^ Don't add me
> more work!! ;)

Small question on PSE core behavior for PoE users.

If we want to enable a port but we can't due to over budget.
Should we :
- Report an error (or not) and save the enable action from userspace. On that
  case, if enough budget is available later due to priority change or port
  disconnected the PSE core will try automatically to re enable the PoE port.
  The port will then be enabled without any action from the user.
- Report an error but do nothing. The user will need to rerun the enable
  command later to try to enable the port again.

How is it currently managed in PoE poprietary userspace tools?

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ