@@ -203,7 +203,7 @@ bfa_isr_rspq(struct bfa_s *bfa, int qid)
203203 u32 pi , ci ;
204204 struct list_head * waitq ;
205205
206- bfa -> iocfc . hwif . hw_rspq_ack (bfa , qid );
206+ bfa_isr_rspq_ack (bfa , qid );
207207
208208 ci = bfa_rspq_ci (bfa , qid );
209209 pi = bfa_rspq_pi (bfa , qid );
@@ -236,9 +236,7 @@ bfa_isr_reqq(struct bfa_s *bfa, int qid)
236236{
237237 struct list_head * waitq ;
238238
239- qid &= (BFI_IOC_MAX_CQS - 1 );
240-
241- bfa -> iocfc .hwif .hw_reqq_ack (bfa , qid );
239+ bfa_isr_reqq_ack (bfa , qid );
242240
243241 /*
244242 * Resume any pending requests in the corresponding reqq.
@@ -296,16 +294,19 @@ bfa_intx(struct bfa_s *bfa)
296294 if (!intr )
297295 return BFA_FALSE ;
298296
297+ qintr = intr & (__HFN_INT_RME_MASK | __HFN_INT_CPE_MASK );
298+ if (qintr )
299+ writel (qintr , bfa -> iocfc .bfa_regs .intr_status );
300+
299301 /*
300302 * RME completion queue interrupt
301303 */
302304 qintr = intr & __HFN_INT_RME_MASK ;
303- writel (qintr , bfa -> iocfc .bfa_regs .intr_status );
304-
305- for (queue = 0 ; queue < BFI_IOC_MAX_CQS_ASIC ; queue ++ ) {
306- if ((intr & (__HFN_INT_RME_Q0 << queue )) && bfa -> queue_process )
307- bfa_isr_rspq (bfa , queue & (BFI_IOC_MAX_CQS - 1 ));
305+ if (qintr && bfa -> queue_process ) {
306+ for (queue = 0 ; queue < BFI_IOC_MAX_CQS ; queue ++ )
307+ bfa_isr_rspq (bfa , queue );
308308 }
309+
309310 intr &= ~qintr ;
310311 if (!intr )
311312 return BFA_TRUE ;
@@ -314,11 +315,9 @@ bfa_intx(struct bfa_s *bfa)
314315 * CPE completion queue interrupt
315316 */
316317 qintr = intr & __HFN_INT_CPE_MASK ;
317- writel (qintr , bfa -> iocfc .bfa_regs .intr_status );
318-
319- for (queue = 0 ; queue < BFI_IOC_MAX_CQS_ASIC ; queue ++ ) {
320- if ((intr & (__HFN_INT_CPE_Q0 << queue )) && bfa -> queue_process )
321- bfa_isr_reqq (bfa , queue & (BFI_IOC_MAX_CQS - 1 ));
318+ if (qintr && bfa -> queue_process ) {
319+ for (queue = 0 ; queue < BFI_IOC_MAX_CQS ; queue ++ )
320+ bfa_isr_reqq (bfa , queue );
322321 }
323322 intr &= ~qintr ;
324323 if (!intr )
@@ -542,7 +541,7 @@ bfa_iocfc_send_cfg(void *bfa_arg)
542541 * dma map IOC configuration itself
543542 */
544543 bfi_h2i_set (cfg_req .mh , BFI_MC_IOCFC , BFI_IOCFC_H2I_CFG_REQ ,
545- bfa_lpuid (bfa ));
544+ bfa_fn_lpu (bfa ));
546545 bfa_dma_be_addr_set (cfg_req .ioc_cfg_dma_addr , iocfc -> cfg_info .pa );
547546
548547 bfa_ioc_mbox_send (& bfa -> ioc , & cfg_req ,
@@ -579,8 +578,8 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
579578 iocfc -> hwif .cpe_vec_q0 = BFI_MSIX_CPE_QMIN_CT ;
580579 } else {
581580 iocfc -> hwif .hw_reginit = bfa_hwcb_reginit ;
582- iocfc -> hwif .hw_reqq_ack = bfa_hwcb_reqq_ack ;
583- iocfc -> hwif .hw_rspq_ack = bfa_hwcb_rspq_ack ;
581+ iocfc -> hwif .hw_reqq_ack = NULL ;
582+ iocfc -> hwif .hw_rspq_ack = NULL ;
584583 iocfc -> hwif .hw_msix_init = bfa_hwcb_msix_init ;
585584 iocfc -> hwif .hw_msix_ctrl_install = bfa_hwcb_msix_ctrl_install ;
586585 iocfc -> hwif .hw_msix_queue_install = bfa_hwcb_msix_queue_install ;
@@ -597,6 +596,7 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
597596 if (bfa_asic_id_ct2 (bfa_ioc_devid (& bfa -> ioc ))) {
598597 iocfc -> hwif .hw_reginit = bfa_hwct2_reginit ;
599598 iocfc -> hwif .hw_isr_mode_set = NULL ;
599+ iocfc -> hwif .hw_rspq_ack = NULL ;
600600 }
601601
602602 iocfc -> hwif .hw_reginit (bfa );
@@ -701,7 +701,7 @@ bfa_iocfc_start_submod(struct bfa_s *bfa)
701701
702702 bfa -> queue_process = BFA_TRUE ;
703703 for (i = 0 ; i < BFI_IOC_MAX_CQS ; i ++ )
704- bfa -> iocfc . hwif . hw_rspq_ack (bfa , i );
704+ bfa_isr_rspq_ack (bfa , i );
705705
706706 for (i = 0 ; hal_mods [i ]; i ++ )
707707 hal_mods [i ]-> start (bfa );
@@ -768,6 +768,7 @@ bfa_iocfc_qreg(struct bfa_s *bfa, struct bfi_iocfc_qreg_s *qreg)
768768 void __iomem * kva = bfa_ioc_bar0 (& bfa -> ioc );
769769
770770 for (i = 0 ; i < BFI_IOC_MAX_CQS ; i ++ ) {
771+ bfa -> iocfc .hw_qid [i ] = qreg -> hw_qid [i ];
771772 r -> cpe_q_ci [i ] = kva + be32_to_cpu (qreg -> cpe_q_ci_off [i ]);
772773 r -> cpe_q_pi [i ] = kva + be32_to_cpu (qreg -> cpe_q_pi_off [i ]);
773774 r -> cpe_q_ctrl [i ] = kva + be32_to_cpu (qreg -> cpe_qctl_off [i ]);
@@ -777,6 +778,16 @@ bfa_iocfc_qreg(struct bfa_s *bfa, struct bfi_iocfc_qreg_s *qreg)
777778 }
778779}
779780
781+ static void
782+ bfa_iocfc_res_recfg (struct bfa_s * bfa , struct bfa_iocfc_fwcfg_s * fwcfg )
783+ {
784+ bfa_fcxp_res_recfg (bfa , fwcfg -> num_fcxp_reqs );
785+ bfa_uf_res_recfg (bfa , fwcfg -> num_uf_bufs );
786+ bfa_rport_res_recfg (bfa , fwcfg -> num_rports );
787+ bfa_fcp_res_recfg (bfa , fwcfg -> num_ioim_reqs );
788+ bfa_tskim_res_recfg (bfa , fwcfg -> num_tskim_reqs );
789+ }
790+
780791/*
781792 * Update BFA configuration from firmware configuration.
782793 */
@@ -802,6 +813,11 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa)
802813 */
803814 bfa_iocfc_qreg (bfa , & cfgrsp -> qreg );
804815
816+ /*
817+ * Re-configure resources as learnt from Firmware
818+ */
819+ bfa_iocfc_res_recfg (bfa , fwcfg );
820+
805821 /*
806822 * Install MSIX queue handlers
807823 */
@@ -880,7 +896,7 @@ bfa_faa_enable(struct bfa_s *bfa, bfa_cb_iocfc_t cbfn, void *cbarg)
880896
881897 memset (& faa_enable_req , 0 , sizeof (struct bfi_faa_en_dis_s ));
882898 bfi_h2i_set (faa_enable_req .mh , BFI_MC_IOCFC ,
883- BFI_IOCFC_H2I_FAA_ENABLE_REQ , bfa_lpuid (bfa ));
899+ BFI_IOCFC_H2I_FAA_ENABLE_REQ , bfa_fn_lpu (bfa ));
884900
885901 bfa_ioc_mbox_send (& bfa -> ioc , & faa_enable_req ,
886902 sizeof (struct bfi_faa_en_dis_s ));
@@ -914,7 +930,7 @@ bfa_faa_disable(struct bfa_s *bfa, bfa_cb_iocfc_t cbfn,
914930
915931 memset (& faa_disable_req , 0 , sizeof (struct bfi_faa_en_dis_s ));
916932 bfi_h2i_set (faa_disable_req .mh , BFI_MC_IOCFC ,
917- BFI_IOCFC_H2I_FAA_DISABLE_REQ , bfa_lpuid (bfa ));
933+ BFI_IOCFC_H2I_FAA_DISABLE_REQ , bfa_fn_lpu (bfa ));
918934
919935 bfa_ioc_mbox_send (& bfa -> ioc , & faa_disable_req ,
920936 sizeof (struct bfi_faa_en_dis_s ));
@@ -944,7 +960,7 @@ bfa_faa_query(struct bfa_s *bfa, struct bfa_faa_attr_s *attr,
944960 iocfc -> faa_args .busy = BFA_TRUE ;
945961 memset (& faa_attr_req , 0 , sizeof (struct bfi_faa_query_s ));
946962 bfi_h2i_set (faa_attr_req .mh , BFI_MC_IOCFC ,
947- BFI_IOCFC_H2I_FAA_QUERY_REQ , bfa_lpuid (bfa ));
963+ BFI_IOCFC_H2I_FAA_QUERY_REQ , bfa_fn_lpu (bfa ));
948964
949965 bfa_ioc_mbox_send (& bfa -> ioc , & faa_attr_req ,
950966 sizeof (struct bfi_faa_query_s ));
@@ -1230,15 +1246,15 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr)
12301246 return BFA_STATUS_DEVBUSY ;
12311247
12321248 bfi_h2i_set (m -> mh , BFI_MC_IOCFC , BFI_IOCFC_H2I_SET_INTR_REQ ,
1233- bfa_lpuid (bfa ));
1249+ bfa_fn_lpu (bfa ));
12341250 m -> coalesce = iocfc -> cfginfo -> intr_attr .coalesce ;
12351251 m -> delay = iocfc -> cfginfo -> intr_attr .delay ;
12361252 m -> latency = iocfc -> cfginfo -> intr_attr .latency ;
12371253
12381254 bfa_trc (bfa , attr -> delay );
12391255 bfa_trc (bfa , attr -> latency );
12401256
1241- bfa_reqq_produce (bfa , BFA_REQQ_IOC );
1257+ bfa_reqq_produce (bfa , BFA_REQQ_IOC , m -> mh );
12421258 return BFA_STATUS_OK ;
12431259}
12441260
0 commit comments