1. 03 10月, 2020 5 次提交
    • X
      net: mscc: ocelot: offload egress VLAN rewriting to VCAP ES0 · 2f17c050
      Xiaoliang Yang 提交于
      VCAP ES0 is an egress VCAP operating on all outgoing frames.
      This patch added ES0 driver to support vlan push action of tc filter.
      Usage:
      
      tc filter add dev swp1 egress protocol 802.1Q flower indev swp0 skip_sw \
              vlan_id 1 vlan_prio 1 action vlan push id 2 priority 2
      Signed-off-by: NXiaoliang Yang <xiaoliang.yang_1@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f17c050
    • X
      net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1 · 75944fda
      Xiaoliang Yang 提交于
      VCAP IS1 is a VCAP module which can filter on the most common L2/L3/L4
      Ethernet keys, and modify the results of the basic QoS classification
      and VLAN classification based on those flow keys.
      
      There are 3 VCAP IS1 lookups, mapped over chains 10000, 11000 and 12000.
      Currently the driver is hardcoded to use IS1_ACTION_TYPE_NORMAL half
      keys.
      
      Note that the VLAN_MANGLE has been omitted for now. In hardware, the
      VCAP_IS1_ACT_VID_REPLACE_ENA field replaces the classified VLAN
      (metadata associated with the frame) and not the VLAN from the header
      itself. There are currently some issues which need to be addressed when
      operating in standalone, or in bridge with vlan_filtering=0 modes,
      because in those cases the switch ports have VLAN awareness disabled,
      and changing the classified VLAN to anything other than the pvid causes
      the packets to be dropped. Another issue is that on egress, we expect
      port tagging to push the classified VLAN, but port tagging is disabled
      in the modes mentioned above, so although the classified VLAN is
      replaced, it is not visible in the packet transmitted by the switch.
      Signed-off-by: NXiaoliang Yang <xiaoliang.yang_1@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      75944fda
    • V
      net: mscc: ocelot: create TCAM skeleton from tc filter chains · 1397a2eb
      Vladimir Oltean 提交于
      For Ocelot switches, there are 2 ingress pipelines for flow offload
      rules: VCAP IS1 (Ingress Classification) and IS2 (Security Enforcement).
      IS1 and IS2 support different sets of actions. The pipeline order for a
      packet on ingress is:
      
      Basic classification -> VCAP IS1 -> VCAP IS2
      
      Furthermore, IS1 is looked up 3 times, and IS2 is looked up twice (each
      TCAM entry can be configured to match only on the first lookup, or only
      on the second, or on both etc).
      
      Because the TCAMs are completely independent in hardware, and because of
      the fixed pipeline, we actually have very limited options when it comes
      to offloading complex rules to them while still maintaining the same
      semantics with the software data path.
      
      This patch maps flow offload rules to ingress TCAMs according to a
      predefined chain index number. There is going to be a script in
      selftests that clarifies the usage model.
      
      There is also an egress TCAM (VCAP ES0, the Egress Rewriter), which is
      modeled on top of the default chain 0 of the egress qdisc, because it
      doesn't have multiple lookups.
      Suggested-by: NAllan W. Nielsen <allan.nielsen@microchip.com>
      Co-developed-by: NXiaoliang Yang <xiaoliang.yang_1@nxp.com>
      Signed-off-by: NXiaoliang Yang <xiaoliang.yang_1@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1397a2eb
    • V
      net: mscc: ocelot: introduce conversion helpers between port and netdev · 319e4dd1
      Vladimir Oltean 提交于
      Since the mscc_ocelot_switch_lib is common between a pure switchdev and
      a DSA driver, the procedure of retrieving a net_device for a certain
      port index differs, as those are registered by their individual
      front-ends.
      
      Up to now that has been dealt with by always passing the port index to
      the switch library, but now, we're going to need to work with net_device
      pointers from the tc-flower offload, for things like indev, or mirred.
      It is not desirable to refactor that, so let's make sure that the flower
      offload core has the ability to translate between a net_device and a
      port index properly.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      319e4dd1
    • V
      net: mscc: ocelot: offload multiple tc-flower actions in same rule · ea9d1f30
      Vladimir Oltean 提交于
      At this stage, the tc-flower offload of mscc_ocelot can only delegate
      rules to the VCAP IS2 security enforcement block. These rules have, in
      hardware, separate bits for policing and for overriding the destination
      port mask and/or copying to the CPU. So it makes sense that we attempt
      to expose some more of that low-level complexity instead of simply
      choosing between a single type of action.
      
      Something similar happens with the VCAP IS1 block, where the same action
      can contain enable bits for VLAN classification and for QoS
      classification at the same time.
      
      So model the action structure after the hardware description, and let
      the high-level ocelot_flower.c construct an action vector from multiple
      tc actions.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ea9d1f30
  2. 02 10月, 2020 3 次提交
  3. 01 10月, 2020 18 次提交
  4. 30 9月, 2020 14 次提交