1. 20 Apr, 2017 5 commits
    • Jacob Keller's avatar
      i40e: reduce wait time for adminq command completion · 9e3f23f4
      Jacob Keller authored
      When sending an adminq command, we wait for the command to complete in
      a loop. This loop waits for an entire millisecond, when in practice the
      adminq command is processed often much faster.
      
      Change the loop to use i40e_usec_delay instead, and wait for 50 usecs
      each time instead. This appears to be about the minimum time required,
      based on some manual observation and testing.
      
      The primary benefit of this change is reducing latency of various
      operations in the PF driver, especially when related to having a large
      number of VFs enabled.
      
      For example, on Linux, when instantiating 128 VFs, the time to finish
      the operation dropped from about 9 seconds down to under 6 seconds.
      Additionally, the time it takes to finish a PF reset with 128 VFs
      dropped from 5.1 seconds down to 0.7 seconds.
      
      As the examples above show, a significant portion of the delay is wasted
      waiting for admiqn operations which have already finished.
      
      This patch shouldn't cause impact to functionality, as we still check
      and keep waiting until the command does get processed. The only expected
      change is an increase in CPU utilization as we now check for completion
      far more times. However, in practice the commands appear to generally be
      complete within the first delay window anyways.
      
      Change-ID: If8af8388e100da0a14eaf9e1af3afadf73a958cf
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9e3f23f4
    • Jacob Keller's avatar
      i40e: fix CONFIG_BUSY checks in i40e_set_settings function · e8d2f4c6
      Jacob Keller authored
      The check for I40E_CONFIG_BUSY state bit in the i40e_set_link_ksettings
      function is fishy. First we can notice a few things about the check here.
      
      First a similar check was introduced by commit
      'c7d05ca8 ("i40e: driver ethtool core")'
      
      Later a commit introducing the link settings was added by commit
      'bf9c7141 ("i40e: Implement set_settings for ethtool")'
      
      However, this second check was against vsi->state instead of pf->state,
      and also failed to set the bit, it only checks. That indicates the locking
      was not quite correct. The only other place that the state bit
      in vsi->state gets used is to protect the filter list.
      
      Since this code does not care about the mac filter list,  and seems
      clear the original code should have set the pf->state bit. Fix these
      issues by using pf->state correctly, and by actually setting the bit
      so that we properly lock as expected.
      
      Since these checks occur while holding the rtnl_lock(), lets also add a
      timeout so that we don't potentially softlock the system.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e8d2f4c6
    • Jacob Keller's avatar
      i40e: factor out queue control from i40e_vsi_control_(tx|rx) · c768e490
      Jacob Keller authored
      A future patch will need to be able to handle controlling queues without
      waiting until all VSIs are handled. Factor out the direct queue
      modification so that we can easily re-use this code. The result is also
      a bit easier to read since we don't embed multiple single-letter loop
      counters.
      
      Change-ID: Id923cbfa43127b1c24d8ed4f809b1012c736d9ac
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c768e490
    • Jacob Keller's avatar
      i40e: don't hold RTNL lock while waiting for VF reset to finish · 024b05f4
      Jacob Keller authored
      We made some effort to reduce the RTNL lock scope when resetting and
      rebuilding the PF. Unfortunately we still held the RTNL lock during the
      VF reset operation, which meant that multiple PFs could not reset in
      parallel due to the global lock. For now, further reduce the scope by
      not holding the RTNL lock while resetting VFs. This allows multiple PFs
      to reset in a timely manner.
      
      Change-ID: I2fbf823a0063f24dff67676cad09f0bbf83ee4ce
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      024b05f4
    • Jingjing Wu's avatar
      i40e: new AQ commands · 1d5c960c
      Jingjing Wu authored
      Add admin queue functions for Pipeline Personalization Profile AQ
      commands:
       - Write Recipe Command buffer (Opcode: 0x0270)
       - Get Applied Profiles list (Opcode: 0x0271)
      
      Change-ID: I558b4145364140f624013af48d4bbf79d21ebb0d
      Signed-off-by: default avatarJingjing Wu <jingjing.wu@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1d5c960c
  2. 19 Apr, 2017 5 commits
    • Scott Peterson's avatar
      i40e/i40evf: Add tracepoints · ed0980c4
      Scott Peterson authored
      This patch adds tracepoints to the i40e and i40evf drivers to which
      BPF programs can be attached for feature testing and verification.
      It's expected that an attached BPF program will identify and count or
      log some interesting subset of traffic. The bcc-tools package is
      helpful there for containing all the BPF arcana in a handy Python
      wrapper. Though you can make these tracepoints log trace messages, the
      messages themselves probably won't be very useful (other to verify the
      tracepoint is being called while you're debugging your BPF program).
      
      The idea here is that tracepoints have such low performance cost when
      disabled that we can leave these in the upstream drivers. This may
      eventually enable the instrumentation of unmodified customer systems
      should the need arise to verify a NIC feature is working as expected.
      In general this enables one set of feature verification tools to be
      used on these drivers whether they're built with the kernel or
      separately.
      
      Users are advised against using these tracepoints for anything other
      than a diagnostic tool. They have a performance impact when enabled,
      and their exact placement and form may change as we see how well they
      work in practice for the purposes above.
      
      Change-ID: Id6014a7322c0e6d08068114dd20bd156f2f6435e
      Signed-off-by: default avatarScott Peterson <scott.d.peterson@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ed0980c4
    • Mitch Williams's avatar
      i40e: dump VF information in debugfs · 3118025a
      Mitch Williams authored
      Dump some internal state about VFs through debugfs. This provides
      information not available with 'ip link show'. To use, write "dump vf
      <id>" to the command file, or just "dump vf" to dump information on all
      of the VFs.
      
      Change-ID: Ibe32b7f4ae55d4358c0b903217475f708ada1ecd
      Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      3118025a
    • Alexander Duyck's avatar
      i40e: Fix support for flow director programming status · 0e626ff7
      Alexander Duyck authored
      This patch fixes an issue I introduced when I converted the code over to
      using the length field to determine if a descriptor was done or not. It
      turns out that we are also processing programming descriptors in the Rx
      path and need to have these processed even though the length field will be
      0 on these packets.  What will happen with a programming descriptor is that
      we will receive a descriptor that has the SPH bit set, and the header
      length and packet length fields cleared.
      
      To account for this we should be checking for the bit for split header
      being set even though we aren't actually using header split. This bit is
      set in the length field to indicate if a programming descriptor response is
      contained in the descriptor. Since we don't support header split we don't
      need to perform the extra checks of using a fixed value for the entire
      length field.
      
      In addition I am moving the function for checking if a filter is a
      programming status filter into the i40e_txrx.c file since there is no
      longer support for FCoE it doesn't make sense to keep this file in i40e.h.
      
      Change-ID: I12c359c3dc70adb9d6b92b27324bb2c7f04c1a06
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      0e626ff7
    • alice michael's avatar
      i40e/i40evf: Remove VF Rx csum offload for tunneled packets · 53240e99
      alice michael authored
      Rx checksum offload for tunneled packets was never being negotiated or
      requested by VF. This capability was assumed by default and enabled in
      current hardware for VF. Going forward, this feature needs to be disabled
      or advanced ptypes should be negotiated with PF in the future.
      
      Change-ID: I9e54cfa8a90e03ab6956db4412f1e337ccd2c2e0
      Signed-off-by: default avatarPreethi Banala <preethi.banala@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      53240e99
    • Tobias Klauser's avatar
      i40evf: Use net_device_stats from struct net_device · 4a0a3abf
      Tobias Klauser authored
      Instead of using a private copy of struct net_device_stats in
      struct i40evf_adapter, use stats from struct net_device. Also remove the
      now unnecessary .ndo_get_stats function.
      Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4a0a3abf
  3. 18 Apr, 2017 30 commits