[Intel-wired-lan] [RFC PATCH net v2] iavf: Fix lost VF MAC when repeatedly set same MAC
Ding Hui
dinghui at sangfor.com.cn
Wed Apr 26 01:11:56 UTC 2023
On 2023/4/26 0:42, Gardocki, PiotrX wrote:
> Hello Ding,
>
> Thanks for the report. Intel is already aware of this issue and the fix should be available in the next release. The way we fixed that is that we're checking whether request from kernel is to change MAC address to the same address that's already applied. This way we're limiting the number of virtchnl calls.
> I think your patch is also valid, but one minor problem with it is that IAVF_FLAG_AQ_DEL_MAC_FILTER flag in aq_required is not being cleared. I'm pasting below our solution. We also have a plan to send this code to upstream, so the final solution might change if community will raise any concerns.
>
Thanks for the reply.
Before the reply, I used to think that the commit 35a2443d0910 ("iavf: Add waiting for response from PF in set mac")
removed the ether_addr_equal() in iavf_set_mac() intentionally, to make sure call virtchnl on every set mac.
> diff --git a/iavf_main.c b/iavf_main.c
> index 51267049..60e32746 100644
> --- a/iavf_main.c
> +++ b/iavf_main.c
> @@ -1190,6 +1190,9 @@ int iavf_replace_primary_mac(struct iavf_adapter *adapter,
> struct iavf_hw *hw = &adapter->hw;
> struct iavf_mac_filter *new_f;
>
> + if (ether_addr_equal(new_mac, hw->mac.addr))
> + return 0;
> +
I also tried add back the ether_addr_equal() condition, but I added it in iavf_set_mac(),
since I think that there is no need to wait_event_interruptible_timeout() if skipping
queue_work().
> spin_lock_bh(&adapter->mac_vlan_list_lock);
>
> new_f = iavf_add_filter(adapter, new_mac);
>
> Regards,
> Piotr
>
>
--
Thanks,
- Ding Hui
More information about the Intel-wired-lan
mailing list