From: Stephen Hemminger <stephen@networkplumber.org>
To: Ivan Malov <ivan.malov@arknetworks.am>
Cc: dev@dpdk.org, Andy Moreton <andy.moreton@amd.com>,
Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>,
Roman Zhukov <Roman.Zhukov@arknetworks.am>,
Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [PATCH 0/3] common/sfc_efx/base: add VADAPTER statistics for Medford4
Date: Tue, 11 Aug 2026 13:31:06 -0700 [thread overview]
Message-ID: <20260811133106.3d9674c6@phoenix.local> (raw)
In-Reply-To: <20260811174949.8993-1-ivan.malov@arknetworks.am>
On Tue, 11 Aug 2026 21:49:46 +0400
Ivan Malov <ivan.malov@arknetworks.am> wrote:
> This series adds support for per-VF (VADAPTER) MAC
> statistics on Medford4 in the libefx base layer.
>
> The first patch selectively updates the MCDI headers, adding
> new definitions needed by the subsequent patches.
>
> The second patch introduces netport VADAPTER statistics IDs,
> which identify the per-VF counter set returned by the NIC.
>
> The third patch switches the netport statistics call to use
> GET_NETPORT_STATISTICS_V2, passing the EVB port handle so
> that the correct per-VF counters are retrieved.
>
> Andy Moreton (2):
> common/sfc_efx/base: add support for VADAPTER statistics IDs
> common/sfc_efx/base: switch netport stats to use EVB port ID
>
> Ivan Malov (1):
> common/sfc_efx/base: update MCDI headers
>
> drivers/common/sfc_efx/base/efx_impl.h | 3 +-
> drivers/common/sfc_efx/base/efx_mcdi.c | 2 +-
> drivers/common/sfc_efx/base/efx_np.c | 60 +++-
> drivers/common/sfc_efx/base/efx_regs_mcdi.h | 313 +++++++++++++++++++-
> drivers/common/sfc_efx/base/medford4_mac.c | 12 +-
> 5 files changed, 373 insertions(+), 17 deletions(-)
>
Detailed AI review had info level comments only.
Reviewed the series against upstream (applied cleanly with git am).
Patch 1 is generated MCDI header import, no review comments.
Patch 2/3 verification notes:
- All five efx_np_mac_stats() call sites are updated for the new
argument order (efx_mcdi.c:2251, medford4_mac.c:175/198/201/205).
The parameter count changed from 5 to 6, so a missed caller would
be a compile error rather than a silent type-compatible swap.
- EFX_MCDI_DECLARE_BUF() was correctly bumped to V2_IN_LEN alongside
emr_in_length, so the new PORT_ID write at offset 20 is in bounds.
- MC_CMD_GET_NETPORT_STATISTICS_V2_IN is a strict superset of V1:
PORT_HANDLE/CMD/DMA_ADDR/DMA_LEN are at identical offsets, only
PORT_ID at 20 is new.
- The new VADAPTER entries in efx_np_mac_stat_map[] land before the
FEC entries in efx_mac_stat_t, so the array size is unchanged, and
the map is only consulted to translate descriptors the FW actually
reports, so the addition is inert on FW without vadapter stats.
efx_mac.c already has the matching name strings, and
medford4_mac_stats_get_mask() derives the mask from the LUT, so the
counters surface automatically.
Info
Patch 2:
- EFX_NP_HW_STAT_ID() shifts the index by
MC_CMD_STAT_ID_MAC_STAT_ID_LBN regardless of the source argument.
This is correct today only because MAC/PHY/VADAPTER_STAT_ID_LBN are
all 16. Using MC_CMD_STAT_ID_##_src##_STAT_ID_LBN would make the
macro self-consistent. Pre-existing (the PHY variant has the same
shape), so no need to fix here unless you are touching it anyway.
Patch 3:
- The request mixes V1 and V2 field names: PORT_HANDLE, CMD,
DMA_ADDR_LO/HI and DMA_LEN still use the
GET_NETPORT_STATISTICS_IN_* names while the length and PORT_ID use
GET_NETPORT_STATISTICS_V2_IN_*. The offsets are identical so this
is functionally correct, but naming all fields V2 would make it
obvious at a glance which msgrequest is being sent.
- The V2 request length is now used unconditionally, with no
capability check or V1 fallback. If any shipping Medford4 firmware
implements only the 20-byte GET_NETPORT_STATISTICS_IN msgrequest,
it will reject the 24-byte request and MAC stats break entirely,
not just the vadapter counters. Is V2 guaranteed present in every
FW build that advertises netport support? efx_np_mac_ctrl() already
makes the same unconditional assumption with MAC_CTRL_IN_V2, so I
suspect the answer is yes and there is a documented FW baseline --
worth a line in the commit message either way.
prev parent reply other threads:[~2026-08-11 20:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 17:49 [PATCH 0/3] common/sfc_efx/base: add VADAPTER statistics for Medford4 Ivan Malov
2026-08-11 17:49 ` [PATCH 1/3] common/sfc_efx/base: update MCDI headers Ivan Malov
2026-08-11 17:49 ` [PATCH 2/3] common/sfc_efx/base: add support for VADAPTER statistics IDs Ivan Malov
2026-08-11 17:49 ` [PATCH 3/3] common/sfc_efx/base: switch netport stats to use EVB port ID Ivan Malov
2026-08-11 20:31 ` Stephen Hemminger [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=20260811133106.3d9674c6@phoenix.local \
--to=stephen@networkplumber.org \
--cc=Roman.Zhukov@arknetworks.am \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=andy.moreton@amd.com \
--cc=dev@dpdk.org \
--cc=ivan.malov@arknetworks.am \
--cc=pieter.jansen-van-vuuren@amd.com \
--cc=viacheslav.galaktionov@arknetworks.am \
/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