From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796133896; b=m3DSUr7Jva3344GZtBBNgd7s34AIRFPGIUS8COIIUM17CwvlWX6yEcX1lb/b4chzCPF7 6ZNFuUaYWkfvUDBX6Tn0GOrJT4EGrES6iewVXrZq+G0oY2QxCa0HlQvcHeI0iPegPPFuQ CHi5RPniBbtsvNHGpZEdg3TeLl3kmNfKEVnucxvgCTm1auRpi4YisdUFeCig/qt4fmnfT DkfjNEEOSJxM/FrCwFvAsvUX7fZChSYCOLpr1gI8yEJhvUi0j5OlJc1r43gzeupiYN8pC qjSygIl36ClKtovB3Hh7Qgia+rIE6OIwCnTpih0n6BmmBq2asTjMdxTtQq25oIwcOfQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796133896; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=SAl9TC/fxiVAwCXFeyNeD55HAMvn7pA7VlGS9DCmQUo=; b=KOW5NHUqgG3Y2lrIh7q7rkrGRDHENh9TQ/RIDFcvxHryKC0ePlrbSpupByxdw9eKDZX7 itg+S1sU3GTQYRKv9naHcwpaGCMIi8eHwdpYuSghH83JvKNY/2KsMEG3nBlS31PmIKiEz we1kOxBPjLjMCPI4KYwtHsGAezzH4PTHGxoso7nvRuQoT1z9EoUzsaN9Ki1lusRg0k2Qz gj0lpFyDnaDI/6J9Bx/QSGRq3VBZXwD2Spo9u9reCHKmDPvrOFe1zgoHJJj98JLnCJtbG 5xFh9gPm1AtlfblKk/94grJbUsLAyqqQPnGlRp1c+tBfWeIbaSsWJoZp2M6KCJ3Lc/g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hYLWR2E5; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA24B606A33D; Tue, 1 Dec 2026 14:04:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hYLWR2E5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBCE61F00898; Tue, 1 Dec 2026 14:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796133896; bh=SAl9TC/fxiVAwCXFeyNeD55HAMvn7pA7VlGS9DCmQUo=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=hYLWR2E5M7N9Y8a3SA+PLw3hKJDfLGNCOdgpep8Lo67I4aZhFIQigIu4vEZEwZltp 2UqdKu3laMDTjPkL2iwmdIc/i6SkiTuHX4+1ZHUP5ithgcluUzf+J2T2bMLl1AixfP xXUtyKRkhRAXm6LYJZQcQeEFgbDCPG13MNdHkJeBrEaUr3OxGN1GqhpP3le5dWaefu MnnmPf0kuVEsHTVRmFHuw+jRL0l8SoBMD8bxnNBDhusQOYUEAz2F03vCvumXuhYXbL 4gapUpNXB5nykZWhc9NZI6anvrDOIgj4bBMG3oDAnbFug8CO8WkuOmoggkwM9P7evW ZY9pTrrcWSMMA== Subject: Re: [PATCH net-next v4 6/6] enic: configure V2 VF receive mode over mailbox 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 Date: Tue, 01 Dec 2026 14:04:55 +0000 Message-ID: <179613389534.3146.15589957948502759447@kernel.org> In-Reply-To: <20261130-b4-enic-sriov-v2-vf-receive-control-v4-6-5858d5a9ecb1@cisco.com> References: <20261130-b4-enic-sriov-v2-vf-receive-control-v4-6-5858d5a9ecb1@cisco.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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