]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e: refactor i40e_update_filter_state to avoid passing aq_err
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 11 Nov 2016 20:39:27 +0000 (12:39 -0800)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:41:46 +0000 (19:41 -0500)
commit9b976b4e40dc2346be19ec3561b122628031db7c
tree8e337f6620fa8f02bf5bdc1f42029872329b7e0a
parent5060f3ef5b544af868e3191f738ccb859ec6d605
i40e: refactor i40e_update_filter_state to avoid passing aq_err

Orabug: 24568124

The current caller of i40e_update_filter_state incorrectly passes
aq_ret, an i40e_status variable, instead of the expected aq_err. This
happens to work because i40e_status is actually just a typedef integer,
and 0 is still the successful return. However i40e_update_filter_state
has special handling for ENOSPC which is currently being ignored.

Also notice that firmware does not update the per-filter response for
many types of errors, such as EINVAL. Thus, modify the filter setup so
that the firmware response memory is pre-set with I40E_AQC_MM_ERR_NO_RES.

This enables us to refactor i40e_update_filter_state, removing the need
to pass aq_err and avoiding a need for having 3 different flows for
checking the filter state.

The resulting code for i40e_update_filter_state is much simpler, only
a single loop and we always check each filter response value every time.
Since we pre-set the response value to match our expected error this
correctly works for all success and error flows.

Change-ID: Ie292c9511f34ee18c6ef40f955ad13e28b7aea7d
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 ac9e239014413e483abadba7722cfc1672302738)
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