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=1796488101; b=BHwP0qIV/QU7g6XLmq223iVeoFvlAob3GJ3KAqvieiHxS58hcFrZLLggQj4oDaX2bm9H PXwsmTstR3MVx6T4TG0wy1a/M3H+M1o48VmRk4DBBZddxRtAHrV+nQ4n/d4AipdTrmJwv +VGX9yx6W/xExhkRMc9kdE2uPewhuGfrUtG6Awtkvij+GXkmoD34/hSWD1mffN2kLmZpe mi1/oRL29xF42BlUKnqJNSwpcht/oF5WEsxfIHoQqy/SMmOjJhdqn1stqXC5qc3ZYaXXu BhOIYYHizLBhBDI8HSy2GMe8V++pzEM/B0U09lFgjArmQbTuSUzKuVQUMRF7trDiY5A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796488101; 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=09bWXWQbE3rtyv++RlxYWZNh8F+BNlSwJrmo7kxRzsY=; b=WjW9MTgjHWNvF2NtkWFmZXrVtkJ1HjEO9lQGMD+0VL1tCVURn+NVbdBqLk6Cecdc75lD 8183aV+Bo4DAofbbsZVBaszHFHhTKXiIHbaWV88XDDqtH7fMOnjpGZ8k6LWCPYpqVRSKt 90ndvfNwYS79rOzSptlXSQbaCud9rKqYkkayivkozOFybFQHYizxnCm9IycQ3KdEyRf7b waxILGgoHTR4W+y6zv6cUvyL4XgRFHLANgw6paq3SySVWg+AkAKyaRCxkwSkQ9ztEg609 TfuLOM2e2tM7+rQ5UUQy+Rt74eg+1Z6ziOfpo6PZB9Ng0Kg8ZbNOD/FDFLZaZ6VvFfg== 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=VWG0z+CI; 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 56C05606A33A; Sat, 5 Dec 2026 16:28:21 +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=VWG0z+CI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58CF81F00A15; Sat, 5 Dec 2026 16:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796488101; bh=09bWXWQbE3rtyv++RlxYWZNh8F+BNlSwJrmo7kxRzsY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=VWG0z+CIp77xpsDEDY/giMZ4NDs7++hNKbnSoDvqg3G93Ox9MSXcAJuRzCucIkLpF eCHhTBomXBSG0nK72dpTVeIIeSVWpxasmasnH0e6inVWG7PG1I+HUQg/gwe2vBBw/m ap4tBY8FrWvzall3/sHENFa4uEZ2+7aZMbBREeujwTFrQd5k3Veww+UD2YXo9y/rNz ciLp/BLNgEkNj5JciPLSBNjbYwb41hKu1ZTmYUbTjwrJHaXEhmMROzfthF3y7QM90C CvLlEVsmlEnkTR7KDdsQPkUMKqJjtqrZ0z6zE89h+Xj5JLHQPojVNU5K/ax+3BegKA wtC8LgW+mBzBg== Subject: Re: [PATCH net-next v6 7/7] 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, sdf@fomichev.me Date: Sat, 05 Dec 2026 16:28:19 +0000 Message-ID: <179648809991.3146.3389639661633696532@kernel.org> In-Reply-To: <20261204-b4-enic-sriov-v2-vf-receive-control-v6-7-ca38950bbe07@cisco.com> References: <20261204-b4-enic-sriov-v2-vf-receive-control-v6-7-ca38950bbe07@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 3 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 2 · 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] On V2 VFs, a group-bit (link-local) address in dev->uc is never programmed and nothing falls back to cover it. - [Medium] An address the PF permanently rejects on ADD keeps taking a projected exact-filter slot on every later callback, so a valid… - [Low] enic_set_vf_rx_mode() reports the same packet-filter denial more than once per callback. -- enic: configure V2 VF receive mode over mailbox This patch adds an asynchronous receive-mode callback for V2 VFs. The callback sends unicast and multicast exact-filter changes, plus packet-filter settings, to the PF over the mailbox. It orders broad-mode transitions around exact-filter updates, reserves 31 unicast and 32 multicast slots, and skips three kinds of address: the station address, all-zero MACs, and addresses whose group bit does not match their list. > diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c > index 0ee2ea5b24682..116666be60340 100644 > --- a/drivers/net/ethernet/cisco/enic/enic_main.c > +++ b/drivers/net/ethernet/cisco/enic/enic_main.c [ ... ] > @@ -1664,17 +1666,425 @@ static int enic_set_mac_address(struct net_device *netdev, void *p) [ ... ] > +static bool > +enic_vf_secondary_addr_valid(const struct enic *enic, > + const struct netdev_hw_addr *ha) > +{ > + u8 type = is_multicast_ether_addr(ha->addr) ? > + NETDEV_HW_ADDR_T_MULTICAST : NETDEV_HW_ADDR_T_UNICAST; > + > + /* The PF stores one exact filter per MAC. Admit it from the list > + * matching its Ethernet address class, and leave the station separate. > + */ > + return ha->type == type && !is_zero_ether_addr(ha->addr) && > + !(enic->vf_station_addr_valid && > + ether_addr_equal(ha->addr, enic->vf_station_addr)); > +} [Severity: Medium] Can a link-local group address in dev->uc be silently dropped here? The core puts these addresses into the uc list itself. enic_netdev_vf_v2_ops has no ndo_fdb_add, so the fdb add path goes through ndo_dflt_fdb_add(): net/core/rtnetlink.c:ndo_dflt_fdb_add() { ... if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) err = dev_uc_add_excl(dev, addr); ... } dev_uc_add_excl() stores the entry as NETDEV_HW_ADDR_T_UNICAST, and the snapshot passed to ndo_set_rx_mode_async keeps ha->type. So a command like "bridge fdb add 01:80:c2:00:00:0e dev self permanent" succeeds. enic_vf_secondary_addr_valid() then rejects the entry, because is_multicast_ether_addr() is true while ha->type is T_UNICAST. The same predicate gates enic_vf_addr_list_count() and enic_vf_collect_mac_ops(). As a result, no add operation is issued for the address, and it does not count toward CMD_PFILTER_PROMISCUOUS or CMD_PFILTER_ALL_MULTICAST. IFF_UNICAST_FLT is set, so the core does not fall back to uc_promisc either. enic_set_vf_rx_mode() returns 0 and the core treats the update as converged. The LLDP/STP style frames that were requested are then never received. An upper device that syncs its uc list down to the VF could reach the same state. The commit message gives this reason for the class check: Counting the same MAC in both lists can reserve capacity twice and removing one reference can delete the filter while the other list still considers it synchronized. Could that be handled by classifying entries by their address bit and deduplicating across the two lists, instead of dropping cross-class entries entirely? [ ... ] > + 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_PERMANENT_MASK) { > + if (add) > + permanent_add = true; > + else > + reconnect = true; > + continue; > + } [Severity: Medium] Does a permanently denied add keep taking a projected exact-filter slot on every later callback? After the denial, the entry keeps sync_cnt == 0, enic->uc_count and enic->mc_count are unchanged, and enic_set_vf_rx_mode() turns the resulting -EACCES into success: err = enic_vf_sync_mac_filters(enic, uc, mc); if (err == -EACCES) { ... err = 0; } On the next callback, projected_uc restarts from enic->uc_count. enic_vf_collect_mac_ops() then collects the same unsynced entry again, because its add branch only skips on: if (ha->sync_cnt || *projected_count >= max_filters) continue; For example, take a uc list with PF-denied A followed by valid B1..B31: pass 1: collects A and B1..B30 (limit 31), A is denied, uc_count becomes 30 pass 2+: projected starts at 30, A takes slot 31, B31 is never collected CMD_PFILTER_PROMISCUOUS is requested because 32 > 31. If the PF refuses it, B31 is never received, even though 30 secondaries plus the station leave one of the PF's 32 entries free. Each extra denied address costs another slot. Multicast behaves the same way when ALL_MULTICAST is denied. The commit message already avoids this crowd-out for the all-zero MAC: The PF rejects that address as INVALID, so reserving capacity for it would crowd out a later valid address on every update. Should addresses the PF has permanently denied also be left out of the projection? [ ... ] > + if (broad_enable_needed) { [ ... ] > + target_filter_updated = prefilter_flags == flags; > + enic_vf_report_pkt_filter_denial(netdev, flags, applied_flags); > + } > + > + if (broad_withdrawal) { [ ... ] > + target_filter_updated = true; > + enic_vf_report_pkt_filter_denial(netdev, flags, applied_flags); > + } [ ... ] > + if (!target_filter_updated && filter_needed) { > + err = enic_vf_set_pkt_filter(enic, flags, &applied_flags); > + if (err) > + return err; > + } else if (!target_filter_updated) { > + applied_flags = enic->vf_pkt_filter_applied; > + } > + > + enic_vf_report_pkt_filter_denial(netdev, flags, applied_flags); [Severity: Low] Is the same denial reported more than once per callback here? When broad_enable_needed is true and broad_withdrawal is false, prefilter_flags == flags, so the enable branch reports the denial. Neither of the final if/else-if branches runs, and this call reports it again with the same arguments. A combined enable-plus-withdrawal transition reports it three times. A denied broad mode keeps broad_enable_needed true on every callback. So each address-list update prints the same netdev_dbg lines two or three times. Would keeping only this final report be enough? -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204-b4-enic-sriov-v2-vf-receive-control-v6-0-ca38950bbe07%40cisco.com