mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: satishkh@cisco.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	willemb@google.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, sebaddel@cisco.com,
	aradhana@cisco.com, rfaucett@cisco.com
Subject: Re: [PATCH net-next v4 6/6] enic: configure V2 VF receive mode over mailbox
Date: Tue, 01 Dec 2026 14:04:55 +0000	[thread overview]
Message-ID: <179613389534.3146.15589957948502759447@kernel.org> (raw)
In-Reply-To: <20261130-b4-enic-sriov-v2-vf-receive-control-v4-6-5858d5a9ecb1@cisco.com>

Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 3 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] enic_vf_sync_mac_filters() treats every SKIPPED DELETE result
  as lost state.
- [Medium] An ADD the PF rejects permanently is never recorded.
- [Medium] A PF result of ENIC_MAC_ADDR_FLAG_OVERFLOW (PF exact-filter
  table full) for a secondary-address ADD is handled the same way as a…
- [Low] The commit message says the patch will "Report policy denials
  during open and runtime updates", but default builds report nothing.

--

enic: configure V2 VF receive mode over mailbox

This commit adds an asynchronous receive-mode callback for V2 VFs. The
callback programs unicast/multicast exact filters and packet-filter modes
through the PF mailbox. It orders broad-mode transitions around exact-filter
updates, tracks per-address results, and schedules a receive-mode replay
after an internal reopen.

> diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
> index a2186f65c74a8..4a9b4bf9e16b8 100644
> --- a/drivers/net/ethernet/cisco/enic/enic_main.c
> +++ b/drivers/net/ethernet/cisco/enic/enic_main.c

[ ... ]

> @@ -1653,17 +1655,419 @@ static int enic_set_mac_address(struct net_device *netdev, void *p)

[ ... ]

> +static void enic_vf_report_pkt_filter_denial(struct net_device *netdev,
> +					     u16 requested, u16 applied)
> +{
> +	if ((requested & CMD_PFILTER_PROMISCUOUS) &&
> +	    !(applied & CMD_PFILTER_PROMISCUOUS))
> +		netdev_dbg(netdev, "PF policy denied promiscuous receive mode\n");
> +	if ((requested & CMD_PFILTER_ALL_MULTICAST) &&
> +	    !(applied & CMD_PFILTER_ALL_MULTICAST))
> +		netdev_dbg(netdev,
> +			   "PF policy denied all-multicast receive mode\n");
> +}

[Severity: Low]
The commit message says:

  "Report policy denials during open and runtime updates."

Does netdev_dbg() meet that? Without DEBUG or CONFIG_DYNAMIC_DEBUG it
compiles to if (0), and with dynamic debug it is off by default. A PF
refusal of CMD_PFILTER_PROMISCUOUS or CMD_PFILTER_ALL_MULTICAST would leave
no trace on the VF.

Per-address ADD denials are not reported at any level either.
enic_vf_sync_mac_filters() folds NOT_PERMITTED, INVALID and OVERFLOW into
-EACCES, and enic_set_vf_rx_mode() turns that into success:

	err = enic_vf_sync_mac_filters(enic, uc, mc);
	if (err == -EACCES) {
		...
		err = 0;
	}

So "ip link set ... promisc on" or a multicast join appears to succeed, and
the netdev shows PROMISC/ALLMULTI, while the PF has not applied it.

Would a netdev_info() or netdev_warn() (possibly rate limited) fit the
commit message better?

[ ... ]

> +static int enic_vf_sync_mac_filters(struct enic *enic,
> +				    struct netdev_hw_addr_list *uc,
> +				    struct netdev_hw_addr_list *mc)
> +{

[ ... ]

> +	for (i = 0; i < num_ops; i++) {
> +		u16 flags = le16_to_cpu(macs[i].flags);
> +		bool add = flags & ENIC_MAC_ADDR_FLAG_ADD;
> +
> +		if (flags & ENIC_MAC_ADDR_FLAG_SKIPPED) {
> +			if (add)
> +				retryable_add = true;
> +			else
> +				reconnect = true;
> +			continue;
> +		}

[Severity: Medium]
Can a pure policy denial trigger a full VF reset here?

Every SKIPPED DELETE sets reconnect. Below, that leads to
enic_mbox_vf_require_reconnect(), which kicks vf_mbox_recovery_work and ends
in enic_hang_reset(enic, true): full datapath stop, re-registration and
reopen.

The station path in this series documents a PF reply where every DELETE is
SKIPPED because an ADD in the same request was rejected. From
enic_vf_station_addr_replace():

	/* A policy-rejected ADD can be reported with all preceding DELETEs
	 * skipped. No operation changed state in that coherent result tuple.
	 */

The "enic: manage V2 VF station and administrative MAC" commit message
also says "If the PF skips every station DELETE and rejects the ADD as not
permitted...".

A receive-mode batch puts the stale DELETEs first and the ADDs after them.
Suppose installed address X is removed while PF-denied address Y is
pending. The batch is [DELETE X, ADD Y], and the PF could answer
DELETE X = SKIPPED and ADD Y = NOT_PERMITTED. Nothing changed on the PF,
but the VF still goes through a hang reset.

Y is never recorded (its sync_cnt stays 0), so it is collected again in
every later batch. Would any later address removal while Y is still listed
repeat the reset? Unprivileged sockets can join and leave multicast groups,
so if the PF denies an MC ADD this could be triggered over and over.

This depends on the out-of-tree PF using the same reply shape for
secondary-address batches as for station operations. Should the
{all DELETEs SKIPPED, ADD permanently rejected} result be treated as "no
state change", as enic_vf_station_addr_replace() does?

> +		if (flags & ENIC_MAC_ADDR_FLAG_PERMANENT_MASK) {
> +			if (add)
> +				permanent_add = true;
> +			else
> +				reconnect = true;
> +			continue;
> +		}

[Severity: Medium]
Is ENIC_MAC_ADDR_FLAG_OVERFLOW meant to be handled like a policy denial
here?

ENIC_MAC_ADDR_FLAG_PERMANENT_MASK in enic_mbox.h groups OVERFLOW with
NOT_PERMITTED and INVALID:

#define ENIC_MAC_ADDR_FLAG_PERMANENT_MASK \
	(ENIC_MAC_ADDR_FLAG_OVERFLOW | ENIC_MAC_ADDR_FLAG_NOT_PERMITTED | \
	 ENIC_MAC_ADDR_FLAG_INVALID)

So when the PF reports its exact-filter table as full for an ADD, the code
sets permanent_add and returns -EACCES, and enic_set_vf_rx_mode() turns
that into success.

The packet-filter flags come only from the driver's own counts:
enic_vf_uc_needs_promisc() triggers above 31 UC entries, and
enic_rx_mode_to_pkt_filter() above 32 MC entries. No PROMISCUOUS or
ALL_MULTICAST fallback is requested for a PF-reported overflow.

If the PF's real capacity or occupancy is smaller than the driver's model,
frames for that address are silently dropped. Examples are an IPv6
solicited-node multicast or a macvlan unicast. The same ADD is then resent
and ignored on every later rx-mode event.

The commit message says:

  "leaving overflow entries unsynchronized for later convergence"

That appears to cover only driver-side overflow, where broad coverage is
requested. Should a PF-reported OVERFLOW also request broad coverage for
that address class?

[ ... ]

> +	if (reconnect) {
> +		enic_mbox_vf_require_reconnect(enic);
> +		err = -EIO;
> +	} else if (err != -EIO) {
> +		/* Do not let a retryable or permanently-denied ADD overwrite an
> +		 * installed-filter counter inconsistency (-EIO) detected above.
> +		 */
> +		if (retryable_add)
> +			err = -EAGAIN;
> +		else if (permanent_add)
> +			err = -EACCES;
> +	}

[Severity: Medium]
Does this precedence let a stable ADD denial use up the core retry budget?

A permanently denied ADD is never recorded, so its sync_cnt stays 0 and
enic_vf_collect_mac_ops() collects it again on every run:

		if (add) {
			if (ha->sync_cnt || *projected_count >= max_filters)
				continue;

The PF may report the other operations in that request as SKIPPED, the
shape handled in enic_vf_station_addr_replace(). Then both permanent_add
and retryable_add are set, and the function returns -EAGAIN rather than
-EACCES.

enic_set_vf_rx_mode() converts only -EACCES to 0. It returns -EAGAIN before
the trailing packet-filter step, and the core retries via
netif_rx_mode_schedule_retry(). Each retry resends the same batch and gets
the same result until the limit is hit:

	if (dev->rx_mode_retry_count >= NETIF_RX_MODE_RETRY_MAX) {
		netdev_err(dev, "rx_mode retry limit reached, giving up\n");

The valid addresses that were SKIPPED in that batch are never installed.
The same thing repeats on every later address-list event while the denied
MAC stays listed. That seems to contradict the commit message:

  "stable ADD policy denials do not consume the retry budget"

The ADD-only replay after a reconnect (see the SKIPPED DELETE question
above) would land in this same loop.

As with the previous question, this depends on PF reply behaviour that is
only inferred from the station path.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-b4-enic-sriov-v2-vf-receive-control-v4-0-5858d5a9ecb1%40cisco.com

      reply	other threads:[~2026-12-01 14:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 13:58 [PATCH net-next v4 0/6] enic: add V2 VF receive control over MBOX Satish Kharat
2026-11-30 13:58 ` [PATCH net-next v4 1/6] net: add netif_rx_mode_schedule_update() Satish Kharat
2026-11-30 13:58 ` [PATCH net-next v4 2/6] enic: serialize V2 VF mailbox requests Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko
2026-11-30 13:58 ` [PATCH net-next v4 3/6] enic: recover V2 VF mailbox after request failure Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko
2026-11-30 13:58 ` [PATCH net-next v4 4/6] enic: validate V2 VF configuration replies Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko
2026-11-30 13:58 ` [PATCH net-next v4 5/6] enic: manage V2 VF station and administrative MAC Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko
2026-11-30 13:58 ` [PATCH net-next v4 6/6] enic: configure V2 VF receive mode over mailbox Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko [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=179613389534.3146.15589957948502759447@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=aradhana@cisco.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rfaucett@cisco.com \
    --cc=satishkh@cisco.com \
    --cc=sebaddel@cisco.com \
    --cc=willemb@google.com \
    /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

all inboxes | Powered by JetHome®