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 0D83FA0C4D; Mon, 4 Oct 2021 16:51:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB693410D7; Mon, 4 Oct 2021 16:51:23 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 9B7EA40E3C for ; Mon, 4 Oct 2021 16:51:22 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="225776101" X-IronPort-AV: E=Sophos;i="5.85,346,1624345200"; d="scan'208";a="225776101" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 07:51:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,346,1624345200"; d="scan'208";a="523343723" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga008.fm.intel.com with ESMTP; 04 Oct 2021 07:51:21 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx605.amr.corp.intel.com (10.18.126.85) 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 07:51:21 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) 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 07:51:21 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) 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 07:51:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RE9wAEJ91lkQhCI+kgZ4Amh/dZgexLW8nvGJ3nO/IKgjpDPoyx+w2WIASL7bEcHFpbsXKlFFw1svo7mlpc8hFacQCsTq3SyJ62MpKXINmhV6jyt2UqIdvxoVi6tXB6dQMO7a0rclU3Ey9Wy98jn2YIH2EnDSvh/n0N5ejLCkjY8jYzI+K1toIcZE9eNyLWJGc/LjoshM7NgkasYzRU2ItDnEhXLtq/aG9V06jKL1nluWmnIHloQxzOGnODR23c6s+QlI1ZLbwGNTaaAjo+i7ycK0/4/QYBOPx7utMul0CDNe4Gv1En6H9xtaMARuFghQsqiQB0P9Eq//T63KvAJ4ew== 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=y8WRPqWKBHXd51roKmX/QusRCG2HXhZ8QiYr7itOhs8=; b=nTEJiS65nA+EHWpCQ9IexDGuuI3GiUftR/pIPEav04ZXSiwXhC0XYuouCkgon3imEbj2+dodyqVIa0rNXCfb30SuOV3CJsklMgBy8MavzwMp4yndhteHJLRTDPIFjvRcujOrcjN9B8jmORimgcNDElVG8MW1evhYI7WCOdHK3PM8bJAodBP/ipmGXACZwwriMAYirOwLCFnGCuyf8q/mL9fTAGk1LAbpWlaFG+m/FCqRhRcXyWbg8xCoHxMC7V9u4k+TEwtFTBdm6dvvINZ7pmFs/UjoYZ8arES7Pab6AOJSf4HutNRmLCTgDeiuWfaNT25utuY7XgMbM4OW1M2dYw== 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=y8WRPqWKBHXd51roKmX/QusRCG2HXhZ8QiYr7itOhs8=; b=tutYGiO0bC+35xtnHkSET75eTWcuQEUyQe5Min1gHomKI6abIjaz0vEMD7NY29PmGvRnq7ohDihU2ugNXlG5rYRrBGdSo9YYDZNYxZR0yj+4dZ/IpCzaYvf0w4nJ0fBYkFvV5c2bq0WkOz0c+WloV7pQ1vdRHHyyz2xN679ALe0= 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 PH0PR11MB4983.namprd11.prod.outlook.com (2603:10b6:510:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19; Mon, 4 Oct 2021 14:51:19 +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 14:51:19 +0000 To: Elad Nachman CC: Eric Christian , dev , Igor Ryzhov References: <20210924105409.21711-1-eladv6@gmail.com> <3ae193df-292c-4907-df4a-88ce3d6735fc@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <1a17d552-8b81-04f9-7594-61e84ea7990f@intel.com> Date: Mon, 4 Oct 2021 15:51:13 +0100 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DU2PR04CA0324.eurprd04.prod.outlook.com (2603:10a6:10:2b5::29) 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 DU2PR04CA0324.eurprd04.prod.outlook.com (2603:10a6:10:2b5::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 14:51:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76aa4e87-3909-4810-4bf6-08d987466cf8 X-MS-TrafficTypeDiagnostic: PH0PR11MB4983: 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: pifbBySoHASZ2XC03AUqH/TYhACcwsYXq0HloCiDZzboF7yPYrZfjUY04fe8iIwWtwWQygpkhHkN+Je7tvHPtj4sasgHulD5FCY5/l0V9K+nro8eZ5b7hCet7WYFqPt/IkpfVCK8QDXyFeXdh2pBTF/YuUtz7V4p/F3G7VghzOpIqPLrcC9PsaxufWlhRwXCqaCGJ4+wep/0H2JomNjrDmgsr/0+i9pyKOlcblcQrfbITpG/z03U8pz6WCDAabAHkSPnMtWy1Py7lrkAq5DAJnCyEZAHzFT+0gqQ5HQTqkUz6F92fsv/LQrqftxIoAMFxCqf90ZJHAeMjshmiOze+KJ0qjxrOFK5fpCKR+KR9T/a3+9BWDl9Z8GNt7S+Sw2JbEgqpfzE0Y8hUfkUlx6+gknUhSCOmWU+t2Q8iXPP9kQeghmwETy4vCM9do/3L6X4E57kM96DTCsQyorTnu/l0Ql+/EM/t3p2Incn8daYgGInXczUZonpZ7fik5a3Z4VCSCdbRpLkPSJc4bkBSoJplhRAfDSYBGz/tTBZ4P6zINfcEbsTL1QFECZ40rpDB5Nw9tWeddNV+wDS7sdKHF+iI5TzyNQAC4+maVmuO/3EL/hGCE0pJgNNpuwCnRZCdyAN8xGl8ndwbatTIYDBGYSqrKpjtHOzfwisB8+Y7nbQCeJWAiW0avBtkha8R1eURDG3cuMKp1S2QQXyDm5wKYPBSw== 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)(26005)(38100700002)(44832011)(31696002)(4326008)(36756003)(316002)(16576012)(86362001)(2906002)(2616005)(956004)(6486002)(54906003)(186003)(508600001)(5660300002)(31686004)(53546011)(66476007)(8936002)(8676002)(83380400001)(66946007)(6666004)(66556008)(6916009)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NU8xVmZrQy90am1iU3Zqek4wbUZOaGgvWFFVUWMxY3RQMHB4U3JBUVVGZjk4?= =?utf-8?B?Uk9aUmU2eEkzY29IZUFHMEw1b1g4OVlnNC96SlBodXVLazdvNmk5L0V3M0lk?= =?utf-8?B?THR0MEJSRFNybzNPcm1QRUVRQXFHTll0eXJycnZRTkUxNzc5MHpCRkZuTEZq?= =?utf-8?B?WlMyN2wwV0k4UjZjU05jL3BsTEZwRUhYLy9POUZPOVdmZlhiWWIxcVRuektS?= =?utf-8?B?Tlp1SG4rREViamVreDJ2eDBzc2tsUWdXR0JUdGsvNWR4TkpYdGdMalM3ckp0?= =?utf-8?B?bDVXbklmekkrSlRsWWhvMWpDRjNCVkVIby9sRDBYQlFVcGRWb0lhbU44THlG?= =?utf-8?B?bnowUGlnTm5vTnduNHdwVWErVTcvU3pkdGQ2WklZdkxiaHNaRGNFMDJnNk9E?= =?utf-8?B?M0hMc3hLOUFPVzJZYlZySkZqdjNuRjFJUFpuQ0RmbnptUkQ1TVA4R2tIdkFu?= =?utf-8?B?VFh6TkpLNmtqeVpjWGJHTnBpTE13SnViaVZWWlZVVmU4bUpBWG56Zlp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0xvVTF6RUZUeFd2?= =?utf-8?B?bmlMd0tIMHRLSmt4MjZVT1I3Q25TMUtvQUhRY1RucE1RVUwycDJUbGVmUlhS?= =?utf-8?B?OWIyWWlUSEtIb0ZsRzRVcG95VC9TMUVDTWNXcjVVaEYvbEJVcFZFTkFjaHZv?= =?utf-8?B?Qm03S3QzNlpsa2N4Z1hIdnEzZVpTTHAydWtRT2ZMNUg4S1d0QWNzNHArZUJ2?= =?utf-8?B?R0M1WGgzbkkvejZnK3ViSGJsTFN6TGhyamc3N0w2UkJYSDViZjZaUFg1NmQx?= =?utf-8?B?akhYUG9aR2xoSVhkZWZBeXBCckpOejRzRmlTRlZyRkpGVVh1ZUxJbGpoZFJa?= =?utf-8?Q?0o3pkQ9pCgs1lcmNKS46RF89m/Kl+PsVrQhgxdM?= X-MS-Exchange-CrossTenant-Network-Message-Id: 76aa4e87-3909-4810-4bf6-08d987466cf8 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 14:51:19.6612 (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: cf2OwSJZTMXkSIwDLKCekZ7sb+CvTL17llrYS/M0XxoOBMW5RoHttoj8btUjhgX4IVtDCRHp25+byKob9+KxOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4983 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: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? > 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? 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? >>>> >>>> >> >>