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 782CC45CDF; Mon, 11 Nov 2024 01:15:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6446E4027C; Mon, 11 Nov 2024 01:15:28 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id C5E2F40151 for ; Mon, 11 Nov 2024 01:15:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pVMi3CCQ+L4i1uosJiIGKzjByfGleINITDsDNFl7tEwVVNTNl0SKuQBPJn6RM4ZWpIDRh63m13OKJnZCo0zKoq9c3mE2RSGbZ48oN6wv+6bsQg+g9RdRqrjDDZG88XWqQflXL45sbzzBW96+SuO3K2kQYF5R9SattGw7LBn8XgY3Iy0OtvMPNU8biO3DoPbClaxwWu3hyJfCCFhQ/vWEdDfI07qar6YoaTx1SJcYOxzWlW6RXN87EE0X4QXchoBqeaKLCy/K+9ZO22SsWp1EaTRd6cvZE/NiIRkBtxZsaDJbXHLhapgHiWhhNbJ6P1t5bmDfHQUy9kzRi0lMUYu6kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=HWjiwdPhAY0ZoLVfisMEuDBnnE3eaHpyEJBuMJWcltk=; b=jLpGlrnvzOyVqu2KFa+w9in75xR07og45KEZay+3Rjz1Am8u9cnFJMdxBmWM4H28w39XvO+YP6Q7v1S50hMVzvPqzPgk7qA6VwAFc8agSQVU3YPx//yFRJf4FJ+cjyDtz60aCld0T6BjNhfsE45AobX1OcyOICBvI7L0YerRYNFmKpD5dQmv77T9L0sKff0Roh8pyhJCznHJ49NoTqyihN3sFwFYaQOEpVObe7tMFTdwePwu5pam0rrAdbcyLxY+9Kp+E9IBigDX7Sm6hXPSABspqlaWbVOQL9ufLnEZl2bYRb1MtLQ5Om5hyszMmfJFofxwQwKMDxs/8JYm+kPuPA== 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=HWjiwdPhAY0ZoLVfisMEuDBnnE3eaHpyEJBuMJWcltk=; b=E3jgXVFIbnl4tAxVRghdO2rIKExLyZR0WOgSx7iway0BQXXw9bxYAnNHLWKXyKORyo3nTggR6+YOlTR9XRcKihcxdBs5ZBvTcSiM0IzKsI2riN0zeyvadIi5wiAcj7hQIuKyKVGVa9MtCowTW0+c6UgdMfuZH2mTLKrafxOjncI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) by LV8PR12MB9264.namprd12.prod.outlook.com (2603:10b6:408:1e8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.26; Mon, 11 Nov 2024 00:15:23 +0000 Received: from SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055]) by SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055%3]) with mapi id 15.20.8137.027; Mon, 11 Nov 2024 00:15:23 +0000 Message-ID: <4a4c36be-1d76-47b5-9b12-1dd8c281a03c@amd.com> Date: Mon, 11 Nov 2024 00:15:19 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 05/17] net/r8169: add support for hw config To: Howard Wang , dev@dpdk.org Cc: pro_nic_dpdk@realtek.com References: <20241108121123.248797-1-howard_wang@realsil.com.cn> <20241108121123.248797-6-howard_wang@realsil.com.cn> Content-Language: en-US From: Ferruh Yigit In-Reply-To: <20241108121123.248797-6-howard_wang@realsil.com.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0020.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::32) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|LV8PR12MB9264:EE_ X-MS-Office365-Filtering-Correlation-Id: 1316f561-e6bf-42a9-b5d5-08dd01e5ef84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?WmpxRnRvbUd4emFLVHNCY1RBSmIrYlVKWFRQMDZHTGxkN29NNDN1dVphSUZF?= =?utf-8?B?WkNoSVR4WC9iUmQzMnhmTUY5ZERpWC9QQVRRZ25WSkhkcE8zSzQ5YXozd2xK?= =?utf-8?B?S21oL3Y2REhzWE9WVUdlVkpmYzA0MU1QdUdKQjB2TDZqTVB4Wi9xU3M2dGNt?= =?utf-8?B?YjlmS3hPalczWUNpdlM3b3hiSzY4djRIVnJyaTRUR2N4U0JScFJjTWFFMXk1?= =?utf-8?B?eHQxMVloeElBeW02cEQ5MnBXVnV5NlZhUVBYSkFicSt2Mm1MMlZBZThCN2FF?= =?utf-8?B?SGk0TUlOYnRJZ20rdzJISTFPemhLMmxmek5iZSs4MERvRnVjeXVETERzaXl5?= =?utf-8?B?ZXRDSTFKdTUyTWV2Qz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VUJRZWZ3OTBuaC9IQitIVndCcXozaG0wYTUrWEZkS2VxektBYzBw?= =?utf-8?B?YnF1VWxMc3FuajU4OHlhanRNVFRCbU0vWUw3VE5yblhHaG1KcnFwNklncjR0?= =?utf-8?B?RzN2S1pYZFkyNHIvL0xhdmY1UFRlS3Z0VDNoaVdiVUdLcE9XTUZVa2UxVzls?= =?utf-8?B?OVVxM2hXVlV6NDYrbGl6VUQvN1h0Z0ZjT2pEY0F4MTBRSTNnWllkeDRxSnRk?= =?utf-8?B?MzVEajBlS25ZOXN4TnN0TVZkZUpQTXZHMkJjN3Q4N0NBSHI5UnZ1V0RwYmxt?= =?utf-8?B?UmJhR2tWNHFnd2xJT1puOEJlcHhVQjIxZjJzZGYwelFlTTZqcERZdG5aYWpS?= =?utf-8?B?MXA1QjhnbHZxMWlSYzhLRnJHd1l5d005UHBVK1ZpTUdBWnFQd01ldjdwL2wy?= =?utf-8?B?RUswSjA4bUF0bXBlL1pCUUFXdjl2VnhzeDA5QlNaMTQxS1d5b1FzcmVWZ1RW?= =?utf-8?Q?6DZQ+nW/FuK0NYrI0o/qH5EarpiLn+VPevhW/0X?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR12MB8830.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MjdlSG1kYXZVV2J4UGlxRjlnRmlPbDlHeDlZbk9WcU1HYnJYczRIME9XanQv?= =?utf-8?B?bXBwWUZIMFJFRFFrTVhNSElZd0U4eFFpaE8zU0NGYzJzSUdiTGdJK3drZTdC?= =?utf-8?B?SFpXd1RHcklsYXZkVDVQRWhSbFZHWHdXMmZ3Y1pCdGphZ1VSbFlQVmIrSlpw?= =?utf-8?B?UjdFQkhjMSswbUFG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UFva2FJa1YxYkhOeEdvV2NWZU5P?= =?utf-8?B?M1ZsdFVqWWlVNjY0N1lGR0VRMFlIMHM4NEVhVFl1TW9KcFhOTjBZR2x6ZVZt?= =?utf-8?B?ZjVuZHNDMDY4L2JaRGV4c0F1aHEvWDdoRzhvaGJpZG1mUjZmZXZ4NmV1T09R?= =?utf-8?Q?Yp1uHIVNpB9TcCqQEsKM0xp4m?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1316f561-e6bf-42a9-b5d5-08dd01e5ef84 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 00:15:23.6326 (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: xLlMQoxTEoUVt8N7MucCCdufgh0RQnKMDXorPkuDA4qKqw0yiC4DZaB6m9323j4S X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9264 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 11/8/2024 12:11 PM, Howard Wang wrote: > Implement the rtl_hw_config function to configure the hardware. > > Signed-off-by: Howard Wang > <...> > +void > +rtl_nic_reset(struct rtl_hw *hw) > +{ > + int i; > + > + rtl_disable_rx_packet_filter(hw); > + > + rtl_enable_rxdvgate(hw); > + > + rtl_stop_all_request(hw); > + > + rtl_wait_txrx_fifo_empty(hw); > + > + rte_delay_ms(2); > + > + /* Soft reset the chip. */ > + RTL_W8(hw, ChipCmd, CmdReset); > + > + /* Check that the chip has finished the reset. */ > + for (i = 100; i > 0; i--) { > + rte_delay_us(100); > + if ((RTL_R8(hw, ChipCmd) & CmdReset) == 0) > + break; > + } > +} > Can you please make functions static as much as possible? Like above 'rtl_nic_reset()' seems can be static. That is OK keep as it is if functions will be called later in the set.