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 0FAC543A3C; Tue, 6 Feb 2024 21:33:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A27F5402E1; Tue, 6 Feb 2024 21:33:30 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2048.outbound.protection.outlook.com [40.107.96.48]) by mails.dpdk.org (Postfix) with ESMTP id 22531402CE for ; Tue, 6 Feb 2024 21:33:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BuaZoZBwXkWXhu+ib78AvnR8W22vJzoNeQAkMgBnpHjgZupyFidFziOR+z0FhPjJ1JtBLgjfCJ/6ETw31TtOKeDaimmsyTsU/PAA0xtB3eYEdmNS+P/rL1X4tuy+q9RLzxXeuwmWZHiwhRa2oL2yuFq9kOqbAgcLRiEP4ME4j0l9xqKaNyCQsvqJ2XSxcpcw/6lnFnyaI72/E4m8bHXMZ+tmUDugzjQX+tW9cB2X439aHe0UIvPrz8aTje3Cib8oxPDXxH/ZRx9gJ8I59YObiQIDjcQGH1nQOdcQl5udyIuHWAeAG9xpJJ6kru7GlwSTWLbtqhRDaPhAXUUq6+tbXw== 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=BnAI/7t0BOt3ow63kBr0/vVI90Hn32vHNdSRT45ZJc0=; b=NilmgGbUlKsDVMK3/xx8CMn51Olx86XxUS/GfuBZF0NPPJZOzsYNoYnjbxpq3+PPl4n1B5TbY2W/u7aCMfgajEP+SqMYLdL9Tf6kdFdV1Gk9VH9CTykvrOORF368znHofTNtEpvgWIslBTp/53r/XVYSk9tS9/lngdWxb/bKM48zZkL2hQU/Z6+sCZtDyxRs6FIga8CTjRRAG4aM08MxmmZVchgh8xJukjroXUdNtIPIoQMUAUyHWOE34ROu6ILr7Rh5HSwizqGCkm1f8FTWXAwFe/A0BZ6XT4/pGQtmnSTuIY8+uiVZhPJo8WUvQIRFV2aAiNk4oTEFiwXrQxGNxA== 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=BnAI/7t0BOt3ow63kBr0/vVI90Hn32vHNdSRT45ZJc0=; b=UL9f/Xscd4AexPmaMEyeYGpzwbBnUtAIvgW9LI1Zs1QUYdX/Q6usovhaY978SW/DemQXzgbSzKda/6aZNqwPoOJ6jf7oLmqvj64414xMJcAeU8OfRk6v/6uRCMFLO7K2aWQVR6RVHzqY+Msm8ZE+QcmnuDTxiHMnSDTSeDLdoiE= 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 SA3PR12MB9131.namprd12.prod.outlook.com (2603:10b6:806:395::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.17; Tue, 6 Feb 2024 20:33:27 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f%4]) with mapi id 15.20.7270.016; Tue, 6 Feb 2024 20:33:27 +0000 Message-ID: <993d5a86-5920-488d-b6a7-a862d028508b@amd.com> Date: Tue, 6 Feb 2024 20:33:23 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ethdev: recommend against using locks in event callbacks Content-Language: en-US To: Kevin Traynor , David Marchand , dev@dpdk.org Cc: Thomas Monjalon , Andrew Rybchenko References: <20240201084319.2687896-1-david.marchand@redhat.com> <8a1a6acf-0e41-40ac-9c27-9265bc5b706f@redhat.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 AQIeAQIXgAIZARYhBEm7aYjps5XGsPHC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83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <8a1a6acf-0e41-40ac-9c27-9265bc5b706f@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0671.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:351::11) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SA3PR12MB9131:EE_ X-MS-Office365-Filtering-Correlation-Id: 364796a0-b7bd-4a47-17b0-08dc2752df90 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JkQNpRSW5FUfcd3KgYgr+3Nk1RdZFicbmarF3B0r9a2CbCTgQHIRg5lCYNV9ssJAtdru5cY52YQJPJF9FHIP0Ph6pirnvVb1QUMRbfeAM9DFKpRy6SWpBtLl+1S4UE2H/9ibyoEZEhSWF1dZ5RYiwLVwYR7S6MU6elqLYc+nJ8QAhASafNeWWJ2B6eMYYjHabjcXb2HNPTArT2dc/SgkFM03Q6IyDsphpsBgoP8qkHmbL2N6T5a55+Sap0u9ErtQ431LLryLMPx9nUtwNP589DVz752IFga+ibnRdf/bsPqSOmoHX883L2KUrirKERXbLEp+Va5kE5E6ATM5QsdaPDQNsPHOPGDnz0x1PT1e8z1m2IjqfD+FHSAPRqqO6I7INmeuwilP5CHNCp7noiixxR6tGAvkU7bfqI4UlS8GdIvI8+YPJ8t4aaS0h8L+KMHjXczl261bbg8Dagl2avThxwXH6sizEl/pivBzKa5LUEuQYtSDz9wzPoV2HcoEy0dTQ/0H2sPaKFw1ZaUPDrDhHU0cDtEsLPH2aP2JQhf5Kf/sSEEcFbjqbAmozZtP0CYEIpd7VkbaJfcS6gal4YGLI69yJIHTHIHZZrKwo8n5r6ZIDz6+mYSrRX0EBIu4PooBkRsZ5DphXn8pLZFghejhQQ== 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)(39860400002)(136003)(346002)(366004)(396003)(376002)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(86362001)(26005)(2616005)(83380400001)(478600001)(5660300002)(38100700002)(6666004)(110136005)(8936002)(4326008)(44832011)(66556008)(66476007)(66946007)(2906002)(6506007)(316002)(8676002)(54906003)(6512007)(31696002)(53546011)(6486002)(36756003)(31686004)(41300700001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MHhTV3AwazdxQU1kU0R1V085RUJKQzI3cDcrSStsVHpJS0NKWUpFVlc5eVp1?= =?utf-8?B?aC8xK2VFWWl2ZkMyUG9SVVlxc0R6SjVLcXB3S0c2b0UvK0FIUXlsd255SnZs?= =?utf-8?B?SHBpYlF3SGRzQWN6dVRzSi82RGYvQTkrTGNDdk4rVVBidHlFeldUdEFUdnEw?= =?utf-8?B?dVZ4SWxTYlRtaHNQZWFTLzdzQk4vL0pWUlB2eGdIb2hIdG5IVWN1dzY1L0JD?= =?utf-8?B?TFo3bC9DaXE2Skw3clE4VEFkeDNsUkVzSi8xcXU3NkV3LytPQnZDNXpmdXdI?= =?utf-8?B?RHRMVlphVXJyUExQZy9LNHVoMkNESkVKMVZWcEY2d2N3ZlJSSlZqT0F3Wmg2?= =?utf-8?B?WkJyUHNSajJCcGlkbUgrN3lDNUlPNk1sbkR2U2ZtM0hta3dpaVpWWnVmZHFK?= =?utf-8?B?dE9KWm5UczJQM1orRU4rL0VPby84alR0VFVqNXoxWUt4UmkxVEtFSHg2bFFn?= =?utf-8?B?em5wc0hqbUwyclFhWFRG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utf-8?B?NUY4WkhnYnA1am4wM2JzOW5qNUEwRTF0ZVU5cWk5ZG5wVHBqZngrTkdEU29z?= =?utf-8?B?djA2enBGeWdVUlZUUUxaWGhQdXRGOFJhYkhIa2hEZEt5L2RkZ1hxYTYwQ1Rr?= =?utf-8?B?K3ZselVScWFvdDl1MGRDYXcwWnlWQzVDOXlsOXdIVFRCbnBuUGVOU0dWanZk?= =?utf-8?B?dXU0a3g2K0QxNDlKbndJUzhiZXo1RnI1SXFwK0lLajU0cjdBbVRWU25wODNq?= =?utf-8?B?YVVBM1FVOVVnK0lJZnZ1VHh6ejFWZjB3Z1FkUFhNa1M2VHRrSVFDR3p6QnZt?= =?utf-8?B?d0hIb0labmUyeFUvTWpGM3V2Z2VNOXVuMzV0a2pUVjhvVzBmYVRSTUlncHlz?= =?utf-8?B?Vm1QVFhLUUF1V1FWQlZSQnNMc3hVTjJ4UGJYYVo4OWZQejd1VjlDQ1JNNFk2?= =?utf-8?B?MVBORGZLbWQ4VlE1cm9yZ3NXZWxXaGVXdm8vUVdUTUM5WjMwRVVtVzNIbkRu?= =?utf-8?B?TmczYzJiMkdOR0xjeVV2TVEzVjVlWXpLMWNCN3RwbmR1VHhFSmZqM1V5L2Zv?= =?utf-8?B?aURpZ1pGTVovSElJTStIb0RpbXp5SDdkV1duWFBFOThmeWZSV2RiNWlVT1Z1?= =?utf-8?B?NWF1cS9wdzQxTzRjTjdWSnV3aklDdHpla2RwdHM4KzZ2MG1pL2duUXprZGpx?= =?utf-8?B?ZlVsMFRaVnVrckUyYkgxeE1RdGVoSDdhNlJXK2JpOG1Qd2hud0NoTDRUKzJw?= =?utf-8?Q?KRS2Adx+ANDI92LVIythK3VKS?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 364796a0-b7bd-4a47-17b0-08dc2752df90 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2024 20:33:27.2607 (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: m8eDuNfbQp2JUDpA+EURS+NOHni1ROXLyoOMz6JCXPwB2Wlj5kxE4cShwGTpjWBe X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9131 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 2/1/2024 10:08 AM, Kevin Traynor wrote: > On 01/02/2024 08:43, David Marchand wrote: >> As described in a recent bugzilla opened against the net/iavf driver, >> a driver may call a event callback from other calls of the ethdev API. >> >> Nothing guarantees in the ethdev API against such behavior. >> >> Add a notice against using locks in those callbacks. >> >> Bugzilla ID: 1337 >> >> Signed-off-by: David Marchand >> --- >> lib/ethdev/rte_ethdev.h | 14 +++++++++++++- >> 1 file changed, 13 insertions(+), 1 deletion(-) >> >> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h >> index 21e3a21903..5c6b104fb4 100644 >> --- a/lib/ethdev/rte_ethdev.h >> +++ b/lib/ethdev/rte_ethdev.h >> @@ -4090,7 +4090,19 @@ enum rte_eth_event_type { >> RTE_ETH_EVENT_MAX /**< max value of this enum */ >> }; >> >> -/** User application callback to be registered for interrupts. */ >> +/** >> + * User application callback to be registered for interrupts. >> + * >> + * Note: there is no guarantee in the DPDK drivers that a callback won't be >> + * called in the middle of other parts of the ethdev API. For example, >> + * imagine that thread A calls rte_eth_dev_start() and as part of this >> + * call, a RTE_ETH_EVENT_INTR_RESET event gets generated and the >> + * associated callback is ran on thread A. In that example, if the >> + * application protects its internal data using locks before calling >> + * rte_eth_dev_start(), and the callback takes a same lock, a deadlock >> + * occurs. Because of this, it is highly recommended NOT to take locks in >> + * those callbacks. >> + */ > > That is a good practical recommendation for an application developer. > > I wonder if it should taken further so that the API formally states the > callback MUST be non-blocking? > Application still can manage the locks in a safe way, but needs to be aware of above condition and possible deadlock. I think above note is sufficient instead of forbidding locks in callbacks completely.