From: Kalesh AP Date: Mon, 31 May 2021 07:26:42 +0000 (+0530) Subject: net/bnxt: fix check for PTP support in FW X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a642112c91246b035dfa6d6f5bc52b0603c44952;p=dpdk.git net/bnxt: fix check for PTP support in FW On Thor, driver must use HWRM to access the timestamp information. Driver should not advertise PTP support to application if PTP information is not available via HWRM commands. Fixes: 6cbd89f9f3d8 ("net/bnxt: support PTP for Thor") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index c6c0af28cb..a65ac6c0ec 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -750,9 +750,13 @@ static int bnxt_hwrm_ptp_qcfg(struct bnxt *bp) HWRM_CHECK_RESULT(); - if (!BNXT_CHIP_P5(bp) && - !(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS)) - return 0; + if (BNXT_CHIP_P5(bp)) { + if (!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_HWRM_ACCESS)) + return 0; + } else { + if (!(resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_DIRECT_ACCESS)) + return 0; + } if (resp->flags & HWRM_PORT_MAC_PTP_QCFG_OUTPUT_FLAGS_ONE_STEP_TX_TS) bp->flags |= BNXT_FLAG_FW_CAP_ONE_STEP_TX_TS;