[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250614123311.49c6bcbf@kernel.org>
Date: Sat, 14 Jun 2025 12:33:11 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Kory Maincent <kory.maincent@...tlin.com>
Cc: Andrew Lunn <andrew@...n.ch>, Oleksij Rempel <o.rempel@...gutronix.de>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, 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 v13 07/13] net: pse-pd: Add support for budget
evaluation strategies
On Tue, 10 Jun 2025 10:11:41 +0200 Kory Maincent wrote:
> +static bool
> +pse_pi_is_admin_enable_not_applied(struct pse_controller_dev *pcdev,
> + int id)
the only caller of this function seems to negate the return value:
drivers/net/pse-pd/pse_core.c:369: if (!pse_pi_is_admin_enable_not_applied(pcdev, i))
let's avoid the double negation ?
> +{
> + int ret;
> +
> + /* PI not enabled or nothing is plugged */
> + if (!pcdev->pi[id].admin_state_enabled ||
> + !pcdev->pi[id].isr_pd_detected)
> + return false;
> +
> + ret = pse_pi_is_hw_enabled(pcdev, id);
> + /* PSE PI is already enabled at hardware level */
> + if (ret == 1)
> + return false;
> +
> + return true;
> +}
> +static int pse_disable_pi_pol(struct pse_controller_dev *pcdev, int id)
> +{
> + unsigned long notifs = ETHTOOL_PSE_EVENT_OVER_BUDGET;
> + struct pse_ntf ntf = {};
> + int ret;
> +
> + dev_dbg(pcdev->dev, "Disabling PI %d to free power budget\n", id);
> +
> + NL_SET_ERR_MSG_FMT(&ntf.extack,
> + "Disabling PI %d to free power budget", id);
You so dutifully fill in this extack but it doesn't go anywhere.
Extacks can only be attached to NLMSG_ERROR and NLMSG_DONE
control messages. You can use the extack infra for the formatting,
but you need to add a string attribute to the notification message
to actually expose it to the user.
Powered by blists - more mailing lists