]> 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)
commitfe975495c6840da32c5322090ffd28f9f5a73c42
tree53c7e62c9ddf3e2134e993e6f6aae9e7cf50965d
parent2293977ddfd244e8910419229f6accf2a0366b9b
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