From patchwork Sun Jul 18 19:36:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 480354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9C27C636CB for ; Sun, 18 Jul 2021 19:36:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E449600D1 for ; Sun, 18 Jul 2021 19:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231861AbhGRTjw (ORCPT ); Sun, 18 Jul 2021 15:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbhGRTjt (ORCPT ); Sun, 18 Jul 2021 15:39:49 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BE5EC061762 for ; Sun, 18 Jul 2021 12:36:51 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id u3so8378620plf.5 for ; Sun, 18 Jul 2021 12:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=547B+jCYZEss9p8PP/5v8fLXb0gL473ByLMnWmZdfrA=; b=Ow1kP8wNPG5AgfQuIHnvCC+6Dsw9aQNJ5V3+c//svnlcIa5l88RsWvCDSUO/UI4/mt fgLU53LD6pL2+wAwb4fqDp+9e+nylsi4hwRcK6Ciboe8a0VxMPEihtZe9tis6/CvexeM 2NzbJpNCqpAgGRF/K+EtNvACd076xj9q5UbD0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=547B+jCYZEss9p8PP/5v8fLXb0gL473ByLMnWmZdfrA=; b=fasaOr7DEPdztjFU61kbaTgerOXYfWdGjRjWbxAHn3e8EifcRuoyW1ucCZYLw2NTqg JPjEP+aFICvZLG7pI1nW81zTqT3aSztI39/RwevRMALeZJ5iMGnoAzzUpGPo7KZZWlFD m+Zp5h9dl2zc9QjCAAmpu724hneMd23E/vi9ozYukYwfW9ShBemN5q/t25LxqUt9ZNmt 9olyDT9HZPAvHwGIOvCE7zYhrWbUatyLtWEqY9TmdXkBAmT8oaHB2jyLjYys2TQPQmiJ aYLVkgQ1yZsDbrp0NWKXlUh6aVpuUAWzu13rmJ6tTkgry94zBk6cvgHl2Q/7wu4q//Fl P9jg== X-Gm-Message-State: AOAM533Kq8LCxonGGpxTKswQKU0jdQqoDu2LX+xTpShizsAD5ICLIeB0 7nQ+F8ACtc8OR9ZfltU9IZbQ+g== X-Google-Smtp-Source: ABdhPJww1YmTOHgI0lUmpCHQD3THyP0ICnKcpndpxYohYKgmmsg8KSzZ69CFVQaq8ZHGRm5Q9SxahQ== X-Received: by 2002:a17:90a:c78f:: with SMTP id gn15mr26641442pjb.90.1626637010731; Sun, 18 Jul 2021 12:36:50 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 22sm16743648pfo.80.2021.07.18.12.36.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Jul 2021 12:36:50 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com Subject: [PATCH net 3/9] bnxt_en: Refresh RoCE capabilities in bnxt_ulp_probe() Date: Sun, 18 Jul 2021 15:36:27 -0400 Message-Id: <1626636993-31926-4-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1626636993-31926-1-git-send-email-michael.chan@broadcom.com> References: <1626636993-31926-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The capabilities can change after firmware upgrade/downgrade, so we should get the up-to-date RoCE capabilities everytime bnxt_ulp_probe() is called. Fixes: 2151fe0830fd ("bnxt_en: Handle RESET_NOTIFY async event from firmware.") Reviewed-by: Somnath Kotur Reviewed-by: Edwin Peer Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c index a918e374f3c5..187ff643ad2a 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c @@ -479,16 +479,17 @@ struct bnxt_en_dev *bnxt_ulp_probe(struct net_device *dev) if (!edev) return ERR_PTR(-ENOMEM); edev->en_ops = &bnxt_en_ops_tbl; - if (bp->flags & BNXT_FLAG_ROCEV1_CAP) - edev->flags |= BNXT_EN_FLAG_ROCEV1_CAP; - if (bp->flags & BNXT_FLAG_ROCEV2_CAP) - edev->flags |= BNXT_EN_FLAG_ROCEV2_CAP; edev->net = dev; edev->pdev = bp->pdev; edev->l2_db_size = bp->db_size; edev->l2_db_size_nc = bp->db_size; bp->edev = edev; } + edev->flags &= ~BNXT_EN_FLAG_ROCE_CAP; + if (bp->flags & BNXT_FLAG_ROCEV1_CAP) + edev->flags |= BNXT_EN_FLAG_ROCEV1_CAP; + if (bp->flags & BNXT_FLAG_ROCEV2_CAP) + edev->flags |= BNXT_EN_FLAG_ROCEV2_CAP; return bp->edev; } EXPORT_SYMBOL(bnxt_ulp_probe);