@@ -265,6 +265,8 @@ const u16 bnxt_bstore_to_trace[] = {
265265 [BNXT_CTX_CA1 ] = DBG_LOG_BUFFER_FLUSH_REQ_TYPE_CA1_TRACE ,
266266 [BNXT_CTX_CA2 ] = DBG_LOG_BUFFER_FLUSH_REQ_TYPE_CA2_TRACE ,
267267 [BNXT_CTX_RIGP1 ] = DBG_LOG_BUFFER_FLUSH_REQ_TYPE_RIGP1_TRACE ,
268+ [BNXT_CTX_KONG ] = DBG_LOG_BUFFER_FLUSH_REQ_TYPE_AFM_KONG_HWRM_TRACE ,
269+ [BNXT_CTX_QPC ] = DBG_LOG_BUFFER_FLUSH_REQ_TYPE_ERR_QPC_TRACE ,
268270};
269271
270272static struct workqueue_struct * bnxt_pf_wq ;
@@ -6836,7 +6838,7 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)
68366838 req -> dflt_ring_grp = cpu_to_le16 (bp -> grp_info [grp_idx ].fw_grp_id );
68376839 req -> lb_rule = cpu_to_le16 (0xffff );
68386840vnic_mru :
6839- vnic -> mru = bp -> dev -> mtu + ETH_HLEN + VLAN_HLEN ;
6841+ vnic -> mru = bp -> dev -> mtu + VLAN_ETH_HLEN ;
68406842 req -> mru = cpu_to_le16 (vnic -> mru );
68416843
68426844 req -> vnic_id = cpu_to_le16 (vnic -> fw_vnic_id );
@@ -9150,15 +9152,15 @@ static int bnxt_hwrm_func_backing_store_cfg_v2(struct bnxt *bp,
91509152 return rc ;
91519153}
91529154
9153- static int bnxt_backing_store_cfg_v2 (struct bnxt * bp , u32 ena )
9155+ static int bnxt_backing_store_cfg_v2 (struct bnxt * bp )
91549156{
91559157 struct bnxt_ctx_mem_info * ctx = bp -> ctx ;
91569158 struct bnxt_ctx_mem_type * ctxm ;
91579159 u16 last_type = BNXT_CTX_INV ;
91589160 int rc = 0 ;
91599161 u16 type ;
91609162
9161- for (type = BNXT_CTX_SRT ; type <= BNXT_CTX_RIGP1 ; type ++ ) {
9163+ for (type = BNXT_CTX_SRT ; type <= BNXT_CTX_QPC ; type ++ ) {
91629164 ctxm = & ctx -> ctx_arr [type ];
91639165 if (!bnxt_bs_trace_avail (bp , type ))
91649166 continue ;
@@ -9176,12 +9178,13 @@ static int bnxt_backing_store_cfg_v2(struct bnxt *bp, u32 ena)
91769178 }
91779179
91789180 if (last_type == BNXT_CTX_INV ) {
9179- if (!ena )
9181+ for (type = 0 ; type < BNXT_CTX_MAX ; type ++ ) {
9182+ ctxm = & ctx -> ctx_arr [type ];
9183+ if (ctxm -> mem_valid )
9184+ last_type = type ;
9185+ }
9186+ if (last_type == BNXT_CTX_INV )
91809187 return 0 ;
9181- else if (ena & FUNC_BACKING_STORE_CFG_REQ_ENABLES_TIM )
9182- last_type = BNXT_CTX_MAX - 1 ;
9183- else
9184- last_type = BNXT_CTX_L2_MAX - 1 ;
91859188 }
91869189 ctx -> ctx_arr [last_type ].last = 1 ;
91879190
@@ -9308,6 +9311,10 @@ static int bnxt_alloc_ctx_mem(struct bnxt *bp)
93089311 if (!ctx || (ctx -> flags & BNXT_CTX_FLAG_INITED ))
93099312 return 0 ;
93109313
9314+ ena = 0 ;
9315+ if (!(bp -> flags & BNXT_FLAG_CHIP_P5_PLUS ))
9316+ goto skip_legacy ;
9317+
93119318 ctxm = & ctx -> ctx_arr [BNXT_CTX_QP ];
93129319 l2_qps = ctxm -> qp_l2_entries ;
93139320 qp1_qps = ctxm -> qp_qp1_entries ;
@@ -9316,7 +9323,6 @@ static int bnxt_alloc_ctx_mem(struct bnxt *bp)
93169323 ctxm = & ctx -> ctx_arr [BNXT_CTX_SRQ ];
93179324 srqs = ctxm -> srq_l2_entries ;
93189325 max_srqs = ctxm -> max_entries ;
9319- ena = 0 ;
93209326 if ((bp -> flags & BNXT_FLAG_ROCE_CAP ) && !is_kdump_kernel ()) {
93219327 pg_lvl = 2 ;
93229328 if (BNXT_SW_RES_LMT (bp )) {
@@ -9410,8 +9416,9 @@ static int bnxt_alloc_ctx_mem(struct bnxt *bp)
94109416 ena |= FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_SP << i ;
94119417 ena |= FUNC_BACKING_STORE_CFG_REQ_DFLT_ENABLES ;
94129418
9419+ skip_legacy :
94139420 if (bp -> fw_cap & BNXT_FW_CAP_BACKING_STORE_V2 )
9414- rc = bnxt_backing_store_cfg_v2 (bp , ena );
9421+ rc = bnxt_backing_store_cfg_v2 (bp );
94159422 else
94169423 rc = bnxt_hwrm_func_backing_store_cfg (bp , ena );
94179424 if (rc ) {
@@ -9625,10 +9632,10 @@ static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
96259632
96269633static int __bnxt_hwrm_func_qcaps (struct bnxt * bp )
96279634{
9635+ u32 flags , flags_ext , flags_ext2 , flags_ext3 ;
9636+ struct bnxt_hw_resc * hw_resc = & bp -> hw_resc ;
96289637 struct hwrm_func_qcaps_output * resp ;
96299638 struct hwrm_func_qcaps_input * req ;
9630- struct bnxt_hw_resc * hw_resc = & bp -> hw_resc ;
9631- u32 flags , flags_ext , flags_ext2 ;
96329639 int rc ;
96339640
96349641 rc = hwrm_req_init (bp , req , HWRM_FUNC_QCAPS );
@@ -9695,6 +9702,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
96959702 (flags_ext2 & FUNC_QCAPS_RESP_FLAGS_EXT2_ROCE_VF_RESOURCE_MGMT_SUPPORTED ))
96969703 bp -> fw_cap |= BNXT_FW_CAP_ROCE_VF_RESC_MGMT_SUPPORTED ;
96979704
9705+ flags_ext3 = le32_to_cpu (resp -> flags_ext3 );
9706+ if (flags_ext3 & FUNC_QCAPS_RESP_FLAGS_EXT3_ROCE_VF_DYN_ALLOC_SUPPORT )
9707+ bp -> fw_cap |= BNXT_FW_CAP_ROCE_VF_DYN_ALLOC_SUPPORT ;
9708+
96989709 bp -> tx_push_thresh = 0 ;
96999710 if ((flags & FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED ) &&
97009711 BNXT_FW_MAJ (bp ) > 217 )
@@ -14737,6 +14748,23 @@ static bool bnxt_fw_pre_resv_vnics(struct bnxt *bp)
1473714748 return false;
1473814749}
1473914750
14751+ static void bnxt_hwrm_pfcwd_qcaps (struct bnxt * bp )
14752+ {
14753+ struct hwrm_queue_pfcwd_timeout_qcaps_output * resp ;
14754+ struct hwrm_queue_pfcwd_timeout_qcaps_input * req ;
14755+ int rc ;
14756+
14757+ bp -> max_pfcwd_tmo_ms = 0 ;
14758+ rc = hwrm_req_init (bp , req , HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS );
14759+ if (rc )
14760+ return ;
14761+ resp = hwrm_req_hold (bp , req );
14762+ rc = hwrm_req_send_silent (bp , req );
14763+ if (!rc )
14764+ bp -> max_pfcwd_tmo_ms = le16_to_cpu (resp -> max_pfcwd_timeout );
14765+ hwrm_req_drop (bp , req );
14766+ }
14767+
1474014768static int bnxt_fw_init_one_p1 (struct bnxt * bp )
1474114769{
1474214770 int rc ;
@@ -14814,6 +14842,7 @@ static int bnxt_fw_init_one_p2(struct bnxt *bp)
1481414842 if (bnxt_fw_pre_resv_vnics (bp ))
1481514843 bp -> fw_cap |= BNXT_FW_CAP_PRE_RESV_VNICS ;
1481614844
14845+ bnxt_hwrm_pfcwd_qcaps (bp );
1481714846 bnxt_hwrm_func_qcfg (bp );
1481814847 bnxt_hwrm_vnic_qcaps (bp );
1481914848 bnxt_hwrm_port_led_qcaps (bp );
@@ -16075,7 +16104,7 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
1607516104 napi_enable_locked (& bnapi -> napi );
1607616105 bnxt_db_nq_arm (bp , & cpr -> cp_db , cpr -> cp_raw_cons );
1607716106
16078- mru = bp -> dev -> mtu + ETH_HLEN + VLAN_HLEN ;
16107+ mru = bp -> dev -> mtu + VLAN_ETH_HLEN ;
1607916108 for (i = 0 ; i < bp -> nr_vnics ; i ++ ) {
1608016109 vnic = & bp -> vnic_info [i ];
1608116110
@@ -16156,7 +16185,7 @@ static void bnxt_remove_one(struct pci_dev *pdev)
1615616185 struct bnxt * bp = netdev_priv (dev );
1615716186
1615816187 if (BNXT_PF (bp ))
16159- bnxt_sriov_disable (bp );
16188+ __bnxt_sriov_disable (bp );
1616016189
1616116190 bnxt_rdma_aux_device_del (bp );
1616216191
0 commit comments