1. 01 11月, 2016 7 次提交
    • J
      i40e: implement __i40e_del_filter and use where applicable · 290d2557
      Jacob Keller 提交于
      When inside a loop where we call i40e_del_filter we use an O(n^2)
      pattern where i40e_del_filter calls i40e_find_filter for us. We can
      avoid this O(n^2) logic by factoring a function, __i40e_del_filter() out
      from the i40e_del_filter code. This allows us to re-use the delete logic
      where appropriate without having to search for the filter twice.
      
      This new function benefits several functions including i40e_vsi_add_vlan,
      i40e_vsi_kill_vlan, i40e_del_mac_vlan_all, and i40e_vsi_release.
      
      Change-ID: I75fabe0f53bf73f56b80d342e5fdcfcc28f4d3eb
      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>
      290d2557
    • J
      i40e: When searching all MAC/VLAN filters, ignore removed filters · 57b341d6
      Jacob Keller 提交于
      When adding new MAC address filters, the driver determines if it should
      behave in VLAN mode (where all MAC addresses get assigned to every
      existing VLAN) or in non-VLAN mode where MAC addresses get assigned the
      VLAN_ANY identifier. Under some circumstances it is possible that a VLAN
      has been marked for removal (such that all filters of that VLAN are set
      to I40E_FILTER_REMOVE), and a subsequent call to i40e_put_mac_in_vlan
      may occur prior to the driver subtask that syncs filters to the
      hardware.
      
      In this case, we may add filters to the new removed VLAN, even though it
      should have been removed. This is most obvious when first adding a new
      VLAN. We will delete all filters which are in I40E_VLAN_ANY (-1) and
      then re-add them as in VLAN 0 (untagged). Then before we sync filters,
      we will add new MAC address filter, which will be added to every VLAN
      that exists. Unfortunately, this will include I40E_VLAN_ANY, so we will
      end up incorrectly adding filters to the -1 VLAN. This can be fixed by
      simply skipping all filters which are marked for removal.
      
      A similar check is not necessary in i40e_del_mac_all_vlan, since we are
      deleting, and any filter which we find already marked for removal would
      simply be deleted again, which doesn't cause any issues.
      
      Change-Id: I7962154013ce02fe950584690aeeb3ed853d0086
      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>
      57b341d6
    • J
      i40e: refactor i40e_put_mac_in_vlan to avoid changing f->vlan · 5feb3d7b
      Jacob Keller 提交于
      When a PVID has been assigned to a VSI, the function
      i40e_put_mac_in_vlan arbitrarily modifies all filters
      to have the same VLAN. This is obviously incorrect
      because it could be modifying active filters without
      putting them into the NEW state. The correct method
      is to remove then re-add filters which is already done
      in the code where we assign the PVID.
      
      Fix this issue and a few other minor nits at the same
      time. First, when we have a PVID don't even bother
      looping and simply add the filter with the PVID immediately.
      
      In the case of the loop, we now can remove several checks.
      We also don't need to use i40e_find_filter first before
      calling i40e_add_filter, since i40e_add_filter implicitly
      does a lookup already.
      
      Finally, update the return semantics of this function so
      that on failure to add a filter it returns NULL, but on
      success, it returns the last filter added. Otherwise,
      we're just returning the last filter in the list. An
      alternative fix might be to return 0 or an error code,
      but this is pretty invasive to every call site.
      
      Change-ID: I2325dfd843aec76d89fb0d7cb0e7c4f290a34840
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      5feb3d7b
    • J
      i40e: move i40e_put_mac_in_vlan and i40e_del_mac_all_vlan · 35ec2ff3
      Jacob Keller 提交于
      A future patch will be modifying these functions and making a call to
      a static function which currently is defined after these functions. Move
      them in a separate patch to ease review and ensure the moved code is
      correct.
      
      Change-ID: I2ca7fd4e10c0c07ed2291db1ea41bf5987fc6474
      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>
      35ec2ff3
    • J
      i40e: make use of __dev_uc_sync and __dev_mc_sync · 6622f5cd
      Jacob Keller 提交于
      The kernel provides __dev_uc_sync and __dev_mc_sync in order for drivers
      which need individual notification of add and delete for each filter.
      These functions allow us to vastly simplify our .set_rx_mode handler. We
      need to implement two functions for sync and unsync which add and remove
      filters respectively.
      
      This change avoids a very complex and inefficient algorithm which
      resulted in an abnormal latency for the .set_rx_mode NDO operation. The
      resulting code after this change is more readable, more efficient, and
      less code.
      
      Due to the callback signature used by these functions we also must
      update several other functions to take a const u8 * pointer.
      
      Change-Id: I2ca7fd4e10c0c07ed2291db1ea41bf5987fc6474
      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>
      6622f5cd
    • J
      i40e: drop is_vf and is_netdev fields in struct i40e_mac_filter · 1bc87e80
      Jacob Keller 提交于
      Originally the is_vf and is_netdev fields were added in order to
      distinguish between VF and netdev filters in a single VSI. However, it
      can be noted that we use separate VSI for SRIOV VFs and for netdev VSI.
      Thus, since a single VSI should only ever have one type of filter, we
      can simply remove the checks and remove the typing.
      
      In a similar fashion, we can note that the only remaining way to get
      multiple filters of a single type is through a debug command that was
      added to debugfs. This command is useless in practice, and results in
      causing bugs if we keep counter tracking but lose the is_vf and
      is_netdev protections as desired above.
      
      Since the only time we'd actually have a counter value besides 0 and
      1 is through use of this debugfs hook, we can remove this unnecessary
      command, and the entire counter logic it required.
      
      We vastly simplify mac filters by removing
      
      (a) the distinction between VF and netdev filters
      (b) counting logic
      (c) the ability to add and remove filters bypassing the stack via debugfs
      
      Change-ID: Idf916dd2a1159b1188ddbab5bef6b85ea6bf27d9
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1bc87e80
    • C
      i40e: Add missing \n to end of dev_err message · ff00f3a9
      Colin Ian King 提交于
      Trival fix, dev_err message is missing a \n, so add it.
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ff00f3a9
  2. 29 10月, 2016 17 次提交
  3. 28 10月, 2016 4 次提交
  4. 18 10月, 2016 2 次提交
    • D
      ixgbe: Flip to the new dev walk API · 1cd127fc
      David Ahern 提交于
      Convert ixgbe users to new dev walk API. This is just a code conversion;
      no functional change is intended.
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1cd127fc
    • J
      ethernet/intel: use core min/max MTU checking · 91c527a5
      Jarod Wilson 提交于
      e100: min_mtu 68, max_mtu 1500
      - remove e100_change_mtu entirely, is identical to old eth_change_mtu,
        and no longer serves a purpose. No need to set min_mtu or max_mtu
        explicitly, as ether_setup() will already set them to 68 and 1500.
      
      e1000: min_mtu 46, max_mtu 16110
      
      e1000e: min_mtu 68, max_mtu varies based on adapter
      
      fm10k: min_mtu 68, max_mtu 15342
      - remove fm10k_change_mtu entirely, does nothing now
      
      i40e: min_mtu 68, max_mtu 9706
      
      i40evf: min_mtu 68, max_mtu 9706
      
      igb: min_mtu 68, max_mtu 9216
      - There are two different "max" frame sizes claimed and both checked in
        the driver, the larger value wasn't relevant though, so I've set max_mtu
        to the smaller of the two values here to retain identical behavior.
      
      igbvf: min_mtu 68, max_mtu 9216
      - Same issue as igb duplicated
      
      ixgb: min_mtu 68, max_mtu 16114
      - Also remove pointless old == new check, as that's done in dev_set_mtu
      
      ixgbe: min_mtu 68, max_mtu 9710
      
      ixgbevf: min_mtu 68, max_mtu dependent on hardware/firmware
      - Some hw can only handle up to max_mtu 1504 on a vf, others 9710
      
      CC: netdev@vger.kernel.org
      CC: intel-wired-lan@lists.osuosl.org
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      91c527a5
  5. 14 10月, 2016 1 次提交
  6. 04 10月, 2016 4 次提交
  7. 03 10月, 2016 2 次提交
  8. 28 9月, 2016 3 次提交