Article View: linux.kernel.netdev
Article #27419Re: [PATCH net-next v6 7/7] enic: configure V2 VF receive mode over mailbox
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 16:28
Date: Sat, 05 Dec 2026 16:28
204 lines
15134 bytes
15134 bytes
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 <vf> 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
Technical Details
Message-ID:
<179648809991.3146.3389639661633696532@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378046-linux-kernel-netdev=dewy.ruReferences:
<20261204-b4-enic-sriov-v2-vf-receive-control-v6-7-ca38950bbe07@cisco.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378046-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v6 7/7] enic: configure V2 VF receive mode over mailbox Date: Sat, 05 Dec 2026 16:28:19 +0000 Organization: Usenet Network Message-ID: <179648809991.3146.3389639661633696532@kernel.org> References: <20261204-b4-enic-sriov-v2-vf-receive-control-v6-7-ca38950bbe07@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3068072"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:K83ZDcYk5QF2EV5aT52vkEuQyHw= sha256:f7QQAv20xG4DSP8iDZ+I3P8RlZRwWMWOKa0CysZbX7M= sha1:WbUf3LpPMltJadh1wdsT6tkHP1k= sha256:AJzYhIg0LglzKFKHcVTUhac4giA3Ukn9VDsGoG7c+Mc= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 5EDDC117E55; Sat, 5 Dec 2026 19:28:40 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.639 X-Spam-Status: No, score=-3.639 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.14, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qh5CqK-ORmpJ; Sat, 5 Dec 2026 19:28:37 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-378046-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 25201117E40; Sat, 5 Dec 2026 19:28:28 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 80BA96031F3; Sat, 5 Dec 2026 16:28:27 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796488102; b=b0EfdRfaIsHrXcC9UbNPy4dKlf3s77Ps71MbUVTGzWaUoTvPSelPxDduE8ck3A/nSIyd KawqkKsyCsnzX5rTbhzCdjCACDj4O5cVCHZMbU73WAqGcD0/h1GM8AVU4nERa2aXdorZT djk2ttnDDrrekzf7FJyWUsUXIpckbN4un/zDWcYW7YBGVZUFOj9NNa76Mj973/115ehRU /vi32g8BwQjl/gHEV2k6Xnwm5vpitRp4LFXOTZtjgRQ8X/LvZo9rwi2zNk+YG8QsKoGI1 QT1JXfl81OCRgRCppy2awdcy0Xl2SgSRwOuAjxeGjAfNGdh+1zDitCihhOSeMkGEswQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796488102; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=09bWXWQbE3rtyv++RlxYWZNh8F+BNlSwJrmo7kxRzsY=; b=QhAglTELGsfHvD0hOqrI3WGOcHT0+wy3xCAQFHBxELq22cJDOVyaxVkZJzQKjL23bQ4D tA9NP3RDKtm/IvlU42O5adqpbhWJX/t/WTb0Lq+JYdoF6+FfIPaEyeeCnu3UMIwH09OET zPR7sGzg2h5ZKULXNMcMfWN7HC9k4v8bO48+1m0PwdZJz8FibrwJuPmHGgqBDHk+RsmVG DApeJ3zdOJcIJ1Et5VlbtXAcjcvChRXOlcExbSuPatTkktDWOUchgI5PxcXBH21YzT766 cfB922M2EYWtj5fohjKad65NjfPi0JOswkFSC2RMaUYOaXklpj94OA4kYLgLgw5mOQA== X-ARC-Authentication-Results: i=2; 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=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35ADF606A6B1; Sat, 5 Dec 2026 16:28:22 +0000 (UTC) X-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 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-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== X-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== X-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 X-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) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58CF81F00A15; Sat, 5 Dec 2026 16:28:20 +0000 (UTC) X-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== X-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 X-In-Reply-To: <20261204-b4-enic-sriov-v2-vf-receive-control-v6-7-ca38950bbe07@cisco.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list