1. 03 2月, 2017 3 次提交
  2. 09 1月, 2017 1 次提交
  3. 11 12月, 2016 1 次提交
  4. 07 12月, 2016 14 次提交
    • J
      i40e: move all updates for VLAN mode into i40e_sync_vsi_filters · 489a3265
      Jacob Keller 提交于
      In a similar fashion to how we handled exiting VLAN mode, move the logic
      in i40e_vsi_add_vlan into i40e_sync_vsi_filters. Extract this logic into
      its own function for ease of understanding as it will become quite
      complex.
      
      The new function, i40e_correct_mac_vlan_filters() correctly updates all
      filters for when we need to enter VLAN mode, exit VLAN mode, and also
      enforces the PVID when assigned.
      
      Call i40e_correct_mac_vlan_filters from i40e_sync_vsi_filters passing it
      the number of active VLAN filters, and the two temporary lists.
      
      Remove the function for updating VLAN=0 filters from i40e_vsi_add_vlan.
      
      The end result is that the logic for entering and exiting VLAN mode is
      in one location which has the most knowledge about all filters. This
      ensures that we always correctly have the non-VLAN filters assigned to
      VID=0 or VID=-1 regardless of how we ended up getting to this result.
      
      Additionally this enforces the PVID at sync time so that we know for
      certain that an assigned PVID results in only filters with that PVID
      will be added to the firmware.
      
      Change-ID: I895cee81e9c92d0a16baee38bd0ca51bbb14e372
      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>
      489a3265
    • J
      i40e: use (add|rm)_vlan_all_mac helper functions when changing PVID · 9af52f60
      Jacob Keller 提交于
      The current flow for adding or updating the PVID for a VF uses
      i40e_vsi_add_vlan and i40e_vsi_kill_vlan which each take, then release
      the hash lock. In addition the two functions also must take special care
      that they do not perform VLAN mode changes as this will make the code in
      i40e_ndo_set_vf_port_vlan behave incorrectly.
      
      Fix these issues by using the new helper functions i40e_add_vlan_all_mac
      and i40e_rm_vlan_all_mac which expect the hash lock to already be taken.
      Additionally these functions do not perform any state updates in regards
      to VLAN mode, so they are safe to use in the PVID update flow.
      
      It should be noted that we don't need the VLAN mode update code here,
      because there are only a few flows here.
      
      (a) we're adding a new PVID
        In this case, if we already had VLAN filters the VSI is knocked
        offline so we don't need to worry about pre-existing VLAN filters
      
      (b) we're replacing an existing PVID
        In this case, we can't have any VLAN filters except those with the old
        PVID which we already take care of manually.
      
      (c) we're removing an existing PVID
        Similarly to above, we can't have any existing VLAN filters except
        those with the old PVID which we already take care of correctly.
      
      Because of this, we do not need (or even want) the special accounting
      done in i40e_vsi_add_vlan, so use of the helpers is a saner alternative.
      It also opens the door for a future patch which will refactor the flow
      of i40e_vsi_add_vlan now that it is not needed in this function.
      
      Change-ID: Ia841f63da94e12b106f41cf7d28ce8ce92f2ad99
      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>
      9af52f60
    • J
      i40e: factor out addition/deletion of VLAN per each MAC address · 490a4ad3
      Jacob Keller 提交于
      A future refactor of how the PF assigns a PVID to a VF will want to be
      able to add and remove a block of filters by VLAN without worrying about
      accidentally triggering the accounting for I40E_VLAN_ANY. Additionally
      the PVID assignment would like to be able to batch several changes under
      one use of the mac_filter_hash_lock.
      
      Factor out the addition and deletion of a VLAN on all MACs into their
      own function which i40e_vsi_(add|kill)_vlan can use. These new functions
      expect the caller to take the hash lock, as well as perform any
      necessary accounting for updating I40E_VLAN_ANY filters if we are now
      operating under VLAN mode.
      
      Change-ID: If79e5b60b770433275350a74b3f1880333a185d5
      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>
      490a4ad3
    • J
      i40e: delete filter after adding its replacement when converting · 75697025
      Jacob Keller 提交于
      Fix a subtle issue with the code for converting VID=-1 filters into VID=0
      filters when adding a new VLAN. Previously the code deleted the VID=-1
      filter, and then added a new VID=0 filter. In the rare case that the
      addition fails due to -ENOMEM, we end up completely deleting the filter
      which prevents recovery if memory pressure subsides. While it is not
      strictly an issue because it is likely that memory issues would result
      in many other problems, we shouldn't delete the filter until after the
      addition succeeds.
      
      Change-ID: Icba07ddd04ecc6a3b27c2e29f2c1c8673d266826
      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>
      75697025
    • J
      i40e: refactor i40e_update_filter_state to avoid passing aq_err · ac9e2390
      Jacob Keller 提交于
      The current caller of i40e_update_filter_state incorrectly passes
      aq_ret, an i40e_status variable, instead of the expected aq_err. This
      happens to work because i40e_status is actually just a typedef integer,
      and 0 is still the successful return. However i40e_update_filter_state
      has special handling for ENOSPC which is currently being ignored.
      
      Also notice that firmware does not update the per-filter response for
      many types of errors, such as EINVAL. Thus, modify the filter setup so
      that the firmware response memory is pre-set with I40E_AQC_MM_ERR_NO_RES.
      
      This enables us to refactor i40e_update_filter_state, removing the need
      to pass aq_err and avoiding a need for having 3 different flows for
      checking the filter state.
      
      The resulting code for i40e_update_filter_state is much simpler, only
      a single loop and we always check each filter response value every time.
      Since we pre-set the response value to match our expected error this
      correctly works for all success and error flows.
      
      Change-ID: Ie292c9511f34ee18c6ef40f955ad13e28b7aea7d
      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>
      ac9e2390
    • J
      i40e: recalculate vsi->active_filters from hash contents · 38326218
      Jacob Keller 提交于
      Previous code refactors have accidentally caused issues with the
      counting of active_filters. Avoid similar issues in the future by simply
      re-counting the active filters every time after we handle add and delete
      of all the filters. Additionally this allows us to simplify the check
      for when we exit promiscuous mode since we can combine the check for
      failed filters at the same time.
      
      Additionally since we recount filters at the end we need to set
      vsi->promisc_threshold as well.
      
      The resulting code takes a bit longer since we do have to loop over
      filters again. However, the result is more readable and less likely to
      become incorrect due to failed accounting of filters in the future.
      Finally, this ensures that it is not possible for vsi->active_filters to
      ever underflow since we never decrement it.
      
      Change-ID: Ib4f3a377e60eb1fa6c91ea86cc02238c08edd102
      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>
      38326218
    • J
      i40e: defeature support for PTP L4 frame detection on XL710 · 1e28e861
      Jacob Keller 提交于
      A product decision has been made to defeature detection of PTP frames
      over L4 (UDP) on the XL710 MAC. Do not advertise support for L4
      timestamping.
      
      Change-ID: I41fbb0f84ebb27c43e23098c08156f2625c6ee06
      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>
      1e28e861
    • M
      i40e: lock service task correctly · 91089033
      Mitch Williams 提交于
      The service task lock was being set in the scheduling function, not the
      actual service task. This would potentially leave the bit set for a long
      time before the task actually ran. Furthermore, if the service task
      takes too long, it calls the schedule function to reschedule itself -
      which would fail to take the lock and do nothing.
      
      Instead, set and clear the lock bit in the service task itself. In the
      process, get rid of the i40e_service_event_complete() function, which is
      really just two lines of code that can be put right in the service task
      itself.
      
      Change-ID: I83155e682b686121e2897f4429eb7d3f7c669168
      Signed-off-by: NMitch Williams <mitch.a.williams@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      91089033
    • C
      i40e: Add support for 25G devices · 3123237a
      Carolyn Wyborny 提交于
      Add support for 25G devices - defines and data structures.
      
      One tricky part here is that the firmware support for these
      Devices introduces a mismatch between the PHY type enum and
      the bitfields for the phy types.
      
      This change creates a macro and uses it to increment the 25G
      PHY values when creating 25G bitfields.
      
      Change-ID: I69b24d837d44cf9220bf5cb8dd46c5be89ce490b
      Signed-off-by: NCarolyn Wyborny <carolyn.wyborny@intel.com>
      Signed-off-by: NMitch Williams <mitch.a.williams@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      3123237a
    • B
    • H
      i40e: Blink LED on 1G BaseT boards · 4f9b4307
      Henry Tieman 提交于
      Before this patch "ethtool -p" was not blinking the LEDs on boards
      with 1G BaseT PHYs.
      
      This commit identifies 1G BaseT boards as having the LEDs connected
      to the MAC. Also, renamed the flag to be more descriptive of usage.
      The flag is now I40E_FLAG_PHY_CONTROLS_LEDS.
      
      Change-ID: I4eb741da9780da7849ddf2dc4c0cb27ffa42a801
      Signed-off-by: NHenry Tieman <henry.w.tieman@intel.com>
      Signed-off-by: NHarshitha Ramamurthy <harshitha.ramamurthy@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4f9b4307
    • J
      i40e: remove code to handle dev_addr specially · 3c7cbd45
      Jacob Keller 提交于
      The netdev->dev_addr MAC filter already exists in the
      MAC/VLAN hash table, as it is added when we configure
      the netdev in i40e_configure_netdev. Because we already
      know that this address will be updated in the
      hash_for_each loops, we do not need to handle it
      specially. This removes duplicate code and simplifies
      the i40e_vsi_add_vlan and i40e_vsi_kill_vlan functions.
      Because we know these filters must be part of the
      MAC/VLAN hash table, this should not have any functional
      impact on what filters are included and is merely a code
      simplification.
      
      Change-ID: I5e648302dbdd7cc29efc6d203b7019c11f0b5705
      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>
      3c7cbd45
    • J
      i40e: restore workaround for removing default MAC filter · 1596b5dd
      Jacob Keller 提交于
      A previous commit 53cb6e9e ("i40e: Removal of workaround for simple
      MAC address filter deletion") removed a workaround for some
      firmware versions which was reported to not be necessary in production
      NICs. Unfortunately this workaround is necessary in some configurations,
      specifically the Ethernet Controller XL710 for 40GbE QSFP+ (8086:1583).
      
      Without this patch, the mentioned NICs with current firmware exhibit
      issues when adding VLANs, as outlined by the following reproduction:
      
        $modprobe i40e
        $ip link set <device> up
        $ip link add link <device> vlan100 type vlan id 100
        $dmesg | tail
        <snip>
        kernel: i40e 0000:82:00.0: Error I40E_AQ_RC_EINVAL adding RX
      filters on PF, promiscuous mode forced on
      
      This results in filters being marked as FAILED and setting the device in
      promiscuous mode.
      
      The root cause of receiving the -EINVAL error response appears to be due
      to a conflict with the default MAC filter which still exists on the
      default firmware for this device. Attempting to add a new VLAN filter on
      the default MAC address conflicts with the IGNORE_VLAN setting on the
      default rule.
      
      Change-ID: I4d8f6d48ac5f60cfe981b3baad30eb4d7c170d61
      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>
      1596b5dd
    • F
      i40e: Driver prints log message on link speed change · 7ec9ba11
      Filip Sadowski 提交于
      This patch makes the driver log link speed change. Before applying the
      patch link messages were printed only on state change. Now message is
      printed when link is brought up or down and when speed changes.
      
      Change-ID: Ifbee14b4b16c24967450b3cecac6e8351dcc8f74
      Signed-off-by: NFilip Sadowski <filip.sadowski@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      7ec9ba11
  5. 03 12月, 2016 6 次提交
  6. 01 11月, 2016 13 次提交
    • F
      i40e: removed unreachable code · 3aa7b74d
      Filip Sadowski 提交于
      Removed some of unnecessary if statements and unreachable code found by
      static code analysis tool.
      The return value of i40e_vsi_control_rings(..., false) is always 0. So,
      test for non-zero will never be true. The function has been split into
      "int i40e_vsi_start_rings()" and "void i40e_vsi_stop_rings()" for better
      understanding.
      Similarly, the function i40e_vsi_kill_vlan() never fails. So, checking
      for return value is also unnecessary. Function definition changed to void.
      The i40e_loopback_test() function is not implemented. The function and
      all references to loopback testing were removed.
      
      Change-ID: Id45cf66f6689ce2bc4e887de13f073e30e8431bd
      Signed-off-by: NFilip Sadowski <filip.sadowski@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      3aa7b74d
    • A
      i40e: Add common function for finding VSI by type · 4b816446
      Alexander Duyck 提交于
      This patch adds a common method for finding a VSI by type.  The main
      motivation for doing this is that the Flow Director path actually had two
      ways of handling this, one stopped on first match and one did not.  This
      patch makes it so that all callers of this function will get the same
      approach for finding a VSI.
      
      Change-ID: Ibf25de8acd8466582520694424aa87da66965fbd
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Signed-off-by: NBimmy Pujari <bimmy.pujari@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4b816446
    • J
      i40e: remove duplicate add/delete adminq command code for filters · 00936319
      Jacob Keller 提交于
      We duplicate some code around adding and deleting filters using the
      adminq interface. This is prone to errors in case there are bugs. Use
      functions which extract the logic to their own portion so that we don't
      duplicate it twice in code.
      
      Change-ID: I60d68aeb887976787dec00b23ab386a106e61465
      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>
      00936319
    • J
      i40e: avoid looping to check whether we're in VLAN mode · cbebb85f
      Jacob Keller 提交于
      We determine that a VSI is in vlan_mode whenever it has any filters
      with a VLAN other than -1 (I40E_VLAN_ALL). The previous method of doing
      so was to perform a loop whenever we needed the check. However, we can
      notice that only place where filters are added (i40e_add_filter) can
      change the condition from false to true, and the only place we can
      return to false is in i40e_vsi_sync_filters_subtask. Thus, we can remove
      the loop and use a boolean directly.
      
      Doing this avoids looping over filters repeatedly especially while we're
      already inside a loop over all the filters. This should reduce the
      latency of filter operations throughout the driver.
      
      Change-ID: Iafde08df588da2a2ea666997d05e11fad8edc338
      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>
      cbebb85f
    • A
      i40e: fix MAC filters when removing VLANs · 84f5ca6c
      Alan Brady 提交于
      Currently there exists a bug where adding at least one VLAN and then
      removing all VLANs leaves the mac filters for the VSI with an incorrect
      value for 'vid' which indicates the mac filter's VLAN status.
      
      The current implementation for handling the removal of VLANs is wrong
      for a couple reasons. The first is that when i40e_vsi_kill_vlan
      iterates through the MAC filters, it fails to account for the MAC filter
      status; i.e. it's not accommodating for filters that are about to be
      deleted. The second problem is that MAC filters can be deleted in other
      places (specifically i40e_set_rx_mode). Thus if it occurs that all the
      VLAN MAC filters get deleted we need to switch out of VLAN mode, but the
      code path through i40e_vsi_kill_vlan has already been executed and we're
      now stuck in VLAN mode.
      
      This patch fixes the issue by removing the check from i40e_vsi_kill_vlan
      and puts the check instead in i40e_sync_vsi_filters where we're
      guaranteed to see all filter deletions and can properly detect when we
      need to switch out of VLAN mode.
      
      Change-ID: Ib38fe6034b356eee9a0e20b8a9eeed5ff2debcd9
      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>
      84f5ca6c
    • J
      i40e: properly cleanup on allocation failure in i40e_sync_vsi_filters · 4a2ce27b
      Jacob Keller 提交于
      Currently, we fail to correctly restore filters on the temporary add
      list when we fail to allocate memory either for deletion or addition.
      Replace calls to "goto out;" with calls to a new location that correctly
      handles memory allocation failures.
      
      Note that it is safe for us to call i40e_undo_filter_entries on the
      tmp_del_list even after we've deleted filters because at this point it
      will be empty, so we don't need to separate the logic for add and
      delete failure.
      
      Change-Id: Iee107fd219c6e03e2fd9645c2debf8e8384a8521
      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>
      4a2ce27b
    • J
      i40e: store MAC/VLAN filters in a hash with the MAC Address as key · 278e7d0b
      Jacob Keller 提交于
      Replace the mac_filter_list with a static size hash table of 8bits. The
      primary advantage of this is a decrease in latency of operations related
      to searching for specific MAC filters, including .set_rx_mode. Using
      a linked list resulted in several locations which were O(n^2). Using
      a hash table should give us latency growth closer to O(n*log(n)).
      
      Change-ID: I5330bd04053b880e670210933e35830b95948ebb
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      278e7d0b
    • 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
  7. 29 10月, 2016 2 次提交
    • A
      i40e: Clean up handling of msglevel flags and debug parameter · 5d4ca23e
      Alexander Duyck 提交于
      So the i40e driver had a really convoluted configuration for how to handle
      the debug flags contained in msg_level.  Part of the issue is that the
      driver has its own 32 bit mask that it was using to track a separate set of
      debug features.  From what I can tell it was trying to use the upper 4 bits
      to determine if the value was meant to represent a bit-mask or the numeric
      value provided by debug level.
      
      What this patch does is clean this up by compressing those 4 bits into bit
      31, as a result we just have to perform a check against the value being
      negative to determine if we are looking at a debug level (positive), or a
      debug mask (negative).  The debug level will populate the msg_level, and
      the debug mask will populate the debug_mask in the hardware struct.
      
      I added similar logic for ethtool.  If the value being provided has bit 31
      set we assume the value being provided is a debug mask, otherwise we assume
      it is a msg_enable mask.  For displaying we only provide the msg_enable,
      and if debug_mask is in use we will print it to the dmesg log.
      
      Lastly I removed the debugfs interface.  It is redundant with what we
      already have in ethtool and really doesn't belong anyway.
      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>
      5d4ca23e
    • D
      i40e: Fix bit logic error in failure case · c17ef430
      David Ertman 提交于
      Patch a036244c "i40e: Fix kernel panic on enable/disable LLDP"
      introduced an error in bit logic.
      
      Originally this bit manipulation was meant to clear two bits to indicate
      that DCB was not enabled or capable. An "&" was incorrectly used instead
      of an "|" bit operator to combine the two bitmasks into one.  This also
      created a static checker error since the resultant code was a no-op.
      
      This patch fixes the error by using the correct bit-wise operator.
      Signed-off-by: NDave Ertman <david.m.ertman@intel.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c17ef430