[ofa-general] [PATCH][REPOST] drivers/infiniband/ulp/srpt: Fix target data corruption

Vladislav Bolkhovitin vst at vlnb.net
Sat Jan 12 01:51:27 PST 2008


davem at systemfabricworks.com wrote:
> This is an updated version of [PATCH] drivers/infiniband/ulp/srpt: Fix
> target data corruption
> 
> It was pointed out to me that the code to round up to a power of 2 was
> not as clean as it should be, plus I extracted two unrelated patches and
> submitted them separately.
> 
> =====================================================================
> 
>    Change the local buffer allocator to use a spin-lock protected linked
>    list instead of an array of atomic_t used/free variables.  The atomic_t
>    code was open to a multi-thread race between test and set.  This has
>    been observed with the result that the same data buffer was used for
>    more than one SCSI operation, either writing the wrong data to the disk
>    or sending the wrong data to the initiator.

I, as a main SCST developer and implementor, would suggest to completely 
remove internal memory management from the SRPT driver and use SCST 
memory management instead. It will provide the following advantages:

1. Simplify SRPT driver and completely remove such kind of bugs.

2. Make SRPT target driver compatible with scst_user module, i.e. will 
allow to use SRPT target driver with backstorage devices, implemented in 
user space. Usual example of such devices is a VTL (Virtual Tape Library).

3. (Most likely, since I'm not too familiar with SRPT drivers internals, 
but for me it looks like so) Allow SRPT driver to reliably work with 
many outstanding commands with big data transfer sizes (>=1MB)

4. Might improve performance by caching and reusing already allocated 
and "iomaped" to Infiniband hardware SG vectors. Vu knows the details, 
we discussed them with him. It will require some minor SCST 
modifications (extending its interface with target drivers), but I'm 
willing to make them if somebody ask for it.

Vlad



More information about the general mailing list