]> git.baikalelectronics.ru Git - kernel.git/commitdiff
bnxt_en: fix potentially incorrect return value for ndo_rx_flow_steer
authorAlex Barba <alex.barba@broadcom.com>
Thu, 3 Nov 2022 23:33:27 +0000 (19:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:42:04 +0000 (17:42 +0100)
[ Upstream commit 186bf6e4a356bdbb5194ffc1e3886dc22b2957dc ]

In the bnxt_en driver ndo_rx_flow_steer returns '0' whenever an entry
that we are attempting to steer is already found.  This is not the
correct behavior.  The return code should be the value/index that
corresponds to the entry.  Returning zero all the time causes the
RFS records to be incorrect unless entry '0' is the correct one.  As
flows migrate to different cores this can create entries that are not
correct.

Fixes: 93658deae41f ("bnxt_en: New Broadcom ethernet driver.")
Reported-by: Akshay Navgire <anavgire@purestorage.com>
Signed-off-by: Alex Barba <alex.barba@broadcom.com>
Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.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 5a7d5e7f3b2384cd1c9f23aca5c5f1ee998a9501..d7d7d6421c4883d59ded4b54ebfe29a261ef0a32 100644 (file)
@@ -11182,8 +11182,8 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
        rcu_read_lock();
        hlist_for_each_entry_rcu(fltr, head, hash) {
                if (bnxt_fltr_match(fltr, new_fltr)) {
+                       rc = fltr->sw_id;
                        rcu_read_unlock();
-                       rc = 0;
                        goto err_free;
                }
        }