From: Pavan Chebbi <pavan.chebbi@broadcom.com>
To: michael.chan@broadcom.com, kuba@kernel.org
Cc: davem@davemloft.net, edumazet@google.com, gospo@broadcom.com,
netdev@vger.kernel.org, pabeni@redhat.com,
richardcochran@gmail.com,
Pavan Chebbi <pavan.chebbi@broadcom.com>
Subject: [PATCH net-next v2 2/3] bnxt: Defer PTP initialization to after querying function caps
Date: Tue, 21 Mar 2023 07:44:48 -0700 [thread overview]
Message-ID: <20230321144449.15289-3-pavan.chebbi@broadcom.com> (raw)
In-Reply-To: <20230321144449.15289-1-pavan.chebbi@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 2009 bytes --]
Driver uses the flag BNXT_FLAG_MULTI_HOST to determine whether
to use non-realtime mode PHC when running on a multi host NIC.
However when ptp initializes on a NIC with shared PHC, we still
don't have this flag set yet because HWRM_FUNC_QCFG is issued
much later.
Move the ptp initialization code after we have issued func_qcfg.
The next patch will use the BNXT_FLAG_MULTI_HOST flag during PTP
initialization.
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +++-
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index f533a8f46217..656a28ac2ff0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -7769,7 +7769,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
if (flags & FUNC_QCAPS_RESP_FLAGS_WOL_MAGICPKT_SUPPORTED)
bp->flags |= BNXT_FLAG_WOL_CAP;
if (flags & FUNC_QCAPS_RESP_FLAGS_PTP_SUPPORTED) {
- __bnxt_hwrm_ptp_qcfg(bp);
+ bp->fw_cap |= BNXT_FW_CAP_PTP;
} else {
bnxt_ptp_clear(bp);
kfree(bp->ptp_cfg);
@@ -12298,6 +12298,8 @@ static int bnxt_fw_init_one_p2(struct bnxt *bp)
bnxt_hwrm_vnic_qcaps(bp);
bnxt_hwrm_port_led_qcaps(bp);
bnxt_ethtool_init(bp);
+ if (bp->fw_cap & BNXT_FW_CAP_PTP)
+ __bnxt_hwrm_ptp_qcfg(bp);
bnxt_dcb_init(bp);
return 0;
}
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index d7eb0d244f42..0eeaed95a4ac 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1996,6 +1996,7 @@ struct bnxt {
#define BNXT_FW_CAP_HOT_RESET_IF BIT_ULL(29)
#define BNXT_FW_CAP_RING_MONITOR BIT_ULL(30)
#define BNXT_FW_CAP_DBG_QCAPS BIT_ULL(31)
+ #define BNXT_FW_CAP_PTP BIT_ULL(32)
u32 fw_dbg_cap;
--
2.39.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
next prev parent reply other threads:[~2023-03-21 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 14:44 [PATCH net-next v2 0/3] bnxt PTP optimizations Pavan Chebbi
2023-03-21 14:44 ` [PATCH net-next v2 1/3] bnxt: Change fw_cap to u64 to accommodate more capability bits Pavan Chebbi
2023-03-21 14:44 ` Pavan Chebbi [this message]
2023-03-21 14:44 ` [PATCH net-next v2 3/3] bnxt: Enforce PTP software freq adjustments only when in non-RTC mode Pavan Chebbi
2023-03-21 19:24 ` [PATCH net-next v2 0/3] bnxt PTP optimizations Jakub Kicinski
2023-03-22 5:54 ` Pavan Chebbi
2023-03-22 15:29 ` Vadim Fedorenko
2023-03-23 3:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230321144449.15289-3-pavan.chebbi@broadcom.com \
--to=pavan.chebbi@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gospo@broadcom.com \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).