Commit 3fd45980 authored by Krishna Gudipati's avatar Krishna Gudipati Committed by James Bottomley

[SCSI] bfa: Brocade-1860 Fabric Adapter vHBA support.

- Introduced partitioning of the BFA resources.
- Added h/w queue ID in CPE messages, firmware uses h/w queue ID
  from messages to pick a matching RME queue.
- Added message header to bfa_reqq_produce(). h/w queue ID is set
  in the message header and firmware modules use h/w queue ID from
  message header instead of from cpqe event.
- Made changes to allow using all 256 queues of Brocade-1860 asic.
  Previously only a single queue per queue group was used.
- Added function tag to BFI message header. Only used by FC BFI
  messages.  Used to translate host tag to firmware tag. bfa_lpuid()
  is changed to bfa_fn_lpu() that encodes both PCI function and port
  ID in BFI message header.
Signed-off-by: default avatarKrishna Gudipati <kgudipat@brocade.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 10a07379
...@@ -54,7 +54,8 @@ void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m); ...@@ -54,7 +54,8 @@ void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);
((void *)((struct bfi_msg_s *)((__bfa)->iocfc.req_cq_ba[__reqq].kva) \ ((void *)((struct bfi_msg_s *)((__bfa)->iocfc.req_cq_ba[__reqq].kva) \
+ bfa_reqq_pi((__bfa), (__reqq))))) + bfa_reqq_pi((__bfa), (__reqq)))))
#define bfa_reqq_produce(__bfa, __reqq) do { \ #define bfa_reqq_produce(__bfa, __reqq, __mh) do { \
(__mh).mtag.h2i.qid = (__bfa)->iocfc.hw_qid[__reqq];\
(__bfa)->iocfc.req_cq_pi[__reqq]++; \ (__bfa)->iocfc.req_cq_pi[__reqq]++; \
(__bfa)->iocfc.req_cq_pi[__reqq] &= \ (__bfa)->iocfc.req_cq_pi[__reqq] &= \
((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1); \ ((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1); \
...@@ -272,6 +273,7 @@ struct bfa_iocfc_s { ...@@ -272,6 +273,7 @@ struct bfa_iocfc_s {
int action; int action;
u32 req_cq_pi[BFI_IOC_MAX_CQS]; u32 req_cq_pi[BFI_IOC_MAX_CQS];
u32 rsp_cq_ci[BFI_IOC_MAX_CQS]; u32 rsp_cq_ci[BFI_IOC_MAX_CQS];
u8 hw_qid[BFI_IOC_MAX_CQS];
struct bfa_cb_qe_s init_hcb_qe; struct bfa_cb_qe_s init_hcb_qe;
struct bfa_cb_qe_s stop_hcb_qe; struct bfa_cb_qe_s stop_hcb_qe;
struct bfa_cb_qe_s dis_hcb_qe; struct bfa_cb_qe_s dis_hcb_qe;
...@@ -294,8 +296,8 @@ struct bfa_iocfc_s { ...@@ -294,8 +296,8 @@ struct bfa_iocfc_s {
struct bfa_faa_args_s faa_args; struct bfa_faa_args_s faa_args;
}; };
#define bfa_lpuid(__bfa) \ #define bfa_fn_lpu(__bfa) \
bfa_ioc_portid(&(__bfa)->ioc) bfi_fn_lpu(bfa_ioc_pcifn(&(__bfa)->ioc), bfa_ioc_portid(&(__bfa)->ioc))
#define bfa_msix_init(__bfa, __nvecs) \ #define bfa_msix_init(__bfa, __nvecs) \
((__bfa)->iocfc.hwif.hw_msix_init(__bfa, __nvecs)) ((__bfa)->iocfc.hwif.hw_msix_init(__bfa, __nvecs))
#define bfa_msix_ctrl_install(__bfa) \ #define bfa_msix_ctrl_install(__bfa) \
...@@ -304,11 +306,18 @@ struct bfa_iocfc_s { ...@@ -304,11 +306,18 @@ struct bfa_iocfc_s {
((__bfa)->iocfc.hwif.hw_msix_queue_install(__bfa)) ((__bfa)->iocfc.hwif.hw_msix_queue_install(__bfa))
#define bfa_msix_uninstall(__bfa) \ #define bfa_msix_uninstall(__bfa) \
((__bfa)->iocfc.hwif.hw_msix_uninstall(__bfa)) ((__bfa)->iocfc.hwif.hw_msix_uninstall(__bfa))
#define bfa_isr_rspq_ack(__bfa, __queue) do { \
if ((__bfa)->iocfc.hwif.hw_rspq_ack) \
(__bfa)->iocfc.hwif.hw_rspq_ack(__bfa, __queue); \
} while (0)
#define bfa_isr_reqq_ack(__bfa, __queue) do { \
if ((__bfa)->iocfc.hwif.hw_reqq_ack) \
(__bfa)->iocfc.hwif.hw_reqq_ack(__bfa, __queue); \
} while (0)
#define bfa_isr_mode_set(__bfa, __msix) do { \ #define bfa_isr_mode_set(__bfa, __msix) do { \
if ((__bfa)->iocfc.hwif.hw_isr_mode_set) \ if ((__bfa)->iocfc.hwif.hw_isr_mode_set) \
(__bfa)->iocfc.hwif.hw_isr_mode_set(__bfa, __msix); \ (__bfa)->iocfc.hwif.hw_isr_mode_set(__bfa, __msix); \
} while (0) } while (0)
#define bfa_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec) \ #define bfa_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec) \
((__bfa)->iocfc.hwif.hw_msix_getvecs(__bfa, __vecmap, \ ((__bfa)->iocfc.hwif.hw_msix_getvecs(__bfa, __vecmap, \
__nvecs, __maxvec)) __nvecs, __maxvec))
...@@ -340,7 +349,6 @@ void bfa_msix_rspq(struct bfa_s *bfa, int vec); ...@@ -340,7 +349,6 @@ void bfa_msix_rspq(struct bfa_s *bfa, int vec);
void bfa_msix_lpu_err(struct bfa_s *bfa, int vec); void bfa_msix_lpu_err(struct bfa_s *bfa, int vec);
void bfa_hwcb_reginit(struct bfa_s *bfa); void bfa_hwcb_reginit(struct bfa_s *bfa);
void bfa_hwcb_reqq_ack(struct bfa_s *bfa, int rspq);
void bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq); void bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq);
void bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs); void bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs);
void bfa_hwcb_msix_ctrl_install(struct bfa_s *bfa); void bfa_hwcb_msix_ctrl_install(struct bfa_s *bfa);
......
...@@ -203,7 +203,7 @@ bfa_isr_rspq(struct bfa_s *bfa, int qid) ...@@ -203,7 +203,7 @@ bfa_isr_rspq(struct bfa_s *bfa, int qid)
u32 pi, ci; u32 pi, ci;
struct list_head *waitq; struct list_head *waitq;
bfa->iocfc.hwif.hw_rspq_ack(bfa, qid); bfa_isr_rspq_ack(bfa, qid);
ci = bfa_rspq_ci(bfa, qid); ci = bfa_rspq_ci(bfa, qid);
pi = bfa_rspq_pi(bfa, qid); pi = bfa_rspq_pi(bfa, qid);
...@@ -236,9 +236,7 @@ bfa_isr_reqq(struct bfa_s *bfa, int qid) ...@@ -236,9 +236,7 @@ bfa_isr_reqq(struct bfa_s *bfa, int qid)
{ {
struct list_head *waitq; struct list_head *waitq;
qid &= (BFI_IOC_MAX_CQS - 1); bfa_isr_reqq_ack(bfa, qid);
bfa->iocfc.hwif.hw_reqq_ack(bfa, qid);
/* /*
* Resume any pending requests in the corresponding reqq. * Resume any pending requests in the corresponding reqq.
...@@ -296,16 +294,19 @@ bfa_intx(struct bfa_s *bfa) ...@@ -296,16 +294,19 @@ bfa_intx(struct bfa_s *bfa)
if (!intr) if (!intr)
return BFA_FALSE; return BFA_FALSE;
qintr = intr & (__HFN_INT_RME_MASK | __HFN_INT_CPE_MASK);
if (qintr)
writel(qintr, bfa->iocfc.bfa_regs.intr_status);
/* /*
* RME completion queue interrupt * RME completion queue interrupt
*/ */
qintr = intr & __HFN_INT_RME_MASK; qintr = intr & __HFN_INT_RME_MASK;
writel(qintr, bfa->iocfc.bfa_regs.intr_status); if (qintr && bfa->queue_process) {
for (queue = 0; queue < BFI_IOC_MAX_CQS; queue++)
for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue++) { bfa_isr_rspq(bfa, queue);
if ((intr & (__HFN_INT_RME_Q0 << queue)) && bfa->queue_process)
bfa_isr_rspq(bfa, queue & (BFI_IOC_MAX_CQS - 1));
} }
intr &= ~qintr; intr &= ~qintr;
if (!intr) if (!intr)
return BFA_TRUE; return BFA_TRUE;
...@@ -314,11 +315,9 @@ bfa_intx(struct bfa_s *bfa) ...@@ -314,11 +315,9 @@ bfa_intx(struct bfa_s *bfa)
* CPE completion queue interrupt * CPE completion queue interrupt
*/ */
qintr = intr & __HFN_INT_CPE_MASK; qintr = intr & __HFN_INT_CPE_MASK;
writel(qintr, bfa->iocfc.bfa_regs.intr_status); if (qintr && bfa->queue_process) {
for (queue = 0; queue < BFI_IOC_MAX_CQS; queue++)
for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue++) { bfa_isr_reqq(bfa, queue);
if ((intr & (__HFN_INT_CPE_Q0 << queue)) && bfa->queue_process)
bfa_isr_reqq(bfa, queue & (BFI_IOC_MAX_CQS - 1));
} }
intr &= ~qintr; intr &= ~qintr;
if (!intr) if (!intr)
...@@ -542,7 +541,7 @@ bfa_iocfc_send_cfg(void *bfa_arg) ...@@ -542,7 +541,7 @@ bfa_iocfc_send_cfg(void *bfa_arg)
* dma map IOC configuration itself * dma map IOC configuration itself
*/ */
bfi_h2i_set(cfg_req.mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_CFG_REQ, bfi_h2i_set(cfg_req.mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_CFG_REQ,
bfa_lpuid(bfa)); bfa_fn_lpu(bfa));
bfa_dma_be_addr_set(cfg_req.ioc_cfg_dma_addr, iocfc->cfg_info.pa); bfa_dma_be_addr_set(cfg_req.ioc_cfg_dma_addr, iocfc->cfg_info.pa);
bfa_ioc_mbox_send(&bfa->ioc, &cfg_req, 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, ...@@ -579,8 +578,8 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
iocfc->hwif.cpe_vec_q0 = BFI_MSIX_CPE_QMIN_CT; iocfc->hwif.cpe_vec_q0 = BFI_MSIX_CPE_QMIN_CT;
} else { } else {
iocfc->hwif.hw_reginit = bfa_hwcb_reginit; iocfc->hwif.hw_reginit = bfa_hwcb_reginit;
iocfc->hwif.hw_reqq_ack = bfa_hwcb_reqq_ack; iocfc->hwif.hw_reqq_ack = NULL;
iocfc->hwif.hw_rspq_ack = bfa_hwcb_rspq_ack; iocfc->hwif.hw_rspq_ack = NULL;
iocfc->hwif.hw_msix_init = bfa_hwcb_msix_init; iocfc->hwif.hw_msix_init = bfa_hwcb_msix_init;
iocfc->hwif.hw_msix_ctrl_install = bfa_hwcb_msix_ctrl_install; iocfc->hwif.hw_msix_ctrl_install = bfa_hwcb_msix_ctrl_install;
iocfc->hwif.hw_msix_queue_install = bfa_hwcb_msix_queue_install; 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, ...@@ -597,6 +596,7 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
if (bfa_asic_id_ct2(bfa_ioc_devid(&bfa->ioc))) { if (bfa_asic_id_ct2(bfa_ioc_devid(&bfa->ioc))) {
iocfc->hwif.hw_reginit = bfa_hwct2_reginit; iocfc->hwif.hw_reginit = bfa_hwct2_reginit;
iocfc->hwif.hw_isr_mode_set = NULL; iocfc->hwif.hw_isr_mode_set = NULL;
iocfc->hwif.hw_rspq_ack = NULL;
} }
iocfc->hwif.hw_reginit(bfa); iocfc->hwif.hw_reginit(bfa);
...@@ -701,7 +701,7 @@ bfa_iocfc_start_submod(struct bfa_s *bfa) ...@@ -701,7 +701,7 @@ bfa_iocfc_start_submod(struct bfa_s *bfa)
bfa->queue_process = BFA_TRUE; bfa->queue_process = BFA_TRUE;
for (i = 0; i < BFI_IOC_MAX_CQS; i++) for (i = 0; i < BFI_IOC_MAX_CQS; i++)
bfa->iocfc.hwif.hw_rspq_ack(bfa, i); bfa_isr_rspq_ack(bfa, i);
for (i = 0; hal_mods[i]; i++) for (i = 0; hal_mods[i]; i++)
hal_mods[i]->start(bfa); hal_mods[i]->start(bfa);
...@@ -768,6 +768,7 @@ bfa_iocfc_qreg(struct bfa_s *bfa, struct bfi_iocfc_qreg_s *qreg) ...@@ -768,6 +768,7 @@ bfa_iocfc_qreg(struct bfa_s *bfa, struct bfi_iocfc_qreg_s *qreg)
void __iomem *kva = bfa_ioc_bar0(&bfa->ioc); void __iomem *kva = bfa_ioc_bar0(&bfa->ioc);
for (i = 0; i < BFI_IOC_MAX_CQS; i++) { for (i = 0; i < BFI_IOC_MAX_CQS; i++) {
bfa->iocfc.hw_qid[i] = qreg->hw_qid[i];
r->cpe_q_ci[i] = kva + be32_to_cpu(qreg->cpe_q_ci_off[i]); r->cpe_q_ci[i] = kva + be32_to_cpu(qreg->cpe_q_ci_off[i]);
r->cpe_q_pi[i] = kva + be32_to_cpu(qreg->cpe_q_pi_off[i]); r->cpe_q_pi[i] = kva + be32_to_cpu(qreg->cpe_q_pi_off[i]);
r->cpe_q_ctrl[i] = kva + be32_to_cpu(qreg->cpe_qctl_off[i]); 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) ...@@ -777,6 +778,16 @@ bfa_iocfc_qreg(struct bfa_s *bfa, struct bfi_iocfc_qreg_s *qreg)
} }
} }
static void
bfa_iocfc_res_recfg(struct bfa_s *bfa, struct bfa_iocfc_fwcfg_s *fwcfg)
{
bfa_fcxp_res_recfg(bfa, fwcfg->num_fcxp_reqs);
bfa_uf_res_recfg(bfa, fwcfg->num_uf_bufs);
bfa_rport_res_recfg(bfa, fwcfg->num_rports);
bfa_fcp_res_recfg(bfa, fwcfg->num_ioim_reqs);
bfa_tskim_res_recfg(bfa, fwcfg->num_tskim_reqs);
}
/* /*
* Update BFA configuration from firmware configuration. * Update BFA configuration from firmware configuration.
*/ */
...@@ -802,6 +813,11 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa) ...@@ -802,6 +813,11 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa)
*/ */
bfa_iocfc_qreg(bfa, &cfgrsp->qreg); bfa_iocfc_qreg(bfa, &cfgrsp->qreg);
/*
* Re-configure resources as learnt from Firmware
*/
bfa_iocfc_res_recfg(bfa, fwcfg);
/* /*
* Install MSIX queue handlers * Install MSIX queue handlers
*/ */
...@@ -880,7 +896,7 @@ bfa_faa_enable(struct bfa_s *bfa, bfa_cb_iocfc_t cbfn, void *cbarg) ...@@ -880,7 +896,7 @@ bfa_faa_enable(struct bfa_s *bfa, bfa_cb_iocfc_t cbfn, void *cbarg)
memset(&faa_enable_req, 0, sizeof(struct bfi_faa_en_dis_s)); memset(&faa_enable_req, 0, sizeof(struct bfi_faa_en_dis_s));
bfi_h2i_set(faa_enable_req.mh, BFI_MC_IOCFC, bfi_h2i_set(faa_enable_req.mh, BFI_MC_IOCFC,
BFI_IOCFC_H2I_FAA_ENABLE_REQ, bfa_lpuid(bfa)); BFI_IOCFC_H2I_FAA_ENABLE_REQ, bfa_fn_lpu(bfa));
bfa_ioc_mbox_send(&bfa->ioc, &faa_enable_req, bfa_ioc_mbox_send(&bfa->ioc, &faa_enable_req,
sizeof(struct bfi_faa_en_dis_s)); sizeof(struct bfi_faa_en_dis_s));
...@@ -914,7 +930,7 @@ bfa_faa_disable(struct bfa_s *bfa, bfa_cb_iocfc_t cbfn, ...@@ -914,7 +930,7 @@ bfa_faa_disable(struct bfa_s *bfa, bfa_cb_iocfc_t cbfn,
memset(&faa_disable_req, 0, sizeof(struct bfi_faa_en_dis_s)); memset(&faa_disable_req, 0, sizeof(struct bfi_faa_en_dis_s));
bfi_h2i_set(faa_disable_req.mh, BFI_MC_IOCFC, bfi_h2i_set(faa_disable_req.mh, BFI_MC_IOCFC,
BFI_IOCFC_H2I_FAA_DISABLE_REQ, bfa_lpuid(bfa)); BFI_IOCFC_H2I_FAA_DISABLE_REQ, bfa_fn_lpu(bfa));
bfa_ioc_mbox_send(&bfa->ioc, &faa_disable_req, bfa_ioc_mbox_send(&bfa->ioc, &faa_disable_req,
sizeof(struct bfi_faa_en_dis_s)); sizeof(struct bfi_faa_en_dis_s));
...@@ -944,7 +960,7 @@ bfa_faa_query(struct bfa_s *bfa, struct bfa_faa_attr_s *attr, ...@@ -944,7 +960,7 @@ bfa_faa_query(struct bfa_s *bfa, struct bfa_faa_attr_s *attr,
iocfc->faa_args.busy = BFA_TRUE; iocfc->faa_args.busy = BFA_TRUE;
memset(&faa_attr_req, 0, sizeof(struct bfi_faa_query_s)); memset(&faa_attr_req, 0, sizeof(struct bfi_faa_query_s));
bfi_h2i_set(faa_attr_req.mh, BFI_MC_IOCFC, bfi_h2i_set(faa_attr_req.mh, BFI_MC_IOCFC,
BFI_IOCFC_H2I_FAA_QUERY_REQ, bfa_lpuid(bfa)); BFI_IOCFC_H2I_FAA_QUERY_REQ, bfa_fn_lpu(bfa));
bfa_ioc_mbox_send(&bfa->ioc, &faa_attr_req, bfa_ioc_mbox_send(&bfa->ioc, &faa_attr_req,
sizeof(struct bfi_faa_query_s)); sizeof(struct bfi_faa_query_s));
...@@ -1230,7 +1246,7 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr) ...@@ -1230,7 +1246,7 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr)
return BFA_STATUS_DEVBUSY; return BFA_STATUS_DEVBUSY;
bfi_h2i_set(m->mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_SET_INTR_REQ, bfi_h2i_set(m->mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_SET_INTR_REQ,
bfa_lpuid(bfa)); bfa_fn_lpu(bfa));
m->coalesce = iocfc->cfginfo->intr_attr.coalesce; m->coalesce = iocfc->cfginfo->intr_attr.coalesce;
m->delay = iocfc->cfginfo->intr_attr.delay; m->delay = iocfc->cfginfo->intr_attr.delay;
m->latency = iocfc->cfginfo->intr_attr.latency; m->latency = iocfc->cfginfo->intr_attr.latency;
...@@ -1238,7 +1254,7 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr) ...@@ -1238,7 +1254,7 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr)
bfa_trc(bfa, attr->delay); bfa_trc(bfa, attr->delay);
bfa_trc(bfa, attr->latency); bfa_trc(bfa, attr->latency);
bfa_reqq_produce(bfa, BFA_REQQ_IOC); bfa_reqq_produce(bfa, BFA_REQQ_IOC, m->mh);
return BFA_STATUS_OK; return BFA_STATUS_OK;
} }
......
...@@ -340,6 +340,9 @@ bfa_fcpim_iocdisable(struct bfa_fcp_mod_s *fcp) ...@@ -340,6 +340,9 @@ bfa_fcpim_iocdisable(struct bfa_fcp_mod_s *fcp)
struct bfa_itnim_s *itnim; struct bfa_itnim_s *itnim;
struct list_head *qe, *qen; struct list_head *qe, *qen;
/* Enqueue unused ioim resources to free_q */
list_splice_tail_init(&fcpim->tskim_unused_q, &fcpim->tskim_free_q);
list_for_each_safe(qe, qen, &fcpim->itnim_q) { list_for_each_safe(qe, qen, &fcpim->itnim_q) {
itnim = (struct bfa_itnim_s *) qe; itnim = (struct bfa_itnim_s *) qe;
bfa_itnim_iocdisable(itnim); bfa_itnim_iocdisable(itnim);
...@@ -1036,7 +1039,7 @@ bfa_itnim_send_fwcreate(struct bfa_itnim_s *itnim) ...@@ -1036,7 +1039,7 @@ bfa_itnim_send_fwcreate(struct bfa_itnim_s *itnim)
} }
bfi_h2i_set(m->mh, BFI_MC_ITN, BFI_ITN_H2I_CREATE_REQ, bfi_h2i_set(m->mh, BFI_MC_ITN, BFI_ITN_H2I_CREATE_REQ,
bfa_lpuid(itnim->bfa)); bfa_fn_lpu(itnim->bfa));
m->fw_handle = itnim->rport->fw_handle; m->fw_handle = itnim->rport->fw_handle;
m->class = FC_CLASS_3; m->class = FC_CLASS_3;
m->seq_rec = itnim->seq_rec; m->seq_rec = itnim->seq_rec;
...@@ -1046,7 +1049,7 @@ bfa_itnim_send_fwcreate(struct bfa_itnim_s *itnim) ...@@ -1046,7 +1049,7 @@ bfa_itnim_send_fwcreate(struct bfa_itnim_s *itnim)
/* /*
* queue I/O message to firmware * queue I/O message to firmware
*/ */
bfa_reqq_produce(itnim->bfa, itnim->reqq); bfa_reqq_produce(itnim->bfa, itnim->reqq, m->mh);
return BFA_TRUE; return BFA_TRUE;
} }
...@@ -1065,14 +1068,14 @@ bfa_itnim_send_fwdelete(struct bfa_itnim_s *itnim) ...@@ -1065,14 +1068,14 @@ bfa_itnim_send_fwdelete(struct bfa_itnim_s *itnim)
} }
bfi_h2i_set(m->mh, BFI_MC_ITN, BFI_ITN_H2I_DELETE_REQ, bfi_h2i_set(m->mh, BFI_MC_ITN, BFI_ITN_H2I_DELETE_REQ,
bfa_lpuid(itnim->bfa)); bfa_fn_lpu(itnim->bfa));
m->fw_handle = itnim->rport->fw_handle; m->fw_handle = itnim->rport->fw_handle;
bfa_stats(itnim, fw_delete); bfa_stats(itnim, fw_delete);
/* /*
* queue I/O message to firmware * queue I/O message to firmware
*/ */
bfa_reqq_produce(itnim->bfa, itnim->reqq); bfa_reqq_produce(itnim->bfa, itnim->reqq, m->mh);
return BFA_TRUE; return BFA_TRUE;
} }
...@@ -2171,12 +2174,12 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) ...@@ -2171,12 +2174,12 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
*/ */
switch (m->cmnd.iodir) { switch (m->cmnd.iodir) {
case FCP_IODIR_READ: case FCP_IODIR_READ:
bfi_h2i_set(m->mh, BFI_MC_IOIM_READ, 0, bfa_lpuid(ioim->bfa)); bfi_h2i_set(m->mh, BFI_MC_IOIM_READ, 0, bfa_fn_lpu(ioim->bfa));
bfa_stats(itnim, input_reqs); bfa_stats(itnim, input_reqs);
ioim->itnim->stats.rd_throughput += fcp_dl; ioim->itnim->stats.rd_throughput += fcp_dl;
break; break;
case FCP_IODIR_WRITE: case FCP_IODIR_WRITE:
bfi_h2i_set(m->mh, BFI_MC_IOIM_WRITE, 0, bfa_lpuid(ioim->bfa)); bfi_h2i_set(m->mh, BFI_MC_IOIM_WRITE, 0, bfa_fn_lpu(ioim->bfa));
bfa_stats(itnim, output_reqs); bfa_stats(itnim, output_reqs);
ioim->itnim->stats.wr_throughput += fcp_dl; ioim->itnim->stats.wr_throughput += fcp_dl;
break; break;
...@@ -2184,16 +2187,16 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim) ...@@ -2184,16 +2187,16 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
bfa_stats(itnim, input_reqs); bfa_stats(itnim, input_reqs);
bfa_stats(itnim, output_reqs); bfa_stats(itnim, output_reqs);
default: default:
bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa)); bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa));
} }
if (itnim->seq_rec || if (itnim->seq_rec ||
(scsi_bufflen(cmnd) & (sizeof(u32) - 1))) (scsi_bufflen(cmnd) & (sizeof(u32) - 1)))
bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_lpuid(ioim->bfa)); bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa));
/* /*
* queue I/O message to firmware * queue I/O message to firmware
*/ */
bfa_reqq_produce(ioim->bfa, ioim->reqq); bfa_reqq_produce(ioim->bfa, ioim->reqq, m->mh);
return BFA_TRUE; return BFA_TRUE;
} }
...@@ -2251,14 +2254,14 @@ bfa_ioim_send_abort(struct bfa_ioim_s *ioim) ...@@ -2251,14 +2254,14 @@ bfa_ioim_send_abort(struct bfa_ioim_s *ioim)
else else
msgop = BFI_IOIM_H2I_IOCLEANUP_REQ; msgop = BFI_IOIM_H2I_IOCLEANUP_REQ;
bfi_h2i_set(m->mh, BFI_MC_IOIM, msgop, bfa_lpuid(ioim->bfa)); bfi_h2i_set(m->mh, BFI_MC_IOIM, msgop, bfa_fn_lpu(ioim->bfa));
m->io_tag = cpu_to_be16(ioim->iotag); m->io_tag = cpu_to_be16(ioim->iotag);
m->abort_tag = ++ioim->abort_tag; m->abort_tag = ++ioim->abort_tag;
/* /*
* queue I/O message to firmware * queue I/O message to firmware
*/ */
bfa_reqq_produce(ioim->bfa, ioim->reqq); bfa_reqq_produce(ioim->bfa, ioim->reqq, m->mh);
return BFA_TRUE; return BFA_TRUE;
} }
...@@ -2998,7 +3001,7 @@ bfa_tskim_send(struct bfa_tskim_s *tskim) ...@@ -2998,7 +3001,7 @@ bfa_tskim_send(struct bfa_tskim_s *tskim)
* build i/o request message next * build i/o request message next
*/ */
bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_TM_REQ, bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_TM_REQ,
bfa_lpuid(tskim->bfa)); bfa_fn_lpu(tskim->bfa));
m->tsk_tag = cpu_to_be16(tskim->tsk_tag); m->tsk_tag = cpu_to_be16(tskim->tsk_tag);
m->itn_fhdl = tskim->itnim->rport->fw_handle; m->itn_fhdl = tskim->itnim->rport->fw_handle;
...@@ -3009,7 +3012,7 @@ bfa_tskim_send(struct bfa_tskim_s *tskim) ...@@ -3009,7 +3012,7 @@ bfa_tskim_send(struct bfa_tskim_s *tskim)
/* /*
* queue I/O message to firmware * queue I/O message to firmware
*/ */
bfa_reqq_produce(tskim->bfa, itnim->reqq); bfa_reqq_produce(tskim->bfa, itnim->reqq, m->mh);
return BFA_TRUE; return BFA_TRUE;
} }
...@@ -3033,14 +3036,14 @@ bfa_tskim_send_abort(struct bfa_tskim_s *tskim) ...@@ -3033,14 +3036,14 @@ bfa_tskim_send_abort(struct bfa_tskim_s *tskim)
* build i/o request message next * build i/o request message next
*/ */
bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_ABORT_REQ, bfi_h2i_set(m->mh, BFI_MC_TSKIM, BFI_TSKIM_H2I_ABORT_REQ,
bfa_lpuid(tskim->bfa)); bfa_fn_lpu(tskim->bfa));
m->tsk_tag = cpu_to_be16(tskim->tsk_tag); m->tsk_tag = cpu_to_be16(tskim->tsk_tag);
/* /*
* queue I/O message to firmware * queue I/O message to firmware
*/ */
bfa_reqq_produce(tskim->bfa, itnim->reqq); bfa_reqq_produce(tskim->bfa, itnim->reqq, m->mh);
return BFA_TRUE; return BFA_TRUE;
} }
...@@ -3112,6 +3115,7 @@ bfa_tskim_attach(struct bfa_fcpim_s *fcpim, struct bfa_meminfo_s *minfo) ...@@ -3112,6 +3115,7 @@ bfa_tskim_attach(struct bfa_fcpim_s *fcpim, struct bfa_meminfo_s *minfo)
u16 i; u16 i;
INIT_LIST_HEAD(&fcpim->tskim_free_q); INIT_LIST_HEAD(&fcpim->tskim_free_q);
INIT_LIST_HEAD(&fcpim->tskim_unused_q);
tskim = (struct bfa_tskim_s *) bfa_meminfo_kva(minfo); tskim = (struct bfa_tskim_s *) bfa_meminfo_kva(minfo);
fcpim->tskim_arr = tskim; fcpim->tskim_arr = tskim;
...@@ -3211,6 +3215,19 @@ bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim, ...@@ -3211,6 +3215,19 @@ bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim,
bfa_sm_send_event(tskim, BFA_TSKIM_SM_START); bfa_sm_send_event(tskim, BFA_TSKIM_SM_START);
} }
void
bfa_tskim_res_recfg(struct bfa_s *bfa, u16 num_tskim_fw)
{
struct bfa_fcpim_s *fcpim = BFA_FCPIM(bfa);
struct list_head *qe;
int i;
for (i = 0; i < (fcpim->num_tskim_reqs - num_tskim_fw); i++) {
bfa_q_deq_tail(&fcpim->tskim_free_q, &qe);
list_add_tail(qe, &fcpim->tskim_unused_q);
}
}
/* BFA FCP module - parent module for fcpim */ /* BFA FCP module - parent module for fcpim */
BFA_MODULE(fcp); BFA_MODULE(fcp);
...@@ -3303,9 +3320,25 @@ bfa_fcp_iocdisable(struct bfa_s *bfa) ...@@ -3303,9 +3320,25 @@ bfa_fcp_iocdisable(struct bfa_s *bfa)
{ {
struct bfa_fcp_mod_s *fcp = BFA_FCP_MOD(bfa); struct bfa_fcp_mod_s *fcp = BFA_FCP_MOD(bfa);
/* Enqueue unused ioim resources to free_q */
list_splice_tail_init(&fcp->iotag_unused_q, &fcp->iotag_ioim_free_q);
bfa_fcpim_iocdisable(fcp); bfa_fcpim_iocdisable(fcp);
} }
void
bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw)
{
struct bfa_fcp_mod_s *mod = BFA_FCP_MOD(bfa);
struct list_head *qe;
int i;
for (i = 0; i < (mod->num_ioim_reqs - num_ioim_fw); i++) {
bfa_q_deq_tail(&mod->iotag_ioim_free_q, &qe);
list_add_tail(qe, &mod->iotag_unused_q);
}
}
void void
bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport, bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m)) void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m))
...@@ -3347,6 +3380,7 @@ bfa_iotag_attach(struct bfa_fcp_mod_s *fcp, struct bfa_meminfo_s *minfo) ...@@ -3347,6 +3380,7 @@ bfa_iotag_attach(struct bfa_fcp_mod_s *fcp, struct bfa_meminfo_s *minfo)
INIT_LIST_HEAD(&fcp->iotag_ioim_free_q); INIT_LIST_HEAD(&fcp->iotag_ioim_free_q);
INIT_LIST_HEAD(&fcp->iotag_tio_free_q); INIT_LIST_HEAD(&fcp->iotag_tio_free_q);
INIT_LIST_HEAD(&fcp->iotag_unused_q);
num_io_req = fcp->num_ioim_reqs + fcp->num_fwtio_reqs; num_io_req = fcp->num_ioim_reqs + fcp->num_fwtio_reqs;
for (i = 0; i < num_io_req; i++, iotag++) { for (i = 0; i < num_io_req; i++, iotag++) {
......
...@@ -42,6 +42,7 @@ void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport, ...@@ -42,6 +42,7 @@ void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m)); void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
void bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m); void bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m);
void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp, struct bfa_meminfo_s *minfo); void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp, struct bfa_meminfo_s *minfo);
void bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw);
#define BFA_FCP_MOD(_hal) (&(_hal)->modules.fcp_mod) #define BFA_FCP_MOD(_hal) (&(_hal)->modules.fcp_mod)
#define BFA_IOTAG_FROM_TAG(_fcp, _tag) \ #define BFA_IOTAG_FROM_TAG(_fcp, _tag) \
...@@ -118,6 +119,7 @@ struct bfa_fcpim_s { ...@@ -118,6 +119,7 @@ struct bfa_fcpim_s {
struct list_head ioim_resfree_q; /* IOs waiting for f/w */ struct list_head ioim_resfree_q; /* IOs waiting for f/w */
struct list_head ioim_comp_q; /* IO global comp Q */ struct list_head ioim_comp_q; /* IO global comp Q */
struct list_head tskim_free_q; struct list_head tskim_free_q;
struct list_head tskim_unused_q; /* Unused tskim Q */
u32 ios_active; /* current active IOs */ u32 ios_active; /* current active IOs */
u32 delay_comp; u32 delay_comp;
struct bfa_fcpim_del_itn_stats_s del_itn_stats; struct bfa_fcpim_del_itn_stats_s del_itn_stats;
...@@ -132,6 +134,7 @@ struct bfa_fcp_mod_s { ...@@ -132,6 +134,7 @@ struct bfa_fcp_mod_s {
struct bfa_s *bfa; struct bfa_s *bfa;
struct list_head iotag_ioim_free_q; /* free IO resources */ struct list_head iotag_ioim_free_q; /* free IO resources */
struct list_head iotag_tio_free_q; /* free IO resources */ struct list_head iotag_tio_free_q; /* free IO resources */
struct list_head iotag_unused_q; /* unused IO resources*/
struct bfa_iotag_s *iotag_arr; struct bfa_iotag_s *iotag_arr;
struct bfa_itn_s *itn_arr; struct bfa_itn_s *itn_arr;
int num_ioim_reqs; int num_ioim_reqs;
...@@ -270,6 +273,7 @@ void bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); ...@@ -270,6 +273,7 @@ void bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
void bfa_tskim_iodone(struct bfa_tskim_s *tskim); void bfa_tskim_iodone(struct bfa_tskim_s *tskim);
void bfa_tskim_iocdisable(struct bfa_tskim_s *tskim); void bfa_tskim_iocdisable(struct bfa_tskim_s *tskim);
void bfa_tskim_cleanup(struct bfa_tskim_s *tskim); void bfa_tskim_cleanup(struct bfa_tskim_s *tskim);
void bfa_tskim_res_recfg(struct bfa_s *bfa, u16 num_tskim_fw);
void bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len, void bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len,
u32 *dm_len); u32 *dm_len);
......
...@@ -1298,7 +1298,7 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric) ...@@ -1298,7 +1298,7 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric)
bfa_fcport_get_rx_bbcredit(bfa), bfa_fcport_get_rx_bbcredit(bfa),
bfa_fcs_fabric_oper_bbscn(fabric)); bfa_fcs_fabric_oper_bbscn(fabric));
bfa_fcxp_send(fcxp, NULL, fabric->vf_id, fabric->lps->lp_tag, bfa_fcxp_send(fcxp, NULL, fabric->vf_id, fabric->lps->bfa_tag,
BFA_FALSE, FC_CLASS_3, BFA_FALSE, FC_CLASS_3,
reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric, reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric,
FC_MAX_PDUSZ, 0); FC_MAX_PDUSZ, 0);
......
...@@ -898,8 +898,8 @@ bfa_fcs_lport_attach(struct bfa_fcs_lport_s *lport, struct bfa_fcs_s *fcs, ...@@ -898,8 +898,8 @@ bfa_fcs_lport_attach(struct bfa_fcs_lport_s *lport, struct bfa_fcs_s *fcs,
lport->fcs = fcs; lport->fcs = fcs;
lport->fabric = bfa_fcs_vf_lookup(fcs, vf_id); lport->fabric = bfa_fcs_vf_lookup(fcs, vf_id);
lport->vport = vport; lport->vport = vport;
lport->lp_tag = (vport) ? vport->lps->lp_tag : lport->lp_tag = (vport) ? vport->lps->bfa_tag :
lport->fabric->lps->lp_tag; lport->fabric->lps->bfa_tag;
INIT_LIST_HEAD(&lport->rport_q); INIT_LIST_HEAD(&lport->rport_q);
lport->num_rports = 0; lport->num_rports = 0;
......
...@@ -35,11 +35,6 @@ bfa_hwcb_reginit(struct bfa_s *bfa) ...@@ -35,11 +35,6 @@ bfa_hwcb_reginit(struct bfa_s *bfa)
} }
} }
void
bfa_hwcb_reqq_ack(struct bfa_s *bfa, int reqq)
{
}
static void static void
bfa_hwcb_reqq_ack_msix(struct bfa_s *bfa, int reqq) bfa_hwcb_reqq_ack_msix(struct bfa_s *bfa, int reqq)
{ {
...@@ -47,11 +42,6 @@ bfa_hwcb_reqq_ack_msix(struct bfa_s *bfa, int reqq) ...@@ -47,11 +42,6 @@ bfa_hwcb_reqq_ack_msix(struct bfa_s *bfa, int reqq)
bfa->iocfc.bfa_regs.intr_status); bfa->iocfc.bfa_regs.intr_status);
} }
void
bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq)
{
}
static void static void
bfa_hwcb_rspq_ack_msix(struct bfa_s *bfa, int rspq) bfa_hwcb_rspq_ack_msix(struct bfa_s *bfa, int rspq)
{ {
......
...@@ -561,9 +561,9 @@ bfa_ioc_set_ct2_hwif(struct bfa_ioc_s *ioc) ...@@ -561,9 +561,9 @@ bfa_ioc_set_ct2_hwif(struct bfa_ioc_s *ioc)
} }
/* /*
* Temporary workaround for MSI-X resource allocation for catapult-2. * Workaround for MSI-X resource allocation for catapult-2 with no asic block
*/ */
#define HOSTFN_MSIX_DEFAULT 16 #define HOSTFN_MSIX_DEFAULT 64
#define HOSTFN_MSIX_VT_INDEX_MBOX_ERR 0x30138 #define HOSTFN_MSIX_VT_INDEX_MBOX_ERR 0x30138
#define HOSTFN_MSIX_VT_OFST_NUMVT 0x3013c #define HOSTFN_MSIX_VT_OFST_NUMVT 0x3013c
#define __MSIX_VT_NUMVT__MK 0x003ff800 #define __MSIX_VT_NUMVT__MK 0x003ff800
......
This diff is collapsed.
...@@ -93,6 +93,7 @@ struct bfa_fcxp_mod_s { ...@@ -93,6 +93,7 @@ struct bfa_fcxp_mod_s {
void *rsp_pld_list_kva; /* list of FCXP resp pld */ void *rsp_pld_list_kva; /* list of FCXP resp pld */
u64 rsp_pld_list_pa; /* list of FCXP resp pld */ u64 rsp_pld_list_pa; /* list of FCXP resp pld */
struct list_head wait_q; /* wait queue for free fcxp */ struct list_head wait_q; /* wait queue for free fcxp */
struct list_head fcxp_unused_q; /* unused fcxps */
u32 req_pld_sz; u32 req_pld_sz;
u32 rsp_pld_sz; u32 rsp_pld_sz;
}; };
...@@ -238,6 +239,7 @@ struct bfa_rport_mod_s { ...@@ -238,6 +239,7 @@ struct bfa_rport_mod_s {
struct bfa_rport_s *rps_list; /* list of rports */ struct bfa_rport_s *rps_list; /* list of rports */
struct list_head rp_free_q; /* free bfa_rports */ struct list_head rp_free_q; /* free bfa_rports */
struct list_head rp_active_q; /* free bfa_rports */ struct list_head rp_active_q; /* free bfa_rports */
struct list_head rp_unused_q; /* unused bfa rports */
u16 num_rports; /* number of rports */ u16 num_rports; /* number of rports */
}; };
...@@ -254,6 +256,7 @@ struct bfa_rport_mod_s { ...@@ -254,6 +256,7 @@ struct bfa_rport_mod_s {
* protected functions * protected functions
*/ */
void bfa_rport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); void bfa_rport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
void bfa_rport_res_recfg(struct bfa_s *bfa, u16 num_rport_fw);
/* /*
* BFA rport information. * BFA rport information.
...@@ -332,6 +335,7 @@ struct bfa_uf_mod_s { ...@@ -332,6 +335,7 @@ struct bfa_uf_mod_s {
u16 num_ufs; /* num unsolicited rx frames */ u16 num_ufs; /* num unsolicited rx frames */
struct list_head uf_free_q; /* free UFs */ struct list_head uf_free_q; /* free UFs */
struct list_head uf_posted_q; /* UFs posted to IOC */ struct list_head uf_posted_q; /* UFs posted to IOC */
struct list_head uf_unused_q; /* unused UF's */
struct bfa_uf_buf_s *uf_pbs_kva; /* list UF bufs request pld */ struct bfa_uf_buf_s *uf_pbs_kva; /* list UF bufs request pld */
u64 uf_pbs_pa; /* phy addr for UF bufs */ u64 uf_pbs_pa; /* phy addr for UF bufs */
struct bfi_uf_buf_post_s *uf_buf_posts; struct bfi_uf_buf_post_s *uf_buf_posts;
...@@ -346,6 +350,7 @@ struct bfa_uf_mod_s { ...@@ -346,6 +350,7 @@ struct bfa_uf_mod_s {
((_ufmod)->uf_pbs_pa + sizeof(struct bfa_uf_buf_s) * (_uftag)) ((_ufmod)->uf_pbs_pa + sizeof(struct bfa_uf_buf_s) * (_uftag))
void bfa_uf_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); void bfa_uf_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
void bfa_uf_res_recfg(struct bfa_s *bfa, u16 num_uf_fw);
#define BFA_UF_BUFSZ (2 * 1024 + 256) #define BFA_UF_BUFSZ (2 * 1024 + 256)
...@@ -364,7 +369,8 @@ struct bfa_lps_s { ...@@ -364,7 +369,8 @@ struct bfa_lps_s {
struct list_head qe; /* queue element */ struct list_head qe; /* queue element */
struct bfa_s *bfa; /* parent bfa instance */ struct bfa_s *bfa; /* parent bfa instance */
bfa_sm_t sm; /* finite state machine */ bfa_sm_t sm; /* finite state machine */
u8 lp_tag; /* lport tag */ u8 bfa_tag; /* lport tag */
u8 fw_tag; /* lport fw tag */
u8 reqq; /* lport request queue */ u8 reqq; /* lport request queue */
u8 alpa; /* ALPA for loop topologies */ u8 alpa; /* ALPA for loop topologies */
u32 lp_pid; /* lport port ID */ u32 lp_pid; /* lport port ID */
...@@ -397,6 +403,7 @@ struct bfa_lps_s { ...@@ -397,6 +403,7 @@ struct bfa_lps_s {
struct bfa_lps_mod_s { struct bfa_lps_mod_s {
struct list_head lps_free_q; struct list_head lps_free_q;
struct list_head lps_active_q; struct list_head lps_active_q;
struct list_head lps_login_q;
struct bfa_lps_s *lps_arr; struct bfa_lps_s *lps_arr;
int num_lps; int num_lps;
}; };
...@@ -583,6 +590,7 @@ void bfa_fcxp_send(struct bfa_fcxp_s *fcxp, struct bfa_rport_s *rport, ...@@ -583,6 +590,7 @@ void bfa_fcxp_send(struct bfa_fcxp_s *fcxp, struct bfa_rport_s *rport,
bfa_status_t bfa_fcxp_abort(struct bfa_fcxp_s *fcxp); bfa_status_t bfa_fcxp_abort(struct bfa_fcxp_s *fcxp);
u32 bfa_fcxp_get_reqbufsz(struct bfa_fcxp_s *fcxp); u32 bfa_fcxp_get_reqbufsz(struct bfa_fcxp_s *fcxp);
u32 bfa_fcxp_get_maxrsp(struct bfa_s *bfa); u32 bfa_fcxp_get_maxrsp(struct bfa_s *bfa);
void bfa_fcxp_res_recfg(struct bfa_s *bfa, u16 num_fcxp_fw);
static inline void * static inline void *
bfa_uf_get_frmbuf(struct bfa_uf_s *uf) bfa_uf_get_frmbuf(struct bfa_uf_s *uf)
...@@ -617,6 +625,7 @@ void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz, ...@@ -617,6 +625,7 @@ void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz,
wwn_t pwwn, wwn_t nwwn); wwn_t pwwn, wwn_t nwwn);
void bfa_lps_fdisclogo(struct bfa_lps_s *lps); void bfa_lps_fdisclogo(struct bfa_lps_s *lps);
void bfa_lps_set_n2n_pid(struct bfa_lps_s *lps, u32 n2n_pid); void bfa_lps_set_n2n_pid(struct bfa_lps_s *lps, u32 n2n_pid);
u8 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag);
u32 bfa_lps_get_base_pid(struct bfa_s *bfa); u32 bfa_lps_get_base_pid(struct bfa_s *bfa);
u8 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid); u8 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid);
void bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status); void bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status);
......
...@@ -38,18 +38,20 @@ struct bfi_mhdr_s { ...@@ -38,18 +38,20 @@ struct bfi_mhdr_s {
union { union {
struct { struct {
u8 qid; u8 qid;
u8 lpu_id; /* msg destination */ u8 fn_lpu; /* msg destination */
} h2i; } h2i;
u16 i2htok; /* token in msgs to host */ u16 i2htok; /* token in msgs to host */
} mtag; } mtag;
}; };
#define bfi_mhdr_2_qid(_mh) ((_mh)->mtag.h2i.qid) #define bfi_fn_lpu(__fn, __lpu) ((__fn) << 1 | (__lpu))
#define bfi_mhdr_2_fn(_mh) ((_mh)->mtag.h2i.fn_lpu >> 1)
#define bfi_mhdr_2_qid(_m) ((_mh)->mtag.h2i.qid)
#define bfi_h2i_set(_mh, _mc, _op, _lpuid) do { \ #define bfi_h2i_set(_mh, _mc, _op, _fn_lpu) do { \
(_mh).msg_class = (_mc); \ (_mh).msg_class = (_mc); \
(_mh).msg_id = (_op); \ (_mh).msg_id = (_op); \
(_mh).mtag.h2i.lpu_id = (_lpuid); \ (_mh).mtag.h2i.fn_lpu = (_fn_lpu); \
} while (0) } while (0)
#define bfi_i2h_set(_mh, _mc, _op, _i2htok) do { \ #define bfi_i2h_set(_mh, _mc, _op, _i2htok) do { \
......
...@@ -88,6 +88,7 @@ struct bfi_iocfc_qreg_s { ...@@ -88,6 +88,7 @@ struct bfi_iocfc_qreg_s {
u32 rme_q_ci_off[BFI_IOC_MAX_CQS]; u32 rme_q_ci_off[BFI_IOC_MAX_CQS];
u32 rme_q_pi_off[BFI_IOC_MAX_CQS]; u32 rme_q_pi_off[BFI_IOC_MAX_CQS];
u32 rme_qctl_off[BFI_IOC_MAX_CQS]; u32 rme_qctl_off[BFI_IOC_MAX_CQS];
u8 hw_qid[BFI_IOC_MAX_CQS];
}; };
struct bfi_iocfc_cfgrsp_s { struct bfi_iocfc_cfgrsp_s {
...@@ -348,7 +349,7 @@ struct bfi_fcxp_send_req_s { ...@@ -348,7 +349,7 @@ struct bfi_fcxp_send_req_s {
u8 class; /* FC class used for req/rsp */ u8 class; /* FC class used for req/rsp */
u8 rsp_timeout; /* timeout in secs, 0-no response */ u8 rsp_timeout; /* timeout in secs, 0-no response */
u8 cts; /* continue sequence */ u8 cts; /* continue sequence */
u8 lp_tag; /* lport tag */ u8 lp_fwtag; /* lport tag */
struct fchs_s fchs; /* request FC header structure */ struct fchs_s fchs; /* request FC header structure */
__be32 req_len; /* request payload length */ __be32 req_len; /* request payload length */
__be32 rsp_maxlen; /* max response length expected */ __be32 rsp_maxlen; /* max response length expected */
...@@ -408,7 +409,7 @@ enum bfi_lps_i2h_msgs { ...@@ -408,7 +409,7 @@ enum bfi_lps_i2h_msgs {
struct bfi_lps_login_req_s { struct bfi_lps_login_req_s {
struct bfi_mhdr_s mh; /* common msg header */ struct bfi_mhdr_s mh; /* common msg header */
u8 lp_tag; u8 bfa_tag;
u8 alpa; u8 alpa;
__be16 pdu_size; __be16 pdu_size;
wwn_t pwwn; wwn_t pwwn;
...@@ -421,7 +422,7 @@ struct bfi_lps_login_req_s { ...@@ -421,7 +422,7 @@ struct bfi_lps_login_req_s {
struct bfi_lps_login_rsp_s { struct bfi_lps_login_rsp_s {
struct bfi_mhdr_s mh; /* common msg header */ struct bfi_mhdr_s mh; /* common msg header */
u8 lp_tag; u8 fw_tag;
u8 status; u8 status;
u8 lsrjt_rsn; u8 lsrjt_rsn;
u8 lsrjt_expl; u8 lsrjt_expl;
...@@ -437,32 +438,32 @@ struct bfi_lps_login_rsp_s { ...@@ -437,32 +438,32 @@ struct bfi_lps_login_rsp_s {
u8 ext_status; u8 ext_status;
u8 brcd_switch; /* attached peer is brcd switch */ u8 brcd_switch; /* attached peer is brcd switch */
u8 bb_scn; /* atatched port's bb_scn */ u8 bb_scn; /* atatched port's bb_scn */
u8 resvd; u8 bfa_tag;
}; };
struct bfi_lps_logout_req_s { struct bfi_lps_logout_req_s {
struct bfi_mhdr_s mh; /* common msg header */ struct bfi_mhdr_s mh; /* common msg header */
u8 lp_tag; u8 fw_tag;
u8 rsvd[3]; u8 rsvd[3];
wwn_t port_name; wwn_t port_name;
}; };
struct bfi_lps_logout_rsp_s { struct bfi_lps_logout_rsp_s {
struct bfi_mhdr_s mh; /* common msg header */ struct bfi_mhdr_s mh; /* common msg header */
u8 lp_tag; u8 bfa_tag;
u8 status; u8 status;
u8 rsvd[2]; u8 rsvd[2];
}; };
struct bfi_lps_cvl_event_s { struct bfi_lps_cvl_event_s {
struct bfi_mhdr_s mh; /* common msg header */ struct bfi_mhdr_s mh; /* common msg header */
u8 lp_tag; u8 bfa_tag;
u8 rsvd[3]; u8 rsvd[3];
}; };
struct bfi_lps_n2n_pid_req_s { struct bfi_lps_n2n_pid_req_s {
struct bfi_mhdr_s mh; /* common msg header */ struct bfi_mhdr_s mh; /* common msg header */
u8 lp_tag; u8 fw_tag;
u32 lp_pid:24; u32 lp_pid:24;
}; };
...@@ -497,7 +498,7 @@ struct bfi_rport_create_req_s { ...@@ -497,7 +498,7 @@ struct bfi_rport_create_req_s {
u16 bfa_handle; /* host rport handle */ u16 bfa_handle; /* host rport handle */
__be16 max_frmsz; /* max rcv pdu size */ __be16 max_frmsz; /* max rcv pdu size */
u32 pid:24, /* remote port ID */ u32 pid:24, /* remote port ID */
lp_tag:8; /* local port tag */ lp_fwtag:8; /* local port tag */
u32 local_pid:24, /* local port ID */ u32 local_pid:24, /* local port ID */
cisc:8; cisc:8;
u8 fc_class; /* supported FC classes */ u8 fc_class; /* supported FC classes */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment