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 1576942643; Tue, 26 Sep 2023 15:07:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2BB240279; Tue, 26 Sep 2023 15:07:48 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2084.outbound.protection.outlook.com [40.107.100.84]) by mails.dpdk.org (Postfix) with ESMTP id 277CC40271 for ; Tue, 26 Sep 2023 15:07:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d0GAHjy3vBpaAiDabTTtJup0jjwZS/Cj4+g43m4dioPpM16dM80rbxnM6kHQZ4ECinhguw1Qv4ANnQMtF+oBT6aD26I4TtSQtuCZFpMEA5eO37imb0pQfD0nqZuMDFUnBfZ1CRTtKKZ7pFZ9rrYBGRypMYqooLXvh0Z0x/2wtY7TWJuofXoWDW0nuhc9azTwSHhsxyMxtidOQqFZaH47WsGtgkZnu4E/cYRtuM6w427cDwDiZsJEvLTtNs2nApaCHlSQGMftuUv8rN4nwZqZIm/rD0SdD0Dxh36qQebv3u3ssQCA1xGdKtvX2ph9HW/Hr5vdc6gRCtnvawebsf5t/g== 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=I4lIXdrnE4eJe7jfcZXSJ8yYpjhIOM+OaUJeNRE7cyk=; b=ZKKCBNFeHUhH7bxH/25wYNlsnT9IB3eqYIuVvqIyIWpT8hfOHVgSwwLpb7S+2cwCvWvLynuaTeiuh1AVGYsVhLvwR3rw5sholDyFSQAb8zDt39zeo9CBfS+vh+yT2OWk6PW75KDE60r02csf5EbdEatt3yfkOf870K0fePGwGnQ2gUXEiqffHyD9aESIpI4vUOlO19NQqZQhjq/7UW+TfKEohO5t2C/cJoOyWT0Zk7FpAzOuWKcBwESqLwJjppONoHS9waqMjXoCR5wqZ0alJHFYBkGU3NQx/uMN1qCd+f36GQkxshflzKbbAOqFh21xouNkhtCbpr8+QHKzCuFVew== 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=I4lIXdrnE4eJe7jfcZXSJ8yYpjhIOM+OaUJeNRE7cyk=; b=RnKv+73PpOjBboEKuQMEeXpKsj29OI5iUmYzwOamedSVRLwcQ5XlX4anZc6k4oXjYd52VdbhZ+EprrPeHoKDB28CQmoNYN28qGNoncSXqCRSSfFTjPSst5g+xfR0aUEAW+uNJ1ASioMhDEVtaYpnJnU2EIvI4L09Q4Hi5s7LhfQ= 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 DS0PR12MB7680.namprd12.prod.outlook.com (2603:10b6:8:11c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Tue, 26 Sep 2023 13:07:43 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::102f:c69b:d3e5:7fe8%4]) with mapi id 15.20.6813.027; Tue, 26 Sep 2023 13:07:43 +0000 Message-ID: <45fcc835-57b8-44fb-8690-a3b96602eeac@amd.com> Date: Tue, 26 Sep 2023 14:07:42 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 11/32] net/sssnic: add dev MAC ops Content-Language: en-US To: wanry@3snic.com, dev@dpdk.org Cc: Steven Song References: <20230904045658.238185-1-wanry@3snic.com> <20230904045658.238185-12-wanry@3snic.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJjb9DJBQkC+3/YAAoJEFRTPtCK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ta5eHAVhmtXvrqPW6Ku 3FQ= In-Reply-To: <20230904045658.238185-12-wanry@3snic.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0489.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13a::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DS0PR12MB7680:EE_ X-MS-Office365-Filtering-Correlation-Id: 284f9e56-1630-4efa-1508-08dbbe91921f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Rzb7VXuysRdQhr8XtFe9kJQMm5NXbbjeAbgx0fA5UCmySjdh5B/fyHmveHffdXCb8JyIM0xU7ol0T4gau1b0WptzhLXaM6+k1uaH/SUhXP7NQ1U3nJy5QTIjvSUsLW7QS5GNRj4JBD1C7U5NMIrxSw+xy7Gr/V3aLd8e8/UjSL0XX9UDvL/R+I8jqEx/QbLtV3n+CkHydEwKv511+qqgqy1PULBLD2EmHrAxA3ACQ0VjV36XxASN3fxsgpqOW9blYf6E9DAOOMOjb+wcYq+HTlEjLsg275e3JVMWByDk7nCuOkcPSemAPqkyTHmiQqGRGKMHm0Zgd4eJj/VkKfRqYpAw/h+hcLvBXfcAZwr/lXTjsxOjajtgV3Y4WNWCUtG2K9WBN6DNwb0tZTJ0Si/sM0eyfVusflPBszxT+SaPd/1+DPI28KGYByBqDv6y1peotR8b3a8wCI5I7wEOBxw7cu5L6ULD47eWachCoHjPsi6XmuDO9Y5aC0URhGWb8Ajd/ebgATC4lhFVyc0DTD9TuhXb3cbLApsbIb9tP4kJrcqtjBshdsaDVLEBz7GWtdc0eBNItwXxZ6NP60ycGj9qHkXV7ngQKcYydfYwuy8xHJv/FFrm54l5aowmv7LPjKNXa6foG/dkNaqaaLAnTLe1PQ== 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:(13230031)(136003)(376002)(39860400002)(396003)(366004)(346002)(230922051799003)(1800799009)(186009)(451199024)(2906002)(53546011)(6512007)(6506007)(6486002)(2616005)(38100700002)(66556008)(66476007)(31696002)(86362001)(478600001)(83380400001)(26005)(36756003)(44832011)(5660300002)(41300700001)(316002)(8676002)(4326008)(8936002)(66946007)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RXFpWnRkcWI0U0ZGbm9Ya2Rma1FWK0Rnd29CTmlyM2FlZVdCbE56eWF5MFhz?= =?utf-8?B?cEtScDFXRm9Vc2VUaXZjYld6WnNUK3pRS25NODVNVVZDbmRrQlQ2MTREMTFn?= =?utf-8?B?VXY3T1dpWHAzbFV4dnpqS0JqclhtMEVlVW4zdWRiZVJLRVZCQ0ZaSW4wUmhO?= =?utf-8?B?RGNOZEdZZU4yYnpmcmhEV2JleUZwSHhoNWtWcnhBQzJNMml5TzFjdEtPdlls?= =?utf-8?B?a2R0YnZOanRWN0pOQ3hURUVvUGtPY0xXQ1JodHdFMTZBOElTSWdvbVZlaEp5?= =?utf-8?B?blNqWDUyMUU0Q3ZyZDYxVHpwWGxEdUdzVVA4dk1kRUdvTHNnUHBYenljSHNP?= =?utf-8?B?aWJTNmVkSkFsVzlRRUtlMklyVFJ2RW5TU0NtSGlkSlEvVWgrWTBOOUlyUnVH?= =?utf-8?B?ak13dkM1bFoyaHRBSjhqbHl1dEkyTS9VcHhLdHpmZGcrN1Z2WS9xSTFrZnRK?= =?utf-8?B?S3lNVzM3UnphcHJ3WUJ1SkpHQThSYUM1TkpZSzFVeGkvLzVRNm5qS0EvVkNo?= =?utf-8?B?WmhOU0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Udq?= =?utf-8?B?ckJ5MVo1ZzJ6QW5CakJwTHpINVRYa3JLVlEzbVNwQVA4UXI2aFdlNXF1YlFU?= =?utf-8?B?a0Vyc1dpOXA3cnRnbkc4T0ZQTmNVZEl0Q1EvaDRtckdMN1N4eDl6aHMrYkhQ?= =?utf-8?B?N3Q0N0hMY2JHVHdndWlWcENsMjQ3bFNzYjY2VlpkdTA3QTZOOGs1ajJ6MXA5?= =?utf-8?B?ZHFzNjRZUkRjVHNKd2pWK01LYjJhTmkrZXRqelBFemp4R25EZVZiVVJBMmoy?= =?utf-8?B?MVFDeUtyUUVWRC81dlhYdjBXeStMbkFMbkRHbkFLeTZTcEcyVFlISmZqaDNk?= =?utf-8?B?VVNML1lpM2NZc1dsOU1aS0xBNytJc0xGc29sbU9RYkJpWnZQMm8xL1hKS0pL?= =?utf-8?B?dWszcHRyY09kaFk0RzRHSVBCT245NHlkYWJ5ZlNJQ3dXVm9NcTc0WS9Hdnl3?= =?utf-8?B?VlJ6Q2ZNNUFSOXB2bFhWcWlHUENkejVwMFRIcHlsSkJ0VTNWVERuczFSKy9i?= =?utf-8?B?Z2MvYWp5Tk9YN08zL3dWS28yTTVHMjViSVpUM3B3K2FUNDJHZjdHbzlQSDNq?= =?utf-8?B?YzhWUUx3NDZPQVdyaWJQMHk0Q3lZcGZ0QnJNdXQrelpXdmVsWFFrcFhrZGc4?= =?utf-8?B?M1F6YXF6S3FNT3Z3dFdHZDlTb05VaWtmekRSR0xHYzNYRTVFK3RlNG51WUlG?= =?utf-8?Q?Tow0Voqvv+YIILj9O7OoSyiHM?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 284f9e56-1630-4efa-1508-08dbbe91921f X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2023 13:07:43.6191 (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: F/jBi9zAaKbzWrsENwOoWoAyGcJiChwNGUOSM/UlJzi1xqwcL8iilJ3suQRPsWBJ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7680 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 9/4/2023 5:56 AM, wanry@3snic.com wrote: > From: Renyong Wan > > Signed-off-by: Steven Song > Signed-off-by: Renyong Wan > <...> > +int > +sssnic_mac_addr_update(struct sssnic_hw *hw, uint8_t *new, uint8_t *old) > +{ > + int ret; > + struct sssnic_mac_addr_update_cmd cmd; > + struct sssnic_msg msg; > + uint32_t cmd_len; > + uint16_t func; > + > + if (hw == NULL || new == NULL || old == NULL) > + return -EINVAL; > + > + if (SSSNIC_FUNC_TYPE(hw) == SSSNIC_FUNC_TYPE_VF) > + func = SSSNIC_PF_FUNC_IDX(hw); > + else > + func = SSSNIC_MPU_FUNC_IDX; > + > + memset(&cmd, 0, sizeof(cmd)); > + cmd_len = sizeof(cmd); > + cmd.function = SSSNIC_FUNC_IDX(hw); > + rte_memcpy(cmd.new_addr, new, 6); > + rte_memcpy(cmd.old_addr, old, 6);> Can use 'RTE_ETHER_ADDR_LEN' instead of hardcoded '6', same for a few other locations, <...> > +static int > +sssnic_ethdev_mac_addrs_init(struct rte_eth_dev *ethdev) > +{ > + int ret; > + struct sssnic_netdev *netdev; > + struct sssnic_hw *hw; > + struct rte_ether_addr default_addr; > + char mac_str[RTE_ETHER_ADDR_FMT_SIZE]; > + > + PMD_INIT_FUNC_TRACE(); > + > + netdev = SSSNIC_ETHDEV_PRIVATE(ethdev); > + hw = SSSNIC_NETDEV_TO_HW(netdev); > + > + ethdev->data->mac_addrs = rte_zmalloc(NULL, > + SSSNIC_ETHDEV_MAX_NUM_UC_MAC * sizeof(struct rte_ether_addr), > + 0); > + if (ethdev->data->mac_addrs == NULL) { > + PMD_DRV_LOG(ERR, > + "Failed to allocate memory to store %u mac addresses", > + SSSNIC_ETHDEV_MAX_NUM_UC_MAC); > + return -ENOMEM; > + } > + > + netdev->mcast_addrs = rte_zmalloc(NULL, > + SSSNIC_ETHDEV_MAX_NUM_MC_MAC * sizeof(struct rte_ether_addr), > + 0); > + if (netdev->mcast_addrs == NULL) { > + PMD_DRV_LOG(ERR, > + "Failed to allocate memory to store %u mcast addresses", > + SSSNIC_ETHDEV_MAX_NUM_MC_MAC); > + ret = -ENOMEM; > + goto alloc_mcast_addr_fail; > + } > + > + /* initialize default MAC address */ > + memset(&default_addr, 0, sizeof(default_addr)); > + ret = sssnic_mac_addr_get(hw, default_addr.addr_bytes); > + if (ret != 0) > + PMD_DRV_LOG(NOTICE, > + "Could not get default MAC address, will use random address"); > + > + if (rte_is_zero_ether_addr(&default_addr)) > + rte_eth_random_addr(default_addr.addr_bytes); > + > + rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, &default_addr); > + > + ret = sssnic_mac_addr_add(hw, default_addr.addr_bytes); > + if (ret != 0) { > + PMD_DRV_LOG(ERR, "Failed to add default MAC address: %s", > + mac_str); > + goto add_ether_addr_fail; > + } > + > + rte_ether_addr_copy(&default_addr, ðdev->data->mac_addrs[0]); > + rte_ether_addr_copy(&default_addr, &netdev->default_addr); > + > Is there a reason to keep 'default_addr' in the device private data, when it is already stored in 'ethdev->data->mac_addrs[0]'? <...> > @@ -80,6 +333,7 @@ sssnic_ethdev_release(struct rte_eth_dev *ethdev) > { > struct sssnic_hw *hw = SSSNIC_ETHDEV_TO_HW(ethdev); > > + sssnic_ethdev_mac_addrs_clean(ethdev); > Should 'netdev->mcast_addrs' freed in this context? As far as I can see it is not freed anywhere. <...> > @@ -140,7 +408,7 @@ sssnic_ethdev_uninit(struct rte_eth_dev *ethdev) > > sssnic_ethdev_release(ethdev); > > - return -EINVAL; > + return 0; > This should be in previous patch, 4/32, which updates uninit function.