[2.6] [PATCH] [LARGE] Rewrite/cleanup of PCI DMA mapping code

Olof Johansson olof at austin.ibm.com
Tue Feb 3 10:40:01 EST 2004


Hello all,

I've spent some time cleaning up the PCI DMA mapping code in 2.6. The
patch is large (117KB, 4000 lines), so I won't post it here. It can be
found at:

http://www.localnet.sh/patches/tce-rewrite-feb02.patch

Summary:

* Renamed include/asm-ppc64/pci_dma.h   -> iommu.h

* Removed include/asm-ppc64/iSeries/iSeries_dma.h

* Broke the contents of old arch/ppc64/kernel/pci_dma.c into:
    arch/ppc64/kernel/pci_iommu.c
    arch/ppc64/kernel/pSeries_iommu.c
    arch/ppc64/kernel/iSeries_iommu.c

...plus a large number of renames of functions, structures and structure
members. I've cleaned out the PPCDBG code from old pci_dma.c, since it
was very rarely useful due to the sheer volume of output and it
cluttered the code. Tracing can be added back in a limited fashion as
the need comes up in the future.

I also replaced the old buddy-style allocator for TCE ranges with a
simpler bitmap allocator. Time and benchmarking will tell if it's
efficient enough, but it's fairly well abstracted and can easily be replaced

Please take some time and look at the patch, the more eyes on it (and
comments/questions) the better. Patch is against ameslab as of today.

I will also add some statistics gathering similar to Linas Vepstas'
patch for the old TCE implementation, but that'll be handled separately.



  arch/ppc64/kernel/pci_dma.c               | 1477 ----------------------
  b/arch/ppc64/kdb/kdbasupport.c            |    2
  b/arch/ppc64/kernel/Makefile              |    6
  b/arch/ppc64/kernel/chrp_setup.c          |    2
  b/arch/ppc64/kernel/iSeries_iommu.c       |  242 ++++
  b/arch/ppc64/kernel/iSeries_pci.c         |    6
  b/arch/ppc64/kernel/mf.c                  |   18
  b/arch/ppc64/kernel/pSeries_iommu.c       |  294 +++++
  b/arch/ppc64/kernel/pSeries_lpar.c        |   86 -
  b/arch/ppc64/kernel/pSeries_pci.c         |    4
  b/arch/ppc64/kernel/pci.c                 |    2
  b/arch/ppc64/kernel/pci_dn.c              |    2
  b/arch/ppc64/kernel/pci_iommu.c           |  431 ++++++++
  b/arch/ppc64/kernel/ppc_ksyms.c           |   12
  b/arch/ppc64/kernel/prom.c                |   14
  b/arch/ppc64/kernel/vio.c                 |  138 +-
  b/arch/ppc64/kernel/viopath.c             |    6
  b/arch/ppc64/mm/init.c                    |    6
  b/drivers/block/viodasd.c                 |    6
  b/drivers/cdrom/viocd.c                   |   12
  b/drivers/net/ibmveth.c                   |    2
  b/drivers/net/iseries_veth.c              |    8
  b/drivers/scsi/iSeries_vscsi.c            |    4
  b/drivers/scsi/rpa_vscsi.c                |    2
  b/include/asm-ppc64/iSeries/iSeries_pci.h |    2
  b/include/asm-ppc64/iommu.h               |  158 +++
  b/include/asm-ppc64/machdep.h             |   12
  b/include/asm-ppc64/prom.h                |    4
  b/include/asm-ppc64/vio.h                 |    6
  include/asm-ppc64/iSeries/iSeries_dma.h   |   95 -
  include/asm-ppc64/pci_dma.h               |  100 --
  31 files changed, 1293 insertions(+), 1866 deletions(-)



Thanks,

-Olof


--
Olof Johansson                                        Office: 4F005/905
pSeries Linux Development                             IBM Systems Group
Email: olof at austin.ibm.com                          Phone: 512-838-9858
All opinions are my own and not those of IBM

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list