[PATCH V10] ethdev: fix one address occupies two entries in MAC addrs
Ferruh Yigit
ferruh.yigit at amd.com
Fri May 19 12:45:53 CEST 2023
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 <lihuisong at huawei.com>
> Acked-by: Chengwen Feng <fengchengwen at huawei.com>
> Acked-by: Thomas Monjalon <thomas at monjalon.net>
Fixes: 854d8ad4ef68 ("ethdev: add default mac address modifier")
Cc: stable at dpdk.org
Reviewed-by: Ferruh Yigit <ferruh.yigit at amd.com>
Applied to dpdk-next-net/main, thanks.
More information about the dev
mailing list