From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2607242B48; Fri, 19 May 2023 12:46:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E96E14161A; Fri, 19 May 2023 12:46:56 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2053.outbound.protection.outlook.com [40.107.92.53]) by mails.dpdk.org (Postfix) with ESMTP id 208944161A for ; Fri, 19 May 2023 12:46:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f3qtzKPY1a+lnNz2U+/6q8ne4Q7ATptROwsjCjR1y/j4IGiOC1jTZp5jZDArg4mmNnndjsIViDSCV1uskGdaNRqbjx4b9Esc5hu8bpwo9VTgYBctTepnCjvTyMEpaHluiJFTDtt9rdwS6+r80IbM794MUJ3RBuMeQnNA1gEF6+pL66ZcR2rQ0OALmWShtn8el2HWKneEl1lY6KlEgj0VhFm+3tE/ezRCtu2XmYNAsgGluBOZpnbXTrVOlBUTmoGTZPaeVhD94e6wWZAfxW9UgNeg0OlHUSzGWiGMB1M9wcudpQevKnT+Ctnb6+DZ2o0e6nAJ4/U6uf+J7rpU+Lymcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bb1mKjBqgcxBkyQbl1ZzWB05IKovdMlw7QrOYI2A69c=; b=T+Hk6WzG1nFUpHNyXx5qo/3PIw2ALPQlmIraKZqIs65sHQkloZ45iqG5h6R3du8YMvakDaBCUzuXSMczgsM7cZaOIbRvcc7k1q7WnRyNw6V3N+clM0ZbLz8e+Vz+FwoqUTdg8DErorP5iID6THtIUOduWBIVgydoirPBYCaxZxBnfi6E9OjE6CKNfNWIdRLuxwsS4xd6GgFLNAx/qof6P6y1zAEnPqiWscuU/Mg1dHSQYVQKRRrhT8jrqv7W1GopmEVPZANZDrfIzZPLOCYSttki7UMVusEGJsGF/fGnwLsXdSvBDtxFozBKmfBVKOVPqyEH8AdeVwUDT0MDpjCtCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bb1mKjBqgcxBkyQbl1ZzWB05IKovdMlw7QrOYI2A69c=; b=5XuVE6lQpzD5jveEmlysJkRAgAmq1roQclPwD8r60kFlMdzAucwmXlAHmQkZK4MPmCUF7w5vN/FPwYOxzPW1lqk2q3WDQOM4m2hgxHIQLCLSvareTnX5nyBfytTOKSNDU9RK3/YIu2tC9ulbsTeUvNP14YMm6QzVk+7XNmXk4H0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SN7PR12MB6789.namprd12.prod.outlook.com (2603:10b6:806:26b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Fri, 19 May 2023 10:46:51 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a%4]) with mapi id 15.20.6411.019; Fri, 19 May 2023 10:46:51 +0000 Message-ID: Date: Fri, 19 May 2023 11:45:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US To: Huisong Li , dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, andrew.rybchenko@oktetlabs.ru, liudongdong3@huawei.com, liuyonglong@huawei.com, fengchengwen@huawei.com References: <20221020093102.20679-1-lihuisong@huawei.com> <20230519093155.50559-1-lihuisong@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH V10] ethdev: fix one address occupies two entries in MAC addrs In-Reply-To: <20230519093155.50559-1-lihuisong@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0576.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:276::23) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SN7PR12MB6789:EE_ X-MS-Office365-Filtering-Correlation-Id: c10f4bd1-6fd1-46e9-5acf-08db58565a85 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4Owo6cKEW3RSs381LkXn+rCDj5QQlNBGr7fBDC4mA/+jWfyNoXMdSlGtAQi7S4SXZ7tKdJaJYki/NTgQuHBXIlHYJ7wI+0RB9pbDVdYpHzHoJ3mId8M8hgPZAYyCMsKLbbdFLmw4oil4R+gOEpmt5ZsXn+Lrbd7LYBFONbMg1hpKgantosHO6yFejmdHIgassI6qusRRpxCOMjXTkoyxLA/ZvJCmAyOJ6kEZeyV0WG5tGZhWZxz5+pTlTN4Tk6MZo1kU6SOqSSRnDUdcju0Q8EriQjgKoXlrWjnTINMvungzTfQki9cUmuhiic21M11+VL7gOeolHxpNTnkyXYp9/5PRtTlrabUaGmqLA5WOOg51xVf9dM8X2aCWUaxrJCmCD8a8OATrqL99DtD0zK5YjWJU2d1a9LhkYuhzHEu5xJaRubrEY98vcbQ07/8z0NUZzKZhFRLkGpRvpLRz8UF+L6RPq3JxHAAI6U1oqYctow+S2hapxLtW90MnpJ+JLMBJUmYL64Hsw+mYnP9V84oSKSC7UgY/sQc+Zz1Okm3L10Hth2uJHykOAx5afPDnRntCKEle3kbWIVrBocjFN8I+LM5Iuk/EsxlplI+HGIg5MjqcdbR+KiMhEuIopA8s9GTcaZ0ELNISrKq4IwEYqF/f0w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(136003)(346002)(396003)(376002)(39860400002)(451199021)(6512007)(53546011)(6506007)(36756003)(26005)(38100700002)(2616005)(31696002)(86362001)(186003)(44832011)(478600001)(2906002)(8676002)(316002)(4326008)(8936002)(31686004)(41300700001)(5660300002)(66476007)(66556008)(66946007)(6486002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U1VqZUk2Y1ZSajA1QzNoNUNVeCtab215bTBSdngySnJmUTk3L3l1ZHpTOWhk?= =?utf-8?B?bUhhdU41ZnhqMnFnVzU3QldQbzJSV1pkL2ZTZ01jdWo4YStLTXFmK1NiSG9H?= =?utf-8?B?Ty9hR29xT3VybERDVTFtdEFSWHozQmFqNy9FV2VSOExnVTZTcmtRMHdRcGVO?= =?utf-8?B?UVN0ZTlYZDBvemVWVnFEMlJvQ2JuWXoyUVJHSXZ5NXdUcFBNb0xmdUdtTlZy?= =?utf-8?B?Y3RFZ3ZVN1FyQm1jNTBuNFBTdVBGSGpRd1l5NDhDTnNoK1M5ZUxVWEo3TTRt?= =?utf-8?B?djQ3dmV0QTVsQk9zbm5CZm1jak15QlRZUlpXSHFoOW5wcU1MeHkvWXk2YmRH?= =?utf-8?B?MkM3ZFF1UX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rossTenant-Network-Message-Id: c10f4bd1-6fd1-46e9-5acf-08db58565a85 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 10:46:51.5892 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eSzY4YiCXVx9kYf6KOkR3zIAyRii2x6MosNMz2ZiFTbT5UVD22fvcIj4gCcJcLmY X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6789 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 > Acked-by: Chengwen Feng > Acked-by: Thomas Monjalon Fixes: 854d8ad4ef68 ("ethdev: add default mac address modifier") Cc: stable@dpdk.org Reviewed-by: Ferruh Yigit Applied to dpdk-next-net/main, thanks.