Commit 86bfb2c1 authored by Vivien Didelot's avatar Vivien Didelot Committed by Jakub Kicinski

net: dsa: use ports list for routing table setup

Use the new ports list instead of accessing the dsa_switch array
of ports when iterating over DSA ports of a switch to set up the
routing table.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
parent fb35c60c
...@@ -157,6 +157,7 @@ static bool dsa_port_setup_routing_table(struct dsa_port *dp) ...@@ -157,6 +157,7 @@ static bool dsa_port_setup_routing_table(struct dsa_port *dp)
static bool dsa_switch_setup_routing_table(struct dsa_switch *ds) static bool dsa_switch_setup_routing_table(struct dsa_switch *ds)
{ {
struct dsa_switch_tree *dst = ds->dst;
bool complete = true; bool complete = true;
struct dsa_port *dp; struct dsa_port *dp;
int i; int i;
...@@ -164,10 +165,8 @@ static bool dsa_switch_setup_routing_table(struct dsa_switch *ds) ...@@ -164,10 +165,8 @@ static bool dsa_switch_setup_routing_table(struct dsa_switch *ds)
for (i = 0; i < DSA_MAX_SWITCHES; i++) for (i = 0; i < DSA_MAX_SWITCHES; i++)
ds->rtable[i] = DSA_RTABLE_NONE; ds->rtable[i] = DSA_RTABLE_NONE;
for (i = 0; i < ds->num_ports; i++) { list_for_each_entry(dp, &dst->ports, list) {
dp = &ds->ports[i]; if (dp->ds == ds && dsa_port_is_dsa(dp)) {
if (dsa_port_is_dsa(dp)) {
complete = dsa_port_setup_routing_table(dp); complete = dsa_port_setup_routing_table(dp);
if (!complete) if (!complete)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment