Lines Matching refs:iores

393 qla_get_fw_resources(struct qla_qpair *qp, struct iocb_resource *iores)
400 iores->res_type = RESOURCE_NONE;
403 if (iores->res_type & RESOURCE_FORCE)
406 if ((iores->iocb_cnt + qp->fwres.iocbs_used) >= qp->fwres.iocbs_qp_limit) {
414 if ((iores->iocb_cnt + iocbs_used) >= qp->fwres.iocbs_limit) {
415 iores->res_type = RESOURCE_NONE;
420 if (iores->res_type & RESOURCE_EXCH) {
427 if ((exch_used + iores->exch_cnt) >= qp->fwres.exch_limit) {
428 iores->res_type = RESOURCE_NONE;
434 if ((iores->iocb_cnt + atomic_read(&ha->fwres.iocb_used)) >=
436 iores->res_type = RESOURCE_NONE;
440 if (iores->res_type & RESOURCE_EXCH) {
441 if ((iores->exch_cnt + atomic_read(&ha->fwres.exch_used)) >=
443 iores->res_type = RESOURCE_NONE;
450 qp->fwres.iocbs_used += iores->iocb_cnt;
451 qp->fwres.exch_used += iores->exch_cnt;
453 atomic_add(iores->iocb_cnt, &ha->fwres.iocb_used);
454 atomic_add(iores->exch_cnt, &ha->fwres.exch_used);
455 iores->res_type |= RESOURCE_HA;
483 qla_put_fw_resources(struct qla_qpair *qp, struct iocb_resource *iores)
487 if (iores->res_type & RESOURCE_HA) {
488 if (iores->res_type & RESOURCE_IOCB)
489 qla_atomic_dtz(&ha->fwres.iocb_used, iores->iocb_cnt);
491 if (iores->res_type & RESOURCE_EXCH)
492 qla_atomic_dtz(&ha->fwres.exch_used, iores->exch_cnt);
495 if (iores->res_type & RESOURCE_IOCB) {
496 if (qp->fwres.iocbs_used >= iores->iocb_cnt) {
497 qp->fwres.iocbs_used -= iores->iocb_cnt;
504 if (iores->res_type & RESOURCE_EXCH) {
505 if (qp->fwres.exch_used >= iores->exch_cnt) {
506 qp->fwres.exch_used -= iores->exch_cnt;
512 iores->res_type = RESOURCE_NONE;