1. 15 10月, 2020 1 次提交
    • H
      cxgb4: handle 4-tuple PEDIT to NAT mode translation · 2ef813b8
      Herat Ramani 提交于
      The 4-tuple NAT offload via PEDIT always overwrites all the 4-tuple
      fields even if they had not been explicitly enabled. If any fields in
      the 4-tuple are not enabled, then the hardware overwrites the
      disabled fields with zeros, instead of ignoring them.
      
      So, add a parser that can translate the enabled 4-tuple PEDIT fields
      to one of the NAT mode combinations supported by the hardware and
      hence avoid overwriting disabled fields to 0. Any rule with
      unsupported NAT mode combination is rejected.
      Signed-off-by: NHerat Ramani <herat@chelsio.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      2ef813b8
  2. 04 8月, 2020 1 次提交
    • R
      cxgb4: fix extracting IP addresses in TC-FLOWER rules · 29b3705f
      Rahul Lakkireddy 提交于
      commit c8729cac ("cxgb4: add ethtool n-tuple filter insertion")
      has removed checking control key for determining IP address types
      for TC-FLOWER rules, which causes all the rules being inserted to
      hardware to become IPv6 rule type always. So, add back the check
      to select the correct IP address type to extract and hence fix the
      correct rule type being inserted to hardware.
      
      Also, ethtool_rx_flow_key doesn't have any control key and instead
      directly sets the IPv4/IPv6 address keys. So, explicitly set the
      IP address type for ethtool n-tuple filters to reuse the same code.
      
      Fixes: c8729cac ("cxgb4: add ethtool n-tuple filter insertion")
      Signed-off-by: NRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29b3705f
  3. 01 7月, 2020 1 次提交
  4. 24 6月, 2020 1 次提交
    • R
      cxgb4: fix endian conversions for L4 ports in filters · 63b53b0b
      Rahul Lakkireddy 提交于
      The source and destination L4 ports in filter offload need to be
      in CPU endian. They will finally be converted to Big Endian after
      all operations are done and before giving them to hardware. The
      L4 ports for NAT are expected to be passed as a byte stream TCB.
      So, treat them as such.
      
      Fixes following sparse warnings in several places:
      cxgb4_tc_flower.c:159:33: warning: cast from restricted __be16
      cxgb4_tc_flower.c:159:33: warning: incorrect type in argument 1 (different
      base types)
      cxgb4_tc_flower.c:159:33:    expected unsigned short [usertype] val
      cxgb4_tc_flower.c:159:33:    got restricted __be16 [usertype] dst
      
      Fixes: dca4faeb ("cxgb4: Add LE hash collision bug fix path in LLD driver")
      Fixes: 62488e4b ("cxgb4: add basic tc flower offload support")
      Fixes: 557ccbf9 ("cxgb4: add tc flower support for L3/L4 rewrite")
      Signed-off-by: NRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      63b53b0b
  5. 20 6月, 2020 4 次提交
  6. 31 3月, 2020 1 次提交
    • J
      net: sched: expose HW stats types per action used by drivers · 93a129eb
      Jiri Pirko 提交于
      It may be up to the driver (in case ANY HW stats is passed) to select
      which type of HW stats he is going to use. Add an infrastructure to
      expose this information to user.
      
      $ tc filter add dev enp3s0np1 ingress proto ip handle 1 pref 1 flower dst_ip 192.168.1.1 action drop
      $ tc -s filter show dev enp3s0np1 ingress
      filter protocol ip pref 1 flower chain 0
      filter protocol ip pref 1 flower chain 0 handle 0x1
        eth_type ipv4
        dst_ip 192.168.1.1
        in_hw in_hw_count 2
              action order 1: gact action drop
               random type none pass val 0
               index 1 ref 1 bind 1 installed 10 sec used 10 sec
              Action statistics:
              Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
              backlog 0b 0p requeues 0
              used_hw_stats immediate     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93a129eb
  7. 19 3月, 2020 1 次提交
    • R
      cxgb4: rework TC filter rule insertion across regions · 8d174351
      Rahul Lakkireddy 提交于
      Chelsio NICs have 3 filter regions, in following order of priority:
      1. High Priority (HPFILTER) region (Highest Priority).
      2. HASH region.
      3. Normal FILTER region (Lowest Priority).
      
      Currently, there's a 1-to-1 mapping between the prio value passed
      by TC and the filter region index. However, it's possible to have
      multiple TC rules with the same prio value. In this case, if a region
      is exhausted, no attempt is made to try inserting the rule in the
      next available region.
      
      So, rework and remove the 1-to-1 mapping. Instead, dynamically select
      the region to insert the filter rule, as long as the new rule's prio
      value doesn't conflict with existing rules across all the 3 regions.
      Signed-off-by: NRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d174351
  8. 18 3月, 2020 1 次提交
  9. 09 3月, 2020 1 次提交
  10. 18 12月, 2019 1 次提交
  11. 11 12月, 2019 1 次提交
  12. 21 11月, 2019 2 次提交
    • R
      cxgb4: add TC-MATCHALL classifier ingress offload · 21c4c60b
      Rahul Lakkireddy 提交于
      Add TC-MATCHALL classifier ingress offload support. The same actions
      supported by existing TC-FLOWER offload can be applied to all incoming
      traffic on the underlying interface.
      
      Ensure the rule priority doesn't conflict with existing rules in the
      TCAM. Only 1 ingress matchall rule can be active at a time on the
      underlying interface.
      
      v5:
      - No change.
      
      v4:
      - Added check to ensure the matchall rule's prio doesn't conflict with
        other rules in TCAM.
      - Added logic to fill default mask for VIID, if none has been
        provided, to prevent conflict with duplicate VIID rules.
      - Used existing variables in private structure to fill VIID info,
        instead of extracting the info manually.
      
      v3:
      - No change.
      
      v2:
      - Removed logic to fetch free index from end of TCAM. Must maintain
        same ordering as in kernel.
      Signed-off-by: NRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      21c4c60b
    • R
      cxgb4: check rule prio conflicts before offload · 41ec03e5
      Rahul Lakkireddy 提交于
      Only offload rule if it satisfies both of the following conditions:
      1. The immediate previous rule has priority <= current rule's priority.
      2. The immediate next rule has priority >= current rule's priority.
      
      Also rework free entry fetch logic to search from end of TCAM, instead
      of beginning, because higher indices have lower priority than lower
      indices. This is similar to how TC auto generates priority values.
      
      v5:
      - Fixed commit message and comment to include comparison for equal
        priority.
      
      v4:
      - Patch added in this version.
      Signed-off-by: NRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41ec03e5
  13. 22 7月, 2019 1 次提交
  14. 10 7月, 2019 1 次提交
  15. 24 5月, 2019 1 次提交
  16. 09 4月, 2019 1 次提交
  17. 07 2月, 2019 3 次提交
  18. 22 8月, 2018 1 次提交
  19. 28 6月, 2018 1 次提交
  20. 15 5月, 2018 1 次提交
  21. 25 1月, 2018 1 次提交
  22. 23 1月, 2018 2 次提交
  23. 11 12月, 2017 1 次提交
    • T
      rhashtable: Change rhashtable_walk_start to return void · 97a6ec4a
      Tom Herbert 提交于
      Most callers of rhashtable_walk_start don't care about a resize event
      which is indicated by a return value of -EAGAIN. So calls to
      rhashtable_walk_start are wrapped wih code to ignore -EAGAIN. Something
      like this is common:
      
             ret = rhashtable_walk_start(rhiter);
             if (ret && ret != -EAGAIN)
                     goto out;
      
      Since zero and -EAGAIN are the only possible return values from the
      function this check is pointless. The condition never evaluates to true.
      
      This patch changes rhashtable_walk_start to return void. This simplifies
      code for the callers that ignore -EAGAIN. For the few cases where the
      caller cares about the resize event, particularly where the table can be
      walked in mulitple parts for netlink or seq file dump, the function
      rhashtable_walk_start_check has been added that returns -EAGAIN on a
      resize event.
      Signed-off-by: NTom Herbert <tom@quantonium.net>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      97a6ec4a
  24. 07 12月, 2017 1 次提交
  25. 01 11月, 2017 4 次提交
  26. 28 10月, 2017 1 次提交
  27. 20 10月, 2017 4 次提交