From: Jakub Kicinski <kuba@kernel•org>
To: Oleksij Rempel <o.rempel@pengutronix•de>
Cc: Michal Kubecek <mkubecek@suse•cz>,
"David S. Miller" <davem@davemloft•net>,
Eric Dumazet <edumazet@google•com>,
Paolo Abeni <pabeni@redhat•com>, Jiri Pirko <jiri@resnulli•us>,
Vladimir Oltean <vladimir.oltean@nxp•com>,
Andrew Lunn <andrew@lunn•ch>,
Arun Ramadoss <arun.ramadoss@microchip•com>,
Woojung.Huh@microchip•com, kernel@pengutronix•de,
netdev@vger•kernel.org, UNGLinuxDriver@microchip•com,
linux-kernel@vger•kernel.org
Subject: Re: [PATCH net v1 1/1] ethtool: netlink: do not return SQI value if link is down
Date: Fri, 5 Jul 2024 18:00:16 -0700 [thread overview]
Message-ID: <20240705180016.64085ea5@kernel.org> (raw)
In-Reply-To: <20240704054007.969557-1-o.rempel@pengutronix.de>
On Thu, 4 Jul 2024 07:40:07 +0200 Oleksij Rempel wrote:
> if (!phydev->drv || !phydev->drv->get_sqi)
> ret = -EOPNOTSUPP;
> + else if (!phydev->link)
> + ret = -ENETDOWN;
Can we stick to EOPNOTSUPP for the link down case as well?
We're consuming the error, the exact value doesn't matter.
Or let's add a helper which checks the int sqi in all it's
incarnations for validity:
static bool linkstate_sqi_no_data(int sqi)
{
return sqi == -EOPNOTSUPP || sqi == -ENETDOWN;
}
prev parent reply other threads:[~2024-07-06 1:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-04 5:40 [PATCH net v1 1/1] ethtool: netlink: do not return SQI value if link is down Oleksij Rempel
2024-07-04 14:01 ` Andrew Lunn
2024-07-05 7:05 ` Oleksij Rempel
2024-07-08 13:29 ` Andrew Lunn
2024-07-06 1:00 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240705180016.64085ea5@kernel.org \
--to=kuba@kernel$(echo .)org \
--cc=UNGLinuxDriver@microchip$(echo .)com \
--cc=Woojung.Huh@microchip$(echo .)com \
--cc=andrew@lunn$(echo .)ch \
--cc=arun.ramadoss@microchip$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=jiri@resnulli$(echo .)us \
--cc=kernel@pengutronix$(echo .)de \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=mkubecek@suse$(echo .)cz \
--cc=netdev@vger$(echo .)kernel.org \
--cc=o.rempel@pengutronix$(echo .)de \
--cc=pabeni@redhat$(echo .)com \
--cc=vladimir.oltean@nxp$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox