From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>,
<netdev@vger.kernel.org>
Cc: <intel-wired-lan@lists.osuosl.org>,
<aleksandr.loktionov@intel.com>, <jacob.e.keller@intel.com>,
<horms@kernel.org>, <anthony.l.nguyen@intel.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <stable@vger.kernel.org>
Subject: Re: [PATCH net v6 3/4] iavf: send MAC change request synchronously
Date: Mon, 22 Jun 2026 13:38:49 +0200 [thread overview]
Message-ID: <55f9e2af-54fb-4257-af25-dc9c0fbeb72c@intel.com> (raw)
In-Reply-To: <20260619061321.8554-4-jtornosm@redhat.com>
[-Jesse, he moved to another company a while ago]
> v6: Address edge cases found by AI review (Jakub Kicinski):
> Although unlikely in practice, v6 adds robustness for corner cases:
> - Allocation failure after message sent: allocate event buffer BEFORE
> sending to PF (theoretical - allocation rarely fails for small buffers)
> - Multi-batch scenario: add loop to send all batches when >200 MACs pending
> (rare - most configurations have far fewer MACs)
> - Timeout rollback: only rollback on send failure (ret != -EAGAIN), not on
> timeout where PF response handler will sync state (transient inconsistency
> during timeout is acceptable and will be resolved by response)
> v5: https://lore.kernel.org/all/20260429102426.210750-4-jtornosm@redhat.com/
>
> drivers/net/ethernet/intel/iavf/iavf.h | 11 ++-
> drivers/net/ethernet/intel/iavf/iavf_main.c | 91 +++++++++++++----
> .../net/ethernet/intel/iavf/iavf_virtchnl.c | 99 +++++++++++++++++--
> 3 files changed, 171 insertions(+), 30 deletions(-)
>
[...]
> +static bool iavf_mac_change_done(struct iavf_adapter *adapter,
> + const void *data, enum virtchnl_ops v_op)
> +{
> + const u8 *addr = data;
> +
> + return iavf_is_mac_set_handled(adapter->netdev, addr);
> +}
[...]
> +static int iavf_set_mac_sync(struct iavf_adapter *adapter, const u8 *addr)
> +{
> + struct iavf_arq_event_info event;
> + int ret;
> +
> + netdev_assert_locked(adapter->netdev);
> +
> + event.buf_len = IAVF_MAX_AQ_BUF_SIZE;
> + event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
> + if (!event.msg_buf)
> + return -ENOMEM;
> +
> + while (adapter->aq_required & IAVF_FLAG_AQ_ADD_MAC_FILTER) {
> + ret = iavf_add_ether_addrs(adapter);
I believe that this change (made in v6) is wrong.
(just an observation: AI review made this series worse vs v5).
the second step onward would fail a check:
"if (adapter->current_op != VIRTCHNL_OP_UNKNOWN)" and thus return
-EBUSY
watchdog would not kick the VC/AQ queue since we hold the netdev lock
here, there is need to manually ensure forward progress by calling
iavf_poll_virtchnl_response() within the loop
I think it should be fine to stop when the "iavf_mac_change_done"
condition is met, this will simply leave the rest of the changes
for watchdog (as we do now).
> + if (ret)
> + goto out;
> + }
> +
> + ret = iavf_poll_virtchnl_response(adapter, &event,
> + iavf_mac_change_done, addr, 2500);
> +
> +out:
> + kfree(event.msg_buf);
> + return ret;
> +}
next prev parent reply other threads:[~2026-06-22 11:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-19 6:13 [PATCH net v6 0/4] Fix i40e/ice/iavf VF bonding after netdev lock changes Jose Ignacio Tornos Martinez
2026-06-19 6:13 ` [PATCH net v6 1/4] iavf: return EBUSY if reset in progress or not ready during MAC change Jose Ignacio Tornos Martinez
2026-06-19 6:13 ` [PATCH net v6 2/4] i40e: skip unnecessary VF reset when setting trust Jose Ignacio Tornos Martinez
2026-06-19 6:13 ` [PATCH net v6 3/4] iavf: send MAC change request synchronously Jose Ignacio Tornos Martinez
2026-06-22 11:38 ` Przemek Kitszel [this message]
2026-06-19 6:13 ` [PATCH net v6 4/4] ice: skip unnecessary VF reset when setting trust Jose Ignacio Tornos Martinez
2026-06-22 11:18 ` Loktionov, Aleksandr
2026-06-22 11:19 ` Loktionov, Aleksandr
2026-06-22 10:31 ` [PATCH net v6 0/4] Fix i40e/ice/iavf VF bonding after netdev lock changes Simon Horman
2026-06-22 10:51 ` [Intel-wired-lan] " 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=55f9e2af-54fb-4257-af25-dc9c0fbeb72c@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=jtornosm@redhat.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox