4

I'm a newbie here at this forum. I'm currently stuck with a problem.

I'm a beginner to Linux kernel drivers, and currently involved in developing a Linux SCSI device driver for a block mass storage device. The development platform is on a high-end machine with Fedora 14. The setup is 1 host to one LU/device. To make the long story short, the driver is working in the sense that it initializes without problems, it can detect the device and send scsi frames to it, it can read and write to the device, and I can do stable Iometer read and write tests through the driver. All of that when there is only 1 outstanding command at a time (no queueing).

The problem is, I couldn't get queuing to work. The upper SCSI layers doesn't send me (LLD) more than one commands to be outstanding unless I scsi_done() the first command. I expect that the upper layer can call queuecommand() more than once before I send the commands to the device for processing, then for the device to interrupt me for the response and for LLD to close the command with scsi_done(). Without queuing, our speed is very slow.

I've already tweaked values I thought are connected to queuing, like setting .can_queue and .cmd_per_lun to my target queue_depth in both scsi_host and scsi_host_template. Basically I've played with various values including 1, but to no avail. I also did disable and enable tagging if this has any effect, but still no change. So far I don't remember doing much with scsi_device in the driver, except in slave_configure. Is there anything I'm missing and can still do in driver level? I can't believe Linux would have no support for command queuing. I'm missing something here.

Chinna
  • 3,930
  • 4
  • 25
  • 55
ubermensch
  • 363
  • 2
  • 12
  • Linux certainly supports SCSI TCQ (and the SATA equivalent, NCQ). However, only unordered tags are supported, not ordered. Other than that, I don't know the answer, and can only suggest to look at how other drivers do it. Also, you might want to try a newer kernel, there has been some changes particularly how cache flushes are implemented since late 2010 or thereabouts. – janneb Oct 16 '12 at 18:53
  • Thanks for the suggestion. I admit i din't look into simple tagging, only untagged and ordered tagged. And yeah, looking at other drivers is what we are doing now. – ubermensch Oct 17 '12 at 16:17
  • Did you fix the problem with simple tagging ? – ARH Dec 25 '13 at 00:33
  • Problem solved by using fio instead of iometer in linux. Iometer seemz to be having problem with async io. – ubermensch Jun 23 '14 at 16:41

0 Answers0