Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282241
b: refs/heads/master
c: 5780790
h: refs/heads/master
i:
  282239: baf507b
v: v3
  • Loading branch information
Andrew Vasquez authored and James Bottomley committed Dec 15, 2011
1 parent 0f65ba0 commit 10d6a08
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a00f6296aaf92ebe89c72eb98c440410992a33c4
refs/heads/master: 5780790ee6836ad64648c0905fcf15e073aad19b
16 changes: 16 additions & 0 deletions trunk/drivers/scsi/qla2xxx/qla_bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ qla2x00_get_ctx_bsg_sp(scsi_qla_host_t *vha, fc_port_t *fcport, size_t size)
memset(sp, 0, sizeof(*sp));
sp->fcport = fcport;
sp->ctx = ctx;
ctx->iocbs = 1;
done:
return sp;
}
Expand Down Expand Up @@ -389,6 +390,20 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
return rval;
}

inline uint16_t
qla24xx_calc_ct_iocbs(uint16_t dsds)
{
uint16_t iocbs;

iocbs = 1;
if (dsds > 2) {
iocbs += (dsds - 2) / 5;
if ((dsds - 2) % 5)
iocbs++;
}
return iocbs;
}

static int
qla2x00_process_ct(struct fc_bsg_job *bsg_job)
{
Expand Down Expand Up @@ -489,6 +504,7 @@ qla2x00_process_ct(struct fc_bsg_job *bsg_job)
ct = sp->ctx;
ct->type = SRB_CT_CMD;
ct->name = "bsg_ct";
ct->iocbs = qla24xx_calc_ct_iocbs(req_sg_cnt + rsp_sg_cnt);
ct->u.bsg_job = bsg_job;

ql_dbg(ql_dbg_user, vha, 0x7016,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/qla2xxx/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ struct srb_iocb {
struct srb_ctx {
uint16_t type;
char *name;
int iocbs;
union {
struct srb_iocb *iocb_cmd;
struct fc_bsg_job *bsg_job;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ qla2x00_get_ctx_sp(scsi_qla_host_t *vha, fc_port_t *fcport, size_t size,
memset(sp, 0, sizeof(*sp));
sp->fcport = fcport;
sp->ctx = ctx;
ctx->iocbs = 1;
ctx->u.iocb_cmd = iocb;
iocb->free = qla2x00_ctx_sp_free;

Expand Down
11 changes: 9 additions & 2 deletions trunk/drivers/scsi/qla2xxx/qla_iocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,7 @@ qla2x00_alloc_iocbs(scsi_qla_host_t *vha, srb_t *sp)
uint32_t index, handle;
request_t *pkt;
uint16_t cnt, req_cnt;
struct srb_ctx *ctx;

pkt = NULL;
req_cnt = 1;
Expand Down Expand Up @@ -1846,6 +1847,12 @@ qla2x00_alloc_iocbs(scsi_qla_host_t *vha, srb_t *sp)
req->outstanding_cmds[handle] = sp;
sp->handle = handle;

/* Adjust entry-counts as needed. */
if (sp->ctx) {
ctx = sp->ctx;
req_cnt = ctx->iocbs;
}

skip_cmd_array:
/* Check for room on request queue. */
if (req->cnt < req_cnt) {
Expand Down Expand Up @@ -2622,8 +2629,8 @@ qla2x00_start_sp(srb_t *sp)
break;
case SRB_CT_CMD:
IS_FWI2_CAPABLE(ha) ?
qla24xx_ct_iocb(sp, pkt) :
qla2x00_ct_iocb(sp, pkt);
qla24xx_ct_iocb(sp, pkt) :
qla2x00_ct_iocb(sp, pkt);
break;
case SRB_ADISC_CMD:
IS_FWI2_CAPABLE(ha) ?
Expand Down

0 comments on commit 10d6a08

Please sign in to comment.