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 41D89A0C47; Tue, 23 Nov 2021 10:54:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 076F740040; Tue, 23 Nov 2021 10:54:20 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 0BAD54003C; Tue, 23 Nov 2021 10:54:17 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10176"; a="221872560" X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="221872560" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 01:54:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="739806027" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga005.fm.intel.com with ESMTP; 23 Nov 2021 01:54:16 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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:54:16 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX612.amr.corp.intel.com (10.22.229.25) 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:54:15 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx611.amr.corp.intel.com (10.22.229.24) 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:54:15 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.108) by edgegateway.intel.com (134.134.137.103) 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:54:15 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oT6D6XikgztsIcf+l4LV75hIJhXQDEHEJrFBMGurgEOoA/Rf6koI5mOcdpvmQP/pFvwNWfc+TjBhXvSQnZU7xdYjs2rFs0kZnCxaj2lqmCOuPFw3ou1RCzpzw93t4nkurQBFxUCYcB1qYiYvIKr1OTTlEjQ8WHVGZtYzmVqfThHH3ca0cLJV0240zqD+S/EiuYRWdyVaPPaXfGmtlpOrlMjmyf3wVxMkLdsDSfW4ip+3nmUcKo3YzV3pn3Pi75tPkFJA+mkKmBEzL5rXvnilTZowILKzHNGdZKqwQSi1MpisuylgouB1OvPUfwnD+QJ9BBHQbAcsnoXxKSs61fADGQ== 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=I+DImi35NAY3O4+9PVM0Yxg4AOTn4ClyIbLfTKbIeTY=; b=KVPfM5w4GGRgClJQX9ndJGZdS+BTng5rEC20bx5kYWLiIVmITpaxxM58DI23iYI2ubKXc6lkXOYuEa/zTbNz8L++eaPtWE9JA0+6RcSTxIifYU6YiLUu9ZlRz43UMXhkOQVIA7HXHEXbNNexsyzEGiVE25XXlV/p6CazHSrvZXno+ptk2yPX/JwdqPmGEObdgM6XdkIG+QP0EvwG4vO553OcdfVY64hTBpJuZKRIilE3/B2UwhlNxIC+zMX1oM4qSfO78O6iJRnWDOlfFZ4DZwJcJw9Zr2B5nc1G+1A4/QdlyGefyydCtQijLWLzoefvlEBQXZs1exV82HXQCStAeQ== 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=I+DImi35NAY3O4+9PVM0Yxg4AOTn4ClyIbLfTKbIeTY=; b=S4YwAdUjp2VoG4z34AuUoA5sPgIE/Jl9IZ162rehojJQt2fVu+Q7QezXtVa2bPzcT46uKZznJ7Dn8mJREEBX32IBJF+8EsTpEsIkizJV0tbUSVLlurFy5mM9+hwlawJ14Pvd/l3b+bgyq9Brw04HXIR4iBQKkvoZB1pr8FOWXEU= Authentication-Results: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5927.namprd11.prod.outlook.com (2603:10b6:510:14e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Tue, 23 Nov 2021 09:54:08 +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:54:08 +0000 Message-ID: Date: Tue, 23 Nov 2021 09:54:01 +0000 Content-Language: en-US To: Stephen Hemminger , Thomas Monjalon , David Marchand CC: Elad Nachman , , , "Igor Ryzhov" , Eric Christian References: <20211008235830.127167-1-ferruh.yigit@intel.com> <20211008190335.1fdc8f4a@hermes.local> From: Ferruh Yigit Subject: Re: [PATCH] kni: restrict bifurcated device support X-User: ferruhy In-Reply-To: <20211008190335.1fdc8f4a@hermes.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB6PR0601CA0021.eurprd06.prod.outlook.com (2603:10a6:4:7b::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 DB6PR0601CA0021.eurprd06.prod.outlook.com (2603:10a6:4:7b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Tue, 23 Nov 2021 09:54:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01e6b26a-34ac-446d-adff-08d9ae673166 X-MS-TrafficTypeDiagnostic: PH0PR11MB5927: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vx7g4+md3cFeQI1Mh+SfvE84zt8SIiE2ifxrexfoUB/Jzq7OZ6SGQWGACiFcVaA4zzulSCCZmJPvVOS546LXLoMmAPJ6IfD10Gg5tqJOYhZ+chy2qR3tQvA3U/Dipslz42QSXlUozWwO9dsrS7ZKYalHljT8PnZYwB/pcCdBdpA6NZZsdvutvJO8riwocf3ffOWZCFGiSmFR8K4ycDmqnX9lZSvb1riHa6Bf8OC9WzGLdDSAjSxu024IVbdD5f3DgJL3+2DTquMy+RmDWfwIlpmg00jH6PupkkGZrIWxrs+dtPtRhY+tjfxfw1+CHpq0z2tLJhmZD9AltaRfpyJ5TR1gBJE+u3/t/17k5uqmnEIkT/ba/JbPFbq4Waowi5Tcqkfmg+8wkt7dB6e4WaWIl1RDuuNUdNV1ClWjXyNX96Z8DOlJTNv1zvp9PCDyyehCnD89pe6s9aFmWh//yOXUHONo0pT2RYSmRXsLz6I7z5UjwmaPHs3aMdM513gk1kWdcJwxyX3TOdoiulXOAXPW3O9Wj6auefKQfHQfYt9Sg+jOWcg5KKg4iUYh44/xpHHoYXQRy6OTPeVK8xo2Zhnm/nxBQfzKhQwqQz1OpuJ+esUI/4X7EtN2RndRFOApD7XWlTSREF2SBpXxpRKc9e/znNTRITUIeaRkq5iuPK1FtMXGFRqQEU9BTqOpPxfDgalzSMJzIA3em7H0sieqxYaIKbHrjlU2UR4JXPFMvSDrb61Q0VaX/K33tdIFgqMd2Cf+Cc1GwgKxkzDVEI9BoRHPV31+AIXRTLuSVKYGns0Sokw= 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)(38100700002)(956004)(83380400001)(66946007)(16576012)(36756003)(508600001)(31686004)(44832011)(316002)(4326008)(31696002)(86362001)(2616005)(110136005)(82960400001)(54906003)(53546011)(8936002)(66556008)(186003)(66476007)(26005)(6666004)(5660300002)(6486002)(966005)(8676002)(2906002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VUt5VzFzbW53ZTB3azlDcUFiZi84QW52cG1YUCs5UzIzeThOZDBlTzRUTnVa?= =?utf-8?B?N2R4dkJraGFkRGFxMG5acStOWWZIVnRsK251UE5lK1ZCTHpqU1NjS3FIS0du?= =?utf-8?B?SktTWFB2MnlXd1N0dFBsREhwcXNSL3liSHpUdGZoRk5TZjJGS2VQTEkya2Z6?= =?utf-8?B?ZGhkVE5XalhDaFVIZ0FoMzIxcVp5dGpmWVMzY3ByeWZnRzUxaDhnSlhieGpB?= =?utf-8?B?b21KTEg5ekpOTVVqaHlZV0xjcnhRbUNXQ1lscnpnTklMM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bVQwQzVoQ0dVRDJxR01RVldCUzI0YjVST21idHUr?= =?utf-8?B?amtSenNaUkFEaFJVZ3V1VkplTXRrMS8wcUJaeUQ0VXpiMnBCZ3QxNStPb21j?= =?utf-8?Q?Pg4cYEWqZh+ULpe3JjJ1TM4=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 01e6b26a-34ac-446d-adff-08d9ae673166 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:54:08.5702 (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: zCVHw3uj3OvlShcaig7gFL6lhIsnOCsP4XWrzxyX/3dYHXUDhHeVUtbtk3OIt9AHZYeF+ttT1NN22ysIF6N3oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5927 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/9/2021 3:03 AM, Stephen Hemminger wrote: > On Sat, 9 Oct 2021 00:58:30 +0100 > Ferruh Yigit wrote: > >> To enable bifurcated device support, rtnl_lock is released before calling >> userspace callbacks and asynchronous requests are enabled. >> >> But these changes caused more issues, like bug #809, #816. To reduce the >> scope of the problems, the bifurcated device support related changes are >> only enabled when it is requested explicitly with new 'enable_bifurcated' >> module parameter. >> And bifurcated device support is disabled by default. >> >> So the bifurcated device related problems are isolated and they can be >> fixed without impacting all use cases. >> >> Bugzilla ID: 816 >> Fixes: 631217c76135 ("kni: fix kernel deadlock with bifurcated device") >> Cc: stable@dpdk.org >> >> Signed-off-by: Ferruh Yigit > > Calling userspace with semaphore held is still risky and buggy. > There is no guarantee that the userspace DPDK application will be well behaved. > And if it is not, the spinning holding RTNL would break any other network management > functions in the kernel. > Hi Stephen, Because of what you described above, we tried the option that releases the RTNL lock before userspace callback, That caused a deadlock in the ifdown, and we add a workaround for it. But now we are facing with two more issues because of the rtnl lock release, - Bugzilla ID: 816, MAC set cause kernel deadlock - Some requests are overwritten (because of the workaround we put for ifdown) This patch just converts the default behavior to what it was previously. Releasing rtnl lock still supported with the module param, but I think it is not good idea to make it default while it is know that it is buggy. @Thomas, @David, Can it be possible to get this patch for -rc4? Since it has potential to cause a deadlock in kernel as it is. I can send a new version with documentation update. > These are the kind of problems that make me think it there should be a > big "DO NOT USE THIS" onto KNI. Maybe make it print a big nasty message > (see kernel VFIO without IOMMU description) or mark kernel as tainted?? > > See: https://fedoraproject.org/wiki/KernelStagingPolicy > > Something like: > > diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c > index 611719b5ee27..d47fc6133cbe 100644 > --- a/kernel/linux/kni/kni_net.c > +++ b/kernel/linux/kni/kni_net.c > @@ -838,6 +838,14 @@ kni_net_init(struct net_device *dev) > dev->header_ops = &kni_net_header_ops; > dev->ethtool_ops = &kni_net_ethtool_ops; > dev->watchdog_timeo = WD_TIMEOUT; > + > + /* > + * KNI is unsafe since it requires calling userspace to do > + * control operations. And the overall quality according to > + * kernel standards is the same as devices in staging. > + */ > + add_taint(TAINT_CRAP, LOCKDEP_STILL_OK); > + netdev_warn(dev, "Adding kernel taint for KNI because it is not safe\n"); I am for discussing above separate from this patch, since this patch restores the behavior that exist since KNI module exists.