Re: [PATCH net-next v5] net: dsa: motorcomm: Add devlink info and resources

From: Jakub Kicinski

Date: Wed Nov 18 2026 - 18:45:55 EST


This is an AI-generated review of your patch. The human sending this
email says "AI is right, see below"
---
net: dsa: motorcomm: Add devlink info and resources

This patch adds devlink support to the yt921x DSA driver. It reports the
ASIC model through devlink info as asic.id. It also registers two devlink
resources, "ACL" and "meters", each with an occupancy callback.

> diff --git a/drivers/net/dsa/motorcomm/devlink.c b/drivers/net/dsa/motorcomm/devlink.c
> new file mode 100644
> index 0000000000000..7b4f3a460f1b3
> --- /dev/null
> +++ b/drivers/net/dsa/motorcomm/devlink.c

[ ... ]

> +int
> +yt921x_dsa_devlink_info_get(struct dsa_switch *ds, struct devlink_info_req *req,
> + struct netlink_ext_ack *extack)
> +{
> + struct yt921x_priv *priv = dsa_to_yt921x_priv(ds);
> + int res;
> +
> + res = devlink_info_version_fixed_put(req,
> + DEVLINK_INFO_VERSION_GENERIC_ASIC_ID,
> + priv->info->name);

[ ... ]

> +static const struct yt921x_devlink_resource yt921x_devlink_resources[] = {
> + {
> + "ACL", yt921x_devlink_occ_get_acl,
> + YT921X_ACL_NUM,
> + YT921X_DEVLINK_RESOURCE_ID_ACL,
> + DEVLINK_RESOURCE_ID_PARENT_TOP,
> + },
> + {
> + "meters", yt921x_devlink_occ_get_meter,
> + YT921X_METER_NUM,
> + YT921X_DEVLINK_RESOURCE_ID_METER,
> + DEVLINK_RESOURCE_ID_PARENT_TOP,
> + },
> +};

[Severity: Low]
This isn't a bug, but should there be a driver-specific devlink document
for yt921x to go with this patch?

Documentation/networking/devlink/index.rst says:

Each driver that implements ``devlink`` is expected to document what
parameters, info versions, and other features it supports.

There is no yt921x or motorcomm .rst file under
Documentation/networking/devlink/, and the toctree in index.rst has no
entry for it. A similar DSA driver, mv88e6xxx, does have one.

The "ACL" and "meters" resource names are driver-specific, so users of
devlink resource show have no documented meaning for them. The same goes
for the asic.id value that yt921x_dsa_devlink_info_get() reports.

Also, "meters" counts only the 64 custom meters tracked in
priv->meters_map. It leaves out the 11 dedicated per-port meters. The only
place that says so is a comment in chip.h:

/* Custom meters only, not including dedicated port meters (11) */
#define YT921X_METER_NUM 64

Could a short Documentation/networking/devlink/yt921x.rst describe the
info version and the two resources, including what "meters" covers?
--
pw-bot: cr