From patchwork Thu Nov 3 23:33:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13031126 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25693C4332F for ; Thu, 3 Nov 2022 23:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230300AbiKCXd6 (ORCPT ); Thu, 3 Nov 2022 19:33:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbiKCXdq (ORCPT ); Thu, 3 Nov 2022 19:33:46 -0400 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81C78193C9 for ; Thu, 3 Nov 2022 16:33:45 -0700 (PDT) Received: by mail-qv1-xf36.google.com with SMTP id x13so2205911qvn.6 for ; Thu, 03 Nov 2022 16:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=s98qI5MR5QUmr1VmzLzImiHCmq7rt1lktOiepsDNiLQ=; b=ArupKVOG30uoNOlq24MKsH/g0A+SEiLtD+39BII6t6LZVD8fn/J4p+ayN9dpIyXpBy bVaPaoN+lhKa58NzrzFvpC6d5JNgjcQiHMZqOVREd7+1PNY9sjIr0jliJytACG2ChkKA 812oVWMc+72NOzkaiFRtaY078OW6pad8Rp3dY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=s98qI5MR5QUmr1VmzLzImiHCmq7rt1lktOiepsDNiLQ=; b=e4jlljMRh0H/vM+HPEXT+8JrglErEsRQuYbNNW514pIryKkF7k1PmgNKqMYX577jYu l3cxAyDljZak8WPlzHbdumb2mNSRWDzSeIkwocVUf8PZhsalMQypwkvqMdd4NQp9v74E WDOMRxEuAwj320n29c7ePaN8eQS10vE8hXlcRYIjAz+7dPKZKAVh6jJfUCVfCpDyQy4f /PJCHRVPRHMe/NC1yoKsi5KWvBYmZ6rE+HDyBOKwXfhrgEunU+mHCLA5fq3tKe/xufxS ZWFuwLBFIs/SQFgCUX+79ai286slklpPVVvHDSlcfEHg0yK/mhJ4hukviW8+2TnqDXEK fVSg== X-Gm-Message-State: ACrzQf2biTMD4XMl1ar6Bb0HHE2dcWZqt/KHCad5sjUxp+vaW/eh9QFD WadH0k6+8ZWAvYIcQW5Cd5kRMtVKIHTXsQ== X-Google-Smtp-Source: AMsMyM6gmyAuF3mR4OsGq7u09kiIEA+mEFmv9y7IZO/Jbo72RG7ckxKZE+BEQLUvlcLBP8vKXW0gQw== X-Received: by 2002:a05:6214:20ed:b0:4bb:6d76:58a4 with SMTP id 13-20020a05621420ed00b004bb6d7658a4mr28657663qvk.117.1667518424471; Thu, 03 Nov 2022 16:33:44 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id u5-20020a37ab05000000b006f8665f483fsm1662020qke.85.2022.11.03.16.33.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Nov 2022 16:33:44 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, gospo@broadcom.com, Alex Barba Subject: [PATCH net 4/4] bnxt_en: fix potentially incorrect return value for ndo_rx_flow_steer Date: Thu, 3 Nov 2022 19:33:27 -0400 Message-Id: <1667518407-15761-5-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1667518407-15761-1-git-send-email-michael.chan@broadcom.com> References: <1667518407-15761-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Alex Barba 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: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Reported-by: Akshay Navgire Signed-off-by: Alex Barba Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index f44f9367b7fd..c78b6e9dea2c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -12903,8 +12903,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; } }