08 Aug, 2017

4 commits


18 Jun, 2017

1 commit

  • After commit 6d3c8c0dd88a ("net: dsa: Remove master_netdev and
    use dst->cpu_dp->netdev") and a29342e73911 ("net: dsa: Associate
    slave network device with CPU port") we would be seeing NULL pointer
    dereferences when accessing dst->cpu_dp->netdev too early. In the legacy
    code, we actually know early in advance the master network device, so
    pass it down to the relevant functions.

    Fixes: 6d3c8c0dd88a ("net: dsa: Remove master_netdev and use dst->cpu_dp->netdev")
    Fixes: a29342e73911 ("net: dsa: Associate slave network device with CPU port")
    Reported-by: Jason Cobham
    Tested-by: Jason Cobham
    Signed-off-by: Florian Fainelli
    Reviewed-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Florian Fainelli
     

14 Jun, 2017

2 commits

  • In preparation for supporting multiple CPU ports with DSA, have the
    dsa_port structure know which CPU it is associated with. This will be
    important in order to make sure the correct CPU is used for transmission
    of the frames. If not for functional reasons, for performance (e.g: load
    balancing) and forwarding decisions.

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

    Florian Fainelli
     
  • In preparation for supporting multiple CPU ports, remove
    dst->master_netdev and ds->master_netdev and replace them with only one
    instance of the common object we have for a port: struct
    dsa_port::netdev. ds->master_netdev is currently write only and would be
    helpful in the case where we have two switches, both with CPU ports, and
    also connected within each other, which the multi-CPU port patch series
    would address.

    While at it, introduce a helper function used in net/dsa/slave.c to
    immediately get a reference on the master network device called
    dsa_master_netdev().

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

    Florian Fainelli
     

07 Jun, 2017

1 commit


05 Jun, 2017

1 commit


02 Jun, 2017

2 commits

  • dsa_switch_suspend() and dsa_switch_resume() are functions that belong in
    net/dsa/dsa.c and are not part of the legacy platform support code.

    Fixes: a6a71f19fe5e ("net: dsa: isolate legacy code")
    Signed-off-by: Florian Fainelli
    Reviewed-by: Andrew Lunn
    Signed-off-by: David S. Miller

    Florian Fainelli
     
  • dsa_ptr is not a void pointer anymore since Nov 2011, as of cf50dcc24f82
    ("dsa: Change dsa_uses_{dsa, trailer}_tags() into inline functions"),
    but an explicit dsa_switch_tree pointer, thus remove the (void *) cast.

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

    Vivien Didelot
     

18 May, 2017

2 commits

  • The public include/net/dsa.h file is meant for DSA drivers, while all
    DSA core files share a common private header net/dsa/dsa_priv.h file.

    Ensure that dsa_priv.h is the only DSA core file to include net/dsa.h,
    and add a new line to separate absolute and relative headers at the same
    time.

    Signed-off-by: Vivien Didelot
    Signed-off-by: David S. Miller

    Vivien Didelot
     
  • A dsa_switch_tree instance holds a dsa_switch pointer and a port index
    to identify the switch port to which the CPU is attached.

    Now that the DSA layer has a dsa_port structure to hold this data, use
    it to point the switch CPU port.

    This patch simply substitutes s/dst->cpu_switch/dst->cpu_dp->ds/ and
    s/dst->cpu_port/dst->cpu_dp->index/.

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

    Vivien Didelot
     

17 Apr, 2017

1 commit