ice: Fix issues updating VSI MAC filters
authorAkeem G Abodunrin <akeem.g.abodunrin@intel.com>
Thu, 25 Jul 2019 09:53:51 +0000 (02:53 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 23 Aug 2019 17:46:53 +0000 (10:46 -0700)
commitbbb968e8b34c2cf5ff99d0dfdb73639070b3dee1
tree818d99587bf955dd98d8979d1efe9fda6bb08da6
parent5a4a8673102761fb87c94ee20633bf1f2a6911ca
ice: Fix issues updating VSI MAC filters

VSI, especially VF could request to add or remove filter for another VSI,
driver should really guide such request and disallow it.
However, instead of returning error for such malicious request, driver
can simply return success.

In addition, we are not tracking number of MAC filters configured per
VF correctly - and this leads to issue updating VF MAC filters whenever
they were removed and re-configured via bringing VF interface down and
up. Also, since VF could send request to update multiple MAC filters at
once, driver should program those filters individually in the switch, in
order to determine which action resulted to error, and communicate
accordingly to the VF.

So, with this changes, we now track number of filters added right from
when VF resources allocation is done, and could properly add filters for
both trusted and non_trusted VFs, without MAC filters mis-match issue in
the switch...

Also refactor code, so that driver can use new function to add or remove
MAC filters.

Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_lib.h
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c