1. 07 9月, 2022 2 次提交
  2. 01 9月, 2022 1 次提交
  3. 25 8月, 2022 1 次提交
  4. 16 8月, 2022 2 次提交
  5. 29 7月, 2022 2 次提交
    • J
      i40e: convert .adjfreq to .adjfine · ccd3bf98
      Jacob Keller 提交于
      The i40e driver currently implements the .adjfreq handler for frequency
      adjustments. This takes the adjustment parameter in parts per billion. The
      PTP core supports .adjfine which provides an adjustment in scaled parts per
      million. This has a higher resolution and can result in more precise
      adjustments for small corrections.
      
      Convert the existing .adjfreq implementation to the newer .adjfine
      implementation. This is trivial since it just requires changing the divisor
      from 1000000000ULL to (1000000ULL << 16) in the mul_u64_u64_div_u64 call.
      
      This improves the precision of the adjustments and gets us one driver
      closer to removing the old .adjfreq support from the kernel.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      ccd3bf98
    • J
      i40e: use mul_u64_u64_div_u64 for PTP frequency calculation · 3626a690
      Jacob Keller 提交于
      The i40e device has a different clock rate depending on the current link
      speed. This requires using a different increment rate for the PTP clock
      registers. For slower link speeds, the base increment value is larger.
      Directly multiplying the larger increment value by the parts per billion
      adjustment might overflow.
      
      To avoid this, the i40e implementation defaults to using the lower
      increment value and then multiplying the adjustment afterwards. This causes
      a loss of precision for lower link speeds.
      
      We can fix this by using mul_u64_u64_div_u64 instead of performing the
      multiplications using standard C operations. On X86, this will use special
      instructions that perform the multiplication and division with 128bit
      intermediate values. For other architectures, the fallback implementation
      will limit the loss of precision for large values. Small adjustments don't
      overflow anyways and won't lose precision at all.
      
      This allows first multiplying the base increment value and then performing
      the adjustment calculation, since we no longer fear overflowing. It also
      makes it easier to convert to the even more precise .adjfine implementation
      in a following change.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      3626a690
  6. 26 7月, 2022 1 次提交
  7. 23 7月, 2022 1 次提交
  8. 19 7月, 2022 1 次提交
  9. 01 7月, 2022 4 次提交
  10. 25 6月, 2022 1 次提交
  11. 22 6月, 2022 3 次提交
  12. 15 6月, 2022 1 次提交
  13. 09 6月, 2022 3 次提交
  14. 08 6月, 2022 1 次提交
    • M
      i40e: Add VF VLAN pruning · c87c938f
      Mateusz Palczewski 提交于
      VFs by default are able to see all tagged traffic regardless of trust
      and VLAN filters configured.
      
      Add new private flag vf-vlan-pruning that allows changing of default
      VF behavior for tagged traffic. When the flag is turned on
      untrusted VF will only be able to receive untagged traffic
      or traffic with VLAN tags it has created interfaces for
      
      The flag is off by default and can only be changed if
      there are no VFs spawned on the PF. This flag will only be effective
      when no PVID is set on VF and VF is not trusted.
      Add new function that computes the correct VLAN ID for VF VLAN filters
      based on trust, PVID, vf-vlan-prune-disable flag and current VLAN ID.
      
      Testing Hints:
      
      Test 1: vf-vlan-pruning == off
      ==============================
      1. Set the private flag
      > ethtool --set-priv-flag eth0 vf-vlan-pruning off (default setting)
      2. Use scapy to send any VLAN tagged traffic and make sure the VF
      receives all VLAN tagged traffic that matches its destination MAC
      filters (unicast, multicast, and broadcast).
      
      Test 2: vf-vlan-pruning == on
      ==============================
      1. Set the private flag
      > ethtool --set-priv-flag eth0 vf-vlan-pruning on
      2. Use scapy to send any VLAN tagged traffic and make sure the VF does
      not receive any VLAN tagged traffic that matches its destination MAC
      filters (unicast, multicast, and broadcast).
      3. Add a VLAN filter on the VF netdev
      > ip link add link eth0v0 name vlan10 type vlan id 10
      4. Bring the VLAN netdev up
      > ip link set vlan10 up
      4. Use scapy to send traffic with VLAN 10, VLAN 11 (anything not VLAN
      10), and untagged traffic. Make sure the VF only receives VLAN 10
      and untagged traffic when the link partner is sending.
      
      Test 3: vf-vlan-pruning == off && VF is in a port VLAN
      ==============================
      1. Set the private flag
      > ethtool --set-priv-flag eth0 vf-vlan-pruning off (default setting)
      2. Create a VF
      > echo 1 > sriov_numvfs
      3. Put the VF in a port VLAN
      > ip link set eth0 vf 0 vlan 10
      4. Use scapy to send traffic with VLAN 10 and VLAN 11 (anything not VLAN
      10) and make sure the VF only receives untagged traffic when the link
      partner is sending VLAN 10 tagged traffic as the VLAN tag is expected
      to be stripped by HW for port VLANs and not visible to the VF.
      
      Test 4: Change vf-vlan-pruning while VFs are created
      ==============================
      echo 0 > sriov_numvfs
      ethtool --set-priv-flag eth0 vf-vlan-pruning off
      echo 1 > sriov_numvfs
      ethtool --set-priv-flag eth0 vf-vlan-pruning on (expect failure)
      Signed-off-by: NSylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
      Signed-off-by: NPrzemyslaw Patynowski <przemyslawx.patynowski@intel.com>
      Signed-off-by: NMateusz Palczewski <mateusz.palczewski@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      c87c938f
  15. 12 5月, 2022 1 次提交
  16. 21 4月, 2022 1 次提交
    • M
      i40e, xsk: Get rid of redundant 'fallthrough' · 9d87e41a
      Maciej Fijalkowski 提交于
      Intel drivers translate actions returned from XDP programs to their own
      return codes that have the following mapping:
      
      XDP_REDIRECT -> I40E_XDP_{REDIR,CONSUMED}
      XDP_TX -> I40E_XDP_{TX,CONSUMED}
      XDP_DROP -> I40E_XDP_CONSUMED
      XDP_ABORTED -> I40E_XDP_CONSUMED
      XDP_PASS -> I40E_XDP_PASS
      
      Commit b8aef650 ("i40e, xsk: Terminate Rx side of NAPI when XSK Rx
      queue gets full") introduced new translation
      
      XDP_REDIRECT -> I40E_XDP_EXIT
      
      which is set when XSK RQ gets full and to indicate that driver should
      stop further Rx processing. This happens for unsuccessful
      xdp_do_redirect() so it is valuable to call trace_xdp_exception() for
      this case. In order to avoid I40E_XDP_EXIT -> IXGBE_XDP_CONSUMED
      overwrite, XDP_DROP case was moved above which in turn made the
      'fallthrough' that is in XDP_ABORTED useless as it became the last label
      in the switch statement.
      
      Simply drop this leftover.
      
      Fixes: b8aef650 ("i40e, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full")
      Signed-off-by: NMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20220421132126.471515-3-maciej.fijalkowski@intel.com
      9d87e41a
  17. 16 4月, 2022 2 次提交
  18. 13 4月, 2022 4 次提交
  19. 17 3月, 2022 1 次提交
  20. 09 3月, 2022 1 次提交
    • J
      i40e: stop disabling VFs due to PF error responses · 5710ab79
      Jacob Keller 提交于
      The i40e_vc_send_msg_to_vf_ex (and its wrapper i40e_vc_send_msg_to_vf)
      function has logic to detect "failure" responses sent to the VF. If a VF
      is sent more than I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED, then the VF is
      marked as disabled. In either case, a dev_info message is printed
      stating that a VF opcode failed.
      
      This logic originates from the early implementation of VF support in
      commit 5c3c48ac ("i40e: implement virtual device interface").
      
      That commit did not go far enough. The "logic" for this behavior seems
      to be that error responses somehow indicate a malicious VF. This is not
      really true. The PF might be sending an error for any number of reasons
      such as lacking resources, an unsupported operation, etc. This does not
      indicate a malicious VF. We already have a separate robust malicious VF
      detection which relies on hardware logic to detect and prevent a variety
      of behaviors.
      
      There is no justification for this behavior in the original
      implementation. In fact, a later commit 18b7af57 ("i40e: Lower some
      message levels") reduced the opcode failure message from a dev_err to a
      dev_info. In addition, recent commit 01cbf508 ("i40e: Fix to not
      show opcode msg on unsuccessful VF MAC change") changed the logic to
      allow quieting it for expected failures.
      
      That commit prevented this logic from kicking in for specific
      circumstances. This change did not go far enough. The behavior is not
      documented nor is it part of any requirement for our products. Other
      operating systems such as the FreeBSD implementation of our driver do
      not include this logic.
      
      It is clear this check does not make sense, and causes problems which
      led to ugly workarounds.
      
      Fix this by just removing the entire logic and the need for the
      i40e_vc_send_msg_to_vf_ex function.
      
      Fixes: 01cbf508 ("i40e: Fix to not show opcode msg on unsuccessful VF MAC change")
      Fixes: 5c3c48ac ("i40e: implement virtual device interface")
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      5710ab79
  21. 25 2月, 2022 1 次提交
  22. 19 2月, 2022 1 次提交
  23. 09 2月, 2022 4 次提交