Re: [PATCH for-5.0] scsi: communicate max segment size to the DMA mapping code

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

 



On Wed, Jan 23, 2019 at 02:45:49PM +0100, Steffen Maier wrote:
> Zfcp can only have max_segment_size of one page (4kB). Officially announced 
> through dev.dma_parms since v2.6.35 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/s390/scsi?id=683229845f1780b10041ee7a1043fc8f10061455.
>
> With Martin's 5.0/scsi-fixes which includes your above patch, I now get 
> 64kB instead of 4kB for the respective queue limit because __scsi_ini_queue 
> overwrites the dma parameter:

Well, had the driver usd the proper dma_set_max_seg_size API instead
of handcoding it I would have converted it..

> To my surprise, I don't get IO errors with zfcp. Maybe my IO pattern does 
> not cause too large segments to be created. I would have expected the FCP 
> channel complaining rightly so if we pass segments larger than one page. 
> Maybe the additional dma_boundary of pagesize-1 helped the too large 
> max_segment_size to not become effective?

The driver already sets the dma_boundary field, which prevents from
merging I/Os that span multiple pages, and thus limits each segment
to a page or less.

> A quick attempt to adapt zfcp to your patch would be to set 
> scsi_host_template.max_segment_size = ZFCP_QDIO_SBALE_LEN.

I think we can just drop the dma_parms max_segment_size without
replacement due to the dma_boundary.

You do however still need to set up the dma_parms structure itself, as
that is also used to communicate the boundary to the IOMMU.  If would
however be great if you moved that setup into the bus code instead
of the driver, like we do for all other major hardware busses.



[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