Skip to contentSkip to conversation

qla4xxx driver resubmission

RFC PATCH In review David C Somayajulu 6 participants 18 messages Sep 20, 2006 – Oct 4, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 qla4xxx driver resubmission

This is another resubmission of qla4xxx driver for QLogic Corporation's iSCSI HBAs.

The main changes from the previous submission are
- use block layer tagging
- clean up code and remove unused function for firmware pass thru

Please not that this patch is dependant on the previously posted patch titled [RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag ( http://marc.theaimsgroup.com/?l=linux-scsi&m=115871027627964&w=2 )

The complete mega patch for the driver is at ftp://ftp.qlogic.com/outgoing/linux/iSCSI/upstream/5.00.05b10-k/0000-Initial-Commit-qla4xxx.txt

For ease of comprehension the above patch has been broken down into the following smaller patches:
(located at ftp://ftp.qlogic.com/outgoing/linux/iSCSI/upstream/5.00.05b10-k/ )

0001-qla4xxx-driver-defs.diff
0002-qla4xxx-driver-init.diff
0003-qla4xxx-driver-os.diff
0004-qla4xxx-driver-isr.diff
0005-qla4xxx-driver-mbx.diff
0006-qla4xxx-driver-support.diff
0007-qla4xxx-driver-version.diff

All patches are against scsi-misc-2.6.git

Other items which needs to be done are
- Add support for sysfs attributes.
- Userspace support for session creation/deletion for iscsi HBAs.
- Add support for other discovery modes ie iSNS/SLP.

Here are the links to the previous two submissions
http://marc.theaimsgroup.com/?l=linux-scsi&m=115532714515853&w=2

http://groups.google.com/group/open-iscsi/browse_frm/thread/536ce2edf9a60c48?hl=en

I believe block layer tagging was the gating item in the last submission. I would really appreciate if it can be merged upstream.

Regards,
David Somayajulu
Qlogic Corporation.

#1 lore raw

Why does your LLD need to reach up into the block layer to find an i/o ?

Even if you are using tags as an index into something... I would think that having to go up to the blk layer to retrieve a something that should have already been known lower in the driver leaves room for race conditions.

-- james s

Quoted 47 lines · David C Somayajulu

This is another resubmission of qla4xxx driver for QLogic Corporation's iSCSI HBAs.

The main changes from the previous submission are
- use block layer tagging
- clean up code and remove unused function for firmware pass thru

Please not that this patch is dependant on the previously posted patch titled
[RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag ( http://marc.theaimsgroup.com/?l=linux-scsi&m=115871027627964&w=2 )

The complete mega patch for the driver is at ftp://ftp.qlogic.com/outgoing/linux/iSCSI/upstream/5.00.05b10-k/0000-Initial-Commit-qla4xxx.txt

For ease of comprehension the above patch has been broken down into the following smaller patches: (located at ftp://ftp.qlogic.com/outgoing/linux/iSCSI/upstream/5.00.05b10-k/ )

0001-qla4xxx-driver-defs.diff
0002-qla4xxx-driver-init.diff
0003-qla4xxx-driver-os.diff
0004-qla4xxx-driver-isr.diff
0005-qla4xxx-driver-mbx.diff
0006-qla4xxx-driver-support.diff
0007-qla4xxx-driver-version.diff

All patches are against scsi-misc-2.6.git

Other items which needs to be done are
- Add support for sysfs attributes.
- Userspace support for session creation/deletion for iscsi HBAs.
- Add support for other discovery modes ie iSNS/SLP.

Here are the links to the previous two submissions
http://marc.theaimsgroup.com/?l=linux-scsi&m=115532714515853&w=2

http://groups.google.com/group/open-iscsi/browse_frm/thread/536ce2edf9a60c48?hl=en

I believe block layer tagging was the gating item in the last submission. I would really appreciate if it can be merged upstream.

Regards, David Somayajulu Qlogic Corporation.

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 2 lines

Why does your LLD need to reach up into the block layer to find an i/o

?
Block layer tagging was the gating item in the previous submission. Going over the conversation on the linux-scsi reflector on STEX driver in this aspect, led us to believe that there should not be any driver level book-keeping of outstanding commands to the HBA. This was the reason for creating scsi_host_find_tag() in scsi_tcq.h (in the patch titled [RFC] [PATCH] helper function for retrieving scsi_cmd given hostbased block layer tag)
http://marc.theaimsgroup.com/?l=linux-scsi&m=115871027627964&w=2

James, would you mind letting us know if block-layer tagging in your opinion simply meant using the scsi_cmd->request->tag and let the driver do the book-keeping of out-standing commands to HBA (like stex driver) or is it along the lines we have implemented.

Quoted 2 lines

Even if you are using tags as an index into something... I would think

that

Quoted 1 line

having to go up to the blk layer to retrieve a something that should

have

Quoted 1 line

already been known lower in the driver leaves room for race

conditions.

Quoted 5 lines

-- james s

Quoted 1 line · David C Somayajulu

This is another resubmission of qla4xxx driver for QLogic

Corporation's iSCSI HBAs.

Quoted 6 lines
Quoted 6 lines

The main changes from the previous submission are
- use block layer tagging
- clean up code and remove unused function for firmware pass thru

Please not that this patch is dependant on the previously posted

patch titled

Quoted 1 line
Quoted 1 line

[RFC] [PATCH] helper function for retrieving scsi_cmd given host

based block layer tag

Quoted 5 lines
Quoted 5 lines

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

The complete mega patch for the driver is at

ftp://ftp.qlogic.com/outgoing/linux/iSCSI/upstream/5.00.05b10-k/0000-Ini tial-Commit-qla4xxx.txt

Quoted 5 lines
Quoted 5 lines

For ease of comprehension the above patch has been broken down into the following smaller patches:
(located at

ftp://ftp.qlogic.com/outgoing/linux/iSCSI/upstream/5.00.05b10-k/ )

Quoted 16 lines
Quoted 16 lines

0001-qla4xxx-driver-defs.diff
0002-qla4xxx-driver-init.diff
0003-qla4xxx-driver-os.diff
0004-qla4xxx-driver-isr.diff
0005-qla4xxx-driver-mbx.diff
0006-qla4xxx-driver-support.diff
0007-qla4xxx-driver-version.diff

All patches are against scsi-misc-2.6.git

Other items which needs to be done are
- Add support for sysfs attributes.
- Userspace support for session creation/deletion for iscsi HBAs.
- Add support for other discovery modes ie iSNS/SLP.

Quoted 4 lines
Quoted 4 lines

Here are the links to the previous two submissions
http://marc.theaimsgroup.com/?l=linux-scsi&m=115532714515853&w=2

http://groups.google.com/group/open-iscsi/browse_frm/thread/536ce2edf9a6
0c48?hl=en

Quoted 2 lines
Quoted 2 lines

I believe block layer tagging was the gating item in the last

submission.

Quoted 10 lines
Quoted 10 lines

I would really appreciate if it can be merged upstream.

Regards,
David Somayajulu
Qlogic Corporation.

-
To unsubscribe from this list: send the line "unsubscribe

linux-scsi" in

Quoted 3 lines
Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 11 lines · David Somayajulu
Quoted 1 line

Why does your LLD need to reach up into the block layer to find an i/o

?
Block layer tagging was the gating item in the previous submission. Going over the conversation on the linux-scsi reflector on STEX driver in this aspect, led us to believe that there should not be any driver level book-keeping of outstanding commands to the HBA. This was the reason for creating scsi_host_find_tag() in scsi_tcq.h (in the patch titled [RFC] [PATCH] helper function for retrieving scsi_cmd given hostbased block layer tag)
http://marc.theaimsgroup.com/?l=linux-scsi&m=115871027627964&w=2

Quoted 4 lines

James, would you mind letting us know if block-layer tagging in your opinion simply meant using the scsi_cmd->request->tag and let the driver do the book-keeping of out-standing commands to HBA (like stex driver) or is it along the lines we have implemented.

Well, in general, I've been working on stuff that has little use for the tags, so they aren't that meaningful. I can certainly see some implementations that can benefit.

But, on a newish transport like iSCSI, I'm surprised. There's lots of house-keeping that has to be done with resets and task management that makes me believe it's better/easier with local structures. I also know that I like to double-check my hardware (based on local structure) rather than blindly trusting job handles. I also believe there will be locking issues or data structures in flight issues between the block layer and LLDD that will be ugly.

I wanted some justification. The new block layer function hasn't been needed in the past and I thought it a rather odd thing to add.

-- james

#4 lore raw
Quoted 24 lines · James Smart
Quoted 11 lines · David Somayajulu
Quoted 1 line

Why does your LLD need to reach up into the block layer to find an i/o

?
Block layer tagging was the gating item in the previous submission. Going over the conversation on the linux-scsi reflector on STEX driver in this aspect, led us to believe that there should not be any driver level book-keeping of outstanding commands to the HBA. This was the reason for creating scsi_host_find_tag() in scsi_tcq.h (in the patch titled [RFC] [PATCH] helper function for retrieving scsi_cmd given hostbased block layer tag)
http://marc.theaimsgroup.com/?l=linux-scsi&m=115871027627964&w=2

Quoted 4 lines

James, would you mind letting us know if block-layer tagging in your opinion simply meant using the scsi_cmd->request->tag and let the driver do the book-keeping of out-standing commands to HBA (like stex driver) or is it along the lines we have implemented.

Well, in general, I've been working on stuff that has little use for the tags, so they aren't that meaningful. I can certainly see some implementations
that can benefit.

Quoted 5 lines

But, on a newish transport like iSCSI, I'm surprised. There's lots of house-keeping that has to be done with resets and task management that makes
me believe it's better/easier with local structures. I also know that I like

The tag and its mapping to the request and scsi command have to exist for the life of the scsi command. Are you thinking we may have cases where the LLD releases the scsi command (and then scsi-ml releases the command and request) but the LLD still needs the local command structure (some driver specific struct) and some mapping to a tag? If so then the block layer tagging in general will not work. Once we release the request then the tag number can be reallocated.

Quoted 9 lines

to double-check my hardware (based on local structure) rather than blindly trusting job handles. I also believe there will be locking issues or data structures in flight issues between the block layer and LLDD that will be ugly.

I wanted some justification. The new block layer function hasn't been needed
in the past and I thought it a rather odd thing to add.

It was not needed because stex just preallocated a local array of its command structs and uses the tag to access that struct. qla4xxx uses a mempool and so it could allocate a array for the mapping but then we have something very similar to what the block layer and scsi provide in its tag_map.

If you do queue based tagging and use the tag number and do not preallocate your commands then there is a lookup function for you do use.

#5 lore raw
In reply to James Smart
Quoted 6 lines · James Smart

Why does your LLD need to reach up into the block layer to find an i/o ?

Even if you are using tags as an index into something... I would think that having to go up to the blk layer to retrieve a something that should have already been known lower in the driver leaves room for race conditions.

This is how the blk and scsi tag api work for queue based tagging. We have the scsi_find_tag() function which takes a scsi device and than calls blk_queue_find_tag to get the request. It then does all the magic sdev to request_queue and request to scsi command work and pass the LLD the scsi command for the tag. So we can either add a driver array and do some tag to scsi command or driver stucture mapping or we can use the array already created in the scsi host block queue tag. And as you see Dave's patch did the latter in the spirit of not duplicating what scsi-ml or the block layer already do.

I think there are some basic races though. For example, scsi_request_fn calls blk_queue_start_tag with only the queue lock held and so if the request_fn was called for two devices on the same host at the same time they both could call find_first_zero_bit on the shared bqt->tag_map and end up getting the same tag.

#6 lore raw
Quoted 18 lines · Mike Christie
Quoted 6 lines · James Smart

Why does your LLD need to reach up into the block layer to find an i/o ?

Even if you are using tags as an index into something... I would think that having to go up to the blk layer to retrieve a something that should have already been known lower in the driver leaves room for race conditions.

This is how the blk and scsi tag api work for queue based tagging. We have the scsi_find_tag() function which takes a scsi device and than calls blk_queue_find_tag to get the request. It then does all the magic sdev to request_queue and request to scsi command work and pass the LLD the scsi command for the tag. So we can either add a driver array and do some tag to scsi command or driver stucture mapping or we can use the array already created in the scsi host block queue tag. And as you see Dave's patch did the latter in the spirit of not duplicating what scsi-ml or the block layer already do.

Quoted 5 lines

I think there are some basic races though. For example, scsi_request_fn calls blk_queue_start_tag with only the queue lock held and so if the request_fn was called for two devices on the same host at the same time they both could call find_first_zero_bit on the shared bqt->tag_map and end up getting the same tag.

Hrmpf good point, I suspect that would be easy enough to fix with just using a

        do {
                tag = ffz_bit(..);
        } while (test_and_set_bit(tag, map);

construct. Agree?

Signature · 1 line
Jens Axboe
#7 lore raw
Quoted 24 lines · Jens Axboe
Quoted 17 lines · Mike Christie
Quoted 6 lines · James Smart

Why does your LLD need to reach up into the block layer to find an i/o ?

Even if you are using tags as an index into something... I would think that having to go up to the blk layer to retrieve a something that should have already been known lower in the driver leaves room for race conditions.

This is how the blk and scsi tag api work for queue based tagging. We have the scsi_find_tag() function which takes a scsi device and than calls blk_queue_find_tag to get the request. It then does all the magic sdev to request_queue and request to scsi command work and pass the LLD the scsi command for the tag. So we can either add a driver array and do some tag to scsi command or driver stucture mapping or we can use the array already created in the scsi host block queue tag. And as you see Dave's patch did the latter in the spirit of not duplicating what scsi-ml or the block layer already do.

Quoted 5 lines

I think there are some basic races though. For example, scsi_request_fn calls blk_queue_start_tag with only the queue lock held and so if the request_fn was called for two devices on the same host at the same time they both could call find_first_zero_bit on the shared bqt->tag_map and end up getting the same tag.

Quoted 9 lines

Hrmpf good point, I suspect that would be easy enough to fix with just using a

        do {
                tag = ffz_bit(..);
        } while (test_and_set_bit(tag, map);

construct. Agree?

I think so. I think this is similar to what Dave was going to do too.

#8 lore raw
Quoted 28 lines · Mike Christie
Quoted 27 lines · Jens Axboe
Quoted 17 lines · Mike Christie
Quoted 6 lines · James Smart

Why does your LLD need to reach up into the block layer to find an i/o ?

Even if you are using tags as an index into something... I would think that having to go up to the blk layer to retrieve a something that should have already been known lower in the driver leaves room for race conditions.

This is how the blk and scsi tag api work for queue based tagging. We have the scsi_find_tag() function which takes a scsi device and than calls blk_queue_find_tag to get the request. It then does all the magic sdev to request_queue and request to scsi command work and pass the LLD the scsi command for the tag. So we can either add a driver array and do some tag to scsi command or driver stucture mapping or we can use the array already created in the scsi host block queue tag. And as you see Dave's patch did the latter in the spirit of not duplicating what scsi-ml or the block layer already do.

Quoted 5 lines

I think there are some basic races though. For example, scsi_request_fn calls blk_queue_start_tag with only the queue lock held and so if the request_fn was called for two devices on the same host at the same time they both could call find_first_zero_bit on the shared bqt->tag_map and end up getting the same tag.

Hrmpf good point, I suspect that would be easy enough to fix with just using a

Quoted 8 lines
Quoted 6 lines
        do {
                tag = ffz_bit(..);
        } while (test_and_set_bit(tag, map);

construct. Agree?

I think so. I think this is similar to what Dave was going to do too.

Already checked in such a fix:

http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=7ddbe6863ac4b7a5588aa4a70f262c098f3c469a

Signature · 1 line
Jens Axboe
#9 lore raw
Quoted 33 lines · Jens Axboe
Quoted 32 lines · Mike Christie
Quoted 31 lines · Jens Axboe
Quoted 17 lines · Mike Christie
Quoted 6 lines · James Smart

Why does your LLD need to reach up into the block layer to find an i/o ?

Even if you are using tags as an index into something... I would think that having to go up to the blk layer to retrieve a something that should have already been known lower in the driver leaves room for race conditions.

This is how the blk and scsi tag api work for queue based tagging. We have the scsi_find_tag() function which takes a scsi device and than calls blk_queue_find_tag to get the request. It then does all the magic sdev to request_queue and request to scsi command work and pass the LLD the scsi command for the tag. So we can either add a driver array and do some tag to scsi command or driver stucture mapping or we can use the array already created in the scsi host block queue tag. And as you see Dave's patch did the latter in the spirit of not duplicating what scsi-ml or the block layer already do.

Quoted 5 lines

I think there are some basic races though. For example, scsi_request_fn calls blk_queue_start_tag with only the queue lock held and so if the request_fn was called for two devices on the same host at the same time they both could call find_first_zero_bit on the shared bqt->tag_map and end up getting the same tag.

Hrmpf good point, I suspect that would be easy enough to fix with just using a

        do {
                tag = ffz_bit(..);
        } while (test_and_set_bit(tag, map);
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

construct. Agree?

I think so. I think this is similar to what Dave was going to do too.

Already checked in such a fix:

http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=7ddbe6863ac4b7a5588aa4a70f262c098f3c469a

BTW, please don't CC closed lists on public lists (the iscsi list spams me on every reply).

Signature · 1 line
Jens Axboe
#10 lore raw
Quoted 7 lines

-----Original Message-----
From: Jens Axboe [mailto:[email protected]]
Sent: Thursday, September 21, 2006 11:48 AM
To: Mike Christie
Cc: [email protected]; David Somayajulu; James Bottomley;

[email protected]; Doug

Quoted 9 lines

Maxey; David Wagner; Ravi Anand; Duane Grigsby
Subject: Re: [RFC] [PATCH] qla4xxx driver resubmission

Quoted 5 lines · Jens Axboe
Quoted 4 lines · Mike Christie
Quoted 3 lines · Jens Axboe
Quoted 2 lines · Mike Christie
Quoted 1 line · James Smart

Why does your LLD need to reach up into the block layer to

find an i/o ?

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Even if you are using tags as an index into something... I

would think that

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

having to go up to the blk layer to retrieve a something that

should have

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

already been known lower in the driver leaves room for race

conditions.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

This is how the blk and scsi tag api work for queue based

tagging. We

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

have the scsi_find_tag() function which takes a scsi device and

than

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

calls blk_queue_find_tag to get the request. It then does all

the magic

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

sdev to request_queue and request to scsi command work and pass

the LLD

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the scsi command for the tag. So we can either add a driver

array and do

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

some tag to scsi command or driver stucture mapping or we can

use the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

array already created in the scsi host block queue tag. And as

you see

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Dave's patch did the latter in the spirit of not duplicating

what

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

scsi-ml or the block layer already do.

I think there are some basic races though. For example,

scsi_request_fn

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

calls blk_queue_start_tag with only the queue lock held and so

if the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

request_fn was called for two devices on the same host at the

same time

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

they both could call find_first_zero_bit on the shared

bqt->tag_map and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

end up getting the same tag.

Hrmpf good point, I suspect that would be easy enough to fix

with just

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 8 lines

using a

        do {
                tag = ffz_bit(..);
        } while (test_and_set_bit(tag, map);

construct. Agree?

I think so. I think this is similar to what Dave was going to do

too.

Quoted 4 lines
Quoted 4 lines

Already checked in such a fix:

http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=7ddbe6863ac4b7a55
88aa4a70f262c098f3c469a

Thanks. This a lot elegant than the one I came up with using a lock. Jens, any comments on this patch
[RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
http://marc.theaimsgroup.com/?l=linux-scsi&m=115871027627964&w=2

#11 lore raw
Quoted 71 lines · David Somayajulu
Quoted 7 lines

-----Original Message-----
From: Jens Axboe [mailto:[email protected]]
Sent: Thursday, September 21, 2006 11:48 AM
To: Mike Christie
Cc: [email protected]; David Somayajulu; James Bottomley;

[email protected]; Doug

Quoted 9 lines

Maxey; David Wagner; Ravi Anand; Duane Grigsby
Subject: Re: [RFC] [PATCH] qla4xxx driver resubmission

Quoted 5 lines · Jens Axboe
Quoted 4 lines · Mike Christie
Quoted 3 lines · Jens Axboe
Quoted 2 lines · Mike Christie
Quoted 1 line · James Smart

Why does your LLD need to reach up into the block layer to

find an i/o ?

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Even if you are using tags as an index into something... I

would think that

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

having to go up to the blk layer to retrieve a something that

should have

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

already been known lower in the driver leaves room for race

conditions.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

This is how the blk and scsi tag api work for queue based

tagging. We

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

have the scsi_find_tag() function which takes a scsi device and

than

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

calls blk_queue_find_tag to get the request. It then does all

the magic

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

sdev to request_queue and request to scsi command work and pass

the LLD

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the scsi command for the tag. So we can either add a driver

array and do

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

some tag to scsi command or driver stucture mapping or we can

use the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

array already created in the scsi host block queue tag. And as

you see

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Dave's patch did the latter in the spirit of not duplicating

what

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

scsi-ml or the block layer already do.

I think there are some basic races though. For example,

scsi_request_fn

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

calls blk_queue_start_tag with only the queue lock held and so

if the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

request_fn was called for two devices on the same host at the

same time

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

they both could call find_first_zero_bit on the shared

bqt->tag_map and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

end up getting the same tag.

Hrmpf good point, I suspect that would be easy enough to fix

with just

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 8 lines

using a

        do {
                tag = ffz_bit(..);
        } while (test_and_set_bit(tag, map);

construct. Agree?

I think so. I think this is similar to what Dave was going to do

too.

Quoted 4 lines
Quoted 4 lines

Already checked in such a fix:

Quoted 8 lines

http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=7ddbe6863ac4b7a55
88aa4a70f262c098f3c469a

Thanks. This a lot elegant than the one I came up with using a lock. Jens, any comments on this patch
[RFC] [PATCH] helper function for retrieving scsi_cmd given host based block layer tag
http://marc.theaimsgroup.com/?l=linux-scsi&m=115871027627964&w=2

Patch looks very nice to me, I'll apply it and let James scream if he dislikes it for some reason (I don't see why, though).

Signature · 1 line
Jens Axboe
#12 lore raw
Quoted 17 lines

From: Jens Axboe [mailto:[email protected]]

Quoted 13 lines · David Somayajulu
Quoted 8 lines

From: Jens Axboe [mailto:[email protected]]
Sent: Thursday, September 21, 2006 11:48 AM

Quoted 5 lines · Jens Axboe
Quoted 4 lines · Mike Christie
Quoted 3 lines · Jens Axboe
Quoted 2 lines · Mike Christie
Quoted 1 line · James Smart

Why does your LLD need to reach up into the block layer to

find an i/o ?

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Even if you are using tags as an index into something... I

would think that

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

having to go up to the blk layer to retrieve a something

that

Quoted 2 lines
Quoted 2 lines

should have

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

already been known lower in the driver leaves room for

race

Quoted 5 lines
Quoted 5 lines

conditions.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

This is how the blk and scsi tag api work for queue based

tagging. We

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

have the scsi_find_tag() function which takes a scsi device

and

Quoted 2 lines
Quoted 2 lines

than

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

calls blk_queue_find_tag to get the request. It then does

all

Quoted 2 lines
Quoted 2 lines

the magic

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

sdev to request_queue and request to scsi command work and

pass

Quoted 4 lines
Quoted 4 lines

the LLD

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the scsi command for the tag. So we can either add a driver

array and do

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

some tag to scsi command or driver stucture mapping or we

can

Quoted 2 lines
Quoted 2 lines

use the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

array already created in the scsi host block queue tag. And

as

Quoted 2 lines
Quoted 2 lines

you see

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Dave's patch did the latter in the spirit of not

duplicating

Quoted 6 lines
Quoted 6 lines

what

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

scsi-ml or the block layer already do.

I think there are some basic races though. For example,

scsi_request_fn

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

calls blk_queue_start_tag with only the queue lock held and

so

Quoted 2 lines
Quoted 2 lines

if the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

request_fn was called for two devices on the same host at

the

Quoted 9 lines
Quoted 9 lines

same time

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

they both could call find_first_zero_bit on the shared

bqt->tag_map and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

end up getting the same tag.

Hrmpf good point, I suspect that would be easy enough to fix

with just

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

using a

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
        do {
                tag = ffz_bit(..);
        } while (test_and_set_bit(tag, map);

construct. Agree?

I think so. I think this is similar to what Dave was going to

do

Quoted 6 lines
Quoted 6 lines

too.

Quoted 4 lines
Quoted 4 lines

Already checked in such a fix:

http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=7ddbe6863ac4b7a55

Quoted 5 lines
Quoted 5 lines

88aa4a70f262c098f3c469a

Thanks. This a lot elegant than the one I came up with using a lock. Jens, any comments on this patch
[RFC] [PATCH] helper function for retrieving scsi_cmd given host

based

Quoted 5 lines
Quoted 2 lines

block layer tag
http://marc.theaimsgroup.com/?l=linux-scsi&m=115871027627964&w=2

Patch looks very nice to me, I'll apply it and let James scream if he dislikes it for some reason (I don't see why, though).

James and Christoph,
I would you really appreciate if you could let me know where we stand on the inclusion of qla4xxx driver upstream. Block layer tagging was the last gating item in the last round and it has been taken care of. Thanks
David Somayajulu

#13 lore raw

Once again, we would really appreciate if you could please let us know the status of qla4xxx driver regarding its inclusion upstream. Thanks
David Somayajulu

#14 lore raw
Quoted 2 lines · David Somayajulu

Once again, we would really appreciate if you could please let us know the status of qla4xxx driver regarding its inclusion upstream.

OK, I have this (it won't go to scsi-misc until Jens pushes the block changes on which it depends).

However, there was a tonne of trailing whitespace I had to remove:

Warning: trailing whitespace in line 6 of drivers/scsi/qla4xxx/Kconfig
Warning: trailing whitespace in lines 173,543,544,801,802 of drivers/scsi/qla4xxx/ql4_mbx.c
Warning: trailing whitespace in lines 587,712 of drivers/scsi/qla4xxx/ql4_isr.c
Warning: trailing whitespace in lines 491,896,1147,1176,1439 of drivers/scsi/qla4xxx/ql4_os.c
Warning: trailing whitespace in lines 44,363,481,527,1135 of drivers/scsi/qla4xxx/ql4_init.c

James

#15 lore raw
Quoted 4 lines

From: James Bottomley [mailto:[email protected]]
Sent: Wednesday, October 04, 2006 8:50 AM
To: David Somayajulu
Cc: Mike Christie; [email protected]; Christoph Hellwig;

David Wagner

Quoted 4 lines

Subject: RE: [RFC] [PATCH] qla4xxx driver resubmission

Quoted 1 line · David Somayajulu

Once again, we would really appreciate if you could please let us

know

Quoted 17 lines
Quoted 1 line

the status of qla4xxx driver regarding its inclusion upstream.

OK, I have this (it won't go to scsi-misc until Jens pushes the block changes on which it depends).

However, there was a tonne of trailing whitespace I had to remove:

Warning: trailing whitespace in line 6 of drivers/scsi/qla4xxx/Kconfig
Warning: trailing whitespace in lines 173,543,544,801,802 of drivers/scsi/qla4xxx/ql4_mbx.c
Warning: trailing whitespace in lines 587,712 of drivers/scsi/qla4xxx/ql4_isr.c
Warning: trailing whitespace in lines 491,896,1147,1176,1439 of drivers/scsi/qla4xxx/ql4_os.c
Warning: trailing whitespace in lines 44,363,481,527,1135 of drivers/scsi/qla4xxx/ql4_init.c

Quoted 2 lines

James

Thanks a lot James. My apologies for the inconvenience pertaining to whitespaces. For future, is there any tool out there which one run, to sanitize the code before submission.
-david S.

#16 lore raw
Quoted 3 lines · David Somayajulu

Thanks a lot James. My apologies for the inconvenience pertaining to whitespaces. For future, is there any tool out there which one run, to sanitize the code before submission.

Quilt and git both warn about this ... which is how I noticed it in the first place.

James

#17 lore raw
In reply to David Somayajulu
Quoted 3 lines · David Somayajulu

Thanks a lot James. My apologies for the inconvenience pertaining to whitespaces. For future, is there any tool out there which one run, to sanitize the code before submission.

grep -n ' \t' drivers/scsi/ncr53c8xx.c