From patchwork Wed Jun 7 07:54:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13270118 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC2C37465 for ; Wed, 7 Jun 2023 07:54:44 +0000 (UTC) Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7724C10C6 for ; Wed, 7 Jun 2023 00:54:43 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-62b65e4c42eso6758226d6.3 for ; Wed, 07 Jun 2023 00:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686124482; x=1688716482; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=00fRL8RxD9SowKNUqYjLLBgtoj6CGuSVSaOL5LoZUh0=; b=Hj6Zfq/t9PX5vlpNJfmgNqItzpMyg9RnWNixOonRgJpod2PJrPVFOzO852q6owz3ke 5LSuH3QTpaD+Bor3cvsAXVZ12ZfSIULteCIN+lzSBF54WMf7mpDpawJY8Cq7OtWM33NA veIyqKABxSl4/8zsaHCKOfXoFlchrkssl5864= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686124482; x=1688716482; h=mime-version: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=00fRL8RxD9SowKNUqYjLLBgtoj6CGuSVSaOL5LoZUh0=; b=LxtN18805l1cUCNEC4GFWSld06VutG198SJssr4KOazQfzRwoDmTh2EGPcKxNv7eUi ZS1wSJ6xfgP02BoA3wYJlWAIFaoBG9I7NpYWYn4shs94CEU5/kPJt2CvfDjM+XsqWku9 1vrIrdlwQpHNa8qrGby8c7+Qq/N+RpZPxvHsAgRvsgP4oRYN1JjyE9eWpRal0emIP32B BjzFguqBT/BHyHg2nZ0lm5CsN+0Y9pQz0ej32jXcpUgGJSe3sHB4jPXDZKGSfuJ8lbnT 2dLYYAC9ZRSbH1tlgknD3f+OCQgXehBitI1fAuOeXqN/eT0So6SXcLguDR3woJ5eI1nW o+jA== X-Gm-Message-State: AC+VfDyMxpy4Z8UsCCFRA0IqS565VFQtqjCloRRmDEGmw0PYHvMlXpDH cbrR2wOdr42d7LG3J3V5Mb5s/MH0ln3S5gXika4= X-Google-Smtp-Source: ACHHUZ54AXTNz0Qg8k+NtWfSiZBv4kFwJDYB/0K+y3bDEiMTmtWzHw+ScOei7qCz+X9/m9w8mqPGeg== X-Received: by 2002:ad4:5747:0:b0:629:78ae:80f0 with SMTP id q7-20020ad45747000000b0062978ae80f0mr2786147qvx.8.1686124482516; Wed, 07 Jun 2023 00:54:42 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id cs12-20020ad44c4c000000b00626362f1bf1sm5850817qvb.63.2023.06.07.00.54.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2023 00:54:41 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Pavan Chebbi , Kalesh Anakkur Purayil , Somnath Kotur Subject: [PATCH net 1/6] bnxt_en: Fix bnxt_hwrm_update_rss_hash_cfg() Date: Wed, 7 Jun 2023 00:54:04 -0700 Message-Id: <20230607075409.228450-2-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230607075409.228450-1-michael.chan@broadcom.com> References: <20230607075409.228450-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Pavan Chebbi We must specify the vnic id of the vnic in the input structure of this firmware message. Otherwise we will get an error from the firmware. Fixes: 98a4322b70e8 ("bnxt_en: update RSS config using difference algorithm") Reviewed-by: Kalesh Anakkur Purayil Reviewed-by: Somnath Kotur Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index dcd9367f05af..4aa490cb2fe0 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -5350,6 +5350,7 @@ static void bnxt_hwrm_update_rss_hash_cfg(struct bnxt *bp) if (hwrm_req_init(bp, req, HWRM_VNIC_RSS_QCFG)) return; + req->vnic_id = cpu_to_le16(vnic->fw_vnic_id); /* all contexts configured to same hash_type, zero always exists */ req->rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]); resp = hwrm_req_hold(bp, req); From patchwork Wed Jun 7 07:54:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13270119 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E76507465 for ; Wed, 7 Jun 2023 07:54:46 +0000 (UTC) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3690812C for ; Wed, 7 Jun 2023 00:54:45 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-62615694bb9so48057556d6.0 for ; Wed, 07 Jun 2023 00:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686124484; x=1688716484; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=0OufplTNJwSbnUq24EenH4KnxC2gWFpCoV7GUxnomWc=; b=RQcfD/mZzArj4G1bxpQwSZ75oN6/7SGRTUFlVp7OM6xIwf3K4wpRVkIsL5hgZeHgYL PyUC8VWIPYtwOZPBk9k+tNuxvCN7qMOevshwDF4oTisaThzpD0Kbtv/zu5Q7udtuuZg9 ug5xJXYogVcfmH5rkEfo/CKqpXZ5CXCGLQkUk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686124484; x=1688716484; h=mime-version: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=0OufplTNJwSbnUq24EenH4KnxC2gWFpCoV7GUxnomWc=; b=Z/fdmrR2DIqQ5E1rXVm/pAhR8Lcv9smA4CPPA1TdFZkKrZ88rSWcf6hJZ63Ismp2g7 6W/ptGPymWf1DIisZowehP+jb4Q+e+Eq14jImDK1IggOhSWY1FEsgHxmYDZsxW20izjM ikVMX3YH9/xJhz1KceqzZs7VLhTujLF6KL2liVLdjNRAC2cxtK1LYPkw4P7m+FbwY4Ye uWZ6Dq9cz01jDN/zxYWZRC3uNVgX8djoGgSqsqyYnPpIz7BYpD515UeBWJPVngAY+PBp eB7dQwqsLMsB0aY0ktopivBIzIko++pEtBJrpK/gn5nVvJ5N3QN3GcdGCrVAwvM4cQWh vUQQ== X-Gm-Message-State: AC+VfDw7Km9Eq7M+bK5RzINMYtpcLVSvdEsuWd2fM06ac4nSbFdfjMQh ip4BmoIgvxr0AniD2JTmRyXseQ== X-Google-Smtp-Source: ACHHUZ6PEPP2YRej8grIx9ouO8QIocDF8HdTwOTckZA7VBkv+0stWBKGJ682b2wu8POHl10zRiFQig== X-Received: by 2002:a05:6214:d0a:b0:626:17b2:5583 with SMTP id 10-20020a0562140d0a00b0062617b25583mr2114271qvh.0.1686124484123; Wed, 07 Jun 2023 00:54:44 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id cs12-20020ad44c4c000000b00626362f1bf1sm5850817qvb.63.2023.06.07.00.54.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2023 00:54:43 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Sreekanth Reddy , Pavan Chebbi Subject: [PATCH net 2/6] bnxt_en: Don't issue AP reset during ethtool's reset operation Date: Wed, 7 Jun 2023 00:54:05 -0700 Message-Id: <20230607075409.228450-3-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230607075409.228450-1-michael.chan@broadcom.com> References: <20230607075409.228450-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Sreekanth Reddy Only older NIC controller's firmware uses the PROC AP reset type. Firmware on 5731X/5741X and newer chips does not support this reset type. When bnxt_reset() issues a series of resets, this PROC AP reset may actually fail on these newer chips because the firmware is not ready to accept this unsupported command yet. Avoid this unnecessary error by skipping this reset type on chips that don't support it. Fixes: 7a13240e3718 ("bnxt_en: fix ethtool_reset_flags ABI violations") Reviewed-by: Pavan Chebbi Signed-off-by: Sreekanth Reddy Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 2dd8ee4a6f75..8fd5071d8b09 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -3831,7 +3831,7 @@ static int bnxt_reset(struct net_device *dev, u32 *flags) } } - if (req & BNXT_FW_RESET_AP) { + if (!BNXT_CHIP_P4_PLUS(bp) && (req & BNXT_FW_RESET_AP)) { /* This feature is not supported in older firmware versions */ if (bp->hwrm_spec_code >= 0x10803) { if (!bnxt_firmware_reset_ap(dev)) { From patchwork Wed Jun 7 07:54:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13270120 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49AA679F7 for ; Wed, 7 Jun 2023 07:54:48 +0000 (UTC) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAEC8AA for ; Wed, 7 Jun 2023 00:54:46 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-3f86b426371so36847361cf.2 for ; Wed, 07 Jun 2023 00:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686124486; x=1688716486; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ShfgLXpfqQqI3OlrtyH1zehmhMcHSWoyygIdkOp/ypo=; b=M/A5Ce+Wwu0DpO+we/LwDiDMGS3Xl77MgvBcB/OTUfh//atBcnYPX/9mINmZhYKl/v U40cXvlZXFfQIKhVfXyc9v6Edu/aaSdb+TaHiv8haprSGG/mP2w7WI7/UqbL5lVUiV9o F43T7X1Z95FRW+kjWjJXTOPaetYzOnsvZZkwQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686124486; x=1688716486; h=mime-version: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=ShfgLXpfqQqI3OlrtyH1zehmhMcHSWoyygIdkOp/ypo=; b=PGcNgTXtsQC1vQQ9V15KCTw3cJNzleFZdXI+S9yRf4de1ybIqa3BcI8d7mbWHOxv/W gKsKueqC3OwZxerttckANBFOoi6S3L2E+ZDccRrTrGs0E/Y6PxcKwgQBtHru7/Xvi4RY Oa7VUH+1EL7vVjIwaJjbDBuX52G2lnzhqtJ0Olo+WdTOn8WLnufYqqLyUd7r16SBnhUH vt18U8EONYXkF+Ukrw9N2yau0z/4gIUiCeSy7A2Wt43m9rnFom4hvOu0KNnxiwrvYbUz +xY+7CZ8EDMVct8spd4+LdqyKDXAOamvfYfqK1otDTgGJ22C8VErF912HsoHY5I26i+M 7uig== X-Gm-Message-State: AC+VfDxfRGjPXT5/KqfZBvN7Ys/RZq2tJh12bZqhbdTudPAViq/SASy0 XYA+pzEIFV9RgSUmCVaq/N8Kyw== X-Google-Smtp-Source: ACHHUZ7h/nwqbtKK8RilkYV1grkVhDcruwvI3nlNGmlqGz7ebFl9gxeK3RfSyw4aLv4n3lLRBYKe/g== X-Received: by 2002:ac8:7f4a:0:b0:3f7:f60c:7806 with SMTP id g10-20020ac87f4a000000b003f7f60c7806mr2949292qtk.12.1686124485716; Wed, 07 Jun 2023 00:54:45 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id cs12-20020ad44c4c000000b00626362f1bf1sm5850817qvb.63.2023.06.07.00.54.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2023 00:54:45 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Somnath Kotur , Pavan Chebbi Subject: [PATCH net 3/6] bnxt_en: Query default VLAN before VNIC setup on a VF Date: Wed, 7 Jun 2023 00:54:06 -0700 Message-Id: <20230607075409.228450-4-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230607075409.228450-1-michael.chan@broadcom.com> References: <20230607075409.228450-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Somnath Kotur We need to call bnxt_hwrm_func_qcfg() on a VF to query the default VLAN that may be setup by the PF. If a default VLAN is enabled, the VF cannot support VLAN acceleration on the receive side and the VNIC must be setup to strip out the default VLAN tag. If a default VLAN is not enabled, the VF can support VLAN acceleration on the receive side. The VNIC should be set up to strip or not strip the VLAN based on the RX VLAN acceleration setting. Without this call to determine the default VLAN before calling bnxt_setup_vnic(), the VNIC may not be set up correctly. For example, bnxt_setup_vnic() may set up to strip the VLAN tag based on stale default VLAN information. If RX VLAN acceleration is not enabled, the VLAN tag will be incorrectly stripped and the RX data path will not work correctly. Fixes: cf6645f8ebc6 ("bnxt_en: Add function for VF driver to query default VLAN.") Reviewed-by: Pavan Chebbi Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 4aa490cb2fe0..2d39b43ee7cd 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -8813,6 +8813,9 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init) goto err_out; } + if (BNXT_VF(bp)) + bnxt_hwrm_func_qcfg(bp); + rc = bnxt_setup_vnic(bp, 0); if (rc) goto err_out; From patchwork Wed Jun 7 07:54:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13270121 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F95D8BE7 for ; Wed, 7 Jun 2023 07:54:50 +0000 (UTC) Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E882D12C for ; Wed, 7 Jun 2023 00:54:48 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-62b69b95a33so6608366d6.0 for ; Wed, 07 Jun 2023 00:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686124488; x=1688716488; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=GRAWd5TgIlg3a1V00WobIR052JIKpWNHFDlf8mAf2dU=; b=hrqO19W4ECOHk7KW85jKiLaJEVz21WymK/r0rbHF7pn1i2+1wYHjkNx3kBnXLcAs7l tVEvU647BLdDARc6ZOKIbUkPpQKeQ0hPxPVQgIYX1AOc+U1Ot0qf3gpjLE02MS31xhfC qGCGmQmlNjbc+zFMn4SK0vxATmOCLh8jVAF2M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686124488; x=1688716488; h=mime-version: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=GRAWd5TgIlg3a1V00WobIR052JIKpWNHFDlf8mAf2dU=; b=ML3wgTjLYwzXnpof0Qs1s9+u+zkkxlepClfs72BOyy+rTHK8t/FshNHtf0itmZgwR8 q/UWpLEDLj7iyrYZuzhuoHwHVJPvxDRa/PYWZ/jT6KQmY5g+GTn3Fmf8CbkgN1Awee7Y 5ZCuEMm1DaJod+EtEpueFJ1duzUTMpjJ0MpBYy0Aqnjw6p5rUorvqYHgEFmkYDqSzTOe wrS+0K+q8ADzF0+ffET6QDycGzNHVhUc4Kszv7NB/QRhTbxYDkGJze4vIsYKSz0oJRyx 21jZQZM4wLqjrYjaK6nyZjWhrQMJmwJiwqrcsVyO+x6KmnSq7kBPFmv4Nw1iWTaKfqA9 /NfA== X-Gm-Message-State: AC+VfDz1kd4/oAQml/FR1/AIBW1EtOdoPGRdQhFDKUqcjbsJkm6+7Ext Duig5OB0K+18acHl2HLgMGheFrrpMe2CCTOkW2o= X-Google-Smtp-Source: ACHHUZ6rzCZHgIO4xF42KoW1AsUANe8/+MkTRF/TFlvJXGScCOsq7NnLO+Qvi3wkU2ulLZP/WpWyRA== X-Received: by 2002:a05:6214:21eb:b0:629:78ae:80f8 with SMTP id p11-20020a05621421eb00b0062978ae80f8mr2348156qvj.10.1686124487603; Wed, 07 Jun 2023 00:54:47 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id cs12-20020ad44c4c000000b00626362f1bf1sm5850817qvb.63.2023.06.07.00.54.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2023 00:54:46 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Vikas Gupta , Somnath Kotur , Pavan Chebbi Subject: [PATCH net 4/6] bnxt_en: Skip firmware fatal error recovery if chip is not accessible Date: Wed, 7 Jun 2023 00:54:07 -0700 Message-Id: <20230607075409.228450-5-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230607075409.228450-1-michael.chan@broadcom.com> References: <20230607075409.228450-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Vikas Gupta Driver starts firmware fatal error recovery by detecting heartbeat failure or fw reset count register changing. But these checks are not reliable if the device is not accessible. This can happen while DPC (Downstream Port containment) is in progress. Skip firmware fatal recovery if pci_device_is_present() returns false. Fixes: acfb50e4e773 ("bnxt_en: Add FW fatal devlink_health_reporter.") Reviewed-by: Somnath Kotur Reviewed-by: Pavan Chebbi Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 2d39b43ee7cd..5c8d409d7af8 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11602,6 +11602,7 @@ static void bnxt_tx_timeout(struct net_device *dev, unsigned int txqueue) static void bnxt_fw_health_check(struct bnxt *bp) { struct bnxt_fw_health *fw_health = bp->fw_health; + struct pci_dev *pdev = bp->pdev; u32 val; if (!fw_health->enabled || test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) @@ -11615,7 +11616,7 @@ static void bnxt_fw_health_check(struct bnxt *bp) } val = bnxt_fw_health_readl(bp, BNXT_FW_HEARTBEAT_REG); - if (val == fw_health->last_fw_heartbeat) { + if (val == fw_health->last_fw_heartbeat && pci_device_is_present(pdev)) { fw_health->arrests++; goto fw_reset; } @@ -11623,7 +11624,7 @@ static void bnxt_fw_health_check(struct bnxt *bp) fw_health->last_fw_heartbeat = val; val = bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG); - if (val != fw_health->last_fw_reset_cnt) { + if (val != fw_health->last_fw_reset_cnt && pci_device_is_present(pdev)) { fw_health->discoveries++; goto fw_reset; } From patchwork Wed Jun 7 07:54:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13270122 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D418A8BE7 for ; Wed, 7 Jun 2023 07:54:51 +0000 (UTC) Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54BDEAA for ; Wed, 7 Jun 2023 00:54:50 -0700 (PDT) Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-6261367d2f1so51746836d6.3 for ; Wed, 07 Jun 2023 00:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686124489; x=1688716489; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=fg/Qb98GLEbdpBWb9kRatcISpRG+6EjwC/InVO03vSE=; b=NYAxV6zKT6i8XVq5pk+baLevmSJ0NGvsuSGubst37AzxTM7ID6M9NQRaqNPYRDez4q XMGK2AzptW9Idn+ZWiON3b96Rr2lGZ/4EW52FbT2TiDI7+z0fy5qUJ4eTY2RzRybkG5w 9RwWncqsc6vxIxCZHm+vl55Hha5fHR/aeygA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686124489; x=1688716489; h=mime-version: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=fg/Qb98GLEbdpBWb9kRatcISpRG+6EjwC/InVO03vSE=; b=fBl94VhSdESWc/SAUMU3FElBDfeE0uS0mg+RcgRvHbhdNwUZnxLwwG7CDeDEGc8/kd YJnQl0mHiWO3VHMZN1xCxWTEF1y7POc+PutHhtzrBdCXd0JuHqQ6efN7/bxet/ZAeftD l3fY+0fH6cguDCSsq0J01rKcUccRcMwJUz8IyE3FHPYa4j0vVbEzYfeQK5SMJniurh8e Dtd274rWFMj4sXmXRD0ydu2v3O0ZsXBZi7WyhWBo7/Txa3CaLmYKNN4uJsYj5lzeIayZ c1M91E2EaoSMiFURt3SKMzkS+DuhxD5/bb2LbiKlaKs5yYPLCzRJs2qtkaH6bjY3/OVQ 2Nig== X-Gm-Message-State: AC+VfDxIF3GPgkg3L4yEOiOlk+moKAqP3X0QttYWMksjCRcCL/mFjElU GbWtSZv9xVclw9T96yt+4IIVqg== X-Google-Smtp-Source: ACHHUZ508WKWfuuRS25FtvLLsk0E4B/aD/qOthTS5tME8mcUd5Edjx2mGzokWxHZN43lU19tyueWXg== X-Received: by 2002:ad4:5f8d:0:b0:621:4669:c806 with SMTP id jp13-20020ad45f8d000000b006214669c806mr2449642qvb.37.1686124489235; Wed, 07 Jun 2023 00:54:49 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id cs12-20020ad44c4c000000b00626362f1bf1sm5850817qvb.63.2023.06.07.00.54.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2023 00:54:48 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Pavan Chebbi Subject: [PATCH net 5/6] bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event Date: Wed, 7 Jun 2023 00:54:08 -0700 Message-Id: <20230607075409.228450-6-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230607075409.228450-1-michael.chan@broadcom.com> References: <20230607075409.228450-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Pavan Chebbi The firmware can send PHC_RTC_UPDATE async event on a PF that may not have PTP registered. In such a case, there will be a null pointer deference for bp->ptp_cfg when we try to handle the event. Fix it by not registering for this event with the firmware if !bp->ptp_cfg. Also, check that bp->ptp_cfg is valid before proceeding when we receive the event. Fixes: 8bcf6f04d4a5 ("bnxt_en: Handle async event when the PHC is updated in RTC mode") Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 5c8d409d7af8..c0b0423de338 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -2365,6 +2365,9 @@ static int bnxt_async_event_process(struct bnxt *bp, struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; u64 ns; + if (!ptp) + goto async_event_process_exit; + spin_lock_bh(&ptp->ptp_lock); bnxt_ptp_update_current_time(bp); ns = (((u64)BNXT_EVENT_PHC_RTC_UPDATE(data1) << @@ -4763,6 +4766,9 @@ int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp, unsigned long *bmap, int bmap_size, if (event_id == ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY && !(bp->fw_cap & BNXT_FW_CAP_ERROR_RECOVERY)) continue; + if (event_id == ASYNC_EVENT_CMPL_EVENT_ID_PHC_UPDATE && + !bp->ptp_cfg) + continue; __set_bit(bnxt_async_events_arr[i], async_events_bmap); } if (bmap && bmap_size) { diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c index e46689128e32..f3886710e778 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c @@ -952,6 +952,7 @@ int bnxt_ptp_init(struct bnxt *bp, bool phc_cfg) bnxt_ptp_timecounter_init(bp, true); bnxt_ptp_adjfine_rtc(bp, 0); } + bnxt_hwrm_func_drv_rgtr(bp, NULL, 0, true); ptp->ptp_info = bnxt_ptp_caps; if ((bp->fw_cap & BNXT_FW_CAP_PTP_PPS)) { From patchwork Wed Jun 7 07:54:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13270123 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E2308C17 for ; Wed, 7 Jun 2023 07:54:53 +0000 (UTC) Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D582712C for ; Wed, 7 Jun 2023 00:54:51 -0700 (PDT) Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-6261a25e9b6so54615196d6.0 for ; Wed, 07 Jun 2023 00:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686124491; x=1688716491; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=LRKOglwD3AsGQYSa90njgP9irkgUlrrVJCiqcer2iww=; b=LkMrzPLcYOtSYc2qKLgV5jGPl56Nljwu+BX5ile/RTqz1fNytPtryX8hC10sOWYY+x OaaUsDk0kvSEeSWKyCevDam3G3dCc7P7hyfH+3JWgI68khe7m1JKQWXjThcynPlbxMxn /dDieFWv/9ZrTeO/K8IXrVNeZeYbHp+Z0tW2Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686124491; x=1688716491; h=mime-version: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=LRKOglwD3AsGQYSa90njgP9irkgUlrrVJCiqcer2iww=; b=OPebix8W6veEvkxBmICUMJtjaPeWpKr3XrQ3y1FTISDv+umhgO34k67qDvvi9Ty3Ni Q813GRm9ZmDfTjwhTOCGyn7dDbSmVOfuyYkcluuufA/Eon+r7CrCafFr6GBsMR/Npe47 q+h+C3UYnAE/Lmb9gbr+p2Sge2EUvVSyT8ZnhEX5Wxr6Txx6T/CUHwyB1Fot0XJSPG+y GzECkGGkRP+/OUq8Nge/EhZzEfMKCX82Mgu3FQ4xNHZ7iyQln3AtyS7jHRP25EZwJgMD Dan/YbdsoOmapoEhxIWI+ctNtQb3Um7pTtBokeNAxMVIC0Ctdp1460RVxl5yuhnOtYRc mSaQ== X-Gm-Message-State: AC+VfDzaeg2dsiMLXIPnH8I2H0p9MoNlpC/zdHDnzV2lS+vlpWrSBWrY KesBpvJjT7UaVWA4rHjLeejuUg== X-Google-Smtp-Source: ACHHUZ7iuEv9G2oIvo94cbRUq+NJJN6H9iBE78rJjerQB22xksBpvH0ZKK0AgM4OhJEk2SnjWvrCJQ== X-Received: by 2002:a05:6214:258b:b0:628:6879:ee34 with SMTP id fq11-20020a056214258b00b006286879ee34mr2814201qvb.46.1686124490758; Wed, 07 Jun 2023 00:54:50 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id cs12-20020ad44c4c000000b00626362f1bf1sm5850817qvb.63.2023.06.07.00.54.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2023 00:54:50 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Somnath Kotur , Kalesh Anakkur Purayil Subject: [PATCH net 6/6] bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks Date: Wed, 7 Jun 2023 00:54:09 -0700 Message-Id: <20230607075409.228450-7-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230607075409.228450-1-michael.chan@broadcom.com> References: <20230607075409.228450-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Somnath Kotur As per the new udp tunnel framework, drivers which need to know the details of a port entry (i.e. port type) when it gets deleted should use the .set_port / .unset_port callbacks. Implementing the current .udp_tunnel_sync callback would mean that the deleted tunnel port entry would be all zeros. This used to work on older firmware because it would not check the input when deleting a tunnel port. With newer firmware, the delete will now fail and subsequent tunnel port allocation will fail as a result. Fixes: 442a35a5a7aa ("bnxt: convert to new udp_tunnel_nic infra") Reviewed-by: Kalesh Anakkur Purayil Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 25 ++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index c0b0423de338..d5dc5ee70a48 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -13036,26 +13036,37 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp) #endif /* CONFIG_RFS_ACCEL */ -static int bnxt_udp_tunnel_sync(struct net_device *netdev, unsigned int table) +static int bnxt_udp_tunnel_set_port(struct net_device *netdev, unsigned int table, + unsigned int entry, struct udp_tunnel_info *ti) { struct bnxt *bp = netdev_priv(netdev); - struct udp_tunnel_info ti; unsigned int cmd; - udp_tunnel_nic_get_port(netdev, table, 0, &ti); - if (ti.type == UDP_TUNNEL_TYPE_VXLAN) + if (ti->type == UDP_TUNNEL_TYPE_VXLAN) cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN; else cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE; - if (ti.port) - return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti.port, cmd); + return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti->port, cmd); +} + +static int bnxt_udp_tunnel_unset_port(struct net_device *netdev, unsigned int table, + unsigned int entry, struct udp_tunnel_info *ti) +{ + struct bnxt *bp = netdev_priv(netdev); + unsigned int cmd; + + if (ti->type == UDP_TUNNEL_TYPE_VXLAN) + cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN; + else + cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE; return bnxt_hwrm_tunnel_dst_port_free(bp, cmd); } static const struct udp_tunnel_nic_info bnxt_udp_tunnels = { - .sync_table = bnxt_udp_tunnel_sync, + .set_port = bnxt_udp_tunnel_set_port, + .unset_port = bnxt_udp_tunnel_unset_port, .flags = UDP_TUNNEL_NIC_INFO_MAY_SLEEP | UDP_TUNNEL_NIC_INFO_OPEN_ONLY, .tables = {