net: dsa: bcm_sf2: Allow targeting CPU ports for CFP rules
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 3 Aug 2018 18:08:41 +0000 (11:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Aug 2018 19:11:43 +0000 (12:11 -0700)
ds->enabled_port_mask only contains a bitmask of user-facing enabled
ports, we also need to allow programming CFP rules that target CPU ports
(e.g: ports 5 and 8).

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2_cfp.c

index b89acaee12d4364247a694ad989d2ae06ca640aa..1e37b65aab931a39d97cffbcfa49f541d748d260 100644 (file)
@@ -755,7 +755,8 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port,
        port_num = fs->ring_cookie / SF2_NUM_EGRESS_QUEUES;
 
        if (fs->ring_cookie == RX_CLS_FLOW_DISC ||
-           !dsa_is_user_port(ds, port_num) ||
+           !(dsa_is_user_port(ds, port_num) ||
+             dsa_is_cpu_port(ds, port_num)) ||
            port_num >= priv->hw_params.num_ports)
                return -EINVAL;
        /*