]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic
authorTaehee Yoo <ap420073@gmail.com>
Sun, 9 Mar 2025 13:42:14 +0000 (13:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:12 +0000 (12:54 -0700)
[ Upstream commit 661958552eda5bf64bfafb4821cbdded935f1f68 ]

When a queue is restarted, it sets MRU to 0 for stopping packet flow.
MRU variable is a member of vnic_info[], the first vnic_info is default
and the second is ntuple.
Only when ntuple is enabled(ethtool -K eth0 ntuple on), vnic_info for
ntuple is allocated in init logic.
The bp->nr_vnics indicates how many vnic_info are allocated.
However bnxt_queue_{start | stop}() accesses vnic_info[BNXT_VNIC_NTUPLE]
regardless of ntuple state.

Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Fixes: b9d2956e869c ("bnxt_en: stop packet flow during bnxt_queue_stop/start")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Link: https://patch.msgid.link/20250309134219.91670-4-ap420073@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index a476f9da40c27721c81be7c7bcdebc3fb34db65c..442c85b3ea3f3a8c4a84e073b5c831ae42514646 100644 (file)
@@ -15287,7 +15287,7 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
        cpr = &rxr->bnapi->cp_ring;
        cpr->sw_stats->rx.rx_resets++;
 
-       for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) {
+       for (i = 0; i <= bp->nr_vnics; i++) {
                vnic = &bp->vnic_info[i];
 
                rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic, true);
@@ -15315,7 +15315,7 @@ static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx)
        struct bnxt_vnic_info *vnic;
        int i;
 
-       for (i = 0; i <= BNXT_VNIC_NTUPLE; i++) {
+       for (i = 0; i <= bp->nr_vnics; i++) {
                vnic = &bp->vnic_info[i];
                vnic->mru = 0;
                bnxt_hwrm_vnic_update(bp, vnic,