1. 01 5月, 2018 2 次提交
    • J
      i40e: avoid overflow in i40e_ptp_adjfreq() · 830e0dd9
      Jacob Keller 提交于
      When operating at 1GbE, the base incval for the PTP clock is so large
      that multiplying it by numbers close to the max_adj can overflow the
      u64.
      
      Rather than attempting to limit the max_adj to a value small enough to
      avoid overflow, instead calculate the incvalue adjustment based on the
      40GbE incvalue, and then multiply that by the scaling factor for the
      link speed.
      
      This sacrifices a small amount of precision in the adjustment but we
      avoid erratic behavior of the clock due to the overflow caused if ppb is
      very near the maximum adjustment.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      830e0dd9
    • A
      i40e: Fix multiple issues with UDP tunnel offload filter configuration · 5305d0fe
      Alexander Duyck 提交于
      This fixes at least 2 issues I have found with the UDP tunnel filter
      configuration.
      
      The first issue is the fact that the tunnels didn't have any sort of mutual
      exclusion in place to prevent an update from racing with a user request to
      add/remove a port. As such you could request to add and remove a port
      before the port update code had a chance to respond which would result in a
      very confusing result. To address it I have added 2 changes. First I added
      the RTNL mutex wrapper around our updating of the pending, port, and
      filter_index bits. Second I added logic so that we cannot use a port that
      has a pending deletion since we need to free the space in hardware before
      we can allow software to reuse it.
      
      The second issue addressed is the fact that we were not recording the
      actual filter index provided to us by the admin queue. As a result we were
      deleting filters that were not associated with the actual filter we wanted
      to delete. To fix that I added a filter_index member to the UDP port
      tracking structure.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      5305d0fe
  2. 28 4月, 2018 1 次提交
  3. 27 3月, 2018 6 次提交
  4. 24 3月, 2018 1 次提交
  5. 20 3月, 2018 1 次提交
  6. 15 2月, 2018 1 次提交
    • A
      i40e: Add and delete cloud filter · e284fc28
      Avinash Dayanand 提交于
      This patch provides support to add or delete cloud filter for queue
      channels created for ADq on VF.
      We are using the HW's cloud filter feature and programming it to act
      as a TC filter applied to a group of queues.
      
      There are two possible modes for a VF when applying a cloud filter
      1. Basic Mode:	Intended to apply filters that don't need a VF to be
      		Trusted. This would include the following
      		  Dest MAC + L4 port
      		  Dest MAC + VLAN + L4 port
      2. Advanced Mode: This mode is only for filters with combination that
      		  requires VF to be Trusted.
      		  Dest IP + L4 port
      
      When cloud filters are applied on a trusted VF and for some reason
      the same VF is later made as untrusted then all cloud filters
      will be deleted. All cloud filters has to be re-applied in
      such a case.
      Cloud filters are also deleted when queue channel is deleted.
      
      Testing-Hints:
      =============
      1. Adding Basic Mode filter should be possible on a VF in
         Non-Trusted mode.
      2. In Advanced mode all filters should be able to be created.
      
      Steps:
      ======
      1. Enable ADq and create TCs using TC mqprio command
      2. Apply cloud filter.
      3. Turn-off the spoof check.
      4. Pass traffic.
      
      Example:
      ========
      1. tc qdisc add dev enp4s2 root mqprio num_tc 4 map 0 0 0 0 1 2 2 3\
      	queues 2@0 2@2 1@4 1@5 hw 1 mode channel
      2. tc qdisc add dev enp4s2 ingress
      3. ethtool -K enp4s2 hw-tc-offload on
      4. ip link set ens261f0 vf 0 spoofchk off
      5. tc filter add dev enp4s2 protocol ip parent ffff: prio 1 flower\
      	dst_ip 192.168.3.5/32 ip_proto udp dst_port 25 skip_sw hw_tc 2
      Signed-off-by: NAvinash Dayanand <avinash.dayanand@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e284fc28
  7. 14 2月, 2018 1 次提交
  8. 13 2月, 2018 1 次提交
    • A
      i40e/i40evf: Add support for new mechanism of updating adaptive ITR · a0073a4b
      Alexander Duyck 提交于
      This patch replaces the existing mechanism for determining the correct
      value to program for adaptive ITR with yet another new and more
      complicated approach.
      
      The basic idea from a 30K foot view is that this new approach will push the
      Rx interrupt moderation up so that by default it starts in low latency and
      is gradually pushed up into a higher latency setup as long as doing so
      increases the number of packets processed, if the number of packets drops
      to 4 to 1 per packet we will reset and just base our ITR on the size of the
      packets being received. For Tx we leave it floating at a high interrupt
      delay and do not pull it down unless we start processing more than 112
      packets per interrupt. If we start exceeding that we will cut our interrupt
      rates in half until we are back below 112.
      
      The side effect of these patches are that we will be processing more
      packets per interrupt. This is both a good and a bad thing as it means we
      will not be blocking processing in the case of things like pktgen and XDP,
      but we will also be consuming a bit more CPU in the cases of things such as
      network throughput tests using netperf.
      
      One delta from this versus the ixgbe version of the changes is that I have
      made the interrupt moderation a bit more aggressive when we are in bulk
      mode by moving our "goldilocks zone" up from 48 to 96 to 56 to 112. The
      main motivation behind moving this is to address the fact that we need to
      update less frequently, and have more fine grained control due to the
      separate Tx and Rx ITR times.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a0073a4b
  9. 27 1月, 2018 1 次提交
  10. 22 11月, 2017 1 次提交
  11. 01 11月, 2017 3 次提交
  12. 18 10月, 2017 1 次提交
  13. 14 10月, 2017 5 次提交
  14. 10 10月, 2017 2 次提交
  15. 06 10月, 2017 4 次提交
  16. 30 9月, 2017 2 次提交
    • A
      i40e: Enable VF to negotiate number of allocated queues · a3f5aa90
      Alan Brady 提交于
      Currently the PF allocates a default number of queues for each VF and
      cannot be changed.  This patch enables the VF to request a different
      number of queues allocated to it.  This patch also adds a new virtchnl
      op and capability flag to facilitate this negotiation.
      
      After the PF receives a request message, it will set a requested number
      of queues for that VF.  Then when the VF resets, its VSI will get a new
      number of queues allocated to it.
      
      This is a best effort request and since we only allocate a guaranteed
      default number, if the VF tries to ask for more than the guaranteed
      number, there may not be enough in HW to accommodate it unless other
      queues for other VFs are freed. It should also be noted decreasing the
      number queues allocated to a VF to below the default will NOT enable the
      allocation of more than 32 VFs per PF and will not free queues guaranteed
      to each VF by default.
      Signed-off-by: NAlan Brady <alan.brady@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a3f5aa90
    • J
      i40e: use separate state bit for miscellaneous IRQ setup · c17401a1
      Jacob Keller 提交于
      We currently (mis)use the __I40E_RECOVERY_PENDING bit to determine when
      we should actually request a new IRQ in i40e_setup_misc_vector().
      
      This led to a design mistake where we open-coded the re-setup of the
      miscellaneous vector in i40e_resume() instead of using the function
      provided. If we did not open-code this and instead tried to use the
      i40e_setup_misc_vector() function, it would lead to never reallocating
      the IRQ.
      
      This would lead to a second i40e_suspend() call failing to free the
      vector due to a NULL pointer dereference.
      
      A future patch is going to re-work how the i40e_suspend() and
      i40e_resume() flows work to clear all IRQ vectors, which would require
      us to use i40e_setup_misc_vector() directly. Since during this time the
      __I40E_RECOVERY_PENDING bit is set, we'll never re-allocate the vector.
      
      Rather than leaving the open-coded setup in i40e_resume() lets just fix
      the problem properly in i40e_setup_misc_vector().
      
      Introduce a new state bit which indicates when the IRQ has been
      assigned, which will be set when i40e_setup_misc_vector is first called.
      This ultimately resolves the issue of re-requesting the vector, without
      overloading the __I40E_RECOVERY_PENDING state. This ensures that the
      suspend/resume cycle can use the setup function instead of open-coding
      the re-request during resume.
      
      Additionally, since the only callers of i40e_stop_misc_vector also want
      to free it, move this code directly into the function to avoid
      duplication. Due to the new functionality, rename it to
      i40e_free_misc_vector().
      
      This lets us drop the extra calls to free and re-enable the vector
      during i40e_suspend() and i40e_resume(). We don't need to call
      i40e_setup_misc_Vector() in i40e_resume() because it gets called by the
      i40e_rebuild() call.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c17401a1
  17. 26 8月, 2017 2 次提交
    • J
      i40e: remove workaround for Open Firmware MAC address · 28921a0c
      Jacob Keller 提交于
      Since commit b499ffb0 ("i40e: Look up MAC address in Open Firmware
      or IDPROM"), we've had support for obtaining the MAC address
      form Open Firmware or IDPROM.
      
      This code relied on sending the Open Firmware address directly to the
      device firmware instead of relying on our MAC/VLAN filter list. Thus,
      a work around was introduced in commit b1b15df5 ("i40e: Explicitly
      write platform-specific mac address after PF reset")
      
      We refactored the Open Firmware address enablement code in the ill-named
      commit 41c4c2b5 ("i40e: allow look-up of MAC address from Open
      Firmware or IDPROM")
      
      Since this refactor, we no longer even set I40E_FLAG_PF_MAC. Further, we
      don't need this work around, because we actually store the MAC address
      as part of the MAC/VLAN filter hash. Thus, we will restore the address
      correctly upon reset.
      
      The refactor above failed to revert the workaround, so do that now.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      28921a0c
    • J
      i40e: separate hw_features from runtime changing flags · d36e41dc
      Jacob Keller 提交于
      The number of flags found in pf->flags has grown quite large, and there
      are a lot of different types of flags. Most of the flags are simply
      hardware features which are enabled on some firmware or some MAC types.
      Other flags are dynamic run-time flags which enable or disable certain
      features of the driver.
      
      Separate these two types of flags into pf->hw_features and pf->flags.
      The hw_features list will contain a set of features which are enabled at
      init time. This will not contain toggles or otherwise dynamically
      changing features. These flags should not need atomic protections, as
      they will be set once during init and then be essentially read only.
      
      Everything else will remain in the flags variable. These flags may be
      modified at any time during run time. A future patch may wish to convert
      these flags into set_bit/clear_bit/test_bit or similar approach to
      ensure atomic correctness.
      
      The I40E_FLAG_MFP_ENABLED flag may be a good fit for hw_features but
      currently is used by ethtool in the private flags settings, and thus has
      been left as part of flags.
      
      Additionally, I40E_FLAG_DCB_CAPABLE may be a good fit for the
      hw_features but this patch has not tried to untangle it yet.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d36e41dc
  18. 21 6月, 2017 4 次提交
  19. 13 6月, 2017 1 次提交
    • J
      i40e: fix handling of HW ATR eviction · 6964e53f
      Jacob Keller 提交于
      A recent commit to refactor the driver and remove the hw_disabled_flags
      field accidentally introduced two regressions. First, we overwrote
      pf->flags which removed various key flags including the MSI-X settings.
      
      Additionally, it was intended that we have now two flags,
      HW_ATR_EVICT_CAPABLE and HW_ATR_EVICT_ENABLED, but this was not done,
      and we accidentally were mis-using HW_ATR_EVICT_CAPABLE everywhere.
      
      This patch adds the missing piece, HW_ATR_EVICT_ENABLED, and safely
      updates pf->flags instead of overwriting it.
      
      Without this patch we will have many problems including disabling MSI-X
      support, and we'll attempt to use HW ATR eviction on devices which do
      not support it.
      
      Fixes: 47994c11 ("i40e: remove hw_disabled_flags in favor of using separate flag bits", 2017-04-19)
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6964e53f