Linux Documentation
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Vladimir Oltean <olteanv@gmail.com>,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v5 1/5] net: dsa: wire flash_update devlink callback to drivers
Date: Thu, 30 Jul 2026 23:08:35 +0200	[thread overview]
Message-ID: <a35bf784-a5c5-4a6b-be43-4d7a2e0dc663@lunn.ch> (raw)
In-Reply-To: <f1a39d3d955be3da51b333959ecfe626b8d6dfc6.1784945329.git.daniel@makrotopia.org>

On Sat, Jul 25, 2026 at 03:15:35AM +0100, Daniel Golle wrote:
> Add a devlink_flash_update callback to dsa_switch_ops so that DSA
> drivers can support devlink dev flash without open-coding the devlink
> plumbing. Unlike the other trampolines in net/dsa/devlink.c, the
> flash_update op is only installed for switches whose driver implements
> the callback: the devlink core rejects flash requests up front when the
> op is absent, before fetching the firmware file from userspace, and an
> unconditionally present trampoline would defeat that early check and
> let unsupported requests block on request_firmware() only to fail with
> -EOPNOTSUPP afterwards.

> +/* The devlink core rejects flash requests up front when the flash_update
> + * op is absent, before fetching the firmware file from userspace. Only
> + * install the op for switches whose driver implements it, so that
> + * unsupported requests keep failing early.
> + */
> +#define DSA_DEVLINK_OPS							\
> +	.info_get			= dsa_devlink_info_get,		\
> +	.sb_pool_get			= dsa_devlink_sb_pool_get,	\
> +	.sb_pool_set			= dsa_devlink_sb_pool_set,	\
> +	.sb_port_pool_get		= dsa_devlink_sb_port_pool_get,	\
> +	.sb_port_pool_set		= dsa_devlink_sb_port_pool_set,	\
> +	.sb_tc_pool_bind_get		= dsa_devlink_sb_tc_pool_bind_get, \
> +	.sb_tc_pool_bind_set		= dsa_devlink_sb_tc_pool_bind_set, \
> +	.sb_occ_snapshot		= dsa_devlink_sb_occ_snapshot,	\
> +	.sb_occ_max_clear		= dsa_devlink_sb_occ_max_clear,	\
> +	.sb_occ_port_pool_get		= dsa_devlink_sb_occ_port_pool_get, \
>  	.sb_occ_tc_port_bind_get	= dsa_devlink_sb_occ_tc_port_bind_get,
> +
> +static const struct devlink_ops dsa_devlink_ops = {
> +	DSA_DEVLINK_OPS
> +};

Is this going to scale? How many different permutations are there?

Firmware upgrade is an infrequent operation, so do we actually care
about a request_firmware() which might turn out to be pointless? I
personally would prefer to avoid the scalability issue and just return
-EOPNOTSUPP.

	Andrew

  reply	other threads:[~2026-07-30 21:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25  2:14 [PATCH net-next v5 0/5] net: dsa: mxl862xx: support firmware update Daniel Golle
2026-07-25  2:15 ` [PATCH net-next v5 1/5] net: dsa: wire flash_update devlink callback to drivers Daniel Golle
2026-07-30 21:08   ` Andrew Lunn [this message]
2026-08-01  5:07     ` Daniel Golle
2026-07-25  2:16 ` [PATCH net-next v5 2/5] net: dsa: mxl862xx: add SMDIO clause-22 register access Daniel Golle
2026-07-30 21:11   ` Andrew Lunn
2026-07-25  2:16 ` [PATCH net-next v5 3/5] net: dsa: mxl862xx: add devlink flash_update and info_get Daniel Golle
2026-07-30 21:29   ` Andrew Lunn
2026-08-01  5:11     ` Daniel Golle
2026-07-25  2:16 ` [PATCH net-next v5 4/5] net: dsa: mxl862xx: recover switch stuck in MCUboot rescue mode Daniel Golle
2026-07-30 21:34   ` Andrew Lunn
2026-07-25  2:17 ` [PATCH net-next v5 5/5] net: dsa: mxl862xx: document devlink flash and info support Daniel Golle
2026-07-30 21:36   ` Andrew Lunn

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=a35bf784-a5c5-4a6b-be43-4d7a2e0dc663@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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