Re: [PATCH 2/2] relax scsi dma alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 31 Dec 2007, James Bottomley wrote:

> This patch relaxes the default SCSI DMA alignment from 512 bytes to 4
> bytes.  I remember from previous discussions that usb and firewire have
> sector size alignment requirements, so I upped their alignments in the
> respective slave allocs.
> 
> The reason for doing this is so that we don't get such a huge amount of
> copy overhead in bio_copy_user() for udev.  (basically all inquiries it
> issues can now be directly mapped).

...

> diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> index 7c9593b..39c03f9 100644
> --- a/drivers/usb/storage/scsiglue.c
> +++ b/drivers/usb/storage/scsiglue.c
> @@ -82,6 +82,12 @@ static int slave_alloc (struct scsi_device *sdev)
>  	sdev->inquiry_len = 36;
>  
>  	/*
> +	 * Update the dma alignment (minimum alignment requirements for
> +	 * start and end of DMA transfers) to be a sector
> +	 */
> +	blk_queue_update_dma_alignment(sdev->request_queue, 511);
> +
> +	/*
>  	 * The UFI spec treates the Peripheral Qualifier bits in an
>  	 * INQUIRY result as reserved and requires devices to set them
>  	 * to 0.  However the SCSI spec requires these bits to be set

It would be better to move the existing code from the start of
slave_configure() up into slave_alloc().  Otherwise it's fine.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux