]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e: refactor i40e_put_mac_in_vlan to avoid changing f->vlan
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 5 Oct 2016 16:30:34 +0000 (09:30 -0700)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:40:37 +0000 (19:40 -0500)
commit448fbb87accb0858f3f8941edd4f292b02bd866b
tree0b0a8f6b21a33dfcf3a214974f5d12c6f58cdd0d
parentcb08300a9fd142ea502dd9930fafea4a3a0fc068
i40e: refactor i40e_put_mac_in_vlan to avoid changing f->vlan

Orabug: 24568124

When a PVID has been assigned to a VSI, the function
i40e_put_mac_in_vlan arbitrarily modifies all filters
to have the same VLAN. This is obviously incorrect
because it could be modifying active filters without
putting them into the NEW state. The correct method
is to remove then re-add filters which is already done
in the code where we assign the PVID.

Fix this issue and a few other minor nits at the same
time. First, when we have a PVID don't even bother
looping and simply add the filter with the PVID immediately.

In the case of the loop, we now can remove several checks.
We also don't need to use i40e_find_filter first before
calling i40e_add_filter, since i40e_add_filter implicitly
does a lookup already.

Finally, update the return semantics of this function so
that on failure to add a filter it returns NULL, but on
success, it returns the last filter added. Otherwise,
we're just returning the last filter in the list. An
alternative fix might be to return 0 or an error code,
but this is pretty invasive to every call site.

Change-ID: I2325dfd843aec76d89fb0d7cb0e7c4f290a34840
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5feb3d7b0c0a66c8537ca8a79d8f80f54783e73f)
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