All of lore.kernel.org
 help / color / mirror / Atom feed
* Using scsi_cmd->request->nr_hw_segments within a LLDD...
@ 2004-09-21 21:55 Andrew Vasquez
  2004-09-22  6:57 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Vasquez @ 2004-09-21 21:55 UTC (permalink / raw)
  To: SCSI Mailing List


All,

Back in March the qla2xxx driver began to use the value in
cmd->request->nr_hw_segments as a guestimate during the calucation of
the number of driver-request-queue entries that would be needed to
fullfill a given command-request.  Here's an URL to thread which
prompted the change:

	http://marc.theaimsgroup.com/?l=linux-scsi&m=107940832718154&w=2

Recently we've had a number of problem reports which appear to
indicate that the value specified within the variable is
un-initialized and/or set to some bogus value.

Here's the relevant code the driver uses in qla2x00_start_scsi():

	/* Calculate the number of request entries needed. */
	req_cnt = (ha->calc_request_entries)(cmd->request->nr_hw_segments);
	if (ha->req_q_cnt < (req_cnt + 2)) {
		cnt = RD_REG_WORD_RELAXED(ISP_REQ_Q_OUT(ha, reg));
		if (ha->req_ring_index < cnt)
			ha->req_q_cnt = cnt - ha->req_ring_index;
		else
			ha->req_q_cnt = ha->request_q_length -
			    (ha->req_ring_index - cnt);
	}
	if (ha->req_q_cnt < (req_cnt + 2))
		goto queuing_error;

The 'req_cnt' derived value in several instances is greater than 4000.

So, can an LLDD depend on the value being set to a proper value
during all I/O submission paths -- BIO as well as IOCTL?

If not, then what should a device driver writer use as an alternative?

Regards,
Andrew Vasquez

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-22 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-21 21:55 Using scsi_cmd->request->nr_hw_segments within a LLDD Andrew Vasquez
2004-09-22  6:57 ` Jens Axboe
2004-09-22 15:01   ` Patrick Mansfield
2004-09-22 15:02     ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.