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 96D00A0C4D; Mon, 4 Oct 2021 18:02:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E37B4137E; Mon, 4 Oct 2021 18:02:38 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 052EB412B6 for ; Mon, 4 Oct 2021 18:02:36 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10127"; a="311692928" X-IronPort-AV: E=Sophos;i="5.85,346,1624345200"; d="scan'208";a="311692928" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 08:48:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,346,1624345200"; d="scan'208";a="544360168" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga004.fm.intel.com with ESMTP; 04 Oct 2021 08:48:10 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 4 Oct 2021 08:48:09 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 4 Oct 2021 08:48:09 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 4 Oct 2021 08:48:09 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 4 Oct 2021 08:48:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LNXy1gAL6LXRBu3cqVjQVNEA4mZBqXijRHsco/m7dWL0KNneyvUI5GxvwVhbTqnWergoMesvwSBqzgpJqLlcZj00ev31QktJ0afmp3ZS+QcSfSjmvHBujTWIGGMoFEU3tW/qlomZppg8QeVC2CXEZALQ1OKFq45CUUjg/NjW4JYbLMiD4d+RK+EjZj94ktmpKs+yii8DOGYQbWmLphBPkEEXABh/y5Jv9/CmefohEcDaEekfv8zNtryv5GifKjFhIHRUPFVG+Klcne6/Q94SFuDzG6tNOsp3vI9zGnQV1MGH0zh8RHpL30vCtY+0HhDPyZCNVwm2mF69iYFoFxA8Vw== 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=x6ZrLdyH20hvjXRipfDwwfmUZf8J/cYUT/1AJqeF69U=; b=OahmBvX7N1d1WGHbqwMHvcjcbQP0RoJsI2CFZH+EDgGQReCeDfu4jti6x+tnYuYCaR4aLMPOBZE+2iPnSU+kHBmGic7uQIfWKrPCIKYJIiviT6cYNkQYdSPdFE/YLp4VmjoLesOJ7DOtQo1Sz8k7zXnnIFiqTDfq8Qm9Eu4J2sYiT6mDNpO9w6UtTCCBPYEwBTE44/032miyzShQQIn6D8edoFMrlaPY5/nuNkEkIiJLuncD3Q6iHYKFw+BlhIvsHLGFCflGuXkNAVBG21/2qVtzjuClEzrU9gmj3Airc0xk5KH43hl5sB6wIl6czFj2ihXLpIrYulWFlTDd+TmoYQ== 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=x6ZrLdyH20hvjXRipfDwwfmUZf8J/cYUT/1AJqeF69U=; b=cqhJqrkA+4pmtx/6oKsOhuZP0g0+oWYRH/w/hn9viE/3EIfXv3M9ZbnWsxWI/gdOUO3Ie8DFVj1SSOF44DCGdEyfNKD8V+p3DyuEptpJJ88cV/+zLLzX2jMyYdeuupSvK8WQCb0Om9HccABk1DUee82GkoIOKXS0KJCYjyxoVNI= Authentication-Results: nfware.com; dkim=none (message not signed) header.d=none;nfware.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5125.namprd11.prod.outlook.com (2603:10b6:510:3e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22; Mon, 4 Oct 2021 15:48:08 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc%4]) with mapi id 15.20.4566.022; Mon, 4 Oct 2021 15:48:08 +0000 To: Elad Nachman CC: Eric Christian , dev , Igor Ryzhov References: <20210924105409.21711-1-eladv6@gmail.com> <3ae193df-292c-4907-df4a-88ce3d6735fc@intel.com> <1a17d552-8b81-04f9-7594-61e84ea7990f@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <8525082f-eb28-92db-11d3-ef4d24144be4@intel.com> Date: Mon, 4 Oct 2021 16:48:02 +0100 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB8P191CA0009.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::19) 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 DB8P191CA0009.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13 via Frontend Transport; Mon, 4 Oct 2021 15:48:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b35b0e1-9230-4792-14f7-08d9874e5ca0 X-MS-TrafficTypeDiagnostic: PH0PR11MB5125: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5f2AEiY6PxaAxkymvUK8agk4p6Dp968L6BT8aU/3qedghASdPzAEZbQMj3omfW6bNtM/lAC0b9fbkOEJLiVZQFpzz01fj3Dug+j5D2Ll85gdfLs09AJPTJTJSbK3oIKhcfpd2R3wMGsqDwAc1IHR1dM1ywCofUPzlKh7LPKuvFyzVlkFt16f59yZw5ai+MMSJlx9TOTS6l4Q8ptdQjfELWb1H1rXwdBHcW79m4NjYlpWzQlhLdZ6wN15mOTMVhJ4Tfyl46jVjzOsOZHK7Pp4fywkNMNmYFJ4AqG8hDKoBCR3f1345KGOH527llOtv37gP5vhOqKfLmCedhCzKpidNCDjatZdNWqiwWeDLyIWz3g8kGghWxSbikmUcUnJsF9mtYyjnL4jBqCJpIRZn1EN5J6OpbgLLqLK6cLLpxKbwgi9E1Zz3KkZvxDIEYSW41qWw6D89C2sSYIE5DmPsK39oLwTHQCoKWFLzuxsA3+s7T9H9BnIkowt0Y5QiXTyLXTYEZ7rgUatN4es3JjXkibuYUilM90c9oixHy/MuOwjgedXNXx4BjYciSY+R9GMitZEWc7FWOTYN+RiGVtvO9hzVWKN+Zfz/he5DfyCz2R65QMlWrX7E2/vCEYx4hsZEWuA9GLeQFXIqDIFtoXyWUHUE6OCEXKYf0CqHi9mXRq1NUUTViIeVHQqR2Fqr69CqxDAlLIFTa6v1YXLx14iTh+/0g== 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:(4636009)(366004)(2616005)(956004)(31686004)(31696002)(6916009)(36756003)(54906003)(16576012)(8936002)(4326008)(8676002)(316002)(5660300002)(2906002)(508600001)(6486002)(44832011)(6666004)(83380400001)(53546011)(66556008)(66476007)(66946007)(186003)(38100700002)(26005)(86362001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b04vcCt5d24yL2htK0E0dzBxYXhyZjlwVDZMTjNLZ3RVaXVrSC9PZWQvQWMx?= =?utf-8?B?N1plSS9QV2phTTJzTGpJcEFvVENDUDk0MkdQL3hGWmsyclBGbEtzNUxZSzY5?= =?utf-8?B?UitIT1Uwbm5scElhbXlFVXRHSzY3a205TmovU0pSWTE0QlIrQWZQak1FU04r?= =?utf-8?B?L0JvVWM5TGxyUkF3eUZ3WCtKSHBkMXo1blJvWU5jTVJ0aUszVThqQnF5OHRN?= =?utf-8?B?dU8ybW5JQWpjWjdRNzhGV25nR2lnRUpBdlcxeEtYa0s5NGJ0MGR3SUl4NEVH?= =?utf-8?B?ZFpkM0FOL2FzaHRBaEplTzFrWmN1VkRXUXdaZ09SU2d6ZjRHcHAvVHNyY2c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SmV0bk1LeTFOWDd6ZmRjbWh1SEhz?= =?utf-8?B?QXZDRTRWZlZKSHF5THJCb2t1TmtmTFVkKzlWampQMU1iSkpHVGxxc0ZOOGsx?= =?utf-8?B?VElSNnd3RmhadDU4MmVVRVM2VlY2cXp1TVBacnFZZEJQY3JJbVRVMGlKOEEy?= =?utf-8?B?VmlFS2lHUi9hd3hUV0lQeHlFOWN1OXJjeHFUMVhKYnhhR0Vnb1FscEQ0elEx?= =?utf-8?B?Ujl4cGFHN2FicitZVUpVK0MwYUhxMnZhQkRKQ3ZOZCtYd2lvTmk2TG9uQWV0?= =?utf-8?B?TGc4b1N4MU11djlVT3hGTVBBTkhibmU5SHZFYVRCc0ZDc1d1MnlqUzZmVmJv?= =?utf-8?B?VDNKeDhyZmxVNi9zdy9PYVVkaWtuSDZPZjM1YnJlU2RrMFF6b1Z6VHlYQWNR?= =?utf-8?B?eUZFQjlBRW1kYUhiR2ZVWExBVFpWaVQ3dEl3Y2dIMmlMcHJwU0RCMitCN1Nj?= =?utf-8?B?QVQvM0RvSkRaVFlOUWVuMDFLYXE2Y1FBMElQcEJyNDBVOG5sRXFuc29CazBT?= =?utf-8?Q?6KNCEdElVZLFpXOS0v9XbgOWlWgl0Ka5UY+LYMP?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5b35b0e1-9230-4792-14f7-08d9874e5ca0 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 15:48:08.1914 (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: 1duAVbOdfeIKcuNgRhCD5ukGGWdi0E6yZqlsWARjWAwhT66QfgBs6cHRtZiszsIaOqQxQdg7DOxLwQ8w9i9N0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5125 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] kni: Fix request overwritten 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 Sender: "dev" On 10/4/2021 3:58 PM, Elad Nachman wrote: > בתאריך יום ב׳, 4 באוק׳ 2021, 17:51, מאת Ferruh Yigit ‏< > ferruh.yigit@intel.com>: > >> On 10/4/2021 3:25 PM, Elad Nachman wrote: >> >> Can you please try to not top post, it will make impossible to follow this >> discussion later from the mail archives. >> >>> 1. Userspace will get an error >> >> So there is nothing special with returning '-EAGAIN', user will only >> observe an >> error. >> Wasn't initial intention to use '-EAGAIN' to try request again? >> > To signal user-space to retry the operation. > Not sure if it will reach to the end user. If user is calling "ifconfig down", it will just fail right, it won't recognize the error type. Unless this is common usage by the Linux network drivers, having this usage in KNI won't help much. I am for handling this in the kernel side if we can. >> >>> 2. Waiting with rtnl locked causes a deadlock; waiting with rtnl unlocked >>> for interface down command causes a crash because of a race condition in >>> the device delete/unregister list in the kernel. >>> >> >> Why waiting with rthnl lock causes a deadlock? As said below we are already >> doing it, why it is different with retry logic? >> > Because it can be interface down request. > (sure you like short answers) Please help me to see why "interface down" is special. Isn't it point of your patch to wait the request execution in the userspace even it is an async request? And yet again, number of retry can be limited. > >> I agree to not wait with rtnl unlocked. >> >>> FYI, >>> >>> Elad. >>> >>> בתאריך יום ב׳, 4 באוק׳ 2021, 17:13, מאת Ferruh Yigit ‏< >>> ferruh.yigit@intel.com>: >>> >>>> On 10/4/2021 2:09 PM, Elad Nachman wrote: >>>>> Hi, >>>>> >>>>> EAGAIN is propogated back to the kernel and to the caller. >>>>> >>>> >>>> So will the user get an error, or it will be handled by the kernel and >>>> retried? >>>> >>>>> We cannot retry from the kni kernel module since we hold the rtnl lock. >>>>> >>>> >>>> Why not? We are already waiting until a command time out, like >>>> 'kni_net_open()' >>>> can retry if 'kni_net_process_request()' returns '-EAGAIN'. And we can >>>> limit the >>>> number of retry for safety. >>>> >>>>> FYI, >>>>> >>>>> Elad >>>>> >>>>> בתאריך יום ב׳, 4 באוק׳ 2021, 16:05, מאת Ferruh Yigit ‏< >>>>> ferruh.yigit@intel.com>: >>>>> >>>>>> On 9/24/2021 11:54 AM, Elad Nachman wrote: >>>>>>> Fix lack of multiple KNI requests handling support by introducing a >>>>>>> request in progress flag which will fail additional requests with >>>>>>> EAGAIN return code if the original request has not been processed >>>>>>> by user-space. >>>>>>> >>>>>>> Bugzilla ID: 809 >>>>>> >>>>>> Hi Eric, >>>>>> >>>>>> Can you please test this patch, if it solves the issue you reported? >>>>>> >>>>>>> >>>>>>> Signed-off-by: Elad Nachman >>>>>>> --- >>>>>>> kernel/linux/kni/kni_net.c | 9 +++++++++ >>>>>>> lib/kni/rte_kni.c | 2 ++ >>>>>>> lib/kni/rte_kni_common.h | 1 + >>>>>>> 3 files changed, 12 insertions(+) >>>>>>> >>>>>> >>>>>> <...> >>>>>> >>>>>>> @@ -123,7 +124,15 @@ kni_net_process_request(struct net_device *dev, >>>>>> struct rte_kni_request *req) >>>>>>> >>>>>>> mutex_lock(&kni->sync_lock); >>>>>>> >>>>>>> + /* Check that existing request has been processed: */ >>>>>>> + cur_req = (struct rte_kni_request *)kni->sync_kva; >>>>>>> + if (cur_req->req_in_progress) { >>>>>>> + ret = -EAGAIN; >>>>>> >>>>>> Overall logic in the KNI looks good to me, this helps to serialize the >>>>>> requests >>>>>> even for async ones. >>>>>> >>>>>> But can you please clarify how it behaves in the kernel side with >>>> '-EAGAIN' >>>>>> return type? Will linux call the ndo again, or will it just fail. >>>>>> >>>>>> If it just fails should we handle the re-try on '-EAGAIN' within the >> kni >>>>>> module? >>>>>> >>>>>> >>>> >>>> >> >> Elad.