]> git.baikalelectronics.ru Git - kernel.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)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 7 Dec 2016 05:22:19 +0000 (21:22 -0800)
commit9b81a93d9bd6384c786e6a43d07f28cabee8dc83
tree53c7e62c9ddf3e2134e993e6f6aae9e7cf50965d
parentccc8c0d4788e367677f75946bacdc6d5f32a7ab9
i40e: recalculate vsi->active_filters from hash contents

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>
drivers/net/ethernet/intel/i40e/i40e_main.c