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 4/4] ice: skip unnecessary VF reset when setting trust
Date: Tue, 15 Sep 2026 10:19:20 +0200	[thread overview]
Message-ID: <20260915081920.14393-1-jtornosm@redhat.com> (raw)
In-Reply-To: <20260824190150.2714587-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 isn't a bug, but doesn't ice_vf_lib.c already have a helper with
> exactly these semantics?
>
> drivers/net/ethernet/intel/ice/ice_vf_lib.c:
> static void ice_vf_set_host_trust_cfg(struct ice_vf *vf)
>
> Would it be preferable to export that one rather than carry a second copy?

ice_vf_set_host_trust_cfg() derives the capability bit from vf->trusted,
which must already be set before calling it. ice_setup_vf_trust() takes
the setting as an explicit parameter, matching the i40e helper and the
call site where vf->trusted and the capability bit are set together.
Different interfaces for different purposes. Not a functional issue.

> [Severity: High]
> Is this predicate complete with respect to everything trust gates in ice?
> Besides LLDP filters and promiscuous mode, vf->trusted also gates the MAC
> and VLAN filter quotas and the administratively assigned MAC.
>
> Do those hardware filters then stay programmed after the log prints "VF N is
> now untrusted"?
>
> Can vf->num_mac therefore remain above ICE_MAX_MACADDR_PER_VF after trust is
> revoked, so that later legitimate MAC adds from the now-untrusted VF are
> rejected until some unrelated reset happens?

Same concern addressed in previous comments for both i40e and ice.
Over-limit filters configured while trusted remain after trust revocation,
but this is acceptable because untrusted VFs can freely delete their own
MAC and VLAN filters, there are no trust checks in the deletion path
(ice_vc_handle_mac_addr_msg() only checks trust when set == true). The VF
simply cannot add more over-limit filters.

ice_vc_handle_mac_addr_msg() decrements vf->num_mac on delete, so the
counter reflects actual state after deletions. The no-reset path is only
reached for VFs with no LLDP or promiscuous mode, having excess
MAC/VLAN filters in this state is extremely unlikely.

> [Severity: High]
> What happens to the negotiated VLAN V2 capabilities when trust changes
> without a reset?  The advertised limit is derived from vf->trusted once,
> at negotiation time, and then cached on the PF.
>
> If the VF negotiated VIRTCHNL_VF_OFFLOAD_VLAN_V2 while trusted, does the
> else branch leave max_filters at VLAN_N_VID, allowing the now-untrusted VF
> to keep programming VLAN filters well beyond ICE_MAX_VLAN_PER_VF?

The VLAN_V2 caps cache invalidation is part of the reset/rebuild path
by design (ice_vf_set_initialized()). This patch does not change that
architecture, it only adds a conditional to skip the reset when no
advanced features are configured. The cache behavior is inherited from
the existing design and is beyond the scope of this fix.

> [Severity: Medium]
> This isn't a bug introduced by this patch, but while ice_set_vf_trust() is
> being touched: the switchdev check earlier in this same function returns
> without releasing the VF reference taken by ice_get_vf_by_id().
>
> Would it make sense to convert that return into "goto out_put_vf;" here?

Pre-existing reference leak, not introduced by this patch.


      reply	other threads:[~2026-09-15  8:19 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
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 [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=20260915081920.14393-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.