]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: return per-port upstream port
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Tue, 5 Dec 2017 20:34:13 +0000 (15:34 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Dec 2017 23:01:34 +0000 (18:01 -0500)
commit3f202cf0f3c28c07da6131fe533001fca030e475
treead4d590c6c4bb4e58712ddb02e84d81426b48b02
parent0ef95f1c30afb8790e03721d84e8367ff1e7dce3
net: dsa: return per-port upstream port

The current dsa_upstream_port() helper still assumes a unique CPU port
in the whole switch fabric. This is becoming wrong, as every port in the
fabric has its dedicated CPU port, thus every port has an upstream port.

Add a port argument to the dsa_upstream_port() helper and fetch its CPU
port instead of the deprecated unique fabric CPU port. A CPU or unused
port has no dedicated CPU port, so return itself in this case.

At the same time, change the return value from u8 to unsigned int since
there is no need to limit the size here.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c
include/net/dsa.h