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 B2E17A0C47; Tue, 23 Nov 2021 10:40:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7DDDE40040; Tue, 23 Nov 2021 10:40:54 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 8FC7F4003C for ; Tue, 23 Nov 2021 10:40:52 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10176"; a="235226603" X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="235226603" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 01:40:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="739802823" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga005.fm.intel.com with ESMTP; 23 Nov 2021 01:40:51 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 23 Nov 2021 01:40:51 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 23 Nov 2021 01:40:50 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 23 Nov 2021 01:40:50 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 23 Nov 2021 01:40:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NLxpBkpufVMMwfRXOB/lvV+RmTpGU+nYpSVL9yT8mM3YbaCrSLzgEvpT7PSoFMRnkVS2XZYrVPoO14nZgU2b6crT7njnYfgEtlAEoC4+3LLxYkMJ1ttAEcE67bzZIwGS9Cmc8xLYEN0BTU/9CyzIzpK39ScBTc2G2CpID8+C90q6NFTLmLlNFQRvUfpaRN8Izh7+uzOrSh2xQq+V5a/dwPCvublcY9sRjrFA4Kg/CkGQ9vs3SsnRmyA0taud7vFg7CE2Fj/ZSuqv8o8tYBESWYbmSOPFzMpr5VTkWO3amBTCPUqiU8l1n31wW+6E3F2Q4N0aTVEZPwR55oRjGZMlIg== 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=6crCpytXYBWpDY3+nEPeMd/K5V7EPQ4EiBSaW1bJbgo=; b=lDp2J+3a1GYCo74hOuSPs5pAOqb58FVd4JbJ5Hoz20pQ6Pn1aE8GMw26gqCtjzIctX6BRsIlYJmsNBka39/Op0vBWtt6avbWkMfnZK5Tw+7OWraFBtB14551nEkvcx630EryP2bj+7A8ej7/JeYICbXE5LmLvZI+kI/ZXyUpnPmC+8AxgY8XZQ7Q4BeauglmMGyjXfluUWHBm1BlXuuF7kQNXTlL8wJl6GlyNV3ZXG/9MAtIlJ4EOe06E5mPpU2+eOjWz/kS9wZVnm/spuiVyGCIukAZSBAZPcCwLy4wivumjOJd7sOB+TIrjCIV7i9hZgN6ke/5H0F4JZqvDeSGvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6crCpytXYBWpDY3+nEPeMd/K5V7EPQ4EiBSaW1bJbgo=; b=tBiWfi1MjwQVKUombYDiykR2knQH8ZU2hiQ9K80bSFJ1X8ZCdtNv0SUQO82K7ZwaQobtEqgZOBlFAGNhKUSEyhWiREkizNNxWjjPSb9I1Zjqo6JvpKDZ29rLLPHOj+KOr1Eld1NOh9Lwp7Tc+gxTOKkCg2DvZEXMBu8L95NgIMw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5031.namprd11.prod.outlook.com (2603:10b6:510:33::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Tue, 23 Nov 2021 09:40:49 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bc5f:31a7:10ad:443c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bc5f:31a7:10ad:443c%5]) with mapi id 15.20.4690.028; Tue, 23 Nov 2021 09:40:49 +0000 Message-ID: <8f19fa9a-9b72-7e3e-b1fa-eeaa09be0941@intel.com> Date: Tue, 23 Nov 2021 09:40:42 +0000 Content-Language: en-US To: Sahithi Singam CC: "dev@dpdk.org" , "eladv6@gmail.com" , Igor Ryzhov , Thomas Monjalon References: From: Ferruh Yigit Subject: Re: [PATCH] kni: fix kernel deadlock due to async changes X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB6PR07CA0201.eurprd07.prod.outlook.com (2603:10a6:6:42::31) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by DB6PR07CA0201.eurprd07.prod.outlook.com (2603:10a6:6:42::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.18 via Frontend Transport; Tue, 23 Nov 2021 09:40:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87349518-5a09-4955-d925-08d9ae6554e4 X-MS-TrafficTypeDiagnostic: PH0PR11MB5031: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oHHLlrZCOpAPsySOBQex1FKi9n59laT/B4MvLJgJlHJjpBaOrN6X9IlQsG3EtPFuZxeHbQNSocRYR83pHLlel9Kj3doxLotkkGxwSsQeo/DFIX1iqgbEy7ObLqjRWCjM/4jd8PFlnpHbBUlO9yCWPcgZtDY+c7B3jkWAzq/eQYbxlewh+XcUoIJtPQpoGA4ZuY43SOzQGsE+HGWmCY6N+OolFiNSePRmyxRlQzxn+OyNzpf00mh/w9Ru9T1+04zhzLRVlS2CokQRmIYDmL4HZkfQKJu/ShjLqrbngdvFqpadwWM9jQkxHEia2xxUXuf2b/AAtL9Uw6taMhY0YQSf+8skfYi4Qw85ByEP2vpCqwHhT8rWvQaHzcIQG8yJCz5rc7f74H0wz8aWHipEVgkV7N5WrXglpoiLfJCwgTNlher7LraAs/bp8u0d6f6URIKX9ZhTQIi5HWv7Ky0rZapH/p0vk1PqZprI70pUOyiNt0/CrEKKvCSkUmtNknU+3d9M2dQRzx9gfe0+hC+rc+KCwaEfDfuhNbdAjOmlfVGhh/PPoFG6BrqcpdGvPniS3NPI3F2iE/6EC0xdlmAXoSVtyJ9B/7P00/WiAX3QViWaRNljnf5fs43gwnJ//lf/Fro1An2xU4Uo/okjnq1uPYBVQxMc3SNLFDAX7soIacp4ON+wmlOAYfY4YQXWskKQLtFgJEUnJ/fgkHTpeuy4reGpZ9lMfx15a8jV3DIAqRLq5KJXvpO8/tWoY6y787ip2PT2LFZsT5Ua+8UuDVRP+M0Uv28uRbCrEfrgtLF07n4HDlM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(508600001)(8676002)(16576012)(6916009)(38100700002)(966005)(26005)(53546011)(4326008)(316002)(8936002)(54906003)(36756003)(83380400001)(186003)(66476007)(31686004)(2906002)(6486002)(2616005)(82960400001)(5660300002)(44832011)(956004)(31696002)(66556008)(86362001)(66946007)(6666004)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?blRLbXhBYkZucnRiT2R4T1o2bmRTRGZhZHVzRnA0TGxESEhHcXpCSkZMS2xI?= =?utf-8?B?MjFBeVUwTStqR3htaWVQeW0xd3IxdEc5b1UvN0xpMWtkd3dtVExkd0hGUnZ5?= =?utf-8?B?S2hNaUFTdWhPbGJBbnBiWmRCalVROS9ac2ZrOU9iSE5BN09NYnk0a1ZKSThP?= =?utf-8?B?dURFYjk3cVV3dGIxQlhQSzUrUlgrOFFiMTU4YnhnckNMUHFkaXYzNXRodDVs?= =?utf-8?B?U1d5d2hmSWFCNDVuYjQvc0R3SlplSTJleUJldy9TUGxjVEZ1RFRZUGNKSGdV?= =?utf-8?B?M21Bd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DdVRHBOQTNUa3BsY2VKRkVPZ2c3dERI?= =?utf-8?B?MHpjbDdHL05wSlVsd3pIbHJmcTRRRTJuOVBvd0ozWUxjMjVub3l5LzMva0Rl?= =?utf-8?Q?d7HfiqbmajSvo9p/NnEnRpg=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 87349518-5a09-4955-d925-08d9ae6554e4 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2021 09:40:49.0980 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XZVrMmW42RlChr9xJA5dl1pHlP/kK2RXx+vH1I8hUu0i+YqXrJGpe9ZGlahSRvv6EDOPWxsSluejzk5X6DrDbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5031 X-OriginatorOrg: intel.com 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 10/11/2021 7:35 AM, Sahithi Singam wrote: > From: Sahithi Singam > > > Async user request changes resulted in a kernel deadlock when used with linux kernel version>= 5.12. > > Starting from linux kernel version 5.12, a new global semaphore dev_addr_sem was introduced in dev_set_mac_address_user() function that should be acquired and released along with rtnl_lock when a mac address set request was received from userspace. > > When a mac address set request is received on KNI interface, before sending request to userspace, kni code is releasing rtnl_lock without releasing dev_addr_sem semaphore. After receiving a response it is again trying to hold rtnl_lock. These changes were added as part of async user request changes to fix a kernel deadlock with bifurcated devices. > > This code is resulting in deadlock as kni is just releasing rtnl_lock without releasing semaphore while mac address set request on some other deviceĀ  could have acquired rtnl_lock and could be waiting for dev_addr_sem held by the current device. > > As a solution, support async user request changes based on a module parameter. This will limit kernel deadlock issue to users using KNI over bifurcated devices with kernel versions >= 5.12. > > Bugzilla ID: 816 > > Fixes: 631217c76135 ("kni: fix kernel deadlock with bifurcated device") > > Cc: eladv6@gmail.com > > Signed-off-by: Sahithi Singam > > Hi Sahithi, Since the patch is in html format, it is not detected by patchwork and we missed it. Can you please check if this patch different from the one I have sent for same purpose: https://patches.dpdk.org/project/dpdk/patch/20211008235830.127167-1-ferruh.yigit@intel.com/ If they are same, would you be OK to continue with above one?