1. 22 Apr, 2020 4 commits
    • David S. Miller's avatar
      Merge branch 'Ocelot-MAC_ETYPE-tc-flower-key-improvements' · a3b6e8fd
      David S. Miller authored
      Vladimir Oltean says:
      
      ====================
      Ocelot MAC_ETYPE tc-flower key improvements
      
      As discussed in the comments surrounding this patch:
      https://patchwork.ozlabs.org/project/netdev/patch/20200417190308.32598-1-olteanv@gmail.com/
      
      the restrictions imposed on non-MAC_ETYPE rules were harsher than they
      needed to be. IP, IPv6, ARP rules can still be added concurrently with
      src_mac and dst_mac rules, as long as those MAC address rules do not ask
      for an offending EtherType.
      
      For that to actually be supported, we need to parse the EtherType from
      the flower classification rule first.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a3b6e8fd
    • Vladimir Oltean's avatar
      net: mscc: ocelot: lift protocol restriction for flow_match_eth_addrs keys · 4faa2e06
      Vladimir Oltean authored
      An attempt was made in commit fe3490e6 ("net: mscc: ocelot: Hardware
      ofload for tc flower filter") to avoid clashes between MAC_ETYPE rules
      and IP rules. Because the protocol blacklist should have included
      ETH_P_ALL too, it created some confusion, but now the situation should
      be dealt with a bit better by the patch immediately previous to this one
      ("net: mscc: ocelot: refine the ocelot_ace_is_problematic_mac_etype
      function").
      
      So now we can remove that check. MAC_ETYPE rules with a protocol of
      ETH_P_IP, ETH_P_IPV6, ETH_P_ARP and ETH_P_ALL _are_ supported, with some
      restrictions regarding per-port exclusivity which are enforced now.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4faa2e06
    • Vladimir Oltean's avatar
      net: mscc: ocelot: refine the ocelot_ace_is_problematic_mac_etype function · 7dec902f
      Vladimir Oltean authored
      The commit mentioned below was a bit too harsh, and while it restricted
      the invalid key combinations which are known to not work, such as:
      
      tc filter add dev swp0 ingress proto ip \
            flower src_ip 192.0.2.1 action drop
      tc filter add dev swp0 ingress proto all \
            flower src_mac 00:11:22:33:44:55 action drop
      
      it also restricted some which still should work, such as:
      
      tc filter add dev swp0 ingress proto ip \
            flower src_ip 192.0.2.1 action drop
      tc filter add dev swp0 ingress proto 0x22f0 \
            flower src_mac 00:11:22:33:44:55 action drop
      
      What actually does not match "sanely" is a MAC_ETYPE rule on frames
      having an EtherType of ARP, IPv4, IPv6, in addition to SNAP and OAM
      frames (which the ocelot tc-flower implementation does not parse yet, so
      the function might need to be revisited again in the future).
      
      So just make the function recognize the problematic MAC_ETYPE rules by
      EtherType - thus the VCAP IS2 can be forced to match even on those
      packets.
      
      This patch makes it possible for IP rules to live on a port together
      with MAC_ETYPE rules that are non-all, non-arp, non-ip and non-ipv6.
      
      Fixes: d4d0cb741d7b ("net: mscc: ocelot: deal with problematic MAC_ETYPE VCAP IS2 rules")
      Reported-by: default avatarAllan W. Nielsen <allan.nielsen@microchip.com>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7dec902f
    • Vladimir Oltean's avatar
      net: mscc: ocelot: support matching on EtherType · 86b956de
      Vladimir Oltean authored
      Currently, the filter's protocol is ignored except for a few special
      cases (IPv4 and IPv6).
      
      The EtherType can be matched inside VCAP IS2 by using a MAC_ETYPE key.
      So there are 2 cases in which EtherType matches are supported:
      
        - As part of a larger MAC_ETYPE rule, such as:
      
          tc filter add dev swp0 ingress protocol ip \
                  flower skip_sw src_mac 42:be:24:9b:76:20 action drop
      
        - Standalone (matching on protocol only):
      
          tc filter add dev swp0 ingress protocol arp \
                  flower skip_sw action drop
      
      As before, if the protocol is not specified, is it implicitly "all" and
      the EtherType mask in the MAC_ETYPE half key is set to zero.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      86b956de
  2. 21 Apr, 2020 13 commits
  3. 20 Apr, 2020 23 commits