16 Sep, 2011

2 commits

  • This was originally done as part of commit
    65f0b417dee94f779ce9b77102b7d73c93723b39 ("sfc: Use write-combining to
    reduce TX latency"), but that had to be reverted.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • This reverts commits 65f0b417dee94f779ce9b77102b7d73c93723b39,
    d88d6b05fee3cc78e5b0273eb58c31201dcc6b76,
    fcfa060468a4edcf776f0c1211d826d5de1668c1,
    747df2258b1b9a2e25929ef496262c339c380009 and
    867955f5682f7157fdafe8670804b9f8ea077bc7.

    Depending on the processor model, write-combining may result in
    reordering that the NIC will not tolerate. This typically results
    in a DMA error event and reset by the driver, logged as:

    sfc 0000:0e:00.0: eth2: TX DMA Q reports TX_EV_PKT_ERR.
    sfc 0000:0e:00.0: eth2: resetting (ALL)

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     

14 Jul, 2011

2 commits


13 Jul, 2011

1 commit


25 Jun, 2011

5 commits

  • This function is intended to assert (when DEBUG is defined) that the
    skb header area includes the header fields it's looking at, which RFS
    should already have pulled. But it uses pskb_may_pull(), which will
    attempt to pull more data if necesary. It must instead compare
    skb_headlen() with the required length.

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     
  • [bwh: Use __force in the one place it's needed]
    Signed-off-by: Ben Hutchings

    Steve Hodgson
     
  • There are certain hardware bugs that may occur on Falcon during normal
    operation, that require a reset to recover from. We try to minimise
    disruption by keeping the PHY running, following a reset sequence
    labelled as 'invisible'.

    Siena does not suffer from these hardware bugs, so we have not
    implemented an 'invisible' reset sequence. However, if a similar
    error does occur (due to a hardware fault or software bug) then the
    code shared with Falcon will wrongly assume that the PHY is not being
    reset.

    Since the mapping of reset reasons (internal) and flags (ethtool) to
    methods must differ significantly between NIC types, move it into
    per-NIC-type functions (replacing the insufficient reset_world_flags
    field).

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     
  • Currently an attempt to schedule any reset is ignored if a reset
    is already pending. This ignores the relative scopes - if the
    requested reset is greater in scope then the scheduled reset should
    be upgraded accordingly.

    There are also some race conditions which could lead to a reset
    request being lost. Deal with them by using atomic operations on a
    bitmask. This also makes tests on reset_pending easier to get right.

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     
  • efx_filter_remove_filter() fails to remove inserted filters in some cases.

    For example:

    1. Two filters A and B have specifications that result in an initial
    hash collision.
    2. A is inserted first, followed by B.
    3. An attempt to remove B first succeeds, but if A is removed first
    a subsequent attempt to remove B fails.

    When searching for an existing filter (!for_insert),
    efx_filter_search() must always continue to the maximum search depth
    for the given type rather than stopping at the first unused entry.

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     

24 Jun, 2011

1 commit


22 Jun, 2011

2 commits

  • There are enough instances of this:

    iph->frag_off & htons(IP_MF | IP_OFFSET)

    that a helper function is probably warranted.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    Paul Gortmaker
     
  • Unnecessary casts of void * clutter the code.

    These are the remainder casts after several specific
    patches to remove netdev_priv and dev_priv.

    Done via coccinelle script (and a little editing):

    $ cat cast_void_pointer.cocci
    @@
    type T;
    T *pt;
    void *pv;
    @@

    - pt = (T *)pv;
    + pt = pv;

    Signed-off-by: Joe Perches
    Acked-by: Sjur Brændeland
    Acked-By: Chris Snook
    Acked-by: Jon Mason
    Acked-by: Geert Uytterhoeven
    Acked-by: David Dillow
    Signed-off-by: David S. Miller

    Joe Perches
     

07 Jun, 2011

1 commit


28 May, 2011

1 commit

  • * git://git.infradead.org/mtd-2.6: (97 commits)
    mtd: kill CONFIG_MTD_PARTITIONS
    mtd: remove add_mtd_partitions, add_mtd_device and friends
    mtd: convert remaining users to mtd_device_register()
    mtd: samsung onenand: convert to mtd_device_register()
    mtd: omap2 onenand: convert to mtd_device_register()
    mtd: txx9ndfmc: convert to mtd_device_register()
    mtd: tmio_nand: convert to mtd_device_register()
    mtd: socrates_nand: convert to mtd_device_register()
    mtd: sharpsl: convert to mtd_device_register()
    mtd: s3c2410 nand: convert to mtd_device_register()
    mtd: ppchameleonevb: convert to mtd_device_register()
    mtd: orion_nand: convert to mtd_device_register()
    mtd: omap2: convert to mtd_device_register()
    mtd: nomadik_nand: convert to mtd_device_register()
    mtd: ndfc: convert to mtd_device_register()
    mtd: mxc_nand: convert to mtd_device_register()
    mtd: mpc5121_nfc: convert to mtd_device_register()
    mtd: jz4740_nand: convert to mtd_device_register()
    mtd: h1910: convert to mtd_device_register()
    mtd: fsmc_nand: convert to mtd_device_register()
    ...

    Fixed up trivial conflicts in
    - drivers/mtd/maps/integrator-flash.c: removed in ARM tree
    - drivers/mtd/maps/physmap.c: addition of afs partition probe type
    clashing with removal of CONFIG_MTD_PARTITIONS

    Linus Torvalds
     

25 May, 2011

1 commit


23 May, 2011

1 commit

  • After discovering that wide use of prefetch on modern CPUs
    could be a net loss instead of a win, net drivers which were
    relying on the implicit inclusion of prefetch.h via the list
    headers showed up in the resulting cleanup fallout. Give
    them an explicit include via the following $0.02 script.

    =========================================
    #!/bin/bash
    MANUAL=""
    for i in `git grep -l 'prefetch(.*)' .` ; do
    grep -q '' $i
    if [ $? = 0 ] ; then
    continue
    fi

    ( echo '?^#include '
    echo .
    echo w
    echo q
    ) | ed -s $i > /dev/null 2>&1
    if [ $? != 0 ]; then
    echo $i needs manual fixup
    MANUAL="$i $MANUAL"
    fi
    done
    echo ------------------- 8\
    [ Fixed up some incorrect #include placements, and added some
    non-network drivers and the fib_trie.c case - Linus ]
    Signed-off-by: Linus Torvalds

    Paul Gortmaker
     

18 May, 2011

2 commits


17 May, 2011

3 commits

  • We need to keep the TX queues stopped throughout a reset, without
    triggering the TX watchdog and regardless of the link state. The
    proper way to do this is to use netif_device_{detach,attach}() just as
    we do around suspend/resume, rather than the current bodge of faking
    link-down.

    Since we also need to do this during an offline self-test and we
    perform a reset during that, add these function calls outside of
    efx_reset_down() and efx_reset_up().

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     
  • Commit 747df2258b1b9a2e25929ef496262c339c380009 ('sfc: Always map MCDI
    shared memory as uncacheable') introduced a separate mapping for the
    MCDI shared memory (MC_TREG_SMEM). This means we can no longer easily
    include it in the register dump. Since it is not particularly useful
    in debugging, substitute a recognisable dummy value.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • This option appears to have been broken by commit
    8313aca38b3937947fffebca6e34bac8e24300c8 ('sfc: Allocate each channel
    separately, along with its RX and TX queues').

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     

14 May, 2011

1 commit


12 May, 2011

1 commit

  • We enabled write-combining for memory-mapped registers in commit
    65f0b417dee94f779ce9b77102b7d73c93723b39, but inhibited it for the
    MCDI shared memory where this is not supported. However,
    write-combining mappings also allow read-reordering, which may also
    be a problem.

    I found that when an SFC9000-family controller is connected to an
    Intel 3000 chipset, and write-combining is enabled, the controller
    stops responding to PCIe read requests during driver initialisation
    while the driver is polling for completion of an MCDI command. This
    results in an NMI and system hang. Adding read memory barriers
    between all reads to the shared memory area appears to reduce but not
    eliminate the probability of this.

    We have not yet established whether this is a bug in our BIU or in the
    PCIe bridge. For now, work around by mapping the shared memory area
    separately.

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     

30 Apr, 2011

3 commits

  • This updates the network drivers so that they don't access the
    ethtool_cmd::speed field directly, but use ethtool_cmd_speed()
    instead.

    For most of the drivers, these changes are purely cosmetic and don't
    fix any problem, such as for those 1GbE/10GbE drivers that indirectly
    call their own ethtool get_settings()/mii_ethtool_gset(). The changes
    are meant to enforce code consistency and provide robustness with
    future larger throughputs, at the expense of a few CPU cycles for each
    ethtool operation.

    All drivers compiled with make allyesconfig ion x86_64 have been
    updated.

    Tested: make allyesconfig on x86_64 + e1000e/bnx2x work
    Signed-off-by: David Decotigny
    Signed-off-by: David S. Miller

    David Decotigny
     
  • This makes sure the ethtool's set_settings() callback of network
    drivers don't ignore the 16 most significant bits when ethtool calls
    their set_settings().

    All drivers compiled with make allyesconfig on x86_64 have been
    updated.

    Signed-off-by: David Decotigny
    Signed-off-by: David S. Miller

    David Decotigny
     
  • This makes sure that when a driver calls the ethtool's
    get/set_settings() callback of another driver, the data passed to it
    is clean. This guarantees that speed_hi will be zeroed correctly if
    the called callback doesn't explicitely set it: we are sure we don't
    get a corrupted speed from the underlying driver. We also take care of
    setting the cmd field appropriately (ETHTOOL_GSET/SSET).

    This applies to dev_ethtool_get_settings(), which now makes sure it
    sets up that ethtool command parameter correctly before passing it to
    drivers. This also means that whoever calls dev_ethtool_get_settings()
    does not have to clean the ethtool command parameter. This function
    also becomes an exported symbol instead of an inline.

    All drivers visible to make allyesconfig under x86_64 have been
    updated.

    Signed-off-by: David Decotigny
    Signed-off-by: David S. Miller

    David Decotigny
     

19 Apr, 2011

1 commit


15 Apr, 2011

2 commits

  • The phy, mac, and board information structures should be const.
    Since tables contain function pointer this improves security
    (at least theoretically).

    Compile tested only.

    Signed-off-by: Stephen Hemminger
    Acked-by: Ben Hutchings
    Signed-off-by: David S. Miller

    stephen hemminger
     
  • When physical identification of an adapter is done by toggling the
    mechanism on and off through software utilizing the set_phys_id operation,
    it is done with a fixed duration for both on and off states. Some drivers
    may want to set a custom duration for the on/off intervals. This patch
    changes the API so the return code from the driver's entry point when it
    is called with ETHTOOL_ID_ACTIVE can specify the frequency at which to
    cycle the on/off states, and updates the drivers that have already been
    converted to use the new set_phys_id and use the synchronous method for
    identifying an adapter.

    The physical identification frequency set in the updated drivers is based
    on how it was done prior to the introduction of set_phys_id.

    Compile tested only. Also fixes a compiler warning in sfc.

    v2: drivers do not return -EINVAL for ETHOOL_ID_ACTIVE
    v3: fold patchset into single patch and cleanup per Ben's feedback

    Signed-off-by: Bruce Allan
    Cc: Ben Hutchings
    Cc: Sathya Perla
    Cc: Subbu Seetharaman
    Cc: Ajit Khaparde
    Cc: Michael Chan
    Cc: Eilon Greenstein
    Cc: Divy Le Ray
    Cc: Don Fry
    Cc: Jon Mason
    Cc: Solarflare linux maintainers
    Cc: Steve Hodgson
    Cc: Stephen Hemminger
    Cc: Matt Carlson
    Acked-by: Jon Mason
    Acked-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Allan, Bruce W
     

13 Apr, 2011

1 commit

  • Enabling write-combining may also enable read reordering. The BIU is
    only guaranteed to read from a 128-bit CSR or 64-bit SRAM word when
    the host reads from its lowest address; otherwise the BIU may use the
    latched value. Therefore we need to reinstate the read memory
    barriers after the first read operation for each CSR or SRAM word.

    Signed-off-by; Ben Hutchings

    Neil Turton
     

12 Apr, 2011

3 commits

  • During self-tests we use efx_process_channel_now() to handle
    completion and other events synchronously. This disables interrupts
    and NAPI processing for the channel in question, but it may still be
    interrupted by another channel. A single socket may receive packets
    from multiple net devices or even multiple channels of the same net
    device, so this can result in deadlock on a socket lock.

    Receiving packets in process context will also result in incorrect
    classification by the network cgroup classifier.

    Therefore, we must only use efx_process_channel_now() in the offline
    loopback tests (which never deliver packets up the stack) and not for
    the online interrupt and event tests.

    For the interrupt test, there is no reason to process events. We
    only care that an interrupt is raised.

    For the event test, we want to know whether events have been received,
    and there may be many events ahead of the one we inject. Therefore
    remove efx_channel::magic_count and instead test whether
    efx_channel::eventq_read_ptr advances. This is currently an event
    queue index and might wrap around to exactly the same value, resulting
    in a false negative. Therefore move the masking to efx_event() and
    efx_nic_eventq_read_ack() so that it cannot wrap within the time of
    the test.

    The event test also tries to diagnose failures by checking whether an
    event was delivered without causing an interrupt. Add and use a
    helper function that only does this.

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     
  • If the TX queues are running during loopback self tests, host
    traffic gets looped back which causes the test to fail. Avoid
    restarting the TX queues after the port reset so that any packets
    sent by the host get held back until after the tests have completed.

    [bwh: Also wake all TX queues at the end of self-tests.]

    Signed-off-by: Ben Hutchings

    Neil Turton
     
  • Conflicts:
    drivers/net/smsc911x.c

    David S. Miller
     

05 Apr, 2011

3 commits


02 Apr, 2011

1 commit


31 Mar, 2011

1 commit


23 Mar, 2011

1 commit

  • If SR-IOV is enabled by firmware, even if it is not enabled in the PCI
    capability, TX pushes using write-combining may be corrupted.

    We want to know whether it is enabled before mapping the NIC
    registers, and even if PCI extended capabilities are not accessible.
    Therefore, we look for the MSI capability, which is removed if SR-IOV
    is enabled.

    Signed-off-by: Ben Hutchings

    Steve Hodgson