Commit 7c814651 authored by Jing Huang's avatar Jing Huang Committed by James Bottomley

[SCSI] bfa: fix interrupt coalescing setting

Do not update the coalesce flag of the intr_attr struct in driver config area
on config response.  This is to prevent the coalesce flag being reported as on
after an ioc disable/enable even if it was set to off before disable.
Signed-off-by: default avatarJing Huang <huangj@brocade.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 4f1806bc
...@@ -113,7 +113,6 @@ bfa_iocfc_send_cfg(void *bfa_arg) ...@@ -113,7 +113,6 @@ bfa_iocfc_send_cfg(void *bfa_arg)
bfa_assert(cfg->fwcfg.num_cqs <= BFI_IOC_MAX_CQS); bfa_assert(cfg->fwcfg.num_cqs <= BFI_IOC_MAX_CQS);
bfa_trc(bfa, cfg->fwcfg.num_cqs); bfa_trc(bfa, cfg->fwcfg.num_cqs);
iocfc->cfgdone = BFA_FALSE;
bfa_iocfc_reset_queues(bfa); bfa_iocfc_reset_queues(bfa);
/** /**
...@@ -144,6 +143,15 @@ bfa_iocfc_send_cfg(void *bfa_arg) ...@@ -144,6 +143,15 @@ bfa_iocfc_send_cfg(void *bfa_arg)
bfa_os_htons(cfg->drvcfg.num_rspq_elems); bfa_os_htons(cfg->drvcfg.num_rspq_elems);
} }
/**
* Enable interrupt coalescing if it is driver init path
* and not ioc disable/enable path.
*/
if (!iocfc->cfgdone)
cfg_info->intr_attr.coalesce = BFA_TRUE;
iocfc->cfgdone = BFA_FALSE;
/** /**
* dma map IOC configuration itself * dma map IOC configuration itself
*/ */
...@@ -364,7 +372,6 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa) ...@@ -364,7 +372,6 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa)
struct bfa_iocfc_s *iocfc = &bfa->iocfc; struct bfa_iocfc_s *iocfc = &bfa->iocfc;
struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp; struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp;
struct bfa_iocfc_fwcfg_s *fwcfg = &cfgrsp->fwcfg; struct bfa_iocfc_fwcfg_s *fwcfg = &cfgrsp->fwcfg;
struct bfi_iocfc_cfg_s *cfginfo = iocfc->cfginfo;
fwcfg->num_cqs = fwcfg->num_cqs; fwcfg->num_cqs = fwcfg->num_cqs;
fwcfg->num_ioim_reqs = bfa_os_ntohs(fwcfg->num_ioim_reqs); fwcfg->num_ioim_reqs = bfa_os_ntohs(fwcfg->num_ioim_reqs);
...@@ -373,10 +380,6 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa) ...@@ -373,10 +380,6 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa)
fwcfg->num_uf_bufs = bfa_os_ntohs(fwcfg->num_uf_bufs); fwcfg->num_uf_bufs = bfa_os_ntohs(fwcfg->num_uf_bufs);
fwcfg->num_rports = bfa_os_ntohs(fwcfg->num_rports); fwcfg->num_rports = bfa_os_ntohs(fwcfg->num_rports);
cfginfo->intr_attr.coalesce = cfgrsp->intr_attr.coalesce;
cfginfo->intr_attr.delay = bfa_os_ntohs(cfgrsp->intr_attr.delay);
cfginfo->intr_attr.latency = bfa_os_ntohs(cfgrsp->intr_attr.latency);
iocfc->cfgdone = BFA_TRUE; iocfc->cfgdone = BFA_TRUE;
/** /**
...@@ -737,10 +740,20 @@ bfa_adapter_get_id(struct bfa_s *bfa) ...@@ -737,10 +740,20 @@ bfa_adapter_get_id(struct bfa_s *bfa)
void void
bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr) bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr)
{ {
struct bfa_iocfc_s *iocfc = &bfa->iocfc; struct bfa_iocfc_s *iocfc = &bfa->iocfc;
attr->intr_attr.coalesce = iocfc->cfginfo->intr_attr.coalesce;
attr->intr_attr.delay = iocfc->cfginfo->intr_attr.delay ?
bfa_os_ntohs(iocfc->cfginfo->intr_attr.delay) :
bfa_os_ntohs(iocfc->cfgrsp->intr_attr.delay);
attr->intr_attr.latency = iocfc->cfginfo->intr_attr.latency ?
bfa_os_ntohs(iocfc->cfginfo->intr_attr.latency) :
bfa_os_ntohs(iocfc->cfgrsp->intr_attr.latency);
attr->config = iocfc->cfg;
attr->intr_attr = iocfc->cfginfo->intr_attr;
attr->config = iocfc->cfg;
} }
bfa_status_t bfa_status_t
...@@ -749,7 +762,10 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr) ...@@ -749,7 +762,10 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr)
struct bfa_iocfc_s *iocfc = &bfa->iocfc; struct bfa_iocfc_s *iocfc = &bfa->iocfc;
struct bfi_iocfc_set_intr_req_s *m; struct bfi_iocfc_set_intr_req_s *m;
iocfc->cfginfo->intr_attr = *attr; iocfc->cfginfo->intr_attr.coalesce = attr->coalesce;
iocfc->cfginfo->intr_attr.delay = bfa_os_htons(attr->delay);
iocfc->cfginfo->intr_attr.latency = bfa_os_htons(attr->latency);
if (!bfa_iocfc_is_operational(bfa)) if (!bfa_iocfc_is_operational(bfa))
return BFA_STATUS_OK; return BFA_STATUS_OK;
...@@ -759,9 +775,10 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr) ...@@ -759,9 +775,10 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr)
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_lpuid(bfa));
m->coalesce = attr->coalesce; m->coalesce = iocfc->cfginfo->intr_attr.coalesce;
m->delay = bfa_os_htons(attr->delay); m->delay = iocfc->cfginfo->intr_attr.delay;
m->latency = bfa_os_htons(attr->latency); m->latency = iocfc->cfginfo->intr_attr.latency;
bfa_trc(bfa, attr->delay); bfa_trc(bfa, attr->delay);
bfa_trc(bfa, attr->latency); bfa_trc(bfa, attr->latency);
......
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