public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] fix iommu sg list merge problem
@ 2007-09-26  8:57 FUJITA Tomonori
  2007-09-26 10:02 ` Muli Ben-Yehuda
  0 siblings, 1 reply; 5+ messages in thread
From: FUJITA Tomonori @ 2007-09-26  8:57 UTC (permalink / raw)
  To: James.Bottomley, jens.axboe, hch, jeff, gregkh, hare, linux-scsi
  Cc: fujita.tomonori

iommu code merges sg lists without considering lld's restrictions so
some llds need a workaround to split sg lists again. This patchset
fixes iommu to handle lld's max segment size limit properly.

The problem is that iommu code can't access to the restrictions
because they are in request_queue. iommu code can access to only
device structure. I chose the simplest approach, adding
max_segment_size to device structure.

We could remove the lld restrictions in request_queue strucutre and
have a new strucutre (something like struct io_restrictions). Then
somehow we could link the new structure with request_queue and device
strucutres. But iommu needs only max_segment_size and
seg_boundary_mask, so the simplest approach is not so bad, I think.

scsi_add_host sets shost_gendev.parent->max_segment_size for iommu
code (copied form shost->dma_max_segment_size).

This patchset includes only the x86_64 iommu patch but my git tree
includes x86_64, ppc, ia64, parisc, and alpha patches. As far as I
know, thye are all the iommu code that merges sg lists. The iommu
patchse are only compile tested.

git://git.kernel.org/pub/scm/linux/kernel/git/tomo/linux-2.6-bidi.git iommu


3 llds, aacraid, scsi_debug, and sata_inic162x sets
shost->dma_max_segment_size in slave_configure hook. But
dma_max_segment_size is a lld restriction. I adds dma_max_segment_size
to scsi_host_template and scsi_host. llds specify dma_max_segment_size
in scsi_host_template, scsi-ml sets dma_max_segment_size in devices
and call blk_queue_max_segment_size. This patchset includes only the
sata_inic162x patch but all the patches for llds, aacraid and
scsi_debug are in the git tree.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/5] fix iommu sg list merge problem
  2007-09-26  8:57 [PATCH 0/5] fix iommu sg list merge problem FUJITA Tomonori
@ 2007-09-26 10:02 ` Muli Ben-Yehuda
  2007-09-26 14:34   ` FUJITA Tomonori
  0 siblings, 1 reply; 5+ messages in thread
From: Muli Ben-Yehuda @ 2007-09-26 10:02 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: James.Bottomley, jens.axboe, hch, jeff, gregkh, hare, linux-scsi,
	fujita.tomonori

On Wed, Sep 26, 2007 at 05:57:57PM +0900, FUJITA Tomonori wrote:

> iommu code merges sg lists without considering lld's restrictions so
> some llds need a workaround to split sg lists again. This patchset
> fixes iommu to handle lld's max segment size limit properly.

The patches look reasonable to me.

> This patchset includes only the x86_64 iommu patch

There are multiple x86-64 IOMMUs, but only GART is in-tree and
supports merging.

> but my git tree includes x86_64, ppc, ia64, parisc, and alpha
> patches. As far as I know, thye are all the iommu code that merges
> sg lists. The iommu patchse are only compile tested.
> 
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tomo/linux-2.6-bidi.git iommu

Do you think it will be possible to abstract the merging code into
common code, rather than duplicating it for every IOMMU?

Cheers,
Muli

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/5] fix iommu sg list merge problem
  2007-09-26 10:02 ` Muli Ben-Yehuda
@ 2007-09-26 14:34   ` FUJITA Tomonori
  2007-09-26 14:38     ` James Bottomley
  0 siblings, 1 reply; 5+ messages in thread
From: FUJITA Tomonori @ 2007-09-26 14:34 UTC (permalink / raw)
  To: muli
  Cc: tomof, James.Bottomley, jens.axboe, hch, jeff, gregkh, hare,
	linux-scsi, fujita.tomonori

On Wed, 26 Sep 2007 12:02:21 +0200
Muli Ben-Yehuda <muli@il.ibm.com> wrote:

> On Wed, Sep 26, 2007 at 05:57:57PM +0900, FUJITA Tomonori wrote:
> 
> > iommu code merges sg lists without considering lld's restrictions so
> > some llds need a workaround to split sg lists again. This patchset
> > fixes iommu to handle lld's max segment size limit properly.
> 
> The patches look reasonable to me.
> 
> > This patchset includes only the x86_64 iommu patch
> 
> There are multiple x86-64 IOMMUs, but only GART is in-tree and
> supports merging.
> 
> > but my git tree includes x86_64, ppc, ia64, parisc, and alpha
> > patches. As far as I know, thye are all the iommu code that merges
> > sg lists. The iommu patchse are only compile tested.
> > 
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/tomo/linux-2.6-bidi.git iommu
> 
> Do you think it will be possible to abstract the merging code into
> common code, rather than duplicating it for every IOMMU?

Yeah, I thought about it and it's possible (but not so easy). parisc
has IOMMU merging helper code and two parisc IOMMUs use it. ia64
sba_iommu is almost identical to parisc code. x86_64 gart, power, and
alpha do in their own way. But I think that we can merging helper code
useful for all.

I'll see what we can have after fixing the mering problem.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/5] fix iommu sg list merge problem
  2007-09-26 14:34   ` FUJITA Tomonori
@ 2007-09-26 14:38     ` James Bottomley
  2007-09-26 14:48       ` FUJITA Tomonori
  0 siblings, 1 reply; 5+ messages in thread
From: James Bottomley @ 2007-09-26 14:38 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: muli, jens.axboe, hch, jeff, gregkh, hare, linux-scsi,
	fujita.tomonori

On Wed, 2007-09-26 at 23:34 +0900, FUJITA Tomonori wrote:
> Yeah, I thought about it and it's possible (but not so easy). parisc
> has IOMMU merging helper code and two parisc IOMMUs use it. ia64
> sba_iommu is almost identical to parisc code. x86_64 gart, power, and
> alpha do in their own way. But I think that we can merging helper code
> useful for all.

Er ... it should be identical ... the SBA iommu is the same ... I
thought we moved the common code out to a shared file.

James



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/5] fix iommu sg list merge problem
  2007-09-26 14:38     ` James Bottomley
@ 2007-09-26 14:48       ` FUJITA Tomonori
  0 siblings, 0 replies; 5+ messages in thread
From: FUJITA Tomonori @ 2007-09-26 14:48 UTC (permalink / raw)
  To: James.Bottomley
  Cc: tomof, muli, jens.axboe, hch, jeff, gregkh, hare, linux-scsi,
	fujita.tomonori

On Wed, 26 Sep 2007 09:38:32 -0500
James Bottomley <James.Bottomley@SteelEye.com> wrote:

> On Wed, 2007-09-26 at 23:34 +0900, FUJITA Tomonori wrote:
> > Yeah, I thought about it and it's possible (but not so easy). parisc
> > has IOMMU merging helper code and two parisc IOMMUs use it. ia64
> > sba_iommu is almost identical to parisc code. x86_64 gart, power, and
> > alpha do in their own way. But I think that we can merging helper code
> > useful for all.
> 
> Er ... it should be identical ... the SBA iommu is the same ... I
> thought we moved the common code out to a shared file.

2.6.23-rc8-mm1 has two iommu_coalesce_chunks in
drivers/iommu-helpers.h and arch/ioa64/hp/common/sb_iommu.c

iommu_coalesce_chunks are almost same. parisc's iommu_coalesce_chunks
is simpler a bit.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-26 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-26  8:57 [PATCH 0/5] fix iommu sg list merge problem FUJITA Tomonori
2007-09-26 10:02 ` Muli Ben-Yehuda
2007-09-26 14:34   ` FUJITA Tomonori
2007-09-26 14:38     ` James Bottomley
2007-09-26 14:48       ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox