1. 20 3月, 2018 1 次提交
  2. 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
  3. 14 2月, 2018 1 次提交
  4. 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
  5. 27 1月, 2018 1 次提交
  6. 22 11月, 2017 1 次提交
  7. 01 11月, 2017 3 次提交
  8. 18 10月, 2017 1 次提交
  9. 14 10月, 2017 5 次提交
  10. 10 10月, 2017 2 次提交
  11. 06 10月, 2017 4 次提交
  12. 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
  13. 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
  14. 21 6月, 2017 4 次提交
  15. 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
  16. 02 6月, 2017 1 次提交
  17. 31 5月, 2017 3 次提交
  18. 30 4月, 2017 4 次提交
    • J
      i40e: remove hw_disabled_flags in favor of using separate flag bits · 47994c11
      Jacob Keller 提交于
      The hw_disabled_flags field was added as a way of signifying that
      a feature was automatically or temporarily disabled. However, we
      actually only use this for FDir features. Replace its use with new
      _AUTO_DISABLED flags instead. This is more readable, because you aren't
      setting an *_ENABLED flag to *disable* the feature.
      
      Additionally, clean up a few areas where we used these bits. First, we
      don't really need to set the auto-disable flag for ATR if we're fully
      disabling the feature via ethtool.
      
      Second, we should always clear the auto-disable bits in case they somehow
      got set when the feature was disabled. However, avoid displaying
      a message that we've re-enabled the feature.
      
      Third, we shouldn't be re-enabling ATR in the SB ntuple add flow,
      because it might have been disabled due to space constraints. Instead,
      we should just wait for the fdir_check_and_reenable to be called by the
      watchdog.
      
      Overall, this change allows us to simplify some code by removing an
      extra field we didn't need, and the result should make it more clear as
      to what we're actually doing with these flags.
      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>
      47994c11
    • J
      i40e: use DECLARE_BITMAP for state fields · 0da36b97
      Jacob Keller 提交于
      Instead of assuming our flags fit within an unsigned long, use
      DECLARE_BITMAP which will ensure that we always allocate enough space.
      Additionally, use __I40E_STATE_SIZE__ markers as the last element of the
      enumeration so that the size of the BITMAP is compile-time assigned
      rather than programmer-time assigned. This ensures that potential future
      flag additions do not actually overrun the array. This is especially
      important as 32bit systems would only have 32bit longs instead of 64bit
      longs as we generally have assumed in the prior code.
      
      This change also removes a dereference of the state fields throughout
      the code, so it does have a bit of code churn. The conversions were
      automated using sed replacements with an alternation
      
        s/&(vsi->back|vsi|pf)->state/\1->state/
        s/&adapter->vsi.state/adapter->vsi.state/
      
      For debugfs, we modify the printing so that we can display chunks of the
      state value on new lines. This ensures that we can print the entire set
      of state values. Additionally, we now print them as 08lx to ensure that
      they display nicely.
      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>
      0da36b97
    • J
      i40e: separate PF and VSI state flags · d19cb64b
      Jacob Keller 提交于
      Avoid using the same named flags for both vsi->state and pf->state. This
      makes code review easier, as it is more likely that future authors will
      use the correct state field when checking bits. Previous commits already
      found issues with at least one check, and possibly others may be
      incorrect.
      
      This reduces confusion as it is more clear what each flag represents,
      and which flags are valid for which state field.
      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>
      d19cb64b
    • J
      i40e: rename index to port to avoid confusion · 27826fd5
      Jacob Keller 提交于
      The .index field of i40e_udp_port_config represents the udp port number.
      Rename this variable to port so that it is more obvious.
      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>
      27826fd5
  19. 20 4月, 2017 2 次提交
    • J
      i40e: use i40e_stop_rings_no_wait to implement PORT_SUSPENDED state · 3480756f
      Jacob Keller 提交于
      This state bit was added as a way for DCB to avoid having to wait for
      the queues to disable when handling LLDP events. The logic for this was
      burried deep within stop Tx and stop Rx queue code. First, let's rename
      it so that it does not appear to only affect Tx when infact it modifies
      both Tx and Rx flow. Second we can move it up into the i40e_stop_rings()
      function, and we can simply re-use the i40e_stop_rings_no_wait() so that
      we don't have to bury the implementation as deep into the call stack.
      
      An alternative might be to remove the state bit and instead attempt to
      shut down everything directly in DCP flow. This, however, is not ideal
      because it creates yet another separate shutdown routine that we'd have
      to maintain. In the current implementation any changes will be made to
      both flows.
      
      Change-ID: I68e1ccb901af320862bca395e9c9746f08e8b17c
      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>
      3480756f
    • J
      i40e: reset all VFs in parallel when rebuilding PF · e4b433f4
      Jacob Keller 提交于
      When there are a lot of active VFs, it can take multiple seconds to
      finish resetting all of them during certain flows., which can cause some
      VFs to fail to wait long enough for the reset to occur. The user might
      see messages like "Never saw reset" or "Reset never finished" and the VF
      driver will stop functioning properly.
      
      The naive solution would be to simply increase the wait timer. We can
      get much more clever. Notice that i40e_reset_vf is run in a serialized
      fashion, and includes lots of delays.
      
      There are two prominent delays which take most of the time. First, when
      we begin resetting VFs, we have multiple 10ms delays which accrue
      because we reset each VF in a serial fashion. These delays accumulate to
      almost 4 seconds when handling the maximum number of VFs (128).
      
      Secondly, there is a massive 50ms delay for each time we disable queues
      on a VSI. This delay is necessary to allow HW to finish disabling queues
      before we restore functionality. However, just like with the first case,
      we are paying the cost for each VF, rather than disabling all VFs and
      waiting once.
      
      Both of these can be fixed, but required some previous refactoring to
      handle the special case. First, we will need the
      i40e_vsi_wait_queues_disabled function which was previously DCB
      specific. Second, we will need to implement our own
      i40e_vsi_stop_rings_no_wait function which will handle the stopping of
      rings without the delays.
      
      Finally, implement an i40e_reset_all_vfs function, which will first
      start the reset of all VFs, and pay the wait cost all at once, rather
      than serially waiting for each VF before we start processing then next
      one. After the VF has been reset, we'll disable all the VF queues, and
      then wait for them to disable. Again, we'll organize the flow such that
      we pay the wait cost only once.
      
      Finally, after we've disabled queues we'll go ahead and begin restoring
      VF functionality. The result is reducing the wait time by a large factor
      and ensuring that VFs do not timeout when waiting in the VF driver.
      
      Change-ID: Ia6e8cf8d98131b78aec89db78afb8d905c9b12be
      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>
      e4b433f4