From: Jeff Kirsher
> Sent: 29 June 2016 05:41
> From: Mitch Williams <[email protected]>
>
> This function uses the i40e_hw struct all over the place, so why doesn't
> it keep a pointer to the struct? Add this pointer as a local variable
> and use it consistently throughout the function.
>
> Change-ID: I10eb688fe40909433fcb8ac7ac891cef67445d72
> Signed-off-by: Mitch Williams <[email protected]>
> Tested-by: Andrew Bowers <[email protected]>
> Signed-off-by: Jeff Kirsher <[email protected]>
> ---
> drivers/net/ethernet/intel/i40e/i40e_main.c | 79
> +++++++++++++++--------------
> 1 file changed, 41 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c
> b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 734cba6..9a26ecc 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -1840,6 +1840,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
> {
> struct list_head tmp_del_list, tmp_add_list;
> struct i40e_mac_filter *f, *ftmp, *fclone;
> + struct i40e_hw *hw = &vsi->back->hw;
> bool promisc_forced_on = false;
> bool add_happened = false;
> int filter_list_len = 0;
> @@ -1920,7 +1921,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
> if (!list_empty(&tmp_del_list)) {
> int del_list_size;
>
> - filter_list_len = pf->hw.aq.asq_buf_size /
> + filter_list_len = hw->aq.asq_buf_size /
...
I suspect you've just made the compiler use separate registers for
pf and hw.
This could easily cause additional register spills to/from stack.
David