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 45AFCA0547; Tue, 19 Oct 2021 18:39:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF3EC40683; Tue, 19 Oct 2021 18:39:12 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 82B824003E for ; Tue, 19 Oct 2021 18:39:10 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10142"; a="289415811" X-IronPort-AV: E=Sophos;i="5.87,164,1631602800"; d="scan'208";a="289415811" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2021 09:39:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,164,1631602800"; d="scan'208";a="443963670" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga006.jf.intel.com with ESMTP; 19 Oct 2021 09:39:08 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 19 Oct 2021 09:39:08 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 19 Oct 2021 09:39:08 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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 via Frontend Transport; Tue, 19 Oct 2021 09:39:08 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 19 Oct 2021 09:39:07 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jeTkQMGzBHuyRA55HwQRDatktWaMiAVInXPJWIX5d3+M1neIf5VnCbfT6cGvqroS3qAQam8FBFtimZQRAOpxt+PeKUNk6L5kTOX27Pw090OVHLmmWPGstn1h8IvZsgIN3oO+1Tu4/znKuJJCUtIY4ZzcKOeR0ZlQH1rWYh6OIdjN/ZFgx9p8uMrNw6/b8jBPqCG9/6efU/H7zYTOidWGvQ68mR0Ptvvfk4xoT1D9GuW1YWGc4qDHulh0P9njefJkaDmcVjN9444X2J4qr0HbhsAJKVPtDeRRHRcDDq36UEpM41qFX4naV+PtyMZEFO720LmmVgkEt8Xu8VLr3WJJVw== 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=0XHbf6sd9cTsZTgKX/wM0Rfd2s/Z0R5Sw0I6QSGNFbY=; b=CVBqyWnP+GBqMa+ajB7lbbaBgR1gbHxqAoFfZO2ip+Ou/RVKHE3D3SEIFEAGOt1AhmwELH7HmiQUzhE0mSIAxwUnqkC56rAPFj/tOBbJ2xX8CnMmhCGpcH5Y6MkiCcqpXfBRBWj8T9aZlugk2w9Q1VllBoP1ZdntbFeSIPa4jE8DJUcMxG1NkUffaP8buD1gv6g/7acmbjYWQcG3PG9XYSvSC4VsjHv4N3hvLJJksgqaPljz0lcO1AWZRDi6YQe2jxziI1H2ZKkM817dnzHZVc31N5WKcSO6qokc3xBkxOmpx3E3O/x7SXNHDA/vTr9TCsnBfZl9rX/2leuoUXqE2A== 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=0XHbf6sd9cTsZTgKX/wM0Rfd2s/Z0R5Sw0I6QSGNFbY=; b=ZjCFuo/2b74fkjbKgbsFVrzDdj3XmOdS2+0qQXr+6/qhhGv1BNKrv6tGCLjOJBl2JHdhCD+jnVaJNtNq4HET1I8elRZruSf+ztEXq/PvP28W+UaOcEVrR6DOz+/4kI+UFpaAoL85NqxC37DgulQgb7ubX2qlIyTXU3xvricMJd8= Authentication-Results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4981.namprd11.prod.outlook.com (2603:10b6:510:39::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Tue, 19 Oct 2021 16:39:05 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%5]) with mapi id 15.20.4608.018; Tue, 19 Oct 2021 16:39:05 +0000 Message-ID: Date: Tue, 19 Oct 2021 17:38:59 +0100 Content-Language: en-US To: Dmitry Kozlyuk , , Qi Zhang CC: Ori Kam , Thomas Monjalon , "Andrew Rybchenko" References: <20211015161822.3099818-1-dkozlyuk@nvidia.com> <20211019123722.3414694-1-dkozlyuk@nvidia.com> <20211019123722.3414694-2-dkozlyuk@nvidia.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211019123722.3414694-2-dkozlyuk@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0170.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::14) 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 LO2P265CA0170.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Tue, 19 Oct 2021 16:39:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 336b0810-96f1-4279-faa1-08d9931ef6dc X-MS-TrafficTypeDiagnostic: PH0PR11MB4981: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True 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: DPPciav6G/mHV0I+og9pAbimE5rWfPPQquiyyeqRZ3fixqn7FP+gQwTHmxdr1xbqlGUG8cYzi+wUwJCMsCaySBCXx9pUc3ixiDzMsuNLhzBZxYW3sAb6RQj8mZW0sOmm4bojVhdHs2TmcKB+JEwEP1wJXpuBRz20juZYvEFhVL3MNSEWj4wWck3+L/JSPfOzDyZTioYdfC/JFKDyuUo5xESTAH2OmYkFQBFVkkEDPa4NKTh8mdemw3hDzwXbxTEDLa5TP+Xmt3gg2xe0MHIg7jO9EhtKaz513t+tsl4bydV+4Y2vd+O+iCSPvorhkztmzzxUHpCxrC7OAgrFR9Kz96O/i4N6zXqJHceiguEcOKHcT0FvrvNGIb60t+J62TQixki8hyxC0JNNex2+D90Ho8rGOkw56na7MvS4P7G3tteDeCjkG/MdqW+8afxXFq50N5esK1Mkeh5oB9JgcS9koTX1PyAwYIVmqq95zYlbj3BvSD1uoL5IfHBEDHCFuyUm+RGsiR7ISkvGdpMmG6Wiy0ZVqBgu7m08LdVhD0EQ1l+VPMwVvZkwvaI7n7NF+hoSNR+tOgWabqX4Xp9FFMtkfrRY6FsyFb5Sq6NVAjoQ6mf4IEL0aOHZlpgrQhnNiuzd3rcioZSP6DBuU0ADkoOTR/ra2GnGVegyame/mN8iq6qYyIQMX5m0nWR9/IXqQkbJbQU8/CLvSgiFHK719yhMgg== 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)(6666004)(38100700002)(508600001)(8676002)(4326008)(66556008)(66946007)(8936002)(2906002)(31686004)(5660300002)(186003)(316002)(66476007)(53546011)(6486002)(26005)(6636002)(86362001)(82960400001)(36756003)(2616005)(44832011)(16576012)(110136005)(54906003)(956004)(31696002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dnpzTVhnMU1XNFZ2TTJZZURZYjkrZ0lLYkk2Z3pJZC9idXZJM0hEOTE5RDFu?= =?utf-8?B?VjIvNEhEcjlBbm9aLy9nakpXQTRpNjB6NG1aYkRKNDYreEkyMkNSd3JpMVNn?= =?utf-8?B?ZUo2M1BpbTBYMzZISENvRnU4REx0ZTVlNVdEMkdFVHhEUlJ0TG1pMEdyd3Zi?= =?utf-8?B?VnpYQnJ1YmJ0OERKSFBBL3NFTXU4bjJ1UkFaaU04K1o3M1J2WHFoTDhXU2c5?= =?utf-8?B?WDJ6U0FKN1A3UFUwRUV3Zkhh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B?Y0JqNkx1ME9TdHpTM1dEd0g3TnBHbVJKOGtCN0laQmpxOHl0RjdzU1FTeWo1?= =?utf-8?B?bzVESm5WRy9POXZOelkyT3AyNGxPNjNUSlU3VktoM2s5eVJ3UXk2VHdNODZY?= =?utf-8?B?bjdsSmlHMitodHE2UjBXZmU4RHk0U0hvMEM2S0xNemc5amdnYVhqcExpR2NF?= =?utf-8?B?eVNDb1dmY0YrVlhJS3JHM1Vyd2V5Ynh4YUhKUE9CTXJGYTBzTVZQb3pNUXgv?= =?utf-8?B?VDkyQ2NBK3NFS0dOYmMxamY4NXBhcU1QeGJSV2RsUjlOaVI3bVF2TkhhUEdq?= =?utf-8?B?K1orV2NRVk52NzFQRWNDS0VQZnpwSUMxbFVPdXdZQjJsZVBtaWhKbDdxaCtk?= =?utf-8?B?UzRqaGNRMGRMaHMrSXhtOEVJN0NmdTAzWUxUcjU4a09ySE9KbXlDREJpUWI0?= =?utf-8?B?eEdZOHd3Qlg0eVF0RWl2MHh5OWwrT0Q0RnVVaG02Z0h3RkkwNWhVYmNqTThS?= =?utf-8?B?Q1BPZEp5dTkwRThZRFBSNk5wUVJRaGw5OGdiZUdmdzlqWFM1b3pLMTAvTG1D?= =?utf-8?B?ejBZV0tYeVNlbGRwT2kvWTZQaTFBYkNMQnIxWEtGRktXMzd0M1J5cDhIUUsw?= =?utf-8?Q?QEjtOhWNmbAgM+LXvLi8dNEYwGYCEn8GRHjrt9G?= X-MS-Exchange-CrossTenant-Network-Message-Id: 336b0810-96f1-4279-faa1-08d9931ef6dc X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2021 16:39:05.1865 (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: 7r9Km64+sZ7AZYpqS/XZ3Lyb3xYOEKMoSl70Q4ByiwonDVvQSGBgMAIh4nSTvXNXxydmgbyAaEQ9bDFUMHg/Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4981 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 1/6] ethdev: add capability to keep flow rules on restart 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/19/2021 1:37 PM, Dmitry Kozlyuk wrote: > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst > index 2b42d5ec8c..ff67b211e3 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -87,6 +87,31 @@ To avoid resource leaks on the PMD side, handles must be explicitly > destroyed by the application before releasing associated resources such as > queues and ports. > > +If ``RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP`` is not advertised, > +rules cannot be created until the device is started for the first time > +and cannot be kept when the device is stopped. So flag means two things: 1) rules cannot be created until the device is started for the first time 2) rules cannot be kept when the device is stopped Can't be a case one is true but other is not? I was thinking flag is only for (2). > +However, PMD also does not flush them automatically on stop, > +so the application must call ``rte_flow_flush()`` or ``rte_flow_destroy()`` > +before stopping the device to ensure no rules remain. > + > +If ``RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP`` is advertised, this means > +the PMD can keep at least some rules across the device stop and start. > +However, ``rte_eth_dev_configure()`` may fail if any rules remain, > +so the application must flush them before attempting a reconfiguration. If there are any remaining rules, should we fail the ``rte_eth_dev_configure()``, or is it allowed PMD to flush the rules itself? As far as I know some Intel PMDs flush remaining rules in configure itself without failing, @Qi can correct me if I am wrong. > +Keeping may be unsupported for some types of rule items and actions, > +as well as depending on the value of flow attributes transfer bit. > +A combination of an item or action type and a value of the transfer bit > +is called a rule feature. > +To test if rules with a particular feature are kept, the application must try > +to create a valid rule using this feature when the device is stopped > +(after it has been configured or started previously). > +If it fails with an error of type ``RTE_FLOW_ERROR_TYPE_STATE``, > +rules using this feature are flushed when the device is stopped. > +If it suceeds, such rules will be kept when the device is stopped, > +provided they do not use other features that are not supported. > +Rules that are created when the device is stopped, including the rules > +created for the test, will be kept after the device is started. > + I understand the intention, but I don't know if this is true for all devices. Can't there be a case that driver can't create rule when it is stopped, but it can keep the rules after stop. Or other-way around, driver can create rule when it is stopped, but can't keep rule after stop. I am feeling we are missing comments from different vendors if this logic works for them.