2004-04-16 19:13:21

by Mukker, Atul

[permalink] [raw]
Subject: RE: [ANNOUNCE][RELEASE]: megaraid unified driver version 2.20.0.B 1

> kdep.h:
> - mraid_scsi_host_alloc/mraid_scsi_host_dealloc should go away, just
> define scsi_host_alloc/scsi_host_put wrappers for 2.4.
> - mraid_scsi_set_pdev should go away, it's not needed in 2.6 at all
> because scsi_add_host does all the work and for 2.4 just use
> scsi_set_pci_device directly.
> - all the SCP2FOO defines should go away, the 2.6 variants
> work for 2.4
> aswell
> - mraid_set_host_lock should go, just use scsi_assign_lock and define
> it for 2.4.
All of these taken and will be incorporated in B3, but not in B2 going out
today

>
> megaraid_clib.c:
> - why do you need the scb pool managment code at all? You
> can dynamically
> allocate scbs in ->queuecommand
Will do. Please see the follow up question below

> - can you explain the need for all the mraid_pci_blk_pool?
> I.e. why the
> generic dma pool routines don't work for megaraid
We did not want to use pci_alloc_consistent because it would give one page
even if we need 16 bytes (and we need a lot of these). Also, the
pci_poo_create and pci_pool_alloc would fail on some setups - maybe because
the driver requires lots of small chunks of DMAable buffers. So we decided
to write wrapper functions over pci_alloc_consistent..

>
> all files:
> - please avoid using scsi.h and hosts.h from drivers/scsi
> in favour of
> the include/scsi/ headers, especially get rid of all the Scsi_Foo
> typedefs
ok


2004-04-16 19:18:01

by Jeff Garzik

[permalink] [raw]
Subject: Re: [ANNOUNCE][RELEASE]: megaraid unified driver version 2.20.0.B 1

Mukker, Atul wrote:
>>megaraid_clib.c:
>> - why do you need the scb pool managment code at all? You
>>can dynamically
>> allocate scbs in ->queuecommand
>
> Will do. Please see the follow up question below

If there is a static maximum of scbs for megaraid hardware, dynamically
allocating scbs in ->queuecommand is a waste of time.

In my drivers, I pre-allocate driver-specific per-request structures --
just like the SCSI layer does ;-)

If you follow this -- faster -- approach, make sure you don't waste a
lot of memory with pre-allocated scb's you'll rarely use.


>> - can you explain the need for all the mraid_pci_blk_pool?
>>I.e. why the
>> generic dma pool routines don't work for megaraid
>
> We did not want to use pci_alloc_consistent because it would give one page
> even if we need 16 bytes (and we need a lot of these). Also, the
> pci_poo_create and pci_pool_alloc would fail on some setups - maybe because
> the driver requires lots of small chunks of DMAable buffers. So we decided
> to write wrapper functions over pci_alloc_consistent..

Would prefer to identify the root cause of pci_pool_xxx failure, since
that is the proper API to use.

Jeff



2004-04-16 19:35:09

by Jeff Garzik

[permalink] [raw]
Subject: Re: [ANNOUNCE][RELEASE]: megaraid unified driver version 2.20.0.B 1

Jeff Garzik wrote:
> If there is a static maximum of scbs for megaraid hardware, dynamically
> allocating scbs in ->queuecommand is a waste of time.
>
> In my drivers, I pre-allocate driver-specific per-request structures --
> just like the SCSI layer does ;-)

Slight correction... it looks like SCSI dynamically allocates requests
these days.

That doesn't change my core argument, however.

Jeff