[ofa-general] [PATCH][REPOST] drivers/infiniband/ulp/srpt: Fix target data corruption
Vladislav Bolkhovitin
vst at vlnb.net
Mon Jan 14 02:48:06 PST 2008
Vladislav Bolkhovitin wrote:
> 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.
Oops, I forgot to mention, probably, the most important advantage:
5. Make SRPT target driver compatible with the upcoming zero-copy cache
usage, where the system cache will be used directly without the extra copy.
> Vlad
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
> To unsubscribe, please visit
> http://openib.org/mailman/listinfo/openib-general
>
More information about the general
mailing list