net: dsa: bcm_sf2: Check earlier for FLOW_EXT and FLOW_MAC_EXT
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 30 Mar 2020 21:38:51 +0000 (14:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Mar 2020 02:55:42 +0000 (19:55 -0700)
We do not currently support matching on FLOW_EXT or FLOW_MAC_EXT, but we
were not checking for those bits being set in the flow specification.

The check for FLOW_EXT and FLOW_MAC_EXT are separated out because a
subsequent commit will add support for matching VLAN TCI which are
covered by FLOW_EXT.

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

index f9785027c096cae22357432a93158609c730d570..40ea88c304de3c75d17b9ea8e01127c5fe14682d 100644 (file)
@@ -878,8 +878,9 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port,
        int ret = -EINVAL;
 
        /* Check for unsupported extensions */
-       if ((fs->flow_type & FLOW_EXT) && (fs->m_ext.vlan_etype ||
-            fs->m_ext.data[1]))
+       if ((fs->flow_type & FLOW_EXT) ||
+           (fs->flow_type & FLOW_MAC_EXT) ||
+           fs->m_ext.data[1])
                return -EINVAL;
 
        if (fs->location != RX_CLS_LOC_ANY &&