25 Jan, 2017

1 commit

  • We may be able to see invalid Broadcom tags when the hardware and drivers are
    misconfigured, or just while exercising the error path. Instead of flooding
    the console with messages, flat out drop the packet.

    Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Florian Fainelli
     

19 Jan, 2017

1 commit

  • Now that the DSA Ethernet switches are true Linux devices, the CPU
    switch is not necessarily the first one. If its address is higher than
    the second switch on the same MDIO bus, its index will be 1, not 0.

    Avoid any confusion by using dst->cpu_switch instead of dst->ds[0].

    Signed-off-by: Vivien Didelot
    Reviewed-by: Andrew Lunn
    Reviewed-by: Florian Fainelli
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Vivien Didelot
     

05 Jun, 2016

1 commit


01 Aug, 2015

1 commit

  • All tagging protocols do the same thing: increment device statistics,
    make room for the tag to be inserted, create the tag, invoke the parent
    network device transmit function.

    In order to prepare for adding netpoll support, which requires the tag
    creation, but not using the parent network device transmit function, do
    some little refactoring which eliminates duplication between the 4
    tagging protocols supported.

    We need to return a sk_buff pointer back to the caller because the tag
    specific transmit function may have to reallocate the original skb (e.g:
    tag_trailer.c) and this is the one we should be transmitting, not the
    original sk_buff we were passed.

    Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Florian Fainelli
     

16 Sep, 2014

1 commit

  • This change addresses several issues.

    First, it was possible to set tag_protocol without setting the ops pointer.
    To correct that I have reordered things so that rcv is now populated before
    we set tag_protocol.

    Second, it didn't make much sense to keep setting the device ops each time a
    new slave was registered. So by moving the receive portion out into root
    switch initialization that issue should be addressed.

    Third, I wanted to avoid sending tags if the rcv pointer was not registered
    so I changed the tag check to verify if the rcv function pointer is set on
    the root tree. If it is then we start sending DSA tagged frames.

    Finally I split the device ops pointer in the structures into two spots. I
    placed the rcv function pointer in the root switch since this makes it
    easiest to access from there, and I placed the xmit function pointer in the
    slave for the same reason.

    Signed-off-by: Alexander Duyck
    Signed-off-by: David S. Miller

    Alexander Duyck
     

14 Sep, 2014

1 commit

  • Now that we introduced an additional multiplexing/demultiplexing layer
    with commit 3e8a72d1dae37 ("net: dsa: reduce number of protocol hooks")
    that lives within the DSA code, we no longer need to have a given switch
    driver tag_protocol be an actual ethertype value, instead, we can
    replace it with an enum: dsa_tag_protocol.

    Do this replacement in the drivers, which allows us to get rid of the
    cpu_to_be16()/htons() dance, and remove ETH_P_BRCMTAG since we do not
    need it anymore.

    Suggested-by: Alexander Duyck
    Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Florian Fainelli
     

28 Aug, 2014

1 commit

  • Add support for the 4-bytes Broadcom tag that built-in switches such as
    the Starfighter 2 might insert when receiving packets, or that we need
    to insert while targetting specific switch ports. We use a fake local
    EtherType value for this 4-bytes switch tag: ETH_P_BRCMTAG to make sure
    we can assign DSA-specific network operations within the DSA drivers.

    Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Florian Fainelli