From: Jakub Kicinski <kuba@kernel.org>
To: mmyangfl@gmail.com
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, andrew@lunn.ch, olteanv@gmail.com,
davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v5] net: dsa: motorcomm: Add devlink info and resources
Date: Wed, 18 Nov 2026 15:45:47 -0800 [thread overview]
Message-ID: <20261118234547.3615845-1-kuba@kernel.org> (raw)
In-Reply-To: <20261116121627.1182631-1-mmyangfl@gmail.com>
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
next prev parent reply other threads:[~2026-11-18 23:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 12:16 David Yang
2026-11-16 13:36 ` Andrew Lunn
2026-11-18 23:45 ` Jakub Kicinski [this message]
2026-11-18 23:46 ` Jakub Kicinski
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=20261118234547.3615845-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/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
all inboxes | Powered by JetHome®