Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'bnxt-ptp-optimizations'

Pavan Chebbi says:

====================
bnxt PTP optimizations

Patches to
1. Enforce software based freq adjustments only on shared PHC NIC

2. A prerequisite change to expand capability storage field to
accommodate more Firmware reported capabilities
====================

Link: https://lore.kernel.org/r/20230321144449.15289-1-pavan.chebbi@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+42 -33
+3 -1
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 7769 7769 if (flags & FUNC_QCAPS_RESP_FLAGS_WOL_MAGICPKT_SUPPORTED) 7770 7770 bp->flags |= BNXT_FLAG_WOL_CAP; 7771 7771 if (flags & FUNC_QCAPS_RESP_FLAGS_PTP_SUPPORTED) { 7772 - __bnxt_hwrm_ptp_qcfg(bp); 7772 + bp->fw_cap |= BNXT_FW_CAP_PTP; 7773 7773 } else { 7774 7774 bnxt_ptp_clear(bp); 7775 7775 kfree(bp->ptp_cfg); ··· 12298 12298 bnxt_hwrm_vnic_qcaps(bp); 12299 12299 bnxt_hwrm_port_led_qcaps(bp); 12300 12300 bnxt_ethtool_init(bp); 12301 + if (bp->fw_cap & BNXT_FW_CAP_PTP) 12302 + __bnxt_hwrm_ptp_qcfg(bp); 12301 12303 bnxt_dcb_init(bp); 12302 12304 return 0; 12303 12305 }
+29 -28
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 1968 1968 1969 1969 u32 msg_enable; 1970 1970 1971 - u32 fw_cap; 1972 - #define BNXT_FW_CAP_SHORT_CMD 0x00000001 1973 - #define BNXT_FW_CAP_LLDP_AGENT 0x00000002 1974 - #define BNXT_FW_CAP_DCBX_AGENT 0x00000004 1975 - #define BNXT_FW_CAP_NEW_RM 0x00000008 1976 - #define BNXT_FW_CAP_IF_CHANGE 0x00000010 1977 - #define BNXT_FW_CAP_KONG_MB_CHNL 0x00000080 1978 - #define BNXT_FW_CAP_OVS_64BIT_HANDLE 0x00000400 1979 - #define BNXT_FW_CAP_TRUSTED_VF 0x00000800 1980 - #define BNXT_FW_CAP_ERROR_RECOVERY 0x00002000 1981 - #define BNXT_FW_CAP_PKG_VER 0x00004000 1982 - #define BNXT_FW_CAP_CFA_ADV_FLOW 0x00008000 1983 - #define BNXT_FW_CAP_CFA_RFS_RING_TBL_IDX_V2 0x00010000 1984 - #define BNXT_FW_CAP_PCIE_STATS_SUPPORTED 0x00020000 1985 - #define BNXT_FW_CAP_EXT_STATS_SUPPORTED 0x00040000 1986 - #define BNXT_FW_CAP_RSS_HASH_TYPE_DELTA 0x00080000 1987 - #define BNXT_FW_CAP_ERR_RECOVER_RELOAD 0x00100000 1988 - #define BNXT_FW_CAP_HOT_RESET 0x00200000 1989 - #define BNXT_FW_CAP_PTP_RTC 0x00400000 1990 - #define BNXT_FW_CAP_RX_ALL_PKT_TS 0x00800000 1991 - #define BNXT_FW_CAP_VLAN_RX_STRIP 0x01000000 1992 - #define BNXT_FW_CAP_VLAN_TX_INSERT 0x02000000 1993 - #define BNXT_FW_CAP_EXT_HW_STATS_SUPPORTED 0x04000000 1994 - #define BNXT_FW_CAP_LIVEPATCH 0x08000000 1995 - #define BNXT_FW_CAP_PTP_PPS 0x10000000 1996 - #define BNXT_FW_CAP_HOT_RESET_IF 0x20000000 1997 - #define BNXT_FW_CAP_RING_MONITOR 0x40000000 1998 - #define BNXT_FW_CAP_DBG_QCAPS 0x80000000 1971 + u64 fw_cap; 1972 + #define BNXT_FW_CAP_SHORT_CMD BIT_ULL(0) 1973 + #define BNXT_FW_CAP_LLDP_AGENT BIT_ULL(1) 1974 + #define BNXT_FW_CAP_DCBX_AGENT BIT_ULL(2) 1975 + #define BNXT_FW_CAP_NEW_RM BIT_ULL(3) 1976 + #define BNXT_FW_CAP_IF_CHANGE BIT_ULL(4) 1977 + #define BNXT_FW_CAP_KONG_MB_CHNL BIT_ULL(7) 1978 + #define BNXT_FW_CAP_OVS_64BIT_HANDLE BIT_ULL(10) 1979 + #define BNXT_FW_CAP_TRUSTED_VF BIT_ULL(11) 1980 + #define BNXT_FW_CAP_ERROR_RECOVERY BIT_ULL(13) 1981 + #define BNXT_FW_CAP_PKG_VER BIT_ULL(14) 1982 + #define BNXT_FW_CAP_CFA_ADV_FLOW BIT_ULL(15) 1983 + #define BNXT_FW_CAP_CFA_RFS_RING_TBL_IDX_V2 BIT_ULL(16) 1984 + #define BNXT_FW_CAP_PCIE_STATS_SUPPORTED BIT_ULL(17) 1985 + #define BNXT_FW_CAP_EXT_STATS_SUPPORTED BIT_ULL(18) 1986 + #define BNXT_FW_CAP_RSS_HASH_TYPE_DELTA BIT_ULL(19) 1987 + #define BNXT_FW_CAP_ERR_RECOVER_RELOAD BIT_ULL(20) 1988 + #define BNXT_FW_CAP_HOT_RESET BIT_ULL(21) 1989 + #define BNXT_FW_CAP_PTP_RTC BIT_ULL(22) 1990 + #define BNXT_FW_CAP_RX_ALL_PKT_TS BIT_ULL(23) 1991 + #define BNXT_FW_CAP_VLAN_RX_STRIP BIT_ULL(24) 1992 + #define BNXT_FW_CAP_VLAN_TX_INSERT BIT_ULL(25) 1993 + #define BNXT_FW_CAP_EXT_HW_STATS_SUPPORTED BIT_ULL(26) 1994 + #define BNXT_FW_CAP_LIVEPATCH BIT_ULL(27) 1995 + #define BNXT_FW_CAP_PTP_PPS BIT_ULL(28) 1996 + #define BNXT_FW_CAP_HOT_RESET_IF BIT_ULL(29) 1997 + #define BNXT_FW_CAP_RING_MONITOR BIT_ULL(30) 1998 + #define BNXT_FW_CAP_DBG_QCAPS BIT_ULL(31) 1999 + #define BNXT_FW_CAP_PTP BIT_ULL(32) 1999 2000 2000 2001 u32 fw_dbg_cap; 2001 2002
+10 -4
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
··· 230 230 ptp_info); 231 231 struct bnxt *bp = ptp->bp; 232 232 233 - if (BNXT_PTP_USE_RTC(bp)) 233 + if (!BNXT_MH(bp)) 234 234 return bnxt_ptp_adjfine_rtc(bp, scaled_ppm); 235 235 236 236 spin_lock_bh(&ptp->ptp_lock); ··· 861 861 memset(&ptp->cc, 0, sizeof(ptp->cc)); 862 862 ptp->cc.read = bnxt_cc_read; 863 863 ptp->cc.mask = CYCLECOUNTER_MASK(48); 864 - ptp->cc.shift = BNXT_CYCLES_SHIFT; 865 - ptp->cc.mult = clocksource_khz2mult(BNXT_DEVCLK_FREQ, ptp->cc.shift); 866 - ptp->cmult = ptp->cc.mult; 864 + if (BNXT_MH(bp)) { 865 + /* Use timecounter based non-real time mode */ 866 + ptp->cc.shift = BNXT_CYCLES_SHIFT; 867 + ptp->cc.mult = clocksource_khz2mult(BNXT_DEVCLK_FREQ, ptp->cc.shift); 868 + ptp->cmult = ptp->cc.mult; 869 + } else { 870 + ptp->cc.shift = 0; 871 + ptp->cc.mult = 1; 872 + } 867 873 ptp->next_overflow_check = jiffies + BNXT_PHC_OVERFLOW_PERIOD; 868 874 } 869 875 if (init_tc)