All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ivan Malov <ivan.malov@arknetworks.am>
Cc: dev@dpdk.org,
	Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>,
	Andy Moreton <andy.moreton@amd.com>,
	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 1/1] common/sfc_efx/base: clear VADAPTER stats upon allocation
Date: Mon, 24 Aug 2026 09:06:32 -0700	[thread overview]
Message-ID: <20260824090632.687d7e6e@phoenix.local> (raw)
In-Reply-To: <20260824112647.27146-1-ivan.malov@arknetworks.am>

On Mon, 24 Aug 2026 15:26:47 +0400
Ivan Malov <ivan.malov@arknetworks.am> wrote:

> The probe-time clear in 'ef10_nic_probe' runs before the VADAPTER is
> allocated and so cannot zero its counters. Add a complementary clear
> to the point at which the VADAPTER is already in place, so that
> VADAPTER statistics begin at zero for both PFs and VFs.
> 
> This change affects only Medford4 NICs within the 26.11 release, where
> Medford4 VADAPTER statistics have been added in the first place.
> 
> Signed-off-by: Ivan Malov <ivan.malov@arknetworks.am>
> Reviewed-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>
> Reviewed-by: Andy Moreton <andy.moreton@amd.com>

Looks correct but Opus AI review spotted something.

Review of [PATCH 1/1] common/sfc_efx/base: clear VADAPTER stats upon
allocation

The new failure path is correct: fail6 frees the vAdaptor only when
alloc_vadaptor is set (so the EVB case, where the vPort belongs to the
vSwitch, is left alone), resets en_vport_id, and falls through to the
existing fail5 unwinding.  efx_np_attach() runs in ef10_nic_probe()
before ef10_nic_init(), so ep_np_handle is valid at the new call site.

Warning: the code comment and the commit message do not match what the
code does on the family they name.  efx_mcdi_mac_stats_clear() splits
on efx_np_supported(), which is true for EFX_FAMILY_MEDFORD4 and
later.  On Medford4 it therefore takes the netport branch,

	efx_np_mac_stats(enp, epp->ep_np_handle, EFX_STATS_CLEAR, NULL, 0)

which never reads en_vport_id, so the comment's "do it here while
'en_vport_id' holds a valid value" does not describe the Medford4
behaviour.  Conversely, it is the pre-Medford4 families that use the
vPort-scoped branch, efx_mcdi_mac_stats(enp, enp->en_vport_id, ...);
the probe-time clear there runs with en_vport_id still EVB_PORT_ID_NULL
(0) and the new one runs with EVB_PORT_ID_ASSIGNED or the vSwitch
vPort, so Huntington/Medford/Medford2 do see a behaviour change as
well, contrary to "This change affects only Medford4 NICs".

Suggested fix: reword both to state the actual reason -- the vAdaptor
counters do not exist until the vAdaptor has been allocated, so a
clear issued at probe time cannot zero them -- and either drop the
Medford4-only claim or explain why the extra vPort-scoped clear is a
no-op on the older families.

  reply	other threads:[~2026-08-24 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 11:26 [PATCH 1/1] common/sfc_efx/base: clear VADAPTER stats upon allocation Ivan Malov
2026-08-24 16:06 ` Stephen Hemminger [this message]
2026-08-24 16:44   ` Ivan Malov
2026-08-24 16:50     ` Stephen Hemminger

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=20260824090632.687d7e6e@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.