]> git.baikalelectronics.ru Git - kernel.git/commit
i40e: avoid looping to check whether we're in VLAN mode
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 5 Oct 2016 16:30:40 +0000 (09:30 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 31 Oct 2016 21:26:40 +0000 (14:26 -0700)
commit9abdfb34a72ff4b1e47a54d093f710a9cd03b30d
treef6496b95a2ed131005b7a1850e20a632ce2be248
parent2b906a2043b8a2e3a213815f4bb3d8a5049fdcd4
i40e: avoid looping to check whether we're in VLAN mode

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: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_main.c