qla2xxx tcq question/bug

Mike Christie
2004-07-09T23:13:38Z

Hi Andrew,

For the qla2xxx driver in 2.6.7 there is this code:

/* Update tagged queuing modifier */
cmd_pkt->control_flags = __constant_cpu_to_le16(CF_SIMPLE_TAG);
if (cmd->device->tagged_supported) {
switch (cmd->tag) {
case HEAD_OF_QUEUE_TAG:
cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_HEAD_TAG);
break;
case ORDERED_QUEUE_TAG:
cmd_pkt->control_flags =
__constant_cpu_to_le16(CF_ORDERED_TAG);
break;
}
}

but do you know where/how cmd->tag gets set? It looks like it gets
copied from req->tag in the scsi_prep_fn, but for drivers that do not
call scsi_actiavte_tcq that value never gets touched by the block
layer. Even for drivers that do call scsi_activate_tcq, the req->tag
value is just the tag nr, and those drivers will use scsi_populate_msg
to get the task attribute. req->tag gets copied in the prep_fn and
does not get set until after the request_fn has prepared the request so
really cmd->tag looks like it is junk for every case.

Is this usage from 2.4? Should the qla2xx driver be calling
scsi_activate_tcq/scsi_populate_msg for devices that support tags,
or is that a waste becuase you never use the tag number and all you
really want is the attribute?

Thanks,

--
Mike Christie
mikenc@us.ibm.com