All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
To: kuba@kernel.org
Cc: aleksandr.loktionov@intel.com, andrew+netdev@lunn.ch,
	anthony.l.nguyen@intel.com, davem@davemloft.net,
	edumazet@google.com, horms@kernel.org, jacob.e.keller@intel.com,
	jtornosm@redhat.com, netdev@vger.kernel.org, pabeni@redhat.com,
	przemyslaw.kitszel@intel.com, rafal.romanowski@intel.com,
	sdf@fomichev.me, stable@vger.kernel.org
Subject: Re: [PATCH net 1/4] iavf: return EBUSY if reset in progress or not ready during MAC change
Date: Tue, 15 Sep 2026 10:12:19 +0200	[thread overview]
Message-ID: <20260915081222.13970-1-jtornosm@redhat.com> (raw)
In-Reply-To: <20260824190145.2714480-1-kuba@kernel.org>

All the comments below fall into pre-existing issues, concerns already
addressed in previous versions and comments, out-of-scope items, or extreme
edge cases. No code changes are considered necessary for a new version.
Details for each comment:

> [Severity: Low]
> This paragraph describes a user-visible behaviour change caused by
> ad7c7b2172c3, but there is no Fixes: tag on this commit.  Was that
> intentional?
>
> Worth noting that this commit does not actually remove the wait under the
> netdev instance lock: after this patch iavf_set_mac() still calls
>
>     ret = wait_event_interruptible_timeout(adapter->vc_waitqueue,
>                            iavf_is_mac_set_handled(netdev, addr->sa_data),
>                            msecs_to_jiffies(2500));
>
> so a Fixes: ad7c7b2172c3 here would arguably be misleading.  The later
> patch in the same series, "iavf: send MAC change request synchronously",
> does carry Fixes: ad7c7b2172c3 and cc: stable, which looks like the right
> place for the provenance.  Is that the intended split?

Yes, that is the intended split. This patch is a preparatory improvement
that adds a best-effort early bail-out, but it does not remove the wait
under the netdev instance lock. Patch 3/4 ("iavf: send MAC change
request synchronously") is the one that actually eliminates the
problematic wait and carries the Fixes: ad7c7b2172c3 tag and cc: stable.

Adding Fixes: here would be misleading since this patch alone does not
fix the problem — it only reduces the likelihood of hitting it.

> [Severity: Low]
> Is this check-then-act sequence racy against the reset scheduling path?
>
> iavf_is_reset_in_progress() does plain reads of adapter->state and
> adapter->flags:
>
>     static bool iavf_is_reset_in_progress(struct iavf_adapter *adapter)
>     {
>         if (adapter->state == __IAVF_RESETTING ||
>             adapter->flags & (IAVF_FLAG_RESET_PENDING |
>                       IAVF_FLAG_RESET_NEEDED))
>             return true;
>
>         return false;
>     }
>
> IAVF_FLAG_RESET_NEEDED can be set from a context that does not hold the
> netdev instance lock:
>
> dev_watchdog()
>   netif_freeze_queues(dev);
>   dev->netdev_ops->ndo_tx_timeout(dev, i);    /* timer context */
>     iavf_tx_timeout()
>       iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED)
>         adapter->flags |= flags;              /* non-atomic RMW */
>
> net/sched/sch_generic.c only freezes the TX queues around ndo_tx_timeout(),
> so there does not appear to be anything serializing that writer against
> iavf_set_mac().  If the TX timeout fires just after the new test, does
> iavf_set_mac() go on to the 2.5 s wait_event_interruptible_timeout() with
> the netdev instance lock held anyway, i.e. exactly the case the check is
> meant to reject?
>
> The window is small and the fallback is the pre-patch behaviour (blocked
> for up to 2.5 s, then -EAGAIN), so this looks like a best-effort guard
> rather than a new failure mode.  Is that the intent, or should the state
> and flags reads be done under the same serialization as the reset path
> (and with READ_ONCE(), given the concurrent non-atomic |= on
> adapter->flags)?

Yes, this is a best-effort guard to inform the user as soon as possible
instead of blocking with the netdev instance lock held. If a reset starts
immediately after the check, the behavior falls back to the pre-patch
code path: blocked for up to 2.5s, then -EAGAIN. No new failure mode is
introduced.

The flags/state access patterns (plain reads, non-atomic RMW on
adapter->flags) are pre-existing throughout the iavf driver — the
watchdog, tx_timeout, and adminq paths all use the same style.
Introducing READ_ONCE / proper serialization here alone would be
inconsistent and incomplete. That is a broader driver-wide cleanup,
out of scope for this fix.


  reply	other threads:[~2026-09-15  8:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 20:45 [PATCH net 0/4][pull request] Fix i40e/ice/iavf VF bonding after netdev lock changes Tony Nguyen
2026-08-21 20:45 ` [PATCH net 1/4] iavf: return EBUSY if reset in progress or not ready during MAC change Tony Nguyen
2026-08-24 19:01   ` Jakub Kicinski
2026-09-15  8:12     ` Jose Ignacio Tornos Martinez [this message]
2026-09-15 16:24       ` Jakub Kicinski
2026-09-16 10:12         ` Jose Ignacio Tornos Martinez
2026-09-25  7:18         ` Jose Ignacio Tornos Martinez
2026-09-25 19:04           ` Jakub Kicinski
2026-08-21 20:45 ` [PATCH net 2/4] i40e: skip unnecessary VF reset when setting trust Tony Nguyen
2026-08-24 19:01   ` Jakub Kicinski
2026-09-15  8:14     ` Jose Ignacio Tornos Martinez
2026-08-21 20:45 ` [PATCH net 3/4] iavf: send MAC change request synchronously Tony Nguyen
2026-08-24 19:01   ` Jakub Kicinski
2026-09-15  8:16     ` Jose Ignacio Tornos Martinez
2026-08-21 20:45 ` [PATCH net 4/4] ice: skip unnecessary VF reset when setting trust Tony Nguyen
2026-08-24 19:01   ` Jakub Kicinski
2026-09-15  8:19     ` Jose Ignacio Tornos Martinez

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=20260915081222.13970-1-jtornosm@redhat.com \
    --to=jtornosm@redhat.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rafal.romanowski@intel.com \
    --cc=sdf@fomichev.me \
    --cc=stable@vger.kernel.org \
    /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.