On 5/19/2023 10:31 AM, Huisong Li wrote:
> The dev->data->mac_addrs[0] will be changed to a new MAC address when
> applications modify the default MAC address by .mac_addr_set(). However,
> if the new default one has been added as a non-default MAC address by
> .mac_addr_add(), the .mac_addr_set() didn't check this address.
> As a result, this MAC address occupies two entries in the list. Like:
> add(MAC1)
> add(MAC2)
> add(MAC3)
> add(MAC4)
> set_default(MAC3)
> default=MAC3, the rest of the list=MAC1, MAC2, MAC3, MAC4
> Note: MAC3 occupies two entries.
> 
> But .mac_addr_set() cannot remove it implicitly in case of MAC address
> shrinking in the list.
> So this patch adds a check on whether the new default address was already
> in the list and if so requires the user to remove it first.
> 
> In addition, this patch documents the position of the default MAC address
> and address unique in the list.
> 
> Signed-off-by: Huisong Li <lihuis...@huawei.com>
> Acked-by: Chengwen Feng <fengcheng...@huawei.com>
> Acked-by: Thomas Monjalon <tho...@monjalon.net>

    Fixes: 854d8ad4ef68 ("ethdev: add default mac address modifier")
    Cc: sta...@dpdk.org

Reviewed-by: Ferruh Yigit <ferruh.yi...@amd.com>

Applied to dpdk-next-net/main, thanks.

Reply via email to