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=1796107187; b=357fkJyQOLIMsuisnA09WYqVGfV2z/3EhiushE+HhHkdH9f+zZIhqhG9zUVXb6lu9ZoU H8H/F+c6D0F5st943Ofv3rCkMUk40+r/9FF51Y0+C3N0r+jv2Ie0nb8+uWR3qHvOEvxnB jupJpuvdQNmSUFnCzIYRL/e62PIpcJKzvq4kg/hciTEU9sPiU63eGYMGTz4F3i6kvwTL9 LvH8Ylx/QlcFwGo813GkK4d8Z0LZOpHwNQPA46khOB3nYYrtWrFqVQhrb7s2oRNkmIl+9 lf8BxRLIVX+r81SIokv3vHs7oFnkVn2LUB+G42NN9EQl+C9FvbXQ1DdSFD95YZkdNcw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107187; 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=8X7BxYxFRftioOrrdsLuhbAlET/wwofQkd2phMJ0tbU=; b=vNUJUhak2NChqbUd6rRp8zhuxZsgZToWUBiiGR891OMLkV6IaLwni6nMwzKY7GjwsRua Tiy1zFKIpGL0sxKVqyz2n2eurZlaHeHz3qadT25ITEfETuSa4XE5W5a4PjnvlC4sec4Gs MVfH1C4w5k9QAF9j2M2M1+5ZGMsaCjr8SBNx6GcQqbUgMZnYb3ZfrqXlYZFx1ZsqeftdG 5hfPk8OqYIL9/noyy9DPDPtGEJy135yViBI5LZdb3K79OrIjT8Lig2on2zA5Jl2Hovxh+ Q21laTYpRUKmbwp6vZ14JF8dVFr+u3VrrnS/pnLdP7wteEmS/0BLGiqhJuT6jo34Zyw== 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=WhnZ3HMp; 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 0E467606A690; Tue, 1 Dec 2026 06:39:46 +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=WhnZ3HMp Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5DF81F00897; Tue, 1 Dec 2026 06:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796107186; bh=8X7BxYxFRftioOrrdsLuhbAlET/wwofQkd2phMJ0tbU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=WhnZ3HMp6FOZZsyv95MbOEf44Ljpd1jx9iIarE7QlTX3FLh2r2kJ4bZWYWV3Loeok ceLEqlpoxpn5QnBRTqzwDfb7fR/WX/IhoNlRbYbHgHtBV7tI6SagzdDuhsV1RHZcVQ 4cQ7iGJ9xu0ehX2lMnFnPPdxm1KQJc7+byYidC6ZevucROhQQiEjOYkM2bgddUcvVT Sj9aqcc7hkQ3wrlf76a/dtUg8SSyNrdSYy1u3euUDH73QzW8fxAM+hmDHBpPqVqJFj W7vvmaP1kXMn8HEfr3A539MVITyO35zikHfz+SD4Qi7/NVvJldITVraE7qb66wsCjU Y2eTytn5Foudg== Subject: Re: [PATCH net-next v11 09/10] bnge: add aRFS flow steering ndo support From: netdev-bot+sashiko@kernel.org To: vikas.gupta@broadcom.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bhargava.marreddy@broadcom.com, rahul-rg.gupta@broadcom.com, vsrama-krishna.nemani@broadcom.com, rajashekar.hudumula@broadcom.com, dharmender.garg@broadcom.com, ajit.khaparde@broadcom.com Date: Tue, 01 Dec 2026 06:39:45 +0000 Message-ID: <179610718537.3146.5243328929678398709@kernel.org> In-Reply-To: <20261130055736.2306367-10-vikas.gupta@broadcom.com> References: <20261130055736.2306367-10-vikas.gupta@broadcom.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@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 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 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] In the expire loop of bnge_cfg_ntp_filters() (bnge_filter.c:835-836), the return value of… -- bnge: add aRFS flow steering ndo support This patch adds the ndo_rx_flow_steer callback to bnge. The callback builds an ntuple filter from the skb flow keys and queues sp_task to program it in firmware. It also adds bnge_cfg_ntp_filters(), which installs, retargets and expires aRFS filters from sp_task, and changes ntuple filter matching to compare the L2 filter by key rather than by firmware id. > diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_filter.c b/drivers/net/ethernet/broadcom/bnge/bnge_filter.c > index 639c36d571f24..b7261018216bc 100644 > --- a/drivers/net/ethernet/broadcom/bnge/bnge_filter.c > +++ b/drivers/net/ethernet/broadcom/bnge/bnge_filter.c [ ... ] > @@ -716,3 +735,105 @@ void bnge_clear_usr_fltrs(struct bnge_net *bn) > } > } > } > + > +void bnge_cfg_ntp_filters(struct bnge_net *bn) > +{ [ ... ] > + /* Free the old HW rule; reinstall it below on the new queue. */ > + list_for_each_entry_safe(fltr, tmp, &update_list, base.list_node) { > + list_del_init(&fltr->base.list_node); > + /* If the free fails the rule stays on the old queue. It is not > + * retried, so a firmware that keeps failing is not hit on every > + * tick. > + */ > + if (bnge_hwrm_cfa_ntuple_filter_free(bn->bd, fltr)) > + continue; > + clear_bit(BNGE_FLTR_FW_DELETED, &fltr->base.state); > + list_add(&fltr->base.list_node, &install_list); > + } [ ... ] > + list_for_each_entry_safe(fltr, tmp, &expire_list, base.list_node) { > + list_del_init(&fltr->base.list_node); > + /* Decide again under ntp_fltr_lock: the scan ran without it and > + * the firmware calls above can take long. Use the rxq and > + * flow_id that bnge_rx_flow_steer() writes under it. Unlink > + * here too, so a flow cannot be retargeted onto a filter that > + * is about to be freed. The firmware free comes after the > + * unlock. > + */ > + spin_lock_bh(&bn->ntp_fltr_lock); > + if (test_bit(BNGE_FLTR_RXQ_UPDATE, &fltr->base.state) || > + !rps_may_expire_flow(bn->netdev, fltr->base.rxq, > + fltr->flow_id, fltr->base.sw_id)) { > + spin_unlock_bh(&bn->ntp_fltr_lock); > + continue; > + } > + hlist_del_init_rcu(&fltr->base.hlist); > + spin_unlock_bh(&bn->ntp_fltr_lock); > + > + bnge_hwrm_cfa_ntuple_filter_free(bn->bd, fltr); > + bnge_del_ntp_filter_rcu(bn, fltr); ^^^^ [Severity: Medium] What happens to the firmware ntuple rule in the expire loop of bnge_cfg_ntp_filters() if bnge_hwrm_cfa_ntuple_filter_free() fails? bnge_hwrm_cfa_ntuple_filter_free() in bnge_hwrm_lib.c only invalidates filter_id on success: rc = bnge_hwrm_req_send(bd, req); if (!rc) fltr->base.filter_id = BNGE_FLTR_ID_INVALID; return rc; Here the return value is ignored and bnge_del_ntp_filter_rcu() always runs. That clears sw_id in ntp_fltr_bmap, decrements ntp_fltr_count and calls kfree_rcu() on the only object that holds the firmware handle. If bnge_hwrm_req_init() or bnge_hwrm_req_send() fails, does the rule stay programmed in the CFA table? It would then keep steering the flow to its old RX ring, and the driver would have no record of it. Close won't free it either. bnge_hwrm_cfa_ntuple_filter_free() returns 0 when BNGE_STATE_OPEN is clear, so the rule looks like it stays in place until VNIC teardown. A later aRFS request for the same flow would send HWRM_CFA_NTUPLE_FILTER_ALLOC for an identical tuple. Depending on the firmware, that could be rejected as a duplicate, in which case sp_task deletes the new entry and the flow can no longer be steered. It could also install a second rule that conflicts with the first. The update loop above checks the same return value and keeps the software entry when the free fails. Should the expire loop handle a failure the same way, instead of dropping the only record of the firmware filter? This path becomes reachable once "bnge: add cpu_rmap support for IRQ affinity" turns aRFS on. > + } > +#endif > +} -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130055736.2306367-1-vikas.gupta%40broadcom.com