]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: initialize the routing table
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Thu, 7 Jul 2016 00:03:54 +0000 (20:03 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Jul 2016 03:59:49 +0000 (23:59 -0400)
commit2261792ed5a3e2ad4ee16f6d558413f5cd5f7ded
treebd365573098b83c1addb653306cb0a49db7dab00
parente641053d8f971c1a993fa44483615c21d4d86470
net: dsa: initialize the routing table

The routing table of every switch in a tree is currently initialized to
all zeros. This is an issue since 0 is a valid port number.

Add a DSA_RTABLE_NONE=-1 constant to initialize the signed values of the
routing table pointing to other switches.

This fixes the device mapping of the mv88e6xxx driver where the port
pointing to the switch itself and to non-existent switches was wrongly
configured to be 0. It is now set to the expected 0xf value.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dsa.h
net/dsa/dsa.c
net/dsa/dsa2.c