]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e: recalculate vsi->active_filters from hash contents
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 11 Nov 2016 20:39:26 +0000 (12:39 -0800)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:41:45 +0000 (19:41 -0500)
commit5060f3ef5b544af868e3191f738ccb859ec6d605
treea2504241b34fe04bd79cb6d970078cb6603c06f1
parentbf402b3c3eaf1c04c407e08567ccb32d0ae998a5
i40e: recalculate vsi->active_filters from hash contents

Orabug: 24568124

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: 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>
(cherry picked from commit 38326218acce336d99cd128a11ecc69f6512f8e4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_main.c