27 Jul, 2008

1 commit

  • Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER
    architecture does:

    This enables us to cleanly fix the Calgary IOMMU issue that some devices
    are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423).

    I think that per-device dma_mapping_ops support would be also helpful for
    KVM people to support PCI passthrough but Andi thinks that this makes it
    difficult to support the PCI passthrough (see the above thread). So I
    CC'ed this to KVM camp. Comments are appreciated.

    A pointer to dma_mapping_ops to struct dev_archdata is added. If the
    pointer is non NULL, DMA operations in asm/dma-mapping.h use it. If it's
    NULL, the system-wide dma_ops pointer is used as before.

    If it's useful for KVM people, I plan to implement a mechanism to register
    a hook called when a new pci (or dma capable) device is created (it works
    with hot plugging). It enables IOMMUs to set up an appropriate
    dma_mapping_ops per device.

    The major obstacle is that dma_mapping_error doesn't take a pointer to the
    device unlike other DMA operations. So x86 can't have dma_mapping_ops per
    device. Note all the POWER IOMMUs use the same dma_mapping_error function
    so this is not a problem for POWER but x86 IOMMUs use different
    dma_mapping_error functions.

    The first patch adds the device argument to dma_mapping_error. The patch
    is trivial but large since it touches lots of drivers and dma-mapping.h in
    all the architecture.

    This patch:

    dma_mapping_error() doesn't take a pointer to the device unlike other DMA
    operations. So we can't have dma_mapping_ops per device.

    Note that POWER already has dma_mapping_ops per device but all the POWER
    IOMMUs use the same dma_mapping_error function. x86 IOMMUs use device
    argument.

    [akpm@linux-foundation.org: fix sge]
    [akpm@linux-foundation.org: fix svc_rdma]
    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: fix bnx2x]
    [akpm@linux-foundation.org: fix s2io]
    [akpm@linux-foundation.org: fix pasemi_mac]
    [akpm@linux-foundation.org: fix sdhci]
    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: fix sparc]
    [akpm@linux-foundation.org: fix ibmvscsi]
    Signed-off-by: FUJITA Tomonori
    Cc: Muli Ben-Yehuda
    Cc: Andi Kleen
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Avi Kivity
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     

04 Jul, 2008

1 commit

  • iph->tot_len is stored in network byte order, so access it using
    ntohs(). This doesn't have any real world impact on pasemi_mac, since
    the device only exists as part of a big-endian system-on-chip, but
    fixing this gets rid of a sparse warning and avoids having a bad example
    in the tree.

    Signed-off-by: Roland Dreier
    Signed-off-by: Jeff Garzik

    Roland Dreier
     

22 Apr, 2008

1 commit

  • * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (202 commits)
    [POWERPC] Fix compile breakage for 64-bit UP configs
    [POWERPC] Define copy_siginfo_from_user32
    [POWERPC] Add compat handler for PTRACE_GETSIGINFO
    [POWERPC] i2c: Fix build breakage introduced by OF helpers
    [POWERPC] Optimize fls64() on 64-bit processors
    [POWERPC] irqtrace support for 64-bit powerpc
    [POWERPC] Stacktrace support for lockdep
    [POWERPC] Move stackframe definitions to common header
    [POWERPC] Fix device-tree locking vs. interrupts
    [POWERPC] Make pci_bus_to_host()'s struct pci_bus * argument const
    [POWERPC] Remove unused __max_memory variable
    [POWERPC] Simplify xics direct/lpar irq_host setup
    [POWERPC] Use pseries_setup_i8259_cascade() in pseries_mpic_init_IRQ()
    [POWERPC] Turn xics_setup_8259_cascade() into a generic pseries_setup_i8259_cascade()
    [POWERPC] Move xics_setup_8259_cascade() into platforms/pseries/setup.c
    [POWERPC] Use asm-generic/bitops/find.h in bitops.h
    [POWERPC] 83xx: mpc8315 - fix USB UTMI Host setup
    [POWERPC] 85xx: Fix the size of qe muram for MPC8568E
    [POWERPC] 86xx: mpc86xx_hpcn - Temporarily accept old dts node identifier.
    [POWERPC] 86xx: mark functions static, other minor cleanups
    ...

    Linus Torvalds
     

17 Apr, 2008

1 commit

  • Having the id field be an int was making more complex bus topologies
    excessively difficult. For now, just convert it to a string, and
    change all instances of "bus->id = val" to
    snprintf(id, MII_BUS_ID_LEN, "%x", val).

    Signed-off-by: Andy Fleming
    Signed-off-by: Jeff Garzik

    Andy Fleming
     

07 Apr, 2008

2 commits


06 Mar, 2008

4 commits


03 Feb, 2008

3 commits


29 Jan, 2008

11 commits

  • pasemi_mac: Don't enable RX/TX without a link (if possible)

    Don't enable RX/TX of packets until we have a link, since there's a chance
    we'll just get RX frame errors, etc.

    The case where we don't have a PHY we can't do much about: Just enable
    it and deal with errors as they come in.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: Print warning when not attaching to a PHY

    Print a warning on the console when not connecting to a phy for an interface.
    It turns out to be a pretty common problem when someone gets the MDIO info
    wrong in their device tree, resulting in the macs running at a fixed 1Gbit FD.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: Remove SKB copy/recycle logic

    It doesn't really buy us much, since copying is about as expensive
    as the allocation in the first place. Just remove it for now.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: SKB unmap optimization

    Avoid touching skb_shinfo() in the unmap path, since it turns out to
    normally cause cache misses and delays. instead, save number of fragments
    in the TX_RING_INFO structures since that's all that's needed anyway.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: Software-based LRO support

    Implement LRO for pasemi_mac. Pretty straightforward.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: Improve RX interrupt mitigation

    Currently the receive side interrupts will go off on the reception of
    a packet, NAPI will poll the ring and keep polling as long as there's
    a decent amount of packets to receive.

    This is less than optimal, especially for LRO where it's better if we
    have a more substantial amount of packets to process at once, to get
    the real LRO benefits.

    So, set the count threshold to a higher value and use the timeout feature
    that will give us an interrupt even if not enough packets have come in
    to set off the count threshold.

    FIXME: It'd be real nice to have ethtool support for users to tune this
    at runtime.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: Fix TX cleaning

    This is a bit awkward. We don't have a timer-delayed interrupt on TX
    complete, but we have a count threshold. So set that reasonably high
    (32 packets), and schedule the NAPI poll when it goes off. Also bump a
    regular timer that will take care of rotting packets for the last 1..31
    ones in case we don't trigger a TX interrupt (and there's no RX activity
    that would otherwise trigger the poll).

    The longer-term fix is to separate TX from RX NAPI and do two separate
    poll loops.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: performance tweaks

    * Seems like we do better with a smaller RX ring, probably because chances of
    still having the SKB cached are better
    * Const-ify variables to get better code generation and fewer reloads
    * Move prefetching around a little, and try to prefetch the whole SKB
    * Set NETIF_F_HIGHDMA
    * Misc other minor tweaks

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: Convert to new dma library

    Convert the pasemi_mac driver to the new platform global DMA manaagement
    library. This also does a couple of other minor cleanups w.r.t. channel
    management.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: Move register definitions to include/asm-powerpc

    Move the common register formats and descriptor layouts from
    drivers/net/pasemi_mac.h to include/asm-poewrpc/pasemi_dma.h

    Previously only the ethernet driver was using them, but other drivers
    are coming up that will also use them, so it makes sense to share the
    constants.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: RX/TX ring management cleanup

    Prepare a bit for supporting multiple TX queues by cleaning up some
    of the ring management and shuffle things around a bit.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     

05 Dec, 2007

2 commits


10 Nov, 2007

2 commits


24 Oct, 2007

1 commit

  • Add missing &:

    drivers/net/pasemi_mac.c: In function 'pasemi_mac_clean_rx':
    drivers/net/pasemi_mac.c:553: warning: passing argument 1 of 'prefetch'
    makes pointer from integer without a cast

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     

11 Oct, 2007

11 commits

  • pasemi_mac: enable iommu support

    Enable IOMMU support for pasemi_mac, but avoid using it on non-partitioned
    systems for performance reasons.

    The user can override this by selecting the PPC_PASEMI_IOMMU_DMA_FORCE
    configuration option.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: use buffer index pointer in clean_rx()

    Use the new features in B0 for buffer ring index on the receive side. This
    means we no longer have to search in the ring for where the buffer
    came from.

    Also cleanup the RX cleaning side a little, while I was at it.

    Note: Pre-B0 hardware is no longer supported, and needs a pile of other
    workarounds that are not being submitted for mainline inclusion. So the
    fact that this breaks old hardware is not a problem at this time.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: clear out old errors on interface open

    Clear out any pending errors when an interface is brought up. Since the bits
    are sticky, they might be from interface shutdown time after firmware has
    used it, etc.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: update todo list

    Remove some stale todo items that have been taken care of. Add a couple
    of upcoming ones.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: further performance tweaks

    Misc driver tweaks for pasemi_mac:
    * Increase ring size (really needed mostly on 10G)
    * Take out an unneeded barrier
    * Move around a few prefetches and reorder a few calls
    * Don't try to clean on full tx buffer, just let things
    take their course and stop the queue directly
    * Avoid filling on the same line as the interface is
    working on to reduce cache line bouncing
    * Avoid unneeded clearing of software state (and make the
    interface shutdown code handle it)
    * Fix up some of the tx ring wrap logic.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: add local skb alignment

    Add local SKB alignment to pasemi_mac, since ppc64 in general has it at 0
    because of design flaws in some of the IBM server bridge chips. However,
    for PWRficient doing the unaligned copies is more expensive than doing
    unaligned DMA so make sure the data is aligned instead.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: workaround for erratum 5971

    Implement workarounds for erratum 5971, where L2 hints aren't considered
    properly unless the way hint is enabled on the interface. Since L2 isn't
    setup to dedicate a way to headers, we need to reset the packet count
    by hand so it won't run out of credits.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: implement sg support

    Implement SG support for pasemi_mac

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: rework ring management

    Rework ring management, switching to an opaque ring format instead of
    the struct-based descriptor+pointer setup, since it will be needed for
    SG support.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: fix bug in receive buffer dma mapping

    skb->len isn't actually set to the size of the allocated skb, so don't
    try to use it when figuring out how much to map.

    (This hasn't surfaced as a real bug because we effectively disable
    translation for the interface, but it still needs fixing for the future)

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson
     
  • pasemi_mac: basic error checking

    Add some rudimentary error checking to pasemi_mac.

    Signed-off-by: Olof Johansson
    Signed-off-by: Jeff Garzik

    Olof Johansson