Re: Performance of SCST versus STGT
FUJITA Tomonori wrote: On Thu, 17 Jan 2008 10:27:08 +0100 Bart Van Assche [EMAIL PROTECTED] wrote: Hello, I have performed a test to compare the performance of SCST and STGT. Apparently the SCST target implementation performed far better than the STGT target implementation. This makes me wonder whether this is due to the design of SCST or whether STGT's performance can be improved to the level of SCST ? Test performed: read 2 GB of data in blocks of 1 MB from a target (hot cache -- no disk reads were performed, all reads were from the cache). Test command: time dd if=/dev/sde of=/dev/null bs=1M count=2000 STGT read SCST read performance (MB/s) performance (MB/s) Ethernet (1 Gb/s network)7789 IPoIB (8 Gb/s network) 82 229 SRP (8 Gb/s network)N/A 600 iSER (8 Gb/s network)80 N/A These results show that SCST uses the InfiniBand network very well (effectivity of about 88% via SRP), but that the current STGT version is unable to transfer data faster than 82 MB/s. Does this mean that there is a severe bottleneck present in the current STGT implementation ? I don't know about the details but Pete said that he can achieve more than 900MB/s read performance with tgt iSER target using ramdisk. http://www.mail-archive.com/[EMAIL PROTECTED]/msg4.html Please don't confuse multithreaded latency insensitive workload with single threaded, hence latency sensitive one. 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 - 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
Re: Performance of SCST versus STGT
On Thu, 17 Jan 2008 10:27:08 +0100 Bart Van Assche [EMAIL PROTECTED] wrote: Hello, I have performed a test to compare the performance of SCST and STGT. Apparently the SCST target implementation performed far better than the STGT target implementation. This makes me wonder whether this is due to the design of SCST or whether STGT's performance can be improved to the level of SCST ? Test performed: read 2 GB of data in blocks of 1 MB from a target (hot cache -- no disk reads were performed, all reads were from the cache). Test command: time dd if=/dev/sde of=/dev/null bs=1M count=2000 STGT read SCST read performance (MB/s) performance (MB/s) Ethernet (1 Gb/s network)7789 IPoIB (8 Gb/s network) 82 229 SRP (8 Gb/s network)N/A 600 iSER (8 Gb/s network)80 N/A These results show that SCST uses the InfiniBand network very well (effectivity of about 88% via SRP), but that the current STGT version is unable to transfer data faster than 82 MB/s. Does this mean that there is a severe bottleneck present in the current STGT implementation ? I don't know about the details but Pete said that he can achieve more than 900MB/s read performance with tgt iSER target using ramdisk. http://www.mail-archive.com/[EMAIL PROTECTED]/msg4.html - 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
Re: Performance of SCST versus STGT
On Thu, 17 Jan 2008 12:48:28 +0300 Vladislav Bolkhovitin [EMAIL PROTECTED] wrote: FUJITA Tomonori wrote: On Thu, 17 Jan 2008 10:27:08 +0100 Bart Van Assche [EMAIL PROTECTED] wrote: Hello, I have performed a test to compare the performance of SCST and STGT. Apparently the SCST target implementation performed far better than the STGT target implementation. This makes me wonder whether this is due to the design of SCST or whether STGT's performance can be improved to the level of SCST ? Test performed: read 2 GB of data in blocks of 1 MB from a target (hot cache -- no disk reads were performed, all reads were from the cache). Test command: time dd if=/dev/sde of=/dev/null bs=1M count=2000 STGT read SCST read performance (MB/s) performance (MB/s) Ethernet (1 Gb/s network)7789 IPoIB (8 Gb/s network) 82 229 SRP (8 Gb/s network)N/A 600 iSER (8 Gb/s network)80 N/A These results show that SCST uses the InfiniBand network very well (effectivity of about 88% via SRP), but that the current STGT version is unable to transfer data faster than 82 MB/s. Does this mean that there is a severe bottleneck present in the current STGT implementation ? I don't know about the details but Pete said that he can achieve more than 900MB/s read performance with tgt iSER target using ramdisk. http://www.mail-archive.com/[EMAIL PROTECTED]/msg4.html Please don't confuse multithreaded latency insensitive workload with single threaded, hence latency sensitive one. Seems that he can get good performance with single threaded workload: http://www.osc.edu/~pw/papers/wyckoff-iser-snapi07-talk.pdf But I don't know about the details so let's wait for Pete to comment on this. Perhaps Voltaire people could comment on the tgt iSER performances. - 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
Re: Performance of SCST versus STGT
FUJITA Tomonori wrote: On Thu, 17 Jan 2008 12:48:28 +0300 Vladislav Bolkhovitin [EMAIL PROTECTED] wrote: FUJITA Tomonori wrote: On Thu, 17 Jan 2008 10:27:08 +0100 Bart Van Assche [EMAIL PROTECTED] wrote: Hello, I have performed a test to compare the performance of SCST and STGT. Apparently the SCST target implementation performed far better than the STGT target implementation. This makes me wonder whether this is due to the design of SCST or whether STGT's performance can be improved to the level of SCST ? Test performed: read 2 GB of data in blocks of 1 MB from a target (hot cache -- no disk reads were performed, all reads were from the cache). Test command: time dd if=/dev/sde of=/dev/null bs=1M count=2000 STGT read SCST read performance (MB/s) performance (MB/s) Ethernet (1 Gb/s network)7789 IPoIB (8 Gb/s network) 82 229 SRP (8 Gb/s network)N/A 600 iSER (8 Gb/s network)80 N/A These results show that SCST uses the InfiniBand network very well (effectivity of about 88% via SRP), but that the current STGT version is unable to transfer data faster than 82 MB/s. Does this mean that there is a severe bottleneck present in the current STGT implementation ? I don't know about the details but Pete said that he can achieve more than 900MB/s read performance with tgt iSER target using ramdisk. http://www.mail-archive.com/[EMAIL PROTECTED]/msg4.html Please don't confuse multithreaded latency insensitive workload with single threaded, hence latency sensitive one. Seems that he can get good performance with single threaded workload: http://www.osc.edu/~pw/papers/wyckoff-iser-snapi07-talk.pdf Hmm, I can't find which IB hardware did he use and it's declared Gbps speed. He declared only Mellanox 4X SDR, switch. What does it mean? But I don't know about the details so let's wait for Pete to comment on this. I added him on CC Perhaps Voltaire people could comment on the tgt iSER performances. - 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
[PATCH] atp870u: don't zero out sense_buffer in queuecommand
LLDs don't need to zero out scsi_cmnd::sense_buffer in queuecommand since scsi-ml does. This is a preparation of the future changes to allocate the sense_buffer only when necessary. Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED] --- drivers/scsi/atp870u.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index db6de5e..fb27f2c 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c @@ -613,7 +613,6 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p, struct Scsi_Host *host; c = scmd_channel(req_p); - req_p-sense_buffer[0]=0; scsi_set_resid(req_p, 0); if (scmd_channel(req_p) 1) { req_p-result = 0x0004; -- 1.5.3.4 - 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
Re: [Stgt-devel] Performance of SCST versus STGT
On Thu, Jan 17, 2008 at 01:34:46PM +0300, Vladislav Bolkhovitin wrote: Hmm, I can't find which IB hardware did he use and it's declared Gbps speed. He declared only Mellanox 4X SDR, switch. What does it mean? SDR is 10Gbit carrier, at most about ~900MB/s data rate. DDR is 20Gbit carrier, at most about ~1400MB/s data rate. On Thu, 17 Jan 2008 10:27:08 +0100 Bart Van Assche [EMAIL PROTECTED] wrote: Test performed: read 2 GB of data in blocks of 1 MB from a target (hot cache -- no disk reads were performed, all reads were from the cache). Test command: time dd if=/dev/sde of=/dev/null bs=1M count=2000 STGT read SCST read performance (MB/s) performance (MB/s) Ethernet (1 Gb/s network)7789 IPoIB (8 Gb/s network) 82 229 SRP (8 Gb/s network)N/A 600 iSER (8 Gb/s network)80 N/A it kinda looks to me like the tgt iSER tests were waaay too slow to be using RDMA :-/ I use tgt to get 500MB/s writes over iSER DDR IB to real files (not ramdisk). Reads are a little slower, but that changes a bit with distro vs. mainline kernels. was iscsiadm was pointed at the IP of the IPoIB interface on the target? I think tgtd requires that. how about setting the transport to be iser with eg. iscsiadm --mode node --targetname something --portal ipoib:3260 --op update -n node.transport_name -v iser iscsiadm --mode node --targetname something --portal ipoib:3260 --op update -n node.conn[0].iscsi.HeaderDigest -v None does the initiator side kernel report that it's using iSER? it should look roughly like the below. Jan 14 14:37:21 x2 kernel: iscsi: registered transport (iser) Jan 14 14:37:21 x2 iscsid: iSCSI logger with pid=5617 started! Jan 14 14:37:22 x2 iscsid: transport class version 2.0-724. iscsid version 2.0-865 Jan 14 14:37:22 x2 iscsid: iSCSI daemon with pid=5618 started! Jan 14 14:37:22 x2 kernel: iser: iser_connect:connecting to: 192.168.1.8, port 0xbc0c Jan 14 14:37:23 x2 kernel: iser: iser_cma_handler:event 0 conn 8102523c4c80 id 81025df68e00 Jan 14 14:37:23 x2 kernel: iser: iser_cma_handler:event 2 conn 8102523c4c80 id 81025df68e00 Jan 14 14:37:24 x2 kernel: iser: iser_create_ib_conn_res:setting conn 8102523c4c80 cma_id 81025df68e00: fmr_pool 81025341b5c0 qp 810252109200 Jan 14 14:37:24 x2 kernel: iser: iser_cma_handler:event 9 conn 8102523c4c80 id 81025df68e00 Jan 14 14:37:24 x2 kernel: iser: iscsi_iser_ep_poll:ib conn 8102523c4c80 rc = 1 Jan 14 14:37:24 x2 kernel: scsi6 : iSCSI Initiator over iSER, v.0.1 Jan 14 14:37:24 x2 kernel: iser: iscsi_iser_conn_bind:binding iscsi conn 810251a94290 to iser_conn 8102523c4c80 Jan 14 14:37:24 x2 kernel: Vendor: IET Model: ControllerRev: 0001 Jan 14 14:37:24 x2 kernel: Type: RAID ANSI SCSI revision: 05 Jan 14 14:37:24 x2 kernel: scsi 6:0:0:0: Attached scsi generic sg2 type 12 Jan 14 14:37:25 x2 kernel: Vendor: IET Model: VIRTUAL-DISK Rev: 0001 Jan 14 14:37:25 x2 kernel: Type: Direct-Access ANSI SCSI revision: 05 Jan 14 14:37:25 x2 kernel: SCSI device sdc: 20971520 512-byte hdwr sectors (10737 MB) Jan 14 14:37:25 x2 kernel: sdc: Write Protect is off Jan 14 14:37:25 x2 kernel: SCSI device sdc: drive cache: write back Jan 14 14:37:25 x2 kernel: SCSI device sdc: 20971520 512-byte hdwr sectors (10737 MB) Jan 14 14:37:25 x2 kernel: sdc: Write Protect is off Jan 14 14:37:25 x2 kernel: SCSI device sdc: drive cache: write back Jan 14 14:37:25 x2 kernel: sdc: unknown partition table Jan 14 14:37:25
Re: [Scst-devel] [Stgt-devel] Performance of SCST versus STGT
Robin Humble wrote: On Thu, Jan 17, 2008 at 01:34:46PM +0300, Vladislav Bolkhovitin wrote: Hmm, I can't find which IB hardware did he use and it's declared Gbps speed. He declared only Mellanox 4X SDR, switch. What does it mean? SDR is 10Gbit carrier, at most about ~900MB/s data rate. DDR is 20Gbit carrier, at most about ~1400MB/s data rate. Thanks. Then the single threaded rate with one outstanding command between SCST SRP on 8Gbps link vs STGT iSRP on 10Gbps link (according to that paper) is 600MB/s vs ~480MB/s (page 26). Still SCST based target is about 60% faster. On Thu, 17 Jan 2008 10:27:08 +0100 Bart Van Assche [EMAIL PROTECTED] wrote: Test performed: read 2 GB of data in blocks of 1 MB from a target (hot cache -- no disk reads were performed, all reads were from the cache). Test command: time dd if=/dev/sde of=/dev/null bs=1M count=2000 STGT read SCST read performance (MB/s) performance (MB/s) Ethernet (1 Gb/s network)7789 IPoIB (8 Gb/s network) 82 229 SRP (8 Gb/s network)N/A 600 iSER (8 Gb/s network)80 N/A it kinda looks to me like the tgt iSER tests were waaay too slow to be using RDMA :-/ I use tgt to get 500MB/s writes over iSER DDR IB to real files (not ramdisk). Reads are a little slower, but that changes a bit with distro vs. mainline kernels. - 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
Re: Performance of SCST versus STGT
FUJITA Tomonori wrote: On Thu, 17 Jan 2008 12:48:28 +0300 Vladislav Bolkhovitin [EMAIL PROTECTED] wrote: FUJITA Tomonori wrote: On Thu, 17 Jan 2008 10:27:08 +0100 Bart Van Assche [EMAIL PROTECTED] wrote: Hello, I have performed a test to compare the performance of SCST and STGT. Apparently the SCST target implementation performed far better than the STGT target implementation. This makes me wonder whether this is due to the design of SCST or whether STGT's performance can be improved to the level of SCST ? Test performed: read 2 GB of data in blocks of 1 MB from a target (hot cache -- no disk reads were performed, all reads were from the cache). Test command: time dd if=/dev/sde of=/dev/null bs=1M count=2000 STGT read SCST read performance (MB/s) performance (MB/s) Ethernet (1 Gb/s network)7789 IPoIB (8 Gb/s network) 82 229 SRP (8 Gb/s network)N/A 600 iSER (8 Gb/s network)80 N/A These results show that SCST uses the InfiniBand network very well (effectivity of about 88% via SRP), but that the current STGT version is unable to transfer data faster than 82 MB/s. Does this mean that there is a severe bottleneck present in the current STGT implementation ? I don't know about the details but Pete said that he can achieve more than 900MB/s read performance with tgt iSER target using ramdisk. http://www.mail-archive.com/[EMAIL PROTECTED]/msg4.html Please don't confuse multithreaded latency insensitive workload with single threaded, hence latency sensitive one. Seems that he can get good performance with single threaded workload: http://www.osc.edu/~pw/papers/wyckoff-iser-snapi07-talk.pdf But I don't know about the details so let's wait for Pete to comment on this. Perhaps Voltaire people could comment on the tgt iSER performances. We didn't run any real performance test with tgt, so I don't have numbers yet. I know that Pete got ~900 MB/sec by hacking sgp_dd, so all data was read/written to the same block (so it was all done in the cache). Pete - am I right? As already mentioned, he got that with IB SDR cards that are 10 Gb/sec cards in theory (actual speed is ~900 MB/sec). With DDR cards (20 Gb/sec), you can get even more. I plan to test that in the near future. Erez - 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
Re: Performance of SCST versus STGT
We didn't run any real performance test with tgt, so I don't have numbers yet. I know that Pete got ~900 MB/sec by hacking sgp_dd, so all data was read/written to the same block (so it was all done in the cache). Pete - am I right? As already mentioned, he got that with IB SDR cards that are 10 Gb/sec cards in theory (actual speed is ~900 MB/sec). With DDR cards (20 Gb/sec), you can get even more. I plan to test that in the near future. Are you writing about a maximum possible speed which he got, including multithreded tests with many outstanding commands or about speed he got on single threaded reads with one outstanding command? This thread is about the second one. As I said, we didn't run any performance tests on stgt yet. Erez - 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
Re: 2.6.24-rc8-mm1 Build Failure on scsi driver
Hi Andrew, The kernel build fails with following error drivers/scsi/aha152x.o: In function `aha152x_host_reset_host': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:1324: multiple definition of `aha152x_host_reset_host' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:1324: first defined here drivers/scsi/aha152x.o: In function `aha152x_release': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:908: multiple definition of `aha152x_release' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:908: first defined here ld: Warning: size of symbol `aha152x_release' changed from 68 in drivers/scsi/pcmcia/built-in.o to 100 in drivers/scsi/aha152x.o drivers/scsi/aha152x.o: In function `aha152x_probe_one': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:772: multiple definition of `aha152x_probe_one' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:772: first defined here drivers/scsi/fdomain.o:(.data+0x0): multiple definition of `fdomain_driver_template' drivers/scsi/pcmcia/built-in.o:(.data+0x5a0): first defined here drivers/scsi/fdomain.o: In function `fdomain_16x0_bus_reset': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:1568: multiple definition of `fdomain_16x0_bus_reset' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:1568: first defined here drivers/scsi/fdomain.o: In function `__fdomain_16x0_detect': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:894: multiple definition of `__fdomain_16x0_detect' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:894: first defined here ld: Warning: size of symbol `__fdomain_16x0_detect' changed from 1206 in drivers/scsi/pcmcia/built-in.o to 1700 in drivers/scsi/fdomain.o drivers/scsi/fdomain.o: In function `fdomain_setup': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:554: multiple definition of `fdomain_setup' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:554: first defined here make[2]: *** [drivers/scsi/built-in.o] Error 1 make[1]: *** [drivers/scsi] Error 2 make: *** [drivers] Error 2 -- Thanks Regards, Kamalesh Babulal, Linux Technology Center, IBM, ISTL. - 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
Re: [PATCH v2] use dynamically allocated sense buffer
On Thu, 2008-01-17 at 18:13 +0900, FUJITA Tomonori wrote: On Wed, 16 Jan 2008 14:35:50 +0200 Benny Halevy [EMAIL PROTECTED] wrote: On Jan. 15, 2008, 17:20 +0200, James Bottomley [EMAIL PROTECTED] wrote: On Tue, 2008-01-15 at 18:23 +0900, FUJITA Tomonori wrote: This is the second version of http://marc.info/?l=linux-scsim=119933628210006w=2 I gave up once, but I found that the performance loss is negligible (within 1%) by using kmem_cache_alloc instead of mempool. I use scsi_debug with fake_rw=1 and disktest (DIO reads with 8 threads) again: scsi-misc (slub) | 486.9 MB/s IOPS 124652.9/s dynamic sense buf (slub) | 483.2 MB/s IOPS 123704.1/s scsi-misc (slab) | 467.0 MB/s IOPS 119544.3/s dynamic sense buf (slab) | 468.7 MB/s IOPS 119986.0/s The results are the averages of three runs with a server using two dual-core 1.60 GHz Xeon processors with DDR2 memory. I doubt think that someone will complain about the performance regression due to this patch. In addition, unlike scsi_debug, the real LLDs allocate the own data structure per scsi_cmnd so the performance differences would be smaller (and with the real hard disk overheads). Here's the full results: http://www.kernel.org/pub/linux/kernel/people/tomo/sense/results.txt Heh, that's one of those good news, bad news things. Certainly good news for you. The bad news for the rest of us is that you just implicated mempool in a performance problem and since they're the core of the SCSI scatterlist allocations and sit at the heart of the critical path in SCSI, we have a potential performance issue in the whole of SCSI. Looking at mempool's code this is peculiar as what seems to be its critical path for alloc and free looks pretty harmless and lightweight. Maybe an extra memory barrier, spin_{,un}lock_* and two extra function call (one of them can be eliminated BTW if the order of arguments to the mempool_{alloc,free}_t functions were the same as for kmem_cache_{alloc,free}). Yeah, so I wondered why the change made a big difference. After more testing, it turned out that mempool is not so slow. v1 patch reserves as many buffers as can_queue per shost. My test server allocates 1519 sense buffers in total and then needs to allocate more. Seems that it hurts the performance. I would bet it does. Mempools aren't a performance enhancer, they're a deadlock avoider. So you don't prefill them with 1519 entries per host, you prefill them with at most two so that we can always guarantee getting a writeout command down in the event the system is totally out of GFP_ATOMIC memory and needs to free something. Plus, pool allocations of that size will get me hunted down and shot by the linux tiny (or other embedded) community. I modified v3 patch to allocate unused 1519 sense buffers via kmem_cache_alloc. It achieved 96.2% of the scsi-misc performance (note that v1 patch achieved 94.6% of the scsi-misc). I modified v3 patch to use mempool to allocate one buffer per host. It achieved 98.3% of the scsi-misc (note that v3 patch achieved 99.3% of the scsi-misc). This is about the correct thing to do. So I could say: - mempool is only about 1% slower to using kmem_cache directly. - reserving lots of slabs seems to hurt SLUB performance (I've not dug into it yet). The full results and two patches are: http://www.kernel.org/pub/linux/kernel/people/tomo/sense/ James - 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
Re: Newer kernel not detecting devices?
On Thu, 2008-01-17 at 14:37 +, David wrote: I have here a server with an LSI SCSI card. On one channel is a tape changer, on the other an external RAID5 box with a number of disks in. All worked fine until a recent upgrade and now the disk array is not recognised. The disk array is still recognised on machine startup in the SCSI card output on HBA 1, ID 0, LUN 0. The tape changer is recognised in the new install and has the correct devices assigned as before. The SCSI card used for the tape changer and disk array is an LSI Logic card. The MegaRAID is seperate, a Dell PERC which has the system disks attached. However, another PERC was tested instead of the LSI SCSI card which had the same problem. lspci: 00:02.0 PCI bridge: Intel Corporation E7525/E7520/E7320 PCI Express Port A (rev 09) 00:04.0 PCI bridge: Intel Corporation E7525/E7520 PCI Express Port B (rev 09) ) 02:0c.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 07) 02:0c.1 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 07) 02:0e.0 RAID bus controller: Dell PowerEdge Expandable RAID controller 4 (rev 06) On the old install, the following is seen: /proc/scsi/sg/device_strs PE/PV 1x2 SCSI BP 1.0 MegaRAID LD 0 RAID1 286G516A E1600SR 0001 (the disk array) HL-DT-ST RW/DVD GCC-4243NA102 Where is the changer in this? uname -a: Linux ubuntu 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux On the new install: /proc/scsi/sg/device_strs HL-DT-ST RW/DVD GCC-4243NA102 PE/PV 1x2 SCSI BP 1.0 MegaRAID LD 0 RAID1 286G516A uname -a: Linux ubuntu 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT 2007 i686 GNU/Linux dmesg output from both builds is attached to this message. A livecd of the old OS still recognises the disk array as sdb1 correctly. Is this an issue with modules/options or a problem with the distro (Ubuntu server)? A good way to tell that would be to try booting with a vanilla linux kernel. 2.6.24-rc8 should do the trick. James - 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
Re: Performance of SCST versus STGT
Erez Zilber wrote: FUJITA Tomonori wrote: On Thu, 17 Jan 2008 12:48:28 +0300 Vladislav Bolkhovitin [EMAIL PROTECTED] wrote: FUJITA Tomonori wrote: On Thu, 17 Jan 2008 10:27:08 +0100 Bart Van Assche [EMAIL PROTECTED] wrote: Hello, I have performed a test to compare the performance of SCST and STGT. Apparently the SCST target implementation performed far better than the STGT target implementation. This makes me wonder whether this is due to the design of SCST or whether STGT's performance can be improved to the level of SCST ? Test performed: read 2 GB of data in blocks of 1 MB from a target (hot cache -- no disk reads were performed, all reads were from the cache). Test command: time dd if=/dev/sde of=/dev/null bs=1M count=2000 STGT read SCST read performance (MB/s) performance (MB/s) Ethernet (1 Gb/s network)7789 IPoIB (8 Gb/s network) 82 229 SRP (8 Gb/s network)N/A 600 iSER (8 Gb/s network)80 N/A These results show that SCST uses the InfiniBand network very well (effectivity of about 88% via SRP), but that the current STGT version is unable to transfer data faster than 82 MB/s. Does this mean that there is a severe bottleneck present in the current STGT implementation ? I don't know about the details but Pete said that he can achieve more than 900MB/s read performance with tgt iSER target using ramdisk. http://www.mail-archive.com/[EMAIL PROTECTED]/msg4.html Please don't confuse multithreaded latency insensitive workload with single threaded, hence latency sensitive one. Seems that he can get good performance with single threaded workload: http://www.osc.edu/~pw/papers/wyckoff-iser-snapi07-talk.pdf But I don't know about the details so let's wait for Pete to comment on this. Perhaps Voltaire people could comment on the tgt iSER performances. We didn't run any real performance test with tgt, so I don't have numbers yet. I know that Pete got ~900 MB/sec by hacking sgp_dd, so all data was read/written to the same block (so it was all done in the cache). Pete - am I right? As already mentioned, he got that with IB SDR cards that are 10 Gb/sec cards in theory (actual speed is ~900 MB/sec). With DDR cards (20 Gb/sec), you can get even more. I plan to test that in the near future. Are you writing about a maximum possible speed which he got, including multithreded tests with many outstanding commands or about speed he got on single threaded reads with one outstanding command? This thread is about the second one. Erez - 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 - 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
Newer kernel not detecting devices?
I have here a server with an LSI SCSI card. On one channel is a tape changer, on the other an external RAID5 box with a number of disks in. All worked fine until a recent upgrade and now the disk array is not recognised. The disk array is still recognised on machine startup in the SCSI card output on HBA 1, ID 0, LUN 0. The tape changer is recognised in the new install and has the correct devices assigned as before. The SCSI card used for the tape changer and disk array is an LSI Logic card. The MegaRAID is seperate, a Dell PERC which has the system disks attached. However, another PERC was tested instead of the LSI SCSI card which had the same problem. lspci: 00:02.0 PCI bridge: Intel Corporation E7525/E7520/E7320 PCI Express Port A (rev 09) 00:04.0 PCI bridge: Intel Corporation E7525/E7520 PCI Express Port B (rev 09) ) 02:0c.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 07) 02:0c.1 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 07) 02:0e.0 RAID bus controller: Dell PowerEdge Expandable RAID controller 4 (rev 06) On the old install, the following is seen: /proc/scsi/sg/device_strs PE/PV 1x2 SCSI BP 1.0 MegaRAIDLD 0 RAID1 286G516A E1600SR 0001 (the disk array) HL-DT-STRW/DVD GCC-4243NA102 uname -a: Linux ubuntu 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux On the new install: /proc/scsi/sg/device_strs HL-DT-STRW/DVD GCC-4243NA102 PE/PV 1x2 SCSI BP 1.0 MegaRAIDLD 0 RAID1 286G516A uname -a: Linux ubuntu 2.6.22-14-server #1 SMP Sun Oct 14 23:34:23 GMT 2007 i686 GNU/Linux dmesg output from both builds is attached to this message. A livecd of the old OS still recognises the disk array as sdb1 correctly. Is this an issue with modules/options or a problem with the distro (Ubuntu server)? Regards, David 2.6.22-dmesg.gz Description: application/gzip 2.6.20-dmesg.gz Description: application/gzip
[PATCH 8/8] Change SG_ALL to mean any size
Change the definition of SG_ALL from 255, which was the biggest possible scatter list array in 32 bit ARCHs (minus one who knows why), to be ~0. Which means that LLD has no size limit on number of scatter-list array and the actual size will be determined by upper layers. Also SG_NONE is removed because it is no longer supported. Note: SG_ALL can not be used as an allocation size anymore. FIXME: Important/capable drivers like iscsi have moved away from SG_ALL to hard coded numbers like 4096. They should reuse SG_ALL now. Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- include/scsi/scsi_host.h |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 5c58d59..6032d07 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -21,16 +21,14 @@ struct blk_queue_tags; /* - * The various choices mean: - * NONE: Self evident. Host adapter is not capable of scatter-gather. + * values to use with .sg_tablesize: * ALL: Means that the host adapter module can do scatter-gather, * and that there is no limit to the size of the table to which * we scatter/gather data. * Anything else: Indicates the maximum number of chains that can be * used in one scatter-gather request. */ -#define SG_NONE 0 -#define SG_ALL 0xff +#define SG_ALL (~0) #define MODE_UNKNOWN 0x00 #define MODE_INITIATOR 0x01 -- 1.5.3.3 - 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
[PATCH 7/8] a100u2w: advansys: initio: Wrong use of SG_ALL
These drivers used the SG_ALL constant, But actually meant some other define. Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- drivers/scsi/a100u2w.c |3 +-- drivers/scsi/advansys.c |8 +++- drivers/scsi/initio.c |2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index f608d4a..82d5210 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c @@ -1068,7 +1068,7 @@ static struct scsi_host_template inia100_template = { .eh_device_reset_handler = inia100_device_reset, .can_queue = 1, .this_id= 1, - .sg_tablesize = SG_ALL, + .sg_tablesize = TOTAL_SG_ENTRY, .cmd_per_lun= 1, .use_clustering = ENABLE_CLUSTERING, }; @@ -1150,7 +1150,6 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev, shost-max_lun = 16; shost-irq = pdev-irq; shost-this_id = host-scsi_id; /* Assign HCS index */ - shost-sg_tablesize = TOTAL_SG_ENTRY; /* Initial orc chip */ error = request_irq(pdev-irq, inia100_intr, IRQF_SHARED, diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 492702b..45d58d3 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -13735,13 +13735,11 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost, } /* -* The value of 'sg_tablesize' can not exceed the SCSI -* mid-level driver definition of SG_ALL. SG_ALL also -* must not be exceeded, because it is used to define the +* The value of 'sg_tablesize' can not exceed the * size of the scatter-gather table in 'struct asc_sg_head'. */ - if (shost-sg_tablesize SG_ALL) { - shost-sg_tablesize = SG_ALL; + if (shost-sg_tablesize ASC_MAX_SG_LIST) { + shost-sg_tablesize = ASC_MAX_SG_LIST; } ASC_DBG(1, sg_tablesize: %d\n, shost-sg_tablesize); diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 52238ee..02cb133 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2829,7 +2829,7 @@ static struct scsi_host_template initio_template = { .bios_param = i91u_biosparam, .can_queue = MAX_TARGETS * i91u_MAXQUEUE, .this_id= 1, - .sg_tablesize = SG_ALL, + .sg_tablesize = TOTAL_SG_ENTRY, .cmd_per_lun= 1, .use_clustering = ENABLE_CLUSTERING, }; -- 1.5.3.3 - 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
[PATCH 5/8] arm/scsi: Not sg-chain ready
arm-scsi core is not sg-chain ready, so maximum scatterlist supported is SCSI_MAX_SG_SEGMENTS. Define it so, in core, and let all drivers use it for the sg_tablesize in host templates. Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- drivers/scsi/arm/acornscsi.c |2 +- drivers/scsi/arm/arxescsi.c |2 +- drivers/scsi/arm/cumana_2.c |2 +- drivers/scsi/arm/eesox.c |2 +- drivers/scsi/arm/powertec.c |2 +- drivers/scsi/arm/scsi.h |2 ++ 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index 3bedf24..58a88a8 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c @@ -2981,7 +2981,7 @@ static struct scsi_host_template acornscsi_template = { .reset = acornscsi_reset, .can_queue = 16, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = ARM_SCSI_MAX_SG, .cmd_per_lun= 2, .unchecked_isa_dma = 0, .use_clustering = DISABLE_CLUSTERING, diff --git a/drivers/scsi/arm/arxescsi.c b/drivers/scsi/arm/arxescsi.c index 2836fe2..a35e7c1 100644 --- a/drivers/scsi/arm/arxescsi.c +++ b/drivers/scsi/arm/arxescsi.c @@ -270,7 +270,7 @@ static struct scsi_host_template arxescsi_template = { .eh_abort_handler = fas216_eh_abort, .can_queue = 0, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = ARM_SCSI_MAX_SG, .cmd_per_lun= 1, .use_clustering = DISABLE_CLUSTERING, .proc_name = arxescsi, diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c index 68a6412..3fe690c 100644 --- a/drivers/scsi/arm/cumana_2.c +++ b/drivers/scsi/arm/cumana_2.c @@ -390,7 +390,7 @@ static struct scsi_host_template cumanascsi2_template = { .eh_abort_handler = fas216_eh_abort, .can_queue = 1, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = ARM_SCSI_MAX_SG, .cmd_per_lun= 1, .use_clustering = DISABLE_CLUSTERING, .proc_name = cumanascsi2, diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c index bb2477b..e0a1cf6 100644 --- a/drivers/scsi/arm/eesox.c +++ b/drivers/scsi/arm/eesox.c @@ -508,7 +508,7 @@ static struct scsi_host_template eesox_template = { .eh_abort_handler = fas216_eh_abort, .can_queue = 1, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = ARM_SCSI_MAX_SG, .cmd_per_lun= 1, .use_clustering = DISABLE_CLUSTERING, .proc_name = eesox, diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c index d9a546d..ca27047 100644 --- a/drivers/scsi/arm/powertec.c +++ b/drivers/scsi/arm/powertec.c @@ -302,7 +302,7 @@ static struct scsi_host_template powertecscsi_template = { .can_queue = 8, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = ARM_SCSI_MAX_SG, .cmd_per_lun= 2, .use_clustering = ENABLE_CLUSTERING, .proc_name = powertec, diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h index c7415fc..dffd073 100644 --- a/drivers/scsi/arm/scsi.h +++ b/drivers/scsi/arm/scsi.h @@ -14,6 +14,8 @@ #define BELT_AND_BRACES +/* FIXME: all drivers that depend on this are not chain-safe */ +#define ARM_SCSI_MAX_SG SCSI_MAX_SG_SEGMENTS /* * The scatter-gather list handling. This contains all * the yucky stuff that needs to be fixed properly. -- 1.5.3.3 - 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
[PATCH 4/8] wd33c93: Not sg-chain ready
wd33c93 core is not sg-chain ready, so maximum scatterlist supported is SCSI_MAX_SG_SEGMENTS. Define it so, in core, and let all drivers use it for the sg_tablesize in host templates. Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- drivers/scsi/a2091.c |2 +- drivers/scsi/a3000.c |2 +- drivers/scsi/gvp11.c |2 +- drivers/scsi/mvme147.c |2 +- drivers/scsi/sgiwd93.c |2 +- drivers/scsi/wd33c93.h |2 ++ 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c index 23f27c9..a5a511f 100644 --- a/drivers/scsi/a2091.c +++ b/drivers/scsi/a2091.c @@ -217,7 +217,7 @@ static struct scsi_host_template driver_template = { .eh_host_reset_handler = wd33c93_host_reset, .can_queue = CAN_QUEUE, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = WD_MAX_SG, .cmd_per_lun= CMD_PER_LUN, .use_clustering = DISABLE_CLUSTERING }; diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c index d7255c8..aaadf73 100644 --- a/drivers/scsi/a3000.c +++ b/drivers/scsi/a3000.c @@ -222,7 +222,7 @@ static struct scsi_host_template driver_template = { .eh_host_reset_handler = wd33c93_host_reset, .can_queue = CAN_QUEUE, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = WD_MAX_SG, .cmd_per_lun= CMD_PER_LUN, .use_clustering = ENABLE_CLUSTERING }; diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c index 37741e9..e56c257 100644 --- a/drivers/scsi/gvp11.c +++ b/drivers/scsi/gvp11.c @@ -371,7 +371,7 @@ static struct scsi_host_template driver_template = { .eh_host_reset_handler = wd33c93_host_reset, .can_queue = CAN_QUEUE, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = WD_MAX_SG, .cmd_per_lun= CMD_PER_LUN, .use_clustering = DISABLE_CLUSTERING }; diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c index be41aad..e69c108 100644 --- a/drivers/scsi/mvme147.c +++ b/drivers/scsi/mvme147.c @@ -140,7 +140,7 @@ static struct scsi_host_template driver_template = { .eh_host_reset_handler = wd33c93_host_reset, .can_queue = CAN_QUEUE, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = WD_MAX_SG, .cmd_per_lun= CMD_PER_LUN, .use_clustering = ENABLE_CLUSTERING }; diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c index d4ebe8c..60cc3d1 100644 --- a/drivers/scsi/sgiwd93.c +++ b/drivers/scsi/sgiwd93.c @@ -208,7 +208,7 @@ static struct scsi_host_template sgiwd93_template = { .eh_host_reset_handler = wd33c93_host_reset, .can_queue = 16, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = WD_MAX_SG, .cmd_per_lun= 8, .use_clustering = DISABLE_CLUSTERING, }; diff --git a/drivers/scsi/wd33c93.h b/drivers/scsi/wd33c93.h index 00123f2..e54d7f4 100644 --- a/drivers/scsi/wd33c93.h +++ b/drivers/scsi/wd33c93.h @@ -339,6 +339,8 @@ struct WD33C93_hostdata { #define PR_TEST 16 #define PR_STOP 17 +/* FIXME: Not sg-chain ready */ +#define WD_MAX_SG SCSI_MAX_SG_SEGMENTS void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs, dma_setup_t setup, dma_stop_t stop, int clock_freq); -- 1.5.3.3 - 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
[PATCH 3/8] NCR5380: Not sg-chain ready
NCR5380 core is not sg-chain ready, so maximum scatterlist supported is SCSI_MAX_SG_SEGMENTS. Define it so, in core, and let all drivers use it for the sg_tablesize in host templates. Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- drivers/scsi/NCR5380.h |3 +++ drivers/scsi/arm/cumana_1.c |2 +- drivers/scsi/arm/oak.c |2 +- drivers/scsi/dmx3191d.c |2 +- drivers/scsi/dtc.c |2 +- drivers/scsi/g_NCR5380.c |2 +- drivers/scsi/mac_scsi.c |9 - drivers/scsi/mac_scsi.h |4 drivers/scsi/sun3_scsi.c |4 ++-- drivers/scsi/sun3_scsi.h |4 drivers/scsi/sun3_scsi_vme.c |4 ++-- 11 files changed, 16 insertions(+), 22 deletions(-) diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h index bdc468c..cd7e258 100644 --- a/drivers/scsi/NCR5380.h +++ b/drivers/scsi/NCR5380.h @@ -37,6 +37,9 @@ #define NCR5380_PUBLIC_RELEASE 7 #define NCR53C400_PUBLIC_RELEASE 2 +/* FIXME: Not sg-chain ready */ +#define NCR5380_MAX_SG SCSI_MAX_SG_SEGMENTS + #define NDEBUG_ARBITRATION 0x1 #define NDEBUG_AUTOSENSE 0x2 #define NDEBUG_DMA 0x4 diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c index 49d838e..6315730 100644 --- a/drivers/scsi/arm/cumana_1.c +++ b/drivers/scsi/arm/cumana_1.c @@ -220,7 +220,7 @@ static struct scsi_host_template cumanascsi_template = { .eh_bus_reset_handler = NCR5380_bus_reset, .can_queue = 16, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = NCR5380_MAX_SG, .cmd_per_lun= 2, .unchecked_isa_dma = 0, .use_clustering = DISABLE_CLUSTERING, diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c index 849cdf8..69d9afd 100644 --- a/drivers/scsi/arm/oak.c +++ b/drivers/scsi/arm/oak.c @@ -123,7 +123,7 @@ static struct scsi_host_template oakscsi_template = { .eh_bus_reset_handler = NCR5380_bus_reset, .can_queue = 16, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = NCR5380_MAX_SG, .cmd_per_lun= 2, .use_clustering = DISABLE_CLUSTERING, .proc_name = oakscsi, diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c index fa738ec..92e89b8 100644 --- a/drivers/scsi/dmx3191d.c +++ b/drivers/scsi/dmx3191d.c @@ -63,7 +63,7 @@ static struct scsi_host_template dmx3191d_driver_template = { .eh_bus_reset_handler = NCR5380_bus_reset, .can_queue = 32, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = NCR5380_MAX_SG, .cmd_per_lun= 2, .use_clustering = DISABLE_CLUSTERING, }; diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c index c2677ba..f8e5dd9 100644 --- a/drivers/scsi/dtc.c +++ b/drivers/scsi/dtc.c @@ -479,7 +479,7 @@ static struct scsi_host_template driver_template = { .bios_param = dtc_biosparam, .can_queue = CAN_QUEUE, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = NCR5380_MAX_SG, .cmd_per_lun= CMD_PER_LUN, .use_clustering = DISABLE_CLUSTERING, }; diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 75585a5..aded3be 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c @@ -922,7 +922,7 @@ static struct scsi_host_template driver_template = { .bios_param = NCR5380_BIOSPARAM, .can_queue = CAN_QUEUE, .this_id = 7, -.sg_tablesize = SG_ALL, +.sg_tablesize = NCR5380_MAX_SG, .cmd_per_lun= CMD_PER_LUN, .use_clustering= DISABLE_CLUSTERING, }; diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c index 3b09ab2..d8a27c0 100644 --- a/drivers/scsi/mac_scsi.c +++ b/drivers/scsi/mac_scsi.c @@ -180,9 +180,8 @@ static int __init mac_scsi_setup(char *str) { if (ints[0] = 3) { if (ints[3] = 0) { setup_sg_tablesize = ints[3]; - /* Must be = SG_ALL (255) */ - if (setup_sg_tablesize SG_ALL) - setup_sg_tablesize = SG_ALL; + if (setup_sg_tablesize NCR5380_MAX_SG) + setup_sg_tablesize = NCR5380_MAX_SG; } } if (ints[0] = 4) { @@ -252,7 +251,7 @@ int macscsi_detect(struct scsi_host_template * tpnt) tpnt-cmd_per_lun = (setup_cmd_per_lun 0) ? setup_cmd_per_lun : CMD_PER_LUN; tpnt-sg_tablesize = - (setup_sg_tablesize = 0) ? setup_sg_tablesize :
[PATCH 2/8] scsi-drivers Don't use SG_ALL as allocation size
below list of drivers have used SG_ALL as a size to preallocate maximum possible command's sg-count. This is no longer possible since the maximum is not set at compile time but as a run time configuration. A better schema can be advised with a more dynamic allocation. Perhaps from a kmem_cache. Affected drivers/files: drivers/scsi/atari_scsi.[ch] drivers/scsi/eata_pio.c drivers/scsi/ibmvscsi/ibmvscsi.[ch] drivers/scsi/mac53c94.c drivers/scsi/mesh.c drivers/scsi/nsp32.h drivers/scsi/qla1280.c drivers/scsi/qla2xxx/qla_os.c drivers/scsi/qla4xxx/ql4_def.h Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- drivers/scsi/atari_scsi.c|8 drivers/scsi/atari_scsi.h|4 ++-- drivers/scsi/eata_pio.c |5 - drivers/scsi/ibmvscsi/ibmvscsi.c |8 +--- drivers/scsi/ibmvscsi/ibmvscsi.h |1 + drivers/scsi/mac53c94.c |8 ++-- drivers/scsi/mesh.c |5 - drivers/scsi/nsp32.h |2 +- drivers/scsi/qla1280.c |3 ++- drivers/scsi/qla2xxx/qla_os.c|2 ++ drivers/scsi/qla4xxx/ql4_def.h |1 + 11 files changed, 32 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index f5732d8..b47b61d 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c @@ -620,7 +620,8 @@ int atari_scsi_detect(struct scsi_host_template *host) /* Force sg_tablesize to 0 on a Falcon! */ host-sg_tablesize = !IS_A_TT() ? ATARI_FALCON_SG_TABLESIZE : - (setup_sg_tablesize = 0) ? setup_sg_tablesize : ATARI_TT_SG_TABLESIZE; + (setup_sg_tablesize 0) ? setup_sg_tablesize : + ATARI_TT_SG_TABLESIZE; if (setup_hostid = 0) host-this_id = setup_hostid; @@ -792,9 +793,8 @@ void __init atari_scsi_setup(char *str, int *ints) if (ints[0] = 3) { if (ints[3] = 0) { setup_sg_tablesize = ints[3]; - /* Must be = SG_ALL (255) */ - if (setup_sg_tablesize SG_ALL) - setup_sg_tablesize = SG_ALL; + if (setup_sg_tablesize ATARI_TT_SG_TABLESIZE) + setup_sg_tablesize = ATARI_TT_SG_TABLESIZE; } } if (ints[0] = 4) { diff --git a/drivers/scsi/atari_scsi.h b/drivers/scsi/atari_scsi.h index efadb8d..21b8c91 100644 --- a/drivers/scsi/atari_scsi.h +++ b/drivers/scsi/atari_scsi.h @@ -35,11 +35,11 @@ int atari_scsi_release (struct Scsi_Host *); #define ATARI_TT_CAN_QUEUE 16 #define ATARI_TT_CMD_PER_LUN 8 -#define ATARI_TT_SG_TABLESIZE SG_ALL +#define ATARI_TT_SG_TABLESIZE 255 #define ATARI_FALCON_CAN_QUEUE 8 #define ATARI_FALCON_CMD_PER_LUN 1 -#define ATARI_FALCON_SG_TABLESIZE SG_NONE +#define ATARI_FALCON_SG_TABLESIZE 1 #defineDEFAULT_USE_TAGGED_QUEUING 0 diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c index b5a6092..8913d9d 100644 --- a/drivers/scsi/eata_pio.c +++ b/drivers/scsi/eata_pio.c @@ -691,6 +691,9 @@ static unsigned int print_selftest(unsigned int base) return (!(inb(base + HA_RSTATUS) HA_SERROR)); } +/* FIXME: is this driver sg-chainning ready? */ +#define EATA_MAX_SG 255 + static int register_pio_HBA(long base, struct get_conf *gc, struct pci_dev *pdev) { unsigned long size = 0; @@ -801,7 +804,7 @@ static int register_pio_HBA(long base, struct get_conf *gc, struct pci_dev *pdev sh-this_id = gc-scsi_id[3]; sh-can_queue = 1; sh-cmd_per_lun = 1; - sh-sg_tablesize = SG_ALL; + sh-sg_tablesize = EATA_MAX_SG; hd-channel = 0; diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 78d46a9..9b1fc94 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -173,7 +173,8 @@ static void release_event_pool(struct event_pool *pool, ++in_use; if (pool-events[i].ext_list) { dma_free_coherent(hostdata-dev, - SG_ALL * sizeof(struct srp_direct_buf), + IBMVSCSI_MAX_SG * + sizeof(struct srp_direct_buf), pool-events[i].ext_list, pool-events[i].ext_list_token); } @@ -423,7 +424,8 @@ static int map_sg_data(struct scsi_cmnd *cmd, if (!evt_struct-ext_list) { evt_struct-ext_list = (struct srp_direct_buf *) dma_alloc_coherent(dev, - SG_ALL * sizeof(struct srp_direct_buf), +
[PATCH 1/8] firewire: ieee1394: Move away from SG_ALL
SG_ALL wants to be ~0 meaning any future size. Below group of drivers preallocate a scatter list buffer of max_size, so set that size to be 255 (Like before). A better schema can be advised with a more dynamic allocation. Perhaps from a kmem_cache. List of drivers/files: drivers/firewire/fw-sbp2.c drivers/ieee1394/sbp2.[ch] Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- drivers/firewire/fw-sbp2.c |6 -- drivers/ieee1394/sbp2.c|2 +- drivers/ieee1394/sbp2.h|4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index c2169d2..078501c 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c @@ -151,6 +151,7 @@ struct sbp2_target { }; #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000 +#define SBP2_MAX_SG_COUNT 255 #define SBP2_MAX_SECTORS 255 /* Max sectors supported */ #define SBP2_ORB_TIMEOUT 2000/* Timeout in ms */ @@ -272,7 +273,8 @@ struct sbp2_command_orb { scsi_done_fn_t done; struct sbp2_logical_unit *lu; - struct sbp2_pointer page_table[SG_ALL] __attribute__((aligned(8))); + struct sbp2_pointer page_table[SBP2_MAX_SG_COUNT] + __attribute__((aligned(8))); dma_addr_t page_table_bus; }; @@ -1329,7 +1331,7 @@ static struct scsi_host_template scsi_driver_template = { .slave_configure= sbp2_scsi_slave_configure, .eh_abort_handler = sbp2_scsi_abort, .this_id= -1, - .sg_tablesize = SG_ALL, + .sg_tablesize = SBP2_MAX_SG_COUNT, .use_clustering = ENABLE_CLUSTERING, .cmd_per_lun= 1, .can_queue = 1, diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 1eda11a..070763a 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -324,7 +324,7 @@ static struct scsi_host_template sbp2_shost_template = { .slave_configure = sbp2scsi_slave_configure, .slave_destroy = sbp2scsi_slave_destroy, .this_id = -1, - .sg_tablesize= SG_ALL, + .sg_tablesize= SBP2_MAX_SG_COUNT, .use_clustering = ENABLE_CLUSTERING, .cmd_per_lun = SBP2_MAX_CMDS, .can_queue = SBP2_MAX_CMDS, diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h index 333a4bb..ae31788 100644 --- a/drivers/ieee1394/sbp2.h +++ b/drivers/ieee1394/sbp2.h @@ -222,6 +222,7 @@ struct sbp2_status_block { */ #define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000 +#define SBP2_MAX_SG_COUNT 255 #define SBP2_MAX_SECTORS 255 /* There is no real limitation of the queue depth (i.e. length of the linked * list of command ORBs) at the target. The chosen depth is merely an @@ -257,7 +258,8 @@ struct sbp2_command_info { /* Also need s/g structure for each sbp2 command */ struct sbp2_unrestricted_page_table - scatter_gather_element[SG_ALL] __attribute__((aligned(8))); + scatter_gather_element[SBP2_MAX_SG_COUNT] + __attribute__((aligned(8))); dma_addr_t sge_dma; void *sge_buffer; dma_addr_t cmd_dma; -- 1.5.3.3 - 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
[patch 0/8] Change SG_ALL to mean any size
I have scanned through the scsi tree and checked all places that used SG_ALL. Those drivers that where not ready for SG_ALL to mean any size where changed to what ever is appropriate for this driver. Mainly 3 groups. Those that meant SG_ALL == 255: [PATCH 1/8] firewire: ieee1394: Move away from SG_ALL [PATCH 2/8] scsi-drivers Don't use SG_ALL as allocation size Those who are not sg-chaining ready: [PATCH 3/8] NCR5380: Not sg-chain ready [PATCH 4/8] wd33c93: Not sg-chain ready [PATCH 5/8] arm/scsi: Not sg-chain ready [PATCH 6/8] scsi: Drivers not ready for sg-chaining And those that just got confused: [PATCH 7/8] a100u2w: advansys: initio: Wrong use of SG_ALL And finally the switch of SG_ALL to ~0, that is MAX_ what ever type it is. [PATCH 8/8] Change SG_ALL to mean any size Please request if you want any patches squashed or split. These are based on the scsi-bidi git-tree and mainly on top of the: [SCSI] remove use_sg_chaining patch. James do you want that I reverse the dependency so your patch will be on top of these patches? (For bisect-ability) Boaz - 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
scsi: Drivers not ready for sg-chaining
All below drivers are not sg-chain ready do to incomplete software. Once fixed they can move back to SG_ALL. For now they are stuck on SCSI_MAX_SG_SEGMENTS. Affected drivers/files: drivers/scsi/aha152x.c drivers/scsi/esp_scsi.[ch] drivers/scsi/imm.c drivers/scsi/in2000.h drivers/scsi/pcmcia/nsp_cs.c drivers/scsi/ppa.c drivers/scsi/tmscsim.c Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- drivers/scsi/aha152x.c |5 - drivers/scsi/esp_scsi.c |2 +- drivers/scsi/esp_scsi.h |3 +++ drivers/scsi/imm.c |5 - drivers/scsi/in2000.h|2 +- drivers/scsi/pcmcia/nsp_cs.c |5 - drivers/scsi/ppa.c |4 +++- drivers/scsi/tmscsim.c |5 - 8 files changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 6ccdc96..6be6008 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -3460,6 +3460,9 @@ static int aha152x_adjust_queue(struct scsi_device *device) return 0; } +/* FIXME: Not sg-chain ready */ +#define AHA152X_MAX_SG SCSI_MAX_SG_SEGMENTS + static struct scsi_host_template aha152x_driver_template = { .module = THIS_MODULE, .name = AHA152X_REVID, @@ -3473,7 +3476,7 @@ static struct scsi_host_template aha152x_driver_template = { .bios_param = aha152x_biosparam, .can_queue = 1, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = AHA152X_MAX_SG, .cmd_per_lun= 1, .use_clustering = DISABLE_CLUSTERING, .slave_alloc= aha152x_adjust_queue, diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index bfdee59..83165f2 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -2603,7 +2603,7 @@ struct scsi_host_template scsi_esp_template = { .eh_host_reset_handler = esp_eh_host_reset_handler, .can_queue = 7, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = ESP_MAX_SG, .use_clustering = ENABLE_CLUSTERING, .max_sectors= 0x, .skip_settle_delay = 1, diff --git a/drivers/scsi/esp_scsi.h b/drivers/scsi/esp_scsi.h index d5576d5..0f86a90 100644 --- a/drivers/scsi/esp_scsi.h +++ b/drivers/scsi/esp_scsi.h @@ -289,6 +289,9 @@ struct esp_cmd_entry { #define ESP_MAX_LUN8 #define ESP_MAX_TAG256 +/* FIXME: not sg-chain ready */ +#define ESP_MAX_SG SCSI_MAX_SG_SEGMENTS + struct esp_lun_data { struct esp_cmd_entry*non_tagged_cmd; int num_tagged; diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index f97d172..6b81692 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -1112,6 +1112,9 @@ static int imm_adjust_queue(struct scsi_device *device) return 0; } +/* FIXME: not sg-chain ready */ +#define IMM_MAX_SG SCSI_MAX_SG_SEGMENTS + static struct scsi_host_template imm_template = { .module = THIS_MODULE, .proc_name = imm, @@ -1123,7 +1126,7 @@ static struct scsi_host_template imm_template = { .eh_host_reset_handler = imm_reset, .bios_param = imm_biosparam, .this_id= 7, - .sg_tablesize = SG_ALL, + .sg_tablesize = IMM_MAX_SG, .cmd_per_lun= 1, .use_clustering = ENABLE_CLUSTERING, .can_queue = 1, diff --git a/drivers/scsi/in2000.h b/drivers/scsi/in2000.h index 0fb8b06..388e16f 100644 --- a/drivers/scsi/in2000.h +++ b/drivers/scsi/in2000.h @@ -405,7 +405,7 @@ static int in2000_bus_reset(Scsi_Cmnd *); #define IN2000_CAN_Q16 -#define IN2000_SG SG_ALL +#define IN2000_SG SCSI_MAX_SG_SEGMENTS /* FIXME: not sg-chain ready */ #define IN2000_CPL 2 #define IN2000_HOST_ID 7 diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 5082ca3..a8f6d24 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c @@ -77,6 +77,9 @@ static int free_ports = 0; module_param(free_ports, bool, 0); MODULE_PARM_DESC(free_ports, Release IO ports after configuration? (default: 0 (=no))); +/* FIXME: not sg-chain ready */ +#define NSP_MAX_SG SCSI_MAX_SG_SEGMENTS + static struct scsi_host_template nsp_driver_template = { .proc_name = nsp_cs, .proc_info = nsp_proc_info, @@ -88,7 +91,7 @@ static struct scsi_host_template nsp_driver_template = { .eh_host_reset_handler = nsp_eh_host_reset, .can_queue = 1, .this_id = NSP_INITIATOR_ID, - .sg_tablesize
Re: [PATCH 2/8] scsi-drivers Don't use SG_ALL as allocation size
On Thu, 17 Jan 2008, Boaz Harrosh wrote: below list of drivers have used SG_ALL as a size to preallocate maximum possible command's sg-count. This is no longer possible since the maximum is not set at compile time but as a run time configuration. A better schema can be advised with a more dynamic allocation. Perhaps from a kmem_cache. Affected drivers/files: drivers/scsi/atari_scsi.[ch] drivers/scsi/eata_pio.c drivers/scsi/ibmvscsi/ibmvscsi.[ch] drivers/scsi/mac53c94.c drivers/scsi/mesh.c drivers/scsi/nsp32.h drivers/scsi/qla1280.c drivers/scsi/qla2xxx/qla_os.c drivers/scsi/qla4xxx/ql4_def.h ... There's no functional change in your patches to qla2xxx and qla4xxx. Perhaps a cut-n-paste typo from qla1280.c (which should be capped): diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 78d1103..e368f38 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -111,6 +111,8 @@ static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *); static int qla2x00_change_queue_depth(struct scsi_device *, int); static int qla2x00_change_queue_type(struct scsi_device *, int); +#define QLA2XXX_MAX_SG 255 + struct scsi_host_template qla2x00_driver_template = { .module = THIS_MODULE, .name = QLA2XXX_DRIVER_NAME, diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h index accaf69..64cd43b 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h @@ -101,6 +101,7 @@ #define MBOX_AEN_REG_COUNT 5 #define MAX_INIT_RETRIES 5 #define IOCB_HIWAT_CUSHION 16 +#define QLA_MAX_SG 255 I don't forsee any issues with maintaining SG_ALL (~0) usage within qla2xxx and qla4xxx, as the number of unused entries on the HBA's request-queue shall ultimately be the rate-limiting factor. -- av - 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
Re: [PATCH 0/14] qla2xxx: updates for 2.6.24 [8.02.00-k7].
On Thu, 17 Jan 2008, James Bottomley wrote: On Thu, 2008-01-17 at 09:33 -0800, Andrew Vasquez wrote: On Thu, 17 Jan 2008, Andrew Vasquez wrote: This patchset updates the qla2xxx driver to 8.02.00-k7. ... BTW: Small typo in the subject, it's obvious these patches aren't for 2.6.24, instead, meant for the next merge window of 2.6.25... I was just about to ask about that. Your patches are all unnumbered, which makes applying them a pain unless they're all independent; are they? Cazzo! No, sorry about that, there's some ordering required. The order should be: [PATCH 01/14] qla2xxx: Consolidate duplicate sense-data handling codes. [PATCH 02/14] qla2xxx: Retrieve additional HBA port statistics from recent ISPs. [PATCH 03/14] qla2xxx: Fix for 32-bit platforms with 64-bit resources. [PATCH 04/14] qla2xxx: Wait for FLASH write-protection to complete after a write. [PATCH 05/14] qla2xxx: Restrict MSI/MSI-X enablement on select ISP2432-type HBAs. [PATCH 06/14] qla2xxx: Don't schedule the DPC routine to perform an issue-lip request. [PATCH 07/14] qla2xxx: Use completion routines. [PATCH 08/14] qla2xxx: Add a filter to compare port_name against the physical on vport creation. [PATCH 09/14] qla2xxx: Code cleanups. [PATCH 10/14] qla2xxx: Trace-Control naming cleanups. [PATCH 11/14] qla2xxx: Add Fibre Channel Event (FCE) tracing support. [PATCH 12/14] qla2xxx: Correct late-memset() of EFT buffer. [PATCH 13/14] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command. [PATCH 14/14] qla2xxx: Update version number to 8.02.00-k7. I believe git-send-email adjusts the 'seconds' field in the 'Date' header, so hopefully, your threaded email reader maintained the order. If not, if you like, I can resend with the X/Y prefix. - 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
Re: [PATCH 1/8] firewire: ieee1394: Move away from SG_ALL
Boaz Harrosh wrote: SG_ALL wants to be ~0 meaning any future size. Below group of drivers preallocate a scatter list buffer of max_size, so set that size to be 255 (Like before). A better schema can be advised with a more dynamic allocation. Perhaps from a kmem_cache. List of drivers/files: drivers/firewire/fw-sbp2.c drivers/ieee1394/sbp2.[ch] Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] Acked-by: Stefan Richter [EMAIL PROTECTED] --- drivers/firewire/fw-sbp2.c |6 -- drivers/ieee1394/sbp2.c|2 +- drivers/ieee1394/sbp2.h|4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) Since I wasn't Cc'd, I suppose you don't want me to take it upstream via linux1394-2.6.git? My guess is that there won't be conflicts of this with linux1394-2.6.git anytime soon, so taking it into any other tree should be fine. -- Stefan Richter -=-==--- ---= =---= http://arcgraph.de/sr/ - 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
Re: [patch 0/8] Change SG_ALL to mean any size
Boaz Harrosh wrote: Those that meant SG_ALL == 255: [PATCH 1/8] firewire: ieee1394: Move away from SG_ALL They simply mean SG_ALL == something, as long as it isn't unreasonably small or large. -- Stefan Richter -=-==--- ---= =---= http://arcgraph.de/sr/ - 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
Re: [PATCH 0/14] qla2xxx: updates for 2.6.24 [8.02.00-k7].
On Thu, 2008-01-17 at 09:33 -0800, Andrew Vasquez wrote: On Thu, 17 Jan 2008, Andrew Vasquez wrote: This patchset updates the qla2xxx driver to 8.02.00-k7. ... BTW: Small typo in the subject, it's obvious these patches aren't for 2.6.24, instead, meant for the next merge window of 2.6.25... I was just about to ask about that. Your patches are all unnumbered, which makes applying them a pain unless they're all independent; are they? James - 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
Re: [PATCH 2/8] scsi-drivers Don't use SG_ALL as allocation size
On Thu, Jan 17 2008 at 19:47 +0200, Andrew Vasquez [EMAIL PROTECTED] wrote: On Thu, 17 Jan 2008, Boaz Harrosh wrote: below list of drivers have used SG_ALL as a size to preallocate maximum possible command's sg-count. This is no longer possible since the maximum is not set at compile time but as a run time configuration. A better schema can be advised with a more dynamic allocation. Perhaps from a kmem_cache. Affected drivers/files: drivers/scsi/atari_scsi.[ch] drivers/scsi/eata_pio.c drivers/scsi/ibmvscsi/ibmvscsi.[ch] drivers/scsi/mac53c94.c drivers/scsi/mesh.c drivers/scsi/nsp32.h drivers/scsi/qla1280.c drivers/scsi/qla2xxx/qla_os.c drivers/scsi/qla4xxx/ql4_def.h ... There's no functional change in your patches to qla2xxx and qla4xxx. Perhaps a cut-n-paste typo from qla1280.c (which should be capped): diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 78d1103..e368f38 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -111,6 +111,8 @@ static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *); static int qla2x00_change_queue_depth(struct scsi_device *, int); static int qla2x00_change_queue_type(struct scsi_device *, int); +#define QLA2XXX_MAX_SG 255 + struct scsi_host_template qla2x00_driver_template = { .module = THIS_MODULE, .name = QLA2XXX_DRIVER_NAME, diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h index accaf69..64cd43b 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h @@ -101,6 +101,7 @@ #define MBOX_AEN_REG_COUNT 5 #define MAX_INIT_RETRIES5 #define IOCB_HIWAT_CUSHION 16 +#define QLA_MAX_SG 255 I don't forsee any issues with maintaining SG_ALL (~0) usage within qla2xxx and qla4xxx, as the number of unused entries on the HBA's request-queue shall ultimately be the rate-limiting factor. -- Please forgive me I have forgot to put the use of this constants at body, see patch below. I have seen the use of a device memory at the scsi_for_each_sg loop and was not at all sure what is the size limit for that. So I played it safe, actually I changed nothing. Please give me the OK to remove ql[24]xxx from these patches, and have them change to SG_ALL==~0 in the last patch. Or should I resend the patch with below added. Thanks for catching this Boaz -- diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index e368f38..b0999b6 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -134,7 +134,7 @@ struct scsi_host_template qla2x00_driver_template = { .this_id= -1, .cmd_per_lun= 3, .use_clustering = ENABLE_CLUSTERING, - .sg_tablesize = SG_ALL, + .sg_tablesize = QLA2XXX_MAX_SG, /* * The RISC allows for each command to transfer (2^32-1) bytes of data, @@ -165,7 +165,7 @@ struct scsi_host_template qla24xx_driver_template = { .this_id= -1, .cmd_per_lun= 3, .use_clustering = ENABLE_CLUSTERING, - .sg_tablesize = SG_ALL, + .sg_tablesize = QLA2XXX_MAX_SG, .max_sectors= 0x, .shost_attrs= qla2x00_host_attrs, diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index b128da5..0b8de79 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -94,7 +94,7 @@ static struct scsi_host_template qla4xxx_driver_template = { .this_id= -1, .cmd_per_lun= 3, .use_clustering = ENABLE_CLUSTERING, - .sg_tablesize = SG_ALL, + .sg_tablesize = QLA_MAX_SG, .max_sectors= 0x, }; - 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
[PATCH] qla2xxx: Trace-Control naming cleanups.
In preparation for FCE (Fibre Channel Event) tracing support. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |3 -- drivers/scsi/qla2xxx/qla_fw.h |7 + drivers/scsi/qla2xxx/qla_gbl.h |4 ++- drivers/scsi/qla2xxx/qla_init.c |5 +-- drivers/scsi/qla2xxx/qla_mbx.c | 49 +- drivers/scsi/qla2xxx/qla_os.c |2 +- 6 files changed, 50 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 144f6d0..3f934bd 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -623,9 +623,6 @@ typedef struct { #define MBC_GET_LINK_PRIV_STATS0x6d/* Get link private data. */ #define MBC_SET_VENDOR_ID 0x76/* Set Vendor ID. */ -#define TC_ENABLE 4 -#define TC_DISABLE 5 - /* Firmware return data sizes */ #define FCAL_MAP_SIZE 128 diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index 69a5e31..ef14bcd 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h @@ -952,6 +952,13 @@ struct device_reg_24xx { uint32_t iobase_sdata; }; +/* Trace Control */ + +#define TC_AEN_DISABLE 0 + +#define TC_EFT_ENABLE 4 +#define TC_EFT_DISABLE 5 + /* MID Support ***/ #define MIN_MULTI_ID_FABRIC64 /* Must be power-of-2. */ diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index fd75539..2fd31fd 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -228,7 +228,9 @@ extern int qla2x00_stop_firmware(scsi_qla_host_t *); extern int -qla2x00_trace_control(scsi_qla_host_t *, uint16_t, dma_addr_t, uint16_t); +qla2x00_enable_eft_trace(scsi_qla_host_t *, dma_addr_t, uint16_t); +extern int +qla2x00_disable_eft_trace(scsi_qla_host_t *); extern int qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t); diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 03444d6..da2cce0 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -766,8 +766,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) goto cont_alloc; } - rval = qla2x00_trace_control(ha, TC_ENABLE, eft_dma, - EFT_NUM_BUFFERS); + rval = qla2x00_enable_eft_trace(ha, eft_dma, EFT_NUM_BUFFERS); if (rval) { qla_printk(KERN_WARNING, ha, Unable to initialize EFT (%d).\n, rval); @@ -3240,7 +3239,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) clear_bit(ISP_ABORT_RETRY, ha-dpc_flags); if (ha-eft) { - rval = qla2x00_trace_control(ha, TC_ENABLE, + rval = qla2x00_enable_eft_trace(ha, ha-eft_dma, EFT_NUM_BUFFERS); if (rval) { qla_printk(KERN_WARNING, ha, diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index ee7899d..7c6aa4e 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -2350,7 +2350,7 @@ qla2x00_stop_firmware(scsi_qla_host_t *ha) } int -qla2x00_trace_control(scsi_qla_host_t *ha, uint16_t ctrl, dma_addr_t eft_dma, +qla2x00_enable_eft_trace(scsi_qla_host_t *ha, dma_addr_t eft_dma, uint16_t buffers) { int rval; @@ -2363,22 +2363,47 @@ qla2x00_trace_control(scsi_qla_host_t *ha, uint16_t ctrl, dma_addr_t eft_dma, DEBUG11(printk(%s(%ld): entered.\n, __func__, ha-host_no)); mcp-mb[0] = MBC_TRACE_CONTROL; - mcp-mb[1] = ctrl; - mcp-out_mb = MBX_1|MBX_0; + mcp-mb[1] = TC_EFT_ENABLE; + mcp-mb[2] = LSW(eft_dma); + mcp-mb[3] = MSW(eft_dma); + mcp-mb[4] = LSW(MSD(eft_dma)); + mcp-mb[5] = MSW(MSD(eft_dma)); + mcp-mb[6] = buffers; + mcp-mb[7] = TC_AEN_DISABLE; + mcp-out_mb = MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; mcp-in_mb = MBX_1|MBX_0; - if (ctrl == TC_ENABLE) { - mcp-mb[2] = LSW(eft_dma); - mcp-mb[3] = MSW(eft_dma); - mcp-mb[4] = LSW(MSD(eft_dma)); - mcp-mb[5] = MSW(MSD(eft_dma)); - mcp-mb[6] = buffers; - mcp-mb[7] = 0; - mcp-out_mb |= MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2; - } mcp-tov = 30; mcp-flags = 0; rval = qla2x00_mailbox_command(ha, mcp); + if (rval != QLA_SUCCESS) { + DEBUG2_3_11(printk(%s(%ld): failed=%x mb[0]=%x mb[1]=%x.\n, + __func__, ha-host_no, rval, mcp-mb[0], mcp-mb[1])); +
[PATCH] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.
From: Seokmann Ju [EMAIL PROTECTED] There is a case where 54xx HBA loads MID firmware as it use 24xx firmware. In this case, the driver should issue MBC_MID_INITIALIZE FIRMWARE even though the HBA doesn't support NPIV. This patch make changes in the driver so that could behave accordingly. Signed-off-by: Seokmann Ju [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_init.c |4 +++- drivers/scsi/qla2xxx/qla_mbx.c |2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 7637fa7..d0633ca 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1193,7 +1193,9 @@ qla2x00_init_rings(scsi_qla_host_t *ha) DEBUG(printk(scsi(%ld): Issue init firmware.\n, ha-host_no)); - mid_init_cb-count = cpu_to_le16(ha-max_npiv_vports); + if (ha-flags.npiv_supported) + mid_init_cb-count = cpu_to_le16(ha-max_npiv_vports); + mid_init_cb-options = __constant_cpu_to_le16(BIT_1); rval = qla2x00_init_firmware(ha, ha-init_cb_size); diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 99d29ff..0c10c0b 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -980,7 +980,7 @@ qla2x00_init_firmware(scsi_qla_host_t *ha, uint16_t size) DEBUG11(printk(qla2x00_init_firmware(%ld): entered.\n, ha-host_no)); - if (ha-flags.npiv_supported) + if (ha-fw_attributes BIT_2) mcp-mb[0] = MBC_MID_INITIALIZE_FIRMWARE; else mcp-mb[0] = MBC_INITIALIZE_FIRMWARE; -- 1.5.4.rc3.14.g44397 - 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
[PATCH] qla2xxx: Code cleanups.
From: Adrian Bunk [EMAIL PROTECTED] - make the following needlessly global code static: - qla_attr.c: qla24xx_vport_delete() - qla_attr.c: qla24xx_vport_disable() - qla_mid.c: qla24xx_allocate_vp_id() - qla_mid.c: qla24xx_find_vhost_by_name() - qla_mid.c: qla2x00_do_dpc_vp() - qla_os.c: struct qla2x00_driver_template - qla_os.c: qla2x00_stop_timer() - qla_os.c: qla2x00_mem_alloc() - qla_os.c: qla2x00_mem_free() - qla_sup.c: qla2x00_lock_nvram_access() - qla_sup.c: qla2x00_unlock_nvram_access() - qla_sup.c: qla2x00_get_nvram_word() - qla_sup.c: qla2x00_write_nvram_word() - #if 0 the following unused global functions: - qla_mbx.c: qla2x00_system_error() - qla_os.c: remove some unneeded function prototypes - removed unused functions: - qla_dbg.c: qla2x00_dump_pkt() - qla_mbx.c: qla2x00_get_serdes_params() - qla_mbx.c: qla2x00_get_idma_speed() - qla_mbx.c: qla24xx_get_vp_database() - qla_mbx.c: qla24xx_get_vp_entry() Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Small modifications and Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c |6 +- drivers/scsi/qla2xxx/qla_dbg.c | 15 drivers/scsi/qla2xxx/qla_gbl.h | 25 -- drivers/scsi/qla2xxx/qla_mbx.c | 177 +-- drivers/scsi/qla2xxx/qla_mid.c |6 +- drivers/scsi/qla2xxx/qla_os.c | 20 ++--- drivers/scsi/qla2xxx/qla_sup.c |8 +- 7 files changed, 19 insertions(+), 238 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 22b3868..adf9732 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -9,7 +9,7 @@ #include linux/kthread.h #include linux/vmalloc.h -int qla24xx_vport_disable(struct fc_vport *, bool); +static int qla24xx_vport_disable(struct fc_vport *, bool); /* SYSFS attributes - */ @@ -1129,7 +1129,7 @@ vport_create_failed_2: return FC_VPORT_FAILED; } -int +static int qla24xx_vport_delete(struct fc_vport *fc_vport) { scsi_qla_host_t *ha = shost_priv(fc_vport-shost); @@ -1162,7 +1162,7 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) return 0; } -int +static int qla24xx_vport_disable(struct fc_vport *fc_vport, bool disable) { scsi_qla_host_t *vha = fc_vport-dd_data; diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index eaa04da..796c4ce 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -1428,21 +1428,6 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd) printk( sp flags=0x%x\n, sp-flags); } -void -qla2x00_dump_pkt(void *pkt) -{ - uint32_t i; - uint8_t *data = (uint8_t *) pkt; - - for (i = 0; i 64; i++) { - if (!(i % 4)) - printk(\n%02x: , i); - - printk(%02x , data[i]); - } - printk(\n); -} - #if defined(QL_DEBUG_ROUTINES) /* * qla2x00_formatted_dump_buffer diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index fa4455f..fd75539 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -70,30 +70,20 @@ extern int qla2x00_loop_reset(scsi_qla_host_t *); /* * Global Functions in qla_mid.c source file. */ -extern struct scsi_host_template qla2x00_driver_template; extern struct scsi_host_template qla24xx_driver_template; extern struct scsi_transport_template *qla2xxx_transport_vport_template; -extern uint8_t qla2x00_mem_alloc(scsi_qla_host_t *); extern void qla2x00_timer(scsi_qla_host_t *); extern void qla2x00_start_timer(scsi_qla_host_t *, void *, unsigned long); -extern void qla2x00_stop_timer(scsi_qla_host_t *); -extern uint32_t qla24xx_allocate_vp_id(scsi_qla_host_t *); extern void qla24xx_deallocate_vp_id(scsi_qla_host_t *); extern int qla24xx_disable_vp (scsi_qla_host_t *); extern int qla24xx_enable_vp (scsi_qla_host_t *); -extern void qla2x00_mem_free(scsi_qla_host_t *); extern int qla24xx_control_vp(scsi_qla_host_t *, int ); extern int qla24xx_modify_vp_config(scsi_qla_host_t *); extern int qla2x00_send_change_request(scsi_qla_host_t *, uint16_t, uint16_t); extern void qla2x00_vp_stop_timer(scsi_qla_host_t *); extern int qla24xx_configure_vhba (scsi_qla_host_t *); -extern int qla24xx_get_vp_entry(scsi_qla_host_t *, uint16_t, int); -extern int qla24xx_get_vp_database(scsi_qla_host_t *, uint16_t); -extern int qla2x00_do_dpc_vp(scsi_qla_host_t *); extern void qla24xx_report_id_acquisition(scsi_qla_host_t *, struct vp_rpt_id_entry_24xx *); -extern scsi_qla_host_t * qla24xx_find_vhost_by_name(scsi_qla_host_t *, -uint8_t *); extern void qla2x00_do_dpc_all_vps(scsi_qla_host_t *); extern int qla24xx_vport_create_req_sanity_check(struct fc_vport *); extern scsi_qla_host_t * qla24xx_create_vhost(struct fc_vport *); @@ -113,7 +103,6 @@ extern void
[PATCH] qla2xxx: Add a filter to compare port_name against the physical on vport creation.
From: Seokmann Ju [EMAIL PROTECTED] During vport creation, there was a possibility to get create a vport with same port_name as pport. A new filter has added to compare given port_name with the port_name of the pport. Signed-Off-by: Seokmann Ju [EMAIL PROTECTED] Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_mid.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 325bdab..dea3768 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -341,6 +341,8 @@ qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport) /* Check up unique WWPN */ u64_to_wwn(fc_vport-port_name, port_name); + if (!memcmp(port_name, ha-port_name, WWN_SIZE)) + return VPCERR_BAD_WWN; vha = qla24xx_find_vhost_by_name(ha, port_name); if (vha) return VPCERR_BAD_WWN; -- 1.5.4.rc3.14.g44397 - 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
[PATCH] qla2xxx: Restrict MSI/MSI-X enablement on select ISP2432-type HBAs.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_isr.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 5d2dc92..22216fe 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1829,6 +1829,18 @@ qla2x00_request_irqs(scsi_qla_host_t *ha) goto skip_msix; } + if (ha-pdev-subsystem_vendor == PCI_VENDOR_ID_HP + (ha-pdev-subsystem_device == 0x7040 || + ha-pdev-subsystem_device == 0x7041 || + ha-pdev-subsystem_device == 0x1705)) { + DEBUG2(qla_printk(KERN_WARNING, ha, + MSI-X: Unsupported ISP2432 SSVID/SSDID (0x%X, 0x%X).\n, + ha-pdev-subsystem_vendor, + ha-pdev-subsystem_device)); + + goto skip_msi; + } + ret = qla24xx_enable_msix(ha); if (!ret) { DEBUG2(qla_printk(KERN_INFO, ha, -- 1.5.4.rc3.14.g44397 - 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
Re: [PATCH 2/8 ver2] scsi-drivers Don't use SG_ALL as allocation size
Subject: [PATCH] scsi-drivers Don't use SG_ALL as allocation size below list of drivers have used SG_ALL as a size to preallocate maximum possible command's sg-count. This is no longer possible since the maximum is not set at compile time but as a run time configuration. A better schema can be advised with a more dynamic allocation. Perhaps from a kmem_cache. Affected drivers/files: drivers/scsi/atari_scsi.[ch] drivers/scsi/eata_pio.c drivers/scsi/ibmvscsi/ibmvscsi.[ch] drivers/scsi/mac53c94.c drivers/scsi/mesh.c drivers/scsi/nsp32.h drivers/scsi/qla1280.c Signed-off-by: Boaz Harrosh [EMAIL PROTECTED] --- drivers/scsi/atari_scsi.c|8 drivers/scsi/atari_scsi.h|4 ++-- drivers/scsi/eata_pio.c |5 - drivers/scsi/ibmvscsi/ibmvscsi.c |8 +--- drivers/scsi/ibmvscsi/ibmvscsi.h |1 + drivers/scsi/mac53c94.c |8 ++-- drivers/scsi/mesh.c |5 - drivers/scsi/nsp32.h |2 +- drivers/scsi/qla1280.c |3 ++- 9 files changed, 29 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index f5732d8..b47b61d 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c @@ -620,7 +620,8 @@ int atari_scsi_detect(struct scsi_host_template *host) /* Force sg_tablesize to 0 on a Falcon! */ host-sg_tablesize = !IS_A_TT() ? ATARI_FALCON_SG_TABLESIZE : - (setup_sg_tablesize = 0) ? setup_sg_tablesize : ATARI_TT_SG_TABLESIZE; + (setup_sg_tablesize 0) ? setup_sg_tablesize : + ATARI_TT_SG_TABLESIZE; if (setup_hostid = 0) host-this_id = setup_hostid; @@ -792,9 +793,8 @@ void __init atari_scsi_setup(char *str, int *ints) if (ints[0] = 3) { if (ints[3] = 0) { setup_sg_tablesize = ints[3]; - /* Must be = SG_ALL (255) */ - if (setup_sg_tablesize SG_ALL) - setup_sg_tablesize = SG_ALL; + if (setup_sg_tablesize ATARI_TT_SG_TABLESIZE) + setup_sg_tablesize = ATARI_TT_SG_TABLESIZE; } } if (ints[0] = 4) { diff --git a/drivers/scsi/atari_scsi.h b/drivers/scsi/atari_scsi.h index efadb8d..21b8c91 100644 --- a/drivers/scsi/atari_scsi.h +++ b/drivers/scsi/atari_scsi.h @@ -35,11 +35,11 @@ int atari_scsi_release (struct Scsi_Host *); #define ATARI_TT_CAN_QUEUE 16 #define ATARI_TT_CMD_PER_LUN 8 -#define ATARI_TT_SG_TABLESIZE SG_ALL +#define ATARI_TT_SG_TABLESIZE 255 #define ATARI_FALCON_CAN_QUEUE 8 #define ATARI_FALCON_CMD_PER_LUN 1 -#define ATARI_FALCON_SG_TABLESIZE SG_NONE +#define ATARI_FALCON_SG_TABLESIZE 1 #defineDEFAULT_USE_TAGGED_QUEUING 0 diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c index b5a6092..8913d9d 100644 --- a/drivers/scsi/eata_pio.c +++ b/drivers/scsi/eata_pio.c @@ -691,6 +691,9 @@ static unsigned int print_selftest(unsigned int base) return (!(inb(base + HA_RSTATUS) HA_SERROR)); } +/* FIXME: is this driver sg-chainning ready? */ +#define EATA_MAX_SG 255 + static int register_pio_HBA(long base, struct get_conf *gc, struct pci_dev *pdev) { unsigned long size = 0; @@ -801,7 +804,7 @@ static int register_pio_HBA(long base, struct get_conf *gc, struct pci_dev *pdev sh-this_id = gc-scsi_id[3]; sh-can_queue = 1; sh-cmd_per_lun = 1; - sh-sg_tablesize = SG_ALL; + sh-sg_tablesize = EATA_MAX_SG; hd-channel = 0; diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 78d46a9..9b1fc94 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -173,7 +173,8 @@ static void release_event_pool(struct event_pool *pool, ++in_use; if (pool-events[i].ext_list) { dma_free_coherent(hostdata-dev, - SG_ALL * sizeof(struct srp_direct_buf), + IBMVSCSI_MAX_SG * + sizeof(struct srp_direct_buf), pool-events[i].ext_list, pool-events[i].ext_list_token); } @@ -423,7 +424,8 @@ static int map_sg_data(struct scsi_cmnd *cmd, if (!evt_struct-ext_list) { evt_struct-ext_list = (struct srp_direct_buf *) dma_alloc_coherent(dev, - SG_ALL * sizeof(struct srp_direct_buf), + IBMVSCSI_MAX_SG * + sizeof(struct srp_direct_buf),
Re: [PATCH 2/8] scsi-drivers Don't use SG_ALL as allocation size
On Thu, 17 Jan 2008, Boaz Harrosh wrote: I don't forsee any issues with maintaining SG_ALL (~0) usage within qla2xxx and qla4xxx, as the number of unused entries on the HBA's request-queue shall ultimately be the rate-limiting factor. -- Please forgive me I have forgot to put the use of this constants at body, see patch below. I have seen the use of a device memory at the scsi_for_each_sg loop and was not at all sure what is the size limit for that. So I played it safe, actually I changed nothing. Please give me the OK to remove ql[24]xxx from these patches, I believe that's best, simply remove the qla2xxx/qla4xxx component from your patchset. Thanks, AV - 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
[PATCH] qla2xxx: Wait for FLASH write-protection to complete after a write.
Some flash parts have a slow enable write-protection (WP) operation whereby subsequent FLASH accesses would fail if the WP operation had not completed. Software now polls the SPI's status-register for WP completion. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_sup.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index ad2fa01..af16c55 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -550,7 +550,7 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, int ret; uint32_t liter, miter; uint32_t sec_mask, rest_addr, conf_addr; - uint32_t fdata, findex ; + uint32_t fdata, findex, cnt; uint8_t man_id, flash_id; struct device_reg_24xx __iomem *reg = ha-iobase-isp24; dma_addr_t optrom_dma; @@ -690,8 +690,14 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, 0xff) | ((fdata 16) 0xff)); } - /* Enable flash write-protection. */ + /* Enable flash write-protection and wait for completion. */ qla24xx_write_flash_dword(ha, flash_conf_to_access_addr(0x101), 0x9c); + for (cnt = 300; cnt + qla24xx_read_flash_dword(ha, + flash_conf_to_access_addr(0x005)) BIT_0; + cnt--) { + udelay(10); + } /* Disable flash write. */ WRT_REG_DWORD(reg-ctrl_status, -- 1.5.4.rc3.14.g44397 - 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
[PATCH] qla2xxx: Retrieve additional HBA port statistics from recent ISPs.
HBAs supporting these additional counters include ISP24xx and ISP25xx type boards. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c | 44 -- drivers/scsi/qla2xxx/qla_def.h | 22 ++--- drivers/scsi/qla2xxx/qla_gbl.h |7 ++- drivers/scsi/qla2xxx/qla_mbx.c | 99 ++ 4 files changed, 74 insertions(+), 98 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 745283f..e3bda8f 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -967,35 +967,51 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) { scsi_qla_host_t *ha = shost_priv(shost); int rval; - uint16_t mb_stat[1]; - link_stat_t stat_buf; + struct link_statistics *stats; + dma_addr_t stats_dma; struct fc_host_statistics *pfc_host_stat; - rval = QLA_FUNCTION_FAILED; pfc_host_stat = ha-fc_host_stat; memset(pfc_host_stat, -1, sizeof(struct fc_host_statistics)); + stats = dma_pool_alloc(ha-s_dma_pool, GFP_KERNEL, stats_dma); + if (stats == NULL) { + DEBUG2_3_11(printk(%s(%ld): Failed to allocate memory.\n, + __func__, ha-host_no)); + goto done; + } + memset(stats, 0, DMA_POOL_SIZE); + + rval = QLA_FUNCTION_FAILED; if (IS_FWI2_CAPABLE(ha)) { - rval = qla24xx_get_isp_stats(ha, (uint32_t *)stat_buf, - sizeof(stat_buf) / 4, mb_stat); + rval = qla24xx_get_isp_stats(ha, stats, stats_dma); } else if (atomic_read(ha-loop_state) == LOOP_READY !test_bit(ABORT_ISP_ACTIVE, ha-dpc_flags) !test_bit(ISP_ABORT_NEEDED, ha-dpc_flags) !ha-dpc_active) { /* Must be in a 'READY' state for statistics retrieval. */ - rval = qla2x00_get_link_status(ha, ha-loop_id, stat_buf, - mb_stat); + rval = qla2x00_get_link_status(ha, ha-loop_id, stats, + stats_dma); } if (rval != QLA_SUCCESS) - goto done; + goto done_free; + + pfc_host_stat-link_failure_count = stats-link_fail_cnt; + pfc_host_stat-loss_of_sync_count = stats-loss_sync_cnt; + pfc_host_stat-loss_of_signal_count = stats-loss_sig_cnt; + pfc_host_stat-prim_seq_protocol_err_count = stats-prim_seq_err_cnt; + pfc_host_stat-invalid_tx_word_count = stats-inval_xmit_word_cnt; + pfc_host_stat-invalid_crc_count = stats-inval_crc_cnt; + if (IS_FWI2_CAPABLE(ha)) { + pfc_host_stat-tx_frames = stats-tx_frames; + pfc_host_stat-rx_frames = stats-rx_frames; + pfc_host_stat-dumped_frames = stats-dumped_frames; + pfc_host_stat-nos_count = stats-nos_rcvd; + } - pfc_host_stat-link_failure_count = stat_buf.link_fail_cnt; - pfc_host_stat-loss_of_sync_count = stat_buf.loss_sync_cnt; - pfc_host_stat-loss_of_signal_count = stat_buf.loss_sig_cnt; - pfc_host_stat-prim_seq_protocol_err_count = stat_buf.prim_seq_err_cnt; - pfc_host_stat-invalid_tx_word_count = stat_buf.inval_xmit_word_cnt; - pfc_host_stat-invalid_crc_count = stat_buf.inval_crc_cnt; +done_free: +dma_pool_free(ha-s_dma_pool, stats, stats_dma); done: return pfc_host_stat; } diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index fe8f782..a33d3d5 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -862,14 +862,20 @@ typedef struct { #define GLSO_SEND_RPS BIT_0 #define GLSO_USE_DID BIT_3 -typedef struct { - uint32_tlink_fail_cnt; - uint32_tloss_sync_cnt; - uint32_tloss_sig_cnt; - uint32_tprim_seq_err_cnt; - uint32_tinval_xmit_word_cnt; - uint32_tinval_crc_cnt; -} link_stat_t; +struct link_statistics { + uint32_t link_fail_cnt; + uint32_t loss_sync_cnt; + uint32_t loss_sig_cnt; + uint32_t prim_seq_err_cnt; + uint32_t inval_xmit_word_cnt; + uint32_t inval_crc_cnt; + uint32_t unused1[0x1b]; + uint32_t tx_frames; + uint32_t rx_frames; + uint32_t dumped_frames; + uint32_t unused2[2]; + uint32_t nos_rcvd; +}; /* * NVRAM Command values. diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 09cb2a9..5b381dc 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -222,11 +222,12 @@ extern int qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map); extern int -qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, link_stat_t *, -uint16_t *); +qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, struct link_statistics *, +dma_addr_t); extern int
[PATCH] qla2xxx: Fix for 32-bit platforms with 64-bit resources.
The driver stores the contents of PCI resources into unsigned long's before ioremapping. This breaks on 32-bit platforms which support 64-bit MMIO resources. Correct code by removing the temporary variables used during MMIO PIO mapping and using resource_size_t where applicable. Also correct a small typo in a printk() where the wrong region number was displayed. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |3 +-- drivers/scsi/qla2xxx/qla_os.c | 22 +++--- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index a33d3d5..d0b78af 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2271,8 +2271,7 @@ typedef struct scsi_qla_host { int bars; device_reg_t __iomem *iobase; /* Base I/O address */ - unsigned long pio_address; - unsigned long pio_length; + resource_size_t pio_address; #define MIN_IOBASE_LEN 0x100 /* ISP ring lock, rings, and indexes */ diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 8ecc047..ab7abe0 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1479,8 +1479,7 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha) static int qla2x00_iospace_config(scsi_qla_host_t *ha) { - unsigned long pio, pio_len, pio_flags; - unsigned long mmio, mmio_len, mmio_flags; + resource_size_t pio; if (pci_request_selected_regions(ha-pdev, ha-bars, QLA2XXX_DRIVER_NAME)) { @@ -1495,10 +1494,8 @@ qla2x00_iospace_config(scsi_qla_host_t *ha) /* We only need PIO for Flash operations on ISP2312 v2 chips. */ pio = pci_resource_start(ha-pdev, 0); - pio_len = pci_resource_len(ha-pdev, 0); - pio_flags = pci_resource_flags(ha-pdev, 0); - if (pio_flags IORESOURCE_IO) { - if (pio_len MIN_IOBASE_LEN) { + if (pci_resource_flags(ha-pdev, 0) IORESOURCE_IO) { + if (pci_resource_len(ha-pdev, 0) MIN_IOBASE_LEN) { qla_printk(KERN_WARNING, ha, Invalid PCI I/O region size (%s)...\n, pci_name(ha-pdev)); @@ -1511,28 +1508,23 @@ qla2x00_iospace_config(scsi_qla_host_t *ha) pio = 0; } ha-pio_address = pio; - ha-pio_length = pio_len; skip_pio: /* Use MMIO operations for all accesses. */ - mmio = pci_resource_start(ha-pdev, 1); - mmio_len = pci_resource_len(ha-pdev, 1); - mmio_flags = pci_resource_flags(ha-pdev, 1); - - if (!(mmio_flags IORESOURCE_MEM)) { + if (!(pci_resource_flags(ha-pdev, 1) IORESOURCE_MEM)) { qla_printk(KERN_ERR, ha, - region #0 not an MMIO resource (%s), aborting\n, + region #1 not an MMIO resource (%s), aborting\n, pci_name(ha-pdev)); goto iospace_error_exit; } - if (mmio_len MIN_IOBASE_LEN) { + if (pci_resource_len(ha-pdev, 1) MIN_IOBASE_LEN) { qla_printk(KERN_ERR, ha, Invalid PCI mem region size (%s), aborting\n, pci_name(ha-pdev)); goto iospace_error_exit; } - ha-iobase = ioremap(mmio, MIN_IOBASE_LEN); + ha-iobase = ioremap(pci_resource_start(ha-pdev, 1), MIN_IOBASE_LEN); if (!ha-iobase) { qla_printk(KERN_ERR, ha, cannot remap MMIO (%s), aborting\n, pci_name(ha-pdev)); -- 1.5.4.rc3.14.g44397 - 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
[PATCH 2/2] aacraid: add Voodoo Lite class of cards.
The cards being added are supported in a limited sense already through family matching, but we needed to add some functionality to the driver to expose selectively the physical drives. These Physical drives are specifically marked to not be part of any array and thus are declared JBODs (Just a Bunch Of Drives) for generic SCSI access. We report that this is the second patch in a set of two, but merely depends on the stand-alone functionality of the first patch which adds in that case the ability to report a driver feature flag via sysfs. We leverage that functionality by reporting that this driver now supports this new JBOD feature for the controller so that the array management applications may react accordingly and guide the user as they manage the controller. This following patch is against current scsi-misc-2.6 after the first of the pair of patches are applied. ObligatoryDisclaimer: Please accept my condolences regarding Outlook's handling of patch attachments. Signed-off-by: Mark Salyzyn [EMAIL PROTECTED] Documentation/scsi/aacraid.txt |4 drivers/scsi/aacraid/aachba.c |5 - drivers/scsi/aacraid/aacraid.h |6 +- drivers/scsi/aacraid/commsup.c | 24 drivers/scsi/aacraid/linit.c | 15 +++ 5 files changed, 48 insertions(+), 6 deletions(-) Sincerely -- Mark Salyzyn aacraid_voodoo_lite.patch Description: aacraid_voodoo_lite.patch
[PATCH] qla2xxx: Don't schedule the DPC routine to perform an issue-lip request.
As the driver depends on the DPC routine to handle bottom-half loop resynchronization in order to recover from the issue-lip request. The issue_lip call is sleeping context capable, so just issue the reset function there. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_attr.c |2 +- drivers/scsi/qla2xxx/qla_gbl.h |2 ++ drivers/scsi/qla2xxx/qla_os.c |3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index e3bda8f..22b3868 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -958,7 +958,7 @@ qla2x00_issue_lip(struct Scsi_Host *shost) { scsi_qla_host_t *ha = shost_priv(shost); - set_bit(LOOP_RESET_NEEDED, ha-dpc_flags); + qla2x00_loop_reset(ha); return 0; } diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 5b381dc..f6917b9 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -65,6 +65,8 @@ extern int ql2xextended_error_logging; extern int ql2xqfullrampup; extern int num_hosts; +extern int qla2x00_loop_reset(scsi_qla_host_t *); + /* * Global Functions in qla_mid.c source file. */ diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index ab7abe0..bb2d3d6 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -105,7 +105,6 @@ static int qla2xxx_eh_abort(struct scsi_cmnd *); static int qla2xxx_eh_device_reset(struct scsi_cmnd *); static int qla2xxx_eh_bus_reset(struct scsi_cmnd *); static int qla2xxx_eh_host_reset(struct scsi_cmnd *); -static int qla2x00_loop_reset(scsi_qla_host_t *ha); static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *); static int qla2x00_change_queue_depth(struct scsi_device *, int); @@ -1060,7 +1059,7 @@ eh_host_reset_lock: * Returns: * 0 = success */ -static int +int qla2x00_loop_reset(scsi_qla_host_t *ha) { int ret; -- 1.5.4.rc3.14.g44397 - 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
[PATCH] qla2xxx: Correct late-memset() of EFT buffer.
Original code would clear the buffer after the firmware had already been initialized to use the buffer, thus potentially and inadvertantly clearing data previously DMA'd by the firmware. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_init.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index cacfd25..7637fa7 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -766,6 +766,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) goto cont_alloc; } + memset(tc, 0, EFT_SIZE); rval = qla2x00_enable_eft_trace(ha, tc_dma, EFT_NUM_BUFFERS); if (rval) { qla_printk(KERN_WARNING, ha, Unable to initialize @@ -779,7 +780,6 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) EFT_SIZE / 1024); eft_size = EFT_SIZE; - memset(tc, 0, eft_size); ha-eft_dma = tc_dma; ha-eft = tc; -- 1.5.4.rc3.14.g44397 - 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
[PATCH] qla2xxx: Update version number to 8.02.00-k7.
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_version.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 6e3dc40..2c2f6b4 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h @@ -7,7 +7,7 @@ /* * Driver version */ -#define QLA2XXX_VERSION 8.02.00-k6 +#define QLA2XXX_VERSION 8.02.00-k7 #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 2 -- 1.5.4.rc3.14.g44397 - 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
[PATCH] qla2xxx: Use completion routines.
From: Marcus Barrow [EMAIL PROTECTED] Instead of abusing the semaphore interfaces for mailbox command completions. Additional cleanups and Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/qla_def.h |4 +- drivers/scsi/qla2xxx/qla_gbl.h |2 - drivers/scsi/qla2xxx/qla_isr.c |8 +++--- drivers/scsi/qla2xxx/qla_mbx.c | 44 +++ drivers/scsi/qla2xxx/qla_mid.c |5 ++- drivers/scsi/qla2xxx/qla_os.c | 22 ++- 6 files changed, 16 insertions(+), 69 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index d0b78af..144f6d0 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2413,9 +2413,9 @@ typedef struct scsi_qla_host { #define MBX_INTR_WAIT 2 #define MBX_UPDATE_FLASH_ACTIVE3 - struct semaphore mbx_cmd_sem; /* Serialialize mbx access */ struct semaphore vport_sem; /* Virtual port synchronization */ - struct semaphore mbx_intr_sem; /* Used for completion notification */ + struct completion mbx_cmd_comp; /* Serialize mbx access */ + struct completion mbx_intr_comp; /* Used for completion notification */ uint32_tmbx_flags; #define MBX_IN_PROGRESS BIT_0 diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index f6917b9..fa4455f 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -105,8 +105,6 @@ extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *); extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int, int); extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *, int); -extern int qla2x00_down_timeout(struct semaphore *, unsigned long); - extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *); extern int qla2x00_wait_for_hba_online(scsi_qla_host_t *); diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 22216fe..642a0c3 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -104,7 +104,7 @@ qla2100_intr_handler(int irq, void *dev_id) if (test_bit(MBX_INTR_WAIT, ha-mbx_cmd_flags) (status MBX_INTERRUPT) ha-flags.mbox_int) { set_bit(MBX_INTERRUPT, ha-mbx_cmd_flags); - up(ha-mbx_intr_sem); + complete(ha-mbx_intr_comp); } return (IRQ_HANDLED); @@ -216,7 +216,7 @@ qla2300_intr_handler(int irq, void *dev_id) if (test_bit(MBX_INTR_WAIT, ha-mbx_cmd_flags) (status MBX_INTERRUPT) ha-flags.mbox_int) { set_bit(MBX_INTERRUPT, ha-mbx_cmd_flags); - up(ha-mbx_intr_sem); + complete(ha-mbx_intr_comp); } return (IRQ_HANDLED); @@ -1597,7 +1597,7 @@ qla24xx_intr_handler(int irq, void *dev_id) if (test_bit(MBX_INTR_WAIT, ha-mbx_cmd_flags) (status MBX_INTERRUPT) ha-flags.mbox_int) { set_bit(MBX_INTERRUPT, ha-mbx_cmd_flags); - up(ha-mbx_intr_sem); + complete(ha-mbx_intr_comp); } return IRQ_HANDLED; @@ -1734,7 +1734,7 @@ qla24xx_msix_default(int irq, void *dev_id) if (test_bit(MBX_INTR_WAIT, ha-mbx_cmd_flags) (status MBX_INTERRUPT) ha-flags.mbox_int) { set_bit(MBX_INTERRUPT, ha-mbx_cmd_flags); - up(ha-mbx_intr_sem); + complete(ha-mbx_intr_comp); } return IRQ_HANDLED; diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 0fc1652..d23d6fc 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -8,19 +8,6 @@ #include linux/delay.h -static void -qla2x00_mbx_sem_timeout(unsigned long data) -{ - struct semaphore*sem_ptr = (struct semaphore *)data; - - DEBUG11(printk(qla2x00_sem_timeout: entered.\n)); - - if (sem_ptr != NULL) { - up(sem_ptr); - } - - DEBUG11(printk(qla2x00_mbx_sem_timeout: exiting.\n)); -} /* * qla2x00_mailbox_command @@ -47,7 +34,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *pvha, mbx_cmd_t *mcp) int rval; unsigned longflags = 0; device_reg_t __iomem *reg; - struct timer_list tmp_intr_timer; uint8_t abort_active; uint8_t io_lock_on; uint16_tcommand; @@ -72,7 +58,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *pvha, mbx_cmd_t *mcp) * non ISP abort time. */ if (!abort_active) { - if (qla2x00_down_timeout(ha-mbx_cmd_sem, mcp-tov * HZ)) { + if (!wait_for_completion_timeout(ha-mbx_cmd_comp, + mcp-tov * HZ)) { /* Timeout occurred. Return error. */ DEBUG2_3_11(printk(%s(%ld): cmd access timeout. Exiting.\n, __func__,
[PATCH] qla2xxx: Add Fibre Channel Event (FCE) tracing support.
FCE support enables the firmware to record FC extended link services and basic link services frames which have been transmitted and received by the ISP. This allows for a limited view of the FC traffic through the ISP without using a FC analyzer. This can be useful in situations where a physical connection to the FC bus is not possible. The driver exports this information in two ways -- first, via a debugfs node exported for all supported ISPs under: debugfs_mount_point/qla2xxx/qla2xxx_host_no/fce where a read of the 'fce' file will provide a snapshot of the firmware's FCE buffer; and finally, the FCE buffer will be extracted during a firmware-dump scenario. Signed-off-by: Andrew Vasquez [EMAIL PROTECTED] --- drivers/scsi/qla2xxx/Makefile |2 +- drivers/scsi/qla2xxx/qla_dbg.c | 22 + drivers/scsi/qla2xxx/qla_dbg.h | 19 drivers/scsi/qla2xxx/qla_def.h | 10 ++ drivers/scsi/qla2xxx/qla_dfs.c | 175 +++ drivers/scsi/qla2xxx/qla_fw.h |7 ++ drivers/scsi/qla2xxx/qla_gbl.h | 13 +++ drivers/scsi/qla2xxx/qla_init.c | 73 +--- drivers/scsi/qla2xxx/qla_mbx.c | 87 +++ drivers/scsi/qla2xxx/qla_os.c | 11 +++ 10 files changed, 405 insertions(+), 14 deletions(-) create mode 100644 drivers/scsi/qla2xxx/qla_dfs.c diff --git a/drivers/scsi/qla2xxx/Makefile b/drivers/scsi/qla2xxx/Makefile index 71ddb5d..c51fd1f 100644 --- a/drivers/scsi/qla2xxx/Makefile +++ b/drivers/scsi/qla2xxx/Makefile @@ -1,4 +1,4 @@ qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ - qla_dbg.o qla_sup.o qla_attr.o qla_mid.o + qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx.o diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 796c4ce..d88e98c 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -1051,6 +1051,7 @@ qla25xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) struct qla25xx_fw_dump *fw; uint32_text_mem_cnt; void*nxt; + struct qla2xxx_fce_chain *fcec; risc_address = ext_mem_cnt = 0; flags = 0; @@ -1321,10 +1322,31 @@ qla25xx_fw_dump(scsi_qla_host_t *ha, int hardware_locked) if (rval != QLA_SUCCESS) goto qla25xx_fw_dump_failed_0; + /* Fibre Channel Trace Buffer. */ nxt = qla2xxx_copy_queues(ha, nxt); if (ha-eft) memcpy(nxt, ha-eft, ntohl(ha-fw_dump-eft_size)); + /* Fibre Channel Event Buffer. */ + if (!ha-fce) + goto qla25xx_fw_dump_failed_0; + + ha-fw_dump-version |= __constant_htonl(DUMP_CHAIN_VARIANT); + + fcec = nxt + ntohl(ha-fw_dump-eft_size); + fcec-type = __constant_htonl(DUMP_CHAIN_FCE | DUMP_CHAIN_LAST); + fcec-chain_size = htonl(sizeof(struct qla2xxx_fce_chain) + + fce_calc_size(ha-fce_bufs)); + fcec-size = htonl(fce_calc_size(ha-fce_bufs)); + fcec-addr_l = htonl(LSD(ha-fce_dma)); + fcec-addr_h = htonl(MSD(ha-fce_dma)); + + iter_reg = fcec-eregs; + for (cnt = 0; cnt 8; cnt++) + *iter_reg++ = htonl(ha-fce_mb[cnt]); + + memcpy(iter_reg, ha-fce, ntohl(fcec-size)); + qla25xx_fw_dump_failed_0: if (rval != QLA_SUCCESS) { qla_printk(KERN_WARNING, ha, diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h index a50ecf0..524598a 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.h +++ b/drivers/scsi/qla2xxx/qla_dbg.h @@ -256,6 +256,25 @@ struct qla25xx_fw_dump { #define EFT_BYTES_PER_BUFFER 0x4000 #define EFT_SIZE ((EFT_BYTES_PER_BUFFER) * (EFT_NUM_BUFFERS)) +#define FCE_NUM_BUFFERS64 +#define FCE_BYTES_PER_BUFFER 0x400 +#define FCE_SIZE ((FCE_BYTES_PER_BUFFER) * (FCE_NUM_BUFFERS)) +#define fce_calc_size(b) ((FCE_BYTES_PER_BUFFER) * (b)) + +struct qla2xxx_fce_chain { + uint32_t type; + uint32_t chain_size; + + uint32_t size; + uint32_t addr_l; + uint32_t addr_h; + uint32_t eregs[8]; +}; + +#define DUMP_CHAIN_VARIANT 0x8000 +#define DUMP_CHAIN_FCE 0x7AF0 +#define DUMP_CHAIN_LAST0x8000 + struct qla2xxx_fw_dump { uint8_t signature[4]; uint32_t version; diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 3f934bd..6f129da 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2156,6 +2156,7 @@ typedef struct scsi_qla_host { uint32_tgpsc_supported :1; uint32_tvsan_enabled:1; uint32_tnpiv_supported :1; + uint32_tfce_enabled :1; } flags; atomic_tloop_state; @@ -2449,6 +2450,15 @@ typedef struct scsi_qla_host {
Re: 2.6.24-rc8-mm1 Build Failure on scsi driver
On Thu, 17 Jan 2008 21:45:39 +0530 Kamalesh Babulal [EMAIL PROTECTED] wrote: Hi Andrew, The kernel build fails with following error drivers/scsi/aha152x.o: In function `aha152x_host_reset_host': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:1324: multiple definition of `aha152x_host_reset_host' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:1324: first defined here drivers/scsi/aha152x.o: In function `aha152x_release': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:908: multiple definition of `aha152x_release' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:908: first defined here ld: Warning: size of symbol `aha152x_release' changed from 68 in drivers/scsi/pcmcia/built-in.o to 100 in drivers/scsi/aha152x.o drivers/scsi/aha152x.o: In function `aha152x_probe_one': Neat. Seems that the scsi build system is linking together two copies of drivers/scsi/aha152x.o. One via drivers/scsi/aha152x.o directly and the other via drivers/scsi/pcmcia/built-in.o. Please send the .config. I'm looking suspiciously at this, from git-scsi-misc: commit 8ae732a91df051aba6820068a47b631a06599d84 Author: Tejun Heo [EMAIL PROTECTED] Date: Fri Dec 7 22:36:23 2007 +0900 [SCSI] make pcmcia directory use obj-y|m instead of subdir-y|m subdir-y|m isn't supposed to contain modules or built-in components. Change subdir-$(CONFIG_PCMCIA) to obj-$(CONFIG_PCMCIA). Signed-off-by: Tejun Heo [EMAIL PROTECTED] Acked-by: Sam Ravnborg [EMAIL PROTECTED] Signed-off-by: James Bottomley [EMAIL PROTECTED] diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index b5441f5..93e1428 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile @@ -17,7 +17,7 @@ CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF CFLAGS_gdth.o= # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS -subdir-$(CONFIG_PCMCIA)+= pcmcia +obj-$(CONFIG_PCMCIA) += pcmcia/ obj-$(CONFIG_SCSI) += scsi_mod.o obj-$(CONFIG_SCSI_TGT) += scsi_tgt.o - 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
Re: [PATCH 0/14] qla2xxx: updates for 2.6.24 [8.02.00-k7].
On Thu, 17 Jan 2008, Andrew Vasquez wrote: This patchset updates the qla2xxx driver to 8.02.00-k7. ... BTW: Small typo in the subject, it's obvious these patches aren't for 2.6.24, instead, meant for the next merge window of 2.6.25... - 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
Re: Performance of SCST versus STGT
[EMAIL PROTECTED] wrote on Thu, 17 Jan 2008 19:05 +0900: On Thu, 17 Jan 2008 12:48:28 +0300 Vladislav Bolkhovitin [EMAIL PROTECTED] wrote: FUJITA Tomonori wrote: On Thu, 17 Jan 2008 10:27:08 +0100 Bart Van Assche [EMAIL PROTECTED] wrote: Hello, I have performed a test to compare the performance of SCST and STGT. Apparently the SCST target implementation performed far better than the STGT target implementation. This makes me wonder whether this is due to the design of SCST or whether STGT's performance can be improved to the level of SCST ? Test performed: read 2 GB of data in blocks of 1 MB from a target (hot cache -- no disk reads were performed, all reads were from the cache). Test command: time dd if=/dev/sde of=/dev/null bs=1M count=2000 STGT read SCST read performance (MB/s) performance (MB/s) Ethernet (1 Gb/s network)7789 IPoIB (8 Gb/s network) 82 229 SRP (8 Gb/s network)N/A 600 iSER (8 Gb/s network)80 N/A These results show that SCST uses the InfiniBand network very well (effectivity of about 88% via SRP), but that the current STGT version is unable to transfer data faster than 82 MB/s. Does this mean that there is a severe bottleneck present in the current STGT implementation ? I don't know about the details but Pete said that he can achieve more than 900MB/s read performance with tgt iSER target using ramdisk. http://www.mail-archive.com/[EMAIL PROTECTED]/msg4.html Please don't confuse multithreaded latency insensitive workload with single threaded, hence latency sensitive one. Seems that he can get good performance with single threaded workload: http://www.osc.edu/~pw/papers/wyckoff-iser-snapi07-talk.pdf But I don't know about the details so let's wait for Pete to comment on this. Page 16 is pretty straight forward. One command outstanding from the client. It is an OSD read command. Data on tmpfs. 500 MB/s is pretty easy to get on IB. The other graph on page 23 is for block commands. 600 MB/s ish. Still single command; so essentially a latency test. Dominated by the memcpy time from tmpfs to pinned IB buffer, as per page 24. Erez said: We didn't run any real performance test with tgt, so I don't have numbers yet. I know that Pete got ~900 MB/sec by hacking sgp_dd, so all data was read/written to the same block (so it was all done in the cache). Pete - am I right? Yes (actually just 1 thread in sg_dd). This is obviously cheating. Take the pread time to zero in SCSI Read analysis on page 24 to show max theoretical. It's IB theoretical minus some initiator and stgt overheads. The other way to get more read throughput is to throw multiple simultaneous commands at the server. There's nothing particularly stunning here. Suspect Bart has configuration issues if not even IPoIB will do 100 MB/s. -- Pete - 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
[PATCH 0/14] qla2xxx: updates for 2.6.24 [8.02.00-k7].
This patchset updates the qla2xxx driver to 8.02.00-k7. drivers/scsi/qla2xxx/Makefile |2 +- drivers/scsi/qla2xxx/qla_attr.c| 52 +++-- drivers/scsi/qla2xxx/qla_dbg.c | 37 ++-- drivers/scsi/qla2xxx/qla_dbg.h | 19 ++ drivers/scsi/qla2xxx/qla_def.h | 42 +++-- drivers/scsi/qla2xxx/qla_dfs.c | 175 +++ drivers/scsi/qla2xxx/qla_fw.h | 14 ++ drivers/scsi/qla2xxx/qla_gbl.h | 51 ++--- drivers/scsi/qla2xxx/qla_init.c| 80 ++-- drivers/scsi/qla2xxx/qla_isr.c | 105 - drivers/scsi/qla2xxx/qla_mbx.c | 426 drivers/scsi/qla2xxx/qla_mid.c | 13 +- drivers/scsi/qla2xxx/qla_os.c | 80 +++- drivers/scsi/qla2xxx/qla_sup.c | 18 +- drivers/scsi/qla2xxx/qla_version.h |2 +- 15 files changed, 616 insertions(+), 500 deletions(-) here's the commits: - Consolidate duplicate sense-data handling codes. - Retrieve additional HBA port statistics from recent ISPs. - Fix for 32-bit platforms with 64-bit resources. - Wait for FLASH write-protection to complete after a write. - Restrict MSI/MSI-X enablement on select ISP2432-type HBAs. - Don't schedule the DPC routine to perform an issue-lip request. - Use completion routines. - Add a filter to compare port_name against the physical on vport creation. - Code cleanups. - Trace-Control naming cleanups. - Add Fibre Channel Event (FCE) tracing support. - Correct late-memset() of EFT buffer. - Issue correct MBC_INITIALIZE_FIRMWARE command. - Update version number to 8.02.00-k7. Regards, Andrew Vasquez 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
[PATCH] SCSI st : convert to unlocked_ioctl
Convert st to unlocked_ioctl. The necessary locking was already in place. Signed-off-by: Kai Makisara [EMAIL PROTECTED] --- The patch is against 2.6.24-rc8. drivers/scsi/st.c |9 - 1 file changed, 4 insertions(+), 5 deletions(-) --- linux-2.6/drivers/scsi/st.c 2007-12-20 18:26:03.0 +0200 +++ linux-2.6-rc8-test/drivers/scsi/st.c2008-01-17 21:49:14.0 +0200 @@ -9,7 +9,7 @@ Steve Hirsch, Andreas Koppenhofer, Michael Leodolter, Eyal Lebedinsky, Michael Schaefer, Jorg Weule, and Eric Youngdale. - Copyright 1992 - 2007 Kai Makisara + Copyright 1992 - 2008 Kai Makisara email [EMAIL PROTECTED] Some small formal changes - aeb, 950809 @@ -17,7 +17,7 @@ Last modified: 18-JAN-1998 Richard Gooch [EMAIL PROTECTED] Devfs support */ -static const char *verstr = 20070203; +static const char *verstr = 20080117; #include linux/module.h @@ -3214,8 +3214,7 @@ static int partition_tape(struct scsi_ta /* The ioctl command */ -static int st_ioctl(struct inode *inode, struct file *file, - unsigned int cmd_in, unsigned long arg) +static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg) { int i, cmd_nr, cmd_type, bt; int retval = 0; @@ -3870,7 +3869,7 @@ static const struct file_operations st_f .owner =THIS_MODULE, .read = st_read, .write =st_write, - .ioctl =st_ioctl, + .unlocked_ioctl = st_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = st_compat_ioctl, #endif - 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
Re: [PATCH v2] use dynamically allocated sense buffer
On Thu, 17 Jan 2008 09:58:11 -0600 James Bottomley [EMAIL PROTECTED] wrote: On Thu, 2008-01-17 at 18:13 +0900, FUJITA Tomonori wrote: On Wed, 16 Jan 2008 14:35:50 +0200 Benny Halevy [EMAIL PROTECTED] wrote: On Jan. 15, 2008, 17:20 +0200, James Bottomley [EMAIL PROTECTED] wrote: On Tue, 2008-01-15 at 18:23 +0900, FUJITA Tomonori wrote: This is the second version of http://marc.info/?l=linux-scsim=119933628210006w=2 I gave up once, but I found that the performance loss is negligible (within 1%) by using kmem_cache_alloc instead of mempool. I use scsi_debug with fake_rw=1 and disktest (DIO reads with 8 threads) again: scsi-misc (slub) | 486.9 MB/s IOPS 124652.9/s dynamic sense buf (slub) | 483.2 MB/s IOPS 123704.1/s scsi-misc (slab) | 467.0 MB/s IOPS 119544.3/s dynamic sense buf (slab) | 468.7 MB/s IOPS 119986.0/s The results are the averages of three runs with a server using two dual-core 1.60 GHz Xeon processors with DDR2 memory. I doubt think that someone will complain about the performance regression due to this patch. In addition, unlike scsi_debug, the real LLDs allocate the own data structure per scsi_cmnd so the performance differences would be smaller (and with the real hard disk overheads). Here's the full results: http://www.kernel.org/pub/linux/kernel/people/tomo/sense/results.txt Heh, that's one of those good news, bad news things. Certainly good news for you. The bad news for the rest of us is that you just implicated mempool in a performance problem and since they're the core of the SCSI scatterlist allocations and sit at the heart of the critical path in SCSI, we have a potential performance issue in the whole of SCSI. Looking at mempool's code this is peculiar as what seems to be its critical path for alloc and free looks pretty harmless and lightweight. Maybe an extra memory barrier, spin_{,un}lock_* and two extra function call (one of them can be eliminated BTW if the order of arguments to the mempool_{alloc,free}_t functions were the same as for kmem_cache_{alloc,free}). Yeah, so I wondered why the change made a big difference. After more testing, it turned out that mempool is not so slow. v1 patch reserves as many buffers as can_queue per shost. My test server allocates 1519 sense buffers in total and then needs to allocate more. Seems that it hurts the performance. I would bet it does. Mempools aren't a performance enhancer, they're a deadlock avoider. So you don't prefill them with 1519 entries per host, you prefill them with at most two so that we can always guarantee getting a writeout command down in the event the system is totally out of GFP_ATOMIC memory and needs to free something. Yes, I misunderstood how mempool works. BTW, I preallocated as many buffers as can_queue an then the server allocates 1519 buffers in total (with five scsi hosts). Plus, pool allocations of that size will get me hunted down and shot by the linux tiny (or other embedded) community. Definitely. I modified v3 patch to allocate unused 1519 sense buffers via kmem_cache_alloc. It achieved 96.2% of the scsi-misc performance (note that v1 patch achieved 94.6% of the scsi-misc). I modified v3 patch to use mempool to allocate one buffer per host. It achieved 98.3% of the scsi-misc (note that v3 patch achieved 99.3% of the scsi-misc). This is about the correct thing to do. Will you merge the v3 patch or the modified v3 patch to use mempool to allocate one buffer per host? Or always allocating sense buffer costs too much? - 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
[PATCH] aha152x: fix isa/pcmcia compile problem
aha152x.c is built twice - once for the isa driver and once for the PCMCIA one. Through #ifdefs, the compiled codes are slightly different; thus, global symbols need to be given different names depending on which flavor is being built. This patch adds GLOBAL() macro to aha152x.h which changes the symbol depending on PCMCIA. This bug has always existed but has been masked by the fact the drivers/scsi/pcmcia used subdir-(y|m) instead of obj-(y|m) which made drivers/scsi/pcmcia/built_in.o not linked into the kernel and thus avoided the duplicate symbols during compilation. Signed-off-by: Tejun Heo [EMAIL PROTECTED] --- drivers/scsi/aha152x.c | 12 ++-- drivers/scsi/aha152x.h | 20 +--- drivers/scsi/pcmcia/aha152x_stub.c | 10 ++ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index ea8c699..0204f44 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -769,7 +769,7 @@ static irqreturn_t swintr(int irqno, void *dev_id) return IRQ_HANDLED; } -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup) +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *setup) { struct Scsi_Host *shpnt; @@ -905,7 +905,7 @@ out_host_put: return NULL; } -void aha152x_release(struct Scsi_Host *shpnt) +void GLOBAL(aha152x_release)(struct Scsi_Host *shpnt) { if (!shpnt) return; @@ -1327,7 +1327,7 @@ static void reset_ports(struct Scsi_Host *shpnt) * Reset the host (bus and controller) * */ -int aha152x_host_reset_host(struct Scsi_Host *shpnt) +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *shpnt) { DPRINTK(debug_eh, KERN_DEBUG scsi%d: host reset\n, shpnt-host_no); @@ -1345,7 +1345,7 @@ int aha152x_host_reset_host(struct Scsi_Host *shpnt) */ static int aha152x_host_reset(Scsi_Cmnd *SCpnt) { - return aha152x_host_reset_host(SCpnt-device-host); + return GLOBAL(aha152x_host_reset_host)(SCpnt-device-host); } /* @@ -3916,7 +3916,7 @@ static int __init aha152x_init(void) for (i=0; isetup_count; i++) { if ( request_region(setup[i].io_port, IO_RANGE, aha152x) ) { - struct Scsi_Host *shpnt = aha152x_probe_one(setup[i]); + struct Scsi_Host *shpnt = GLOBAL(aha152x_probe_one)(setup[i]); if( !shpnt ) { release_region(setup[i].io_port, IO_RANGE); @@ -3946,7 +3946,7 @@ static void __exit aha152x_exit(void) list_for_each_entry(hd, aha152x_host_list, host_list) { struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata); - aha152x_release(shost); + GLOBAL(aha152x_release)(shost); } } diff --git a/drivers/scsi/aha152x.h b/drivers/scsi/aha152x.h index ac4bfa4..7db6c47 100644 --- a/drivers/scsi/aha152x.h +++ b/drivers/scsi/aha152x.h @@ -330,8 +330,22 @@ struct aha152x_setup { char *conf; }; -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *); -void aha152x_release(struct Scsi_Host *); -int aha152x_host_reset_host(struct Scsi_Host *); +/* + * This file and aha152x.c are compiled in two different ways - for + * the isa driver and pcmcia one. When building the pcmcia one, the + * file is slightly modified, so they can't share the same object + * file. The following macro alters a symbol depending on whether + * pcmcia driver is being built or not and should be used for any + * global symbol. + */ +#if defined(PCMCIA) +#define GLOBAL(x) CS_##x +#else +#define GLOBAL(x) x +#endif + +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *); +void GLOBAL(aha152x_release)(struct Scsi_Host *); +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *); #endif /* _AHA152X_H */ diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 2dd0dc9..57f83d1 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c @@ -47,13 +47,15 @@ #include scsi.h #include scsi/scsi_host.h -#include aha152x.h #include pcmcia/cs_types.h #include pcmcia/cs.h #include pcmcia/cistpl.h #include pcmcia/ds.h +#define PCMCIA 1 +#include aha152x.h + #ifdef PCMCIA_DEBUG static int pc_debug = PCMCIA_DEBUG; module_param(pc_debug, int, 0644); @@ -194,7 +196,7 @@ static int aha152x_config_cs(struct pcmcia_device *link) if (ext_trans) s.ext_trans = ext_trans; -host = aha152x_probe_one(s); +host = GLOBAL(aha152x_probe_one)(s); if (host == NULL) { printk(KERN_INFO aha152x_cs: no SCSI devices found\n); goto cs_failed; @@ -216,7 +218,7 @@ static void aha152x_release_cs(struct pcmcia_device *link) { scsi_info_t *info = link-priv; - aha152x_release(info-host); + GLOBAL(aha152x_release)(info-host); pcmcia_disable_device(link); } @@
Re: [PATCH] firewire: fw-sbp2: prepare for s/g chaining
On Tue, 15 Jan 2008 21:10:50 +0100 (CET) Stefan Richter [EMAIL PROTECTED] wrote: Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- Replacement of patch firewire: fw-sbp2: enable s/g chaining. It's the same, minus '+ .use_sg_chaining = ENABLE_SG_CHAINING,' hunk to prevent conflicts when James is going to remove .use_sg_chaining. drivers/firewire/fw-sbp2.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) Index: linux/drivers/firewire/fw-sbp2.c === --- linux.orig/drivers/firewire/fw-sbp2.c +++ linux/drivers/firewire/fw-sbp2.c @@ -1107,9 +1107,9 @@ sbp2_map_scatterlist(struct sbp2_command * elements larger than 65535 bytes, some IOMMUs may merge sg elements * during DMA mapping, and Linux currently doesn't prevent this. */ On a relate note, I fixed the IOMMU merge issue. The patches have been -mm though I'm not sure whether they will go into v2.6.25. The patches enable you to remove the following workaround if you configure the maximum sg element length. From a quick look, fw-sbp2 uses scsi-ml in a different way so it would be a bit trick to configure the maximum sg element length. You call dma_map_sg with pci_dev::dev but don't call scsi_add_host with pci_dev::dev. If you set the maximum sg element length to pci_dev::dev, and then call scsi_add_host with it, the block layer and the IOMMU send you proper size sg elements. - for (i = 0, j = 0; i count; i++) { - sg_len = sg_dma_len(sg + i); - sg_addr = sg_dma_address(sg + i); + for (i = 0, j = 0; i count; i++, sg = sg_next(sg)) { + sg_len = sg_dma_len(sg); + sg_addr = sg_dma_address(sg); while (sg_len) { /* FIXME: This won't get us out of the pinch. */ if (unlikely(j = ARRAY_SIZE(orb-page_table))) { -- Stefan Richter -=-==--- ---= - http://arcgraph.de/sr/ - 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 - 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
Re: [PATCH] aha152x: fix isa/pcmcia compile problem
On Fri, Jan 18, 2008 at 09:53:16AM +0900, Tejun Heo wrote: aha152x.c is built twice - once for the isa driver and once for the PCMCIA one. Through #ifdefs, the compiled codes are slightly different; thus, global symbols need to be given different names depending on which flavor is being built. This patch adds GLOBAL() macro to aha152x.h which changes the symbol depending on PCMCIA. This bug has always existed but has been masked by the fact the drivers/scsi/pcmcia used subdir-(y|m) instead of obj-(y|m) which made drivers/scsi/pcmcia/built_in.o not linked into the kernel and thus avoided the duplicate symbols during compilation. Signed-off-by: Tejun Heo [EMAIL PROTECTED] --- drivers/scsi/aha152x.c | 12 ++-- drivers/scsi/aha152x.h | 20 +--- drivers/scsi/pcmcia/aha152x_stub.c | 10 ++ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index ea8c699..0204f44 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -769,7 +769,7 @@ static irqreturn_t swintr(int irqno, void *dev_id) return IRQ_HANDLED; } -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup) +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *setup) { struct Scsi_Host *shpnt; @@ -905,7 +905,7 @@ out_host_put: return NULL; } -void aha152x_release(struct Scsi_Host *shpnt) +void GLOBAL(aha152x_release)(struct Scsi_Host *shpnt) { if (!shpnt) return; @@ -1327,7 +1327,7 @@ static void reset_ports(struct Scsi_Host *shpnt) * Reset the host (bus and controller) * */ -int aha152x_host_reset_host(struct Scsi_Host *shpnt) +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *shpnt) { DPRINTK(debug_eh, KERN_DEBUG scsi%d: host reset\n, shpnt-host_no); @@ -1345,7 +1345,7 @@ int aha152x_host_reset_host(struct Scsi_Host *shpnt) */ static int aha152x_host_reset(Scsi_Cmnd *SCpnt) { - return aha152x_host_reset_host(SCpnt-device-host); + return GLOBAL(aha152x_host_reset_host)(SCpnt-device-host); } /* @@ -3916,7 +3916,7 @@ static int __init aha152x_init(void) for (i=0; isetup_count; i++) { if ( request_region(setup[i].io_port, IO_RANGE, aha152x) ) { - struct Scsi_Host *shpnt = aha152x_probe_one(setup[i]); + struct Scsi_Host *shpnt = GLOBAL(aha152x_probe_one)(setup[i]); if( !shpnt ) { release_region(setup[i].io_port, IO_RANGE); @@ -3946,7 +3946,7 @@ static void __exit aha152x_exit(void) list_for_each_entry(hd, aha152x_host_list, host_list) { struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata); - aha152x_release(shost); + GLOBAL(aha152x_release)(shost); } } diff --git a/drivers/scsi/aha152x.h b/drivers/scsi/aha152x.h index ac4bfa4..7db6c47 100644 --- a/drivers/scsi/aha152x.h +++ b/drivers/scsi/aha152x.h @@ -330,8 +330,22 @@ struct aha152x_setup { char *conf; }; -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *); -void aha152x_release(struct Scsi_Host *); -int aha152x_host_reset_host(struct Scsi_Host *); +/* + * This file and aha152x.c are compiled in two different ways - for + * the isa driver and pcmcia one. When building the pcmcia one, the + * file is slightly modified, so they can't share the same object + * file. The following macro alters a symbol depending on whether + * pcmcia driver is being built or not and should be used for any + * global symbol. + */ +#if defined(PCMCIA) +#define GLOBAL(x)CS_##x +#else +#define GLOBAL(x)x +#endif + +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *); +void GLOBAL(aha152x_release)(struct Scsi_Host *); +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *); #endif /* _AHA152X_H */ diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 2dd0dc9..57f83d1 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c @@ -47,13 +47,15 @@ #include scsi.h #include scsi/scsi_host.h -#include aha152x.h #include pcmcia/cs_types.h #include pcmcia/cs.h #include pcmcia/cistpl.h #include pcmcia/ds.h +#define PCMCIA 1 +#include aha152x.h + #ifdef PCMCIA_DEBUG static int pc_debug = PCMCIA_DEBUG; module_param(pc_debug, int, 0644); @@ -194,7 +196,7 @@ static int aha152x_config_cs(struct pcmcia_device *link) if (ext_trans) s.ext_trans = ext_trans; -host = aha152x_probe_one(s); +host = GLOBAL(aha152x_probe_one)(s); if (host == NULL) { printk(KERN_INFO aha152x_cs: no SCSI devices found\n); goto cs_failed; @@ -216,7 +218,7 @@ static void aha152x_release_cs(struct pcmcia_device *link) { scsi_info_t
Re: 2.6.24-rc8-mm1 Build Failure on scsi driver
Andrew Morton wrote: On Thu, 17 Jan 2008 21:45:39 +0530 Kamalesh Babulal [EMAIL PROTECTED] wrote: Hi Andrew, The kernel build fails with following error drivers/scsi/aha152x.o: In function `aha152x_host_reset_host': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:1324: multiple definition of `aha152x_host_reset_host' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:1324: first defined here drivers/scsi/aha152x.o: In function `aha152x_release': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:908: multiple definition of `aha152x_release' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/aha152x.c:908: first defined here ld: Warning: size of symbol `aha152x_release' changed from 68 in drivers/scsi/pcmcia/built-in.o to 100 in drivers/scsi/aha152x.o drivers/scsi/aha152x.o: In function `aha152x_probe_one': Neat. Seems that the scsi build system is linking together two copies of drivers/scsi/aha152x.o. One via drivers/scsi/aha152x.o directly and the other via drivers/scsi/pcmcia/built-in.o. Please send the .config. I'm looking suspiciously at this, from git-scsi-misc: commit 8ae732a91df051aba6820068a47b631a06599d84 Author: Tejun Heo [EMAIL PROTECTED] Date: Fri Dec 7 22:36:23 2007 +0900 [SCSI] make pcmcia directory use obj-y|m instead of subdir-y|m subdir-y|m isn't supposed to contain modules or built-in components. Change subdir-$(CONFIG_PCMCIA) to obj-$(CONFIG_PCMCIA). Signed-off-by: Tejun Heo [EMAIL PROTECTED] Acked-by: Sam Ravnborg [EMAIL PROTECTED] Signed-off-by: James Bottomley [EMAIL PROTECTED] diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index b5441f5..93e1428 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile @@ -17,7 +17,7 @@ CFLAGS_aha152x.o = -DAHA152X_STAT -DAUTOCONF CFLAGS_gdth.o= # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS -subdir-$(CONFIG_PCMCIA) += pcmcia +obj-$(CONFIG_PCMCIA) += pcmcia/ obj-$(CONFIG_SCSI) += scsi_mod.o obj-$(CONFIG_SCSI_TGT) += scsi_tgt.o Hi Andrew, Patch from Tejun Heo fixes the aha152x.c build failure, and following second part of the build failure, is still occurring. drivers/scsi/fdomain.o:(.data+0x0): multiple definition of `fdomain_driver_template' drivers/scsi/pcmcia/built-in.o:(.data+0x5a0): first defined here drivers/scsi/fdomain.o: In function `fdomain_16x0_bus_reset': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:1568: multiple definition of `fdomain_16x0_bus_reset' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:1568: first defined here drivers/scsi/fdomain.o: In function `__fdomain_16x0_detect': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:894: multiple definition of `__fdomain_16x0_detect' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:894: first defined here ld: Warning: size of symbol `__fdomain_16x0_detect' changed from 1206 in drivers/scsi/pcmcia/built-in.o to 1700 in drivers/scsi/fdomain.o drivers/scsi/fdomain.o: In function `fdomain_setup': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:554: multiple definition of `fdomain_setup' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:554: first defined here make[2]: *** [drivers/scsi/built-in.o] Error 1 make[1]: *** [drivers/scsi] Error 2 make: *** [drivers] Error 2 -- Thanks Regards, Kamalesh Babulal, Linux Technology Center, IBM, ISTL. - 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
[PATCH] SCSI: fix isa/pcmcia compile problem
aha152x.c and fdomain are built twice - once for the isa driver and once for the PCMCIA one. Through #ifdefs, the compiled codes are slightly different; thus, global symbols need to be given different names depending on which flavor is being built. This patch adds GLOBAL() macro to aha152x.h and fdomain.h which change the symbol depending on PCMCIA. This bug has always existed but has been masked by the fact the drivers/scsi/pcmcia used subdir-(y|m) instead of obj-(y|m) which made drivers/scsi/pcmcia/built_in.o not linked into the kernel and thus avoided the duplicate symbols during compilation. Signed-off-by: Tejun Heo [EMAIL PROTECTED] --- Ah... missed that one. Here's the updated version. drivers/scsi/aha152x.c | 12 ++-- drivers/scsi/aha152x.h | 20 +--- drivers/scsi/fdomain.c | 20 ++-- drivers/scsi/fdomain.h | 21 + drivers/scsi/pcmcia/aha152x_stub.c | 10 ++ drivers/scsi/pcmcia/fdomain_stub.c | 10 ++ 6 files changed, 62 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index ea8c699..0204f44 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -769,7 +769,7 @@ static irqreturn_t swintr(int irqno, void *dev_id) return IRQ_HANDLED; } -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup) +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *setup) { struct Scsi_Host *shpnt; @@ -905,7 +905,7 @@ out_host_put: return NULL; } -void aha152x_release(struct Scsi_Host *shpnt) +void GLOBAL(aha152x_release)(struct Scsi_Host *shpnt) { if (!shpnt) return; @@ -1327,7 +1327,7 @@ static void reset_ports(struct Scsi_Host *shpnt) * Reset the host (bus and controller) * */ -int aha152x_host_reset_host(struct Scsi_Host *shpnt) +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *shpnt) { DPRINTK(debug_eh, KERN_DEBUG scsi%d: host reset\n, shpnt-host_no); @@ -1345,7 +1345,7 @@ int aha152x_host_reset_host(struct Scsi_Host *shpnt) */ static int aha152x_host_reset(Scsi_Cmnd *SCpnt) { - return aha152x_host_reset_host(SCpnt-device-host); + return GLOBAL(aha152x_host_reset_host)(SCpnt-device-host); } /* @@ -3916,7 +3916,7 @@ static int __init aha152x_init(void) for (i=0; isetup_count; i++) { if ( request_region(setup[i].io_port, IO_RANGE, aha152x) ) { - struct Scsi_Host *shpnt = aha152x_probe_one(setup[i]); + struct Scsi_Host *shpnt = GLOBAL(aha152x_probe_one)(setup[i]); if( !shpnt ) { release_region(setup[i].io_port, IO_RANGE); @@ -3946,7 +3946,7 @@ static void __exit aha152x_exit(void) list_for_each_entry(hd, aha152x_host_list, host_list) { struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata); - aha152x_release(shost); + GLOBAL(aha152x_release)(shost); } } diff --git a/drivers/scsi/aha152x.h b/drivers/scsi/aha152x.h index ac4bfa4..f441e54 100644 --- a/drivers/scsi/aha152x.h +++ b/drivers/scsi/aha152x.h @@ -330,8 +330,22 @@ struct aha152x_setup { char *conf; }; -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *); -void aha152x_release(struct Scsi_Host *); -int aha152x_host_reset_host(struct Scsi_Host *); +/* + * This file and aha152x.c are compiled in two different ways - for + * the isa driver and pcmcia one. When building the pcmcia one, the + * file is slightly modified, so they can't share the same object + * file. The following macro alters a symbol depending on whether + * pcmcia driver is being built or not and should be used for any + * global symbol. + */ +#if defined(PCMCIA) +#define GLOBAL(x) CS_##x +#else +#define GLOBAL(x) ISA_##x +#endif + +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *); +void GLOBAL(aha152x_release)(struct Scsi_Host *); +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *); #endif /* _AHA152X_H */ diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 2cd6b49..e14c59b 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -550,7 +550,7 @@ static void print_banner( struct Scsi_Host *shpnt ) printk( \n ); } -int fdomain_setup(char *str) +int GLOBAL(fdomain_setup)(char *str) { int ints[4]; @@ -571,7 +571,7 @@ int fdomain_setup(char *str) return 1; } -__setup(fdomain=, fdomain_setup); +__setup(fdomain=, GLOBAL(fdomain_setup)); static void do_pause(unsigned amount) /* Pause for amount*10 milliseconds */ @@ -890,7 +890,7 @@ fail: #endif -struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) +struct Scsi_Host *GLOBAL(__fdomain_16x0_detect)(struct scsi_host_template *tpnt ) { int retcode; struct Scsi_Host
Re: 2.6.24-rc8-mm1 Build Failure on scsi driver
On Fri, 18 Jan 2008 12:07:27 +0530 Kamalesh Babulal [EMAIL PROTECTED] wrote: Hi Andrew, Patch from Tejun Heo fixes the aha152x.c build failure, and following second part of the build failure, is still occurring. drivers/scsi/fdomain.o:(.data+0x0): multiple definition of `fdomain_driver_template' drivers/scsi/pcmcia/built-in.o:(.data+0x5a0): first defined here drivers/scsi/fdomain.o: In function `fdomain_16x0_bus_reset': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:1568: multiple definition of `fdomain_16x0_bus_reset' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:1568: first defined here drivers/scsi/fdomain.o: In function `__fdomain_16x0_detect': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:894: multiple definition of `__fdomain_16x0_detect' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:894: first defined here ld: Warning: size of symbol `__fdomain_16x0_detect' changed from 1206 in drivers/scsi/pcmcia/built-in.o to 1700 in drivers/scsi/fdomain.o drivers/scsi/fdomain.o: In function `fdomain_setup': /home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:554: multiple definition of `fdomain_setup' drivers/scsi/pcmcia/built-in.o:/home/kamalesh/scrap/linux-2.6.24-rc8/drivers/scsi/fdomain.c:554: first defined here Tejun has more fixing to do, I suspect ;) I assume a basic allyesconfig will weed out most remaining problems of this sort. Problem is, it needs to be done for all architectures (and even that might not suffice). So old-fashioned code inspection is also needed. - 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
Re: [PATCH] SCSI: fix isa/pcmcia compile problem
On Fri, Jan 18, 2008 at 04:20:40PM +0900, Tejun Heo wrote: aha152x.c and fdomain are built twice - once for the isa driver and once for the PCMCIA one. Through #ifdefs, the compiled codes are slightly different; thus, global symbols need to be given different names depending on which flavor is being built. This patch adds GLOBAL() macro to aha152x.h and fdomain.h which change the symbol depending on PCMCIA. This bug has always existed but has been masked by the fact the drivers/scsi/pcmcia used subdir-(y|m) instead of obj-(y|m) which made drivers/scsi/pcmcia/built_in.o not linked into the kernel and thus avoided the duplicate symbols during compilation. Hi Tejun Heo, Thanks, I have tested the patch, it fixes both build failures. Tested-by: Kamalesh Babulal [EMAIL PROTECTED] Signed-off-by: Tejun Heo [EMAIL PROTECTED] --- Ah... missed that one. Here's the updated version. drivers/scsi/aha152x.c | 12 ++-- drivers/scsi/aha152x.h | 20 +--- drivers/scsi/fdomain.c | 20 ++-- drivers/scsi/fdomain.h | 21 + drivers/scsi/pcmcia/aha152x_stub.c | 10 ++ drivers/scsi/pcmcia/fdomain_stub.c | 10 ++ 6 files changed, 62 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index ea8c699..0204f44 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -769,7 +769,7 @@ static irqreturn_t swintr(int irqno, void *dev_id) return IRQ_HANDLED; } -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup) +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *setup) { struct Scsi_Host *shpnt; @@ -905,7 +905,7 @@ out_host_put: return NULL; } -void aha152x_release(struct Scsi_Host *shpnt) +void GLOBAL(aha152x_release)(struct Scsi_Host *shpnt) { if (!shpnt) return; @@ -1327,7 +1327,7 @@ static void reset_ports(struct Scsi_Host *shpnt) * Reset the host (bus and controller) * */ -int aha152x_host_reset_host(struct Scsi_Host *shpnt) +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *shpnt) { DPRINTK(debug_eh, KERN_DEBUG scsi%d: host reset\n, shpnt-host_no); @@ -1345,7 +1345,7 @@ int aha152x_host_reset_host(struct Scsi_Host *shpnt) */ static int aha152x_host_reset(Scsi_Cmnd *SCpnt) { - return aha152x_host_reset_host(SCpnt-device-host); + return GLOBAL(aha152x_host_reset_host)(SCpnt-device-host); } /* @@ -3916,7 +3916,7 @@ static int __init aha152x_init(void) for (i=0; isetup_count; i++) { if ( request_region(setup[i].io_port, IO_RANGE, aha152x) ) { - struct Scsi_Host *shpnt = aha152x_probe_one(setup[i]); + struct Scsi_Host *shpnt = GLOBAL(aha152x_probe_one)(setup[i]); if( !shpnt ) { release_region(setup[i].io_port, IO_RANGE); @@ -3946,7 +3946,7 @@ static void __exit aha152x_exit(void) list_for_each_entry(hd, aha152x_host_list, host_list) { struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata); - aha152x_release(shost); + GLOBAL(aha152x_release)(shost); } } diff --git a/drivers/scsi/aha152x.h b/drivers/scsi/aha152x.h index ac4bfa4..f441e54 100644 --- a/drivers/scsi/aha152x.h +++ b/drivers/scsi/aha152x.h @@ -330,8 +330,22 @@ struct aha152x_setup { char *conf; }; -struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *); -void aha152x_release(struct Scsi_Host *); -int aha152x_host_reset_host(struct Scsi_Host *); +/* + * This file and aha152x.c are compiled in two different ways - for + * the isa driver and pcmcia one. When building the pcmcia one, the + * file is slightly modified, so they can't share the same object + * file. The following macro alters a symbol depending on whether + * pcmcia driver is being built or not and should be used for any + * global symbol. + */ +#if defined(PCMCIA) +#define GLOBAL(x) CS_##x +#else +#define GLOBAL(x) ISA_##x +#endif + +struct Scsi_Host *GLOBAL(aha152x_probe_one)(struct aha152x_setup *); +void GLOBAL(aha152x_release)(struct Scsi_Host *); +int GLOBAL(aha152x_host_reset_host)(struct Scsi_Host *); #endif /* _AHA152X_H */ diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 2cd6b49..e14c59b 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c @@ -550,7 +550,7 @@ static void print_banner( struct Scsi_Host *shpnt ) printk( \n ); } -int fdomain_setup(char *str) +int GLOBAL(fdomain_setup)(char *str) { int ints[4]; @@ -571,7 +571,7 @@ int fdomain_setup(char *str) return 1; } -__setup(fdomain=, fdomain_setup); +__setup(fdomain=, GLOBAL(fdomain_setup)); static void do_pause(unsigned amount) /* Pause for amount*10 milliseconds */ @@ -890,7 +890,7 @@ fail: #endif -struct Scsi_Host