Thread (13 messages) read the whole thread 13 messages, 2 authors, 11h ago

Re: [PATCH net-next v5 1/5] net: dsa: wire flash_update devlink callback to drivers

From: Daniel Golle <daniel@makrotopia.org>
Date: 2026-08-01 05:08:08
Also in: lkml, netdev

On Thu, Jul 30, 2026 at 11:08:35PM +0200, Andrew Lunn wrote:

A quick note first: this review crossed mid-air with newer versions,
v6 through v8 were already out. v8 is the current one, where this
patch is retitled "net: dsa: add devlink flash_update callback to
dsa_switch_ops":
https://lore.kernel.org/all/2103d1c460b35c5e59c96bd91a892596478474d1.1785389905.git.daniel@makrotopia.org/ (local)
This part is unchanged there, though, so your comment applies as-is.
quoted
+#define DSA_DEVLINK_OPS							\
[...]
quoted
+static const struct devlink_ops dsa_devlink_ops = {
+	DSA_DEVLINK_OPS
+};
Is this going to scale? How many different permutations are there?
It obviously doesn't scale. The choice to do this was because the
cost of requesting an update file, which would happen before the
-EOPNOTSUPP, is a relatively high cost. None of the other devlink
operations have such costly side-effects even if not implemented by
a DSA driver.
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.
I will drop the macro and the second struct, make .flash_update a
regular member of the single dsa_devlink_ops, and have the trampoline
return -EOPNOTSUPP when ds->ops->devlink_flash_update is absent in v9.


Cheers


Daniel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help