All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-scsi@vger.kernel.org
@ 2010-06-29 21:11 Brett Dennis
  0 siblings, 0 replies; only message in thread
From: Brett Dennis @ 2010-06-29 21:11 UTC (permalink / raw)
  To: linux-scsi

Hello,

In kernel 2.6.26, the implementation of __blk_rq_map_user changed and
now includes a call to bio_copy_user:

uaddr = (unsigned long) ubuf;
alignment = queue_dma_alignment(q) | q->dma_pad_mask;
if (!(uaddr & alignment) && !(len & alignment))

bio = bio_map_user(q, NULL, uaddr, len, reading);

else

bio = bio_copy_user(q, uaddr, len, reading);


bio_copy_user uses the HBA's scatter-gather pages for the copy.  The
problem I face is that if the data size is not aligned properly, or
the len parameter does not divide properly, and the transfer is
greater than the number of scatter-gather pages, the IO operation will
fail.  I am considering increasing the size of my data buffer to meet
the length-alignment requirement and changing the 'len' parameter
passed into blk_rq_map_user to include a larger size than my CDB
transfer length.  The tape device should still honor the CDB write
length, so unless there are other limitations imposed by the Linux
kernel or SCSI subsystem, I think this is a workable solution.  Does
anyone in this list know if there is are requirements against sending
a larger buffer length than CDB transfer length?

Thanks in advance.

Brett Dennis
IBM tape device driver developer

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-29 21:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-29 21:11 linux-scsi@vger.kernel.org Brett Dennis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.