17 Dec, 2009

1 commit


12 Dec, 2009

2 commits


24 Nov, 2009

3 commits


18 Sep, 2009

1 commit

  • If we reach the test just below the loop with a `timeout' value of 0,
    this does not mean that the timeout caused the loop to end, but rather
    the `smi_rd.s.pending', in the last iteration. If timeout caused the
    loop to end, then `timeout' is -1, not 0.

    Since this can occur only in the last iteration, it is not very likely
    to be a problem. By changing the post- to prefix decrement we ensure
    that a timeout of 0 does mean it timed out.

    Signed-off-by: Roel Kluin
    Acked-by: David Daney
    Signed-off-by: Ralf Baechle

    Roel Kluin
     

02 Sep, 2009

1 commit


25 Jun, 2009

2 commits

  • The existing code had the following race:

    Thread-1 Thread-2

    inc/read in_use
    inc/read in_use
    inc tx_free_list[qos].len
    inc tx_free_list[qos].len

    The actual in_use value was incremented twice, but thread-1 is going
    to free memory based on its stale value, and will free one too many
    times. The result is that memory is freed back to the kernel while
    its packet is still in the transmit buffer. If the memory is
    overwritten before it is transmitted, the hardware will put a valid
    checksum on it and send it out (just like it does with good packets).
    If by chance the TCP flags are clobbered but not the addresses or
    ports, the result can be a broken TCP stream.

    The fix is to track the number of freed packets in a single location
    (a Fetch-and-Add Unit register). That way it can never get out of sync
    with itself.

    We try to free up to MAX_SKB_TO_FREE (currently 10) buffers at a time.
    If fewer are available we adjust the free count with the difference.
    The action of claiming buffers to free is atomic so two threads cannot
    claim the same buffers.

    Signed-off-by: David Daney
    Signed-off-by: Ralf Baechle

    David Daney
     
  • Convert the driver to use net_device_ops as it is now mandatory.

    Also compensate for the removal of struct sk_buff's dst field.

    The changes are mostly mechanical, the content of ethernet-common.c
    was moved to ethernet.c and ethernet-common.{c,h} are removed.

    Signed-off-by: David Daney
    Signed-off-by: Ralf Baechle

    David Daney
     

17 Jun, 2009

1 commit

  • The octeon-ethernet driver supports the sgmii, rgmii, spi, and xaui
    ports present on the Cavium OCTEON family of SOCs. These SOCs are
    multi-core mips64 processors with existing support over in arch/mips.

    The driver files can be categorized into three basic groups:

    1) Register definitions, these are named cvmx-*-defs.h

    2) Main driver code, these have names that don't start cvmx-.

    3) Interface specific functions and other utility code, names starting
    with cvmx-

    Signed-off-by: David Daney
    Signed-off-by: Ralf Baechle

    David Daney