From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81A15C433F5 for ; Tue, 2 Nov 2021 13:54:36 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 0744460F5A for ; Tue, 2 Nov 2021 13:54:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0744460F5A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0FE194114D; Tue, 2 Nov 2021 14:54:35 +0100 (CET) Received: from AZHDRRW-EX01.nvidia.com (azhdrrw-ex01.nvidia.com [20.51.104.162]) by mails.dpdk.org (Postfix) with ESMTP id 486FB4114A for ; Tue, 2 Nov 2021 14:54:33 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) by mxs.oss.nvidia.com (10.13.234.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Tue, 2 Nov 2021 06:54:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gzgtouaJlkaL5pk+QNyxm3I35RBiiS/2lSQm+pnc3+JR6IBuJsjafLc6X/mOtDdx3C6qj179AAtFtJDLaz9p5DjpJLE04oGs44J0ZfxxWuH1sf9+OjG1Yie8SI2IQoTG4h1eyhG2OXFr4ds/RoWGJFeTF25nSJJmad2IpJJPIZ5lWZwGidTu0F5Pzlte3qY279jIp0BYhrdw6ZIV7IcvpJ0xg+6o64tOTW5JKkKb6Uy0a+QhAVOVBR/P89y/ydH5gApteay743ZeYWrxwNbcb3KrfM2EHJ2vOVZbKA8bpd6aoxnS1/C2tsms+2pwgunciIRtZeUfxtyhrIPsbkDS1w== 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=RG6fQMMjY92nDUqVgDJogSEqoG1MSxY7PvX6fu65ygs=; b=iPXSZZ5AoSW2AfaBFFeRuchF6+3cnFLRta/XsR4z46gXD8RFi1dLrsSOmzffY6QY2jEtawzzHQuvUyLY9wDCMu5rgaTb6NExxfH/PMGhYCd42StqTAucGOzhUUrSL9q5N7ti1BLGd4dq2jYVsLx+RG3uEBTs6qL17l3En42IzkORGcIDHAY87+LUt3tjOlJX3HfO6wcwL5JYtWw5La0A1io7NJoJ4/zzE7tCnCaCl0tV1s8BRhD2idq1gCPDx4OSM7bIHraWjg2rIs5KRtlF8P3hDmgJd8w3q1Obb5kdsCZDKws24ODsLIjb/8lxu2l7XKCTtVOour/GXYdsxJ/16A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RG6fQMMjY92nDUqVgDJogSEqoG1MSxY7PvX6fu65ygs=; b=RBsk7liJVdKMGeqgWTFs+du4Q9KeoBc59EWsMm4KnuLp7+GPFWzTjlZbHduPCpUhQUf4LVfr8l7himqRsm/osD1tLKKQW22wOVWAPnVKsVJZLGPMiCEKafCfFUoC9fpSoW0aBOAwjXEVUwBQdgI5KHeddNwnVo9GEDU8AEpjOCx9Ui3ooB0p716od8/3CWdV2FxHqG96yc+006h3zN8Sh/5KfBfYeNIsHZENAgHrrPyA6I8rMdWrFwHjR1HcwSlUUemLTL2OOgwd2XdmPAuC9VTsClNMp2iwfIs3E1eLSzZMUNsfuSj1xqFR/UqmSGBIM6C0c+bkyj5heRCU5p2rPg== Received: from MWHPR17CA0085.namprd17.prod.outlook.com (2603:10b6:300:c2::23) by MWHPR12MB1631.namprd12.prod.outlook.com (2603:10b6:301:f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.18; Tue, 2 Nov 2021 13:54:31 +0000 Received: from CO1NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:300:c2:cafe::2) by MWHPR17CA0085.outlook.office365.com (2603:10b6:300:c2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Tue, 2 Nov 2021 13:54:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT031.mail.protection.outlook.com (10.13.174.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4649.14 via Frontend Transport; Tue, 2 Nov 2021 13:54:31 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 2 Nov 2021 13:54:27 +0000 From: Dmitry Kozlyuk To: Date: Tue, 2 Nov 2021 15:54:09 +0200 Message-ID: <20211102135415.944050-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211021063503.3632732-1-dkozlyuk@nvidia.com> References: <20211021063503.3632732-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 44265cea-758a-4b02-27be-08d99e084b7f X-MS-TrafficTypeDiagnostic: MWHPR12MB1631: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t1k8CBjdD4vqszb7bGaiCzthi68KOlD7u2FfPYsTxPojfleS5NF3Gql8QJ8YaxYq8PlRL4sPj29pe0wtFqSsvZa2fzaxUg0K0nD5rqb9Gz0dUV27dEzYHEX6bHTVNFog/iRVTD1u/+Qg1g166lol7ngOsnbWhdtme7HrjEF/g6tWSMVPiI9VJJ5v5JyIHEtFZpmQf0dLsvYJIWQhxZKljCKptbkV7Abdnfiu8I+qLHHDXM0uFrWd7osGG79uA4w6Agr8G+CBkOU3/DGr1T0RNp0i0NRUnbHNQV4/B6U44LrHAXR6EblXBKxb7kuUT9TNNAhGtlTD2UzXGlTc6xkEvLh4mZedddzuh3mVTEwlZ/MO56KLM/YtQ5vz8VsGb/t/DTRNWGL2WVx5RFziMw24SH75oexzV5JNZZsdhWi6Iy7pS1aOKSYHU98SbWzvBef2AI+DztT632PIMw2poCZ5QTOJU/dSJWLP23ONEFeZgb0/npwKADbAc9tWcERI7mc5F/xq8iCF5Mx0QWhnLK10ur7j4MYXRdo4ygfvyfasPC0kAls9iJZwlNgKnW93LmnHeQCb6eZqxfKS3KqYgBbhPB/yU35KWWEz7Pxx8f0zWj4gMmGtCPXFF6w7b1s+uFWGYUxuZmTtNmumuWvNoLQXQ7AoWXHqvmhqYewdk3xOCmzhgUnLFqYSffQOribRVkxtOmIPrW3ecdvligylGlf113v4rA4o1Zk+UDThaXZIUASJkRoTTFmY9xVQoQhtgqhnNQaXkCB3SohklK4fdYNcycRTfGATiZuBFo6t2nZ6E2uDyQhM8wr6z3D61pCzOyO3z4Gct5ai6C4UxwnToO6WDw== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(55016002)(316002)(6286002)(83380400001)(36906005)(356005)(86362001)(26005)(47076005)(2906002)(7636003)(7696005)(6916009)(6666004)(82310400003)(966005)(36860700001)(186003)(336012)(5660300002)(426003)(1076003)(2616005)(8936002)(8676002)(36756003)(70206006)(70586007)(16526019)(508600001); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2021 13:54:31.2067 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 44265cea-758a-4b02-27be-08d99e084b7f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1631 Subject: [dpdk-dev] [PATCH v5 0/6] Flow entites behavior on port 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" It is unspecified whether flow rules and indirect actions are kept when a port is stopped, possibly reconfigured, and started again. Vendors approach the topic differently, e.g. mlx5 and i40e PMD disagree in whether flow rules can be kept, and mlx5 PMD would keep indirect actions. In the end, applications are greatly affected by whatever contract there is and need to know it. Applications may wish to restart the port to reconfigure it, e.g. switch offloads or even modify queues. Keeping rte_flow entities enables application improvements: 1. Since keeping the rules across restart comes with the ability to create rules before the device is started. This allows to have all the rules created at the moment of start, so that there is no time frame when traffic is coming already, but the rules are not yet created (restored). 2. When a rule or an indirect action has some associated state, such as a counter, application saves the need to keep additional state in order to cope with information loss if such an entity would be destroyed. It is proposed to advertise capabilities of keeping flow rules and indirect actions (as a special case of shared object) using a combination of ethdev info and rte_flow calls. Then a bug is fixed in mlx5 PMD that prevented indirect RSS action from being kept, and the driver starts advertising the new capability. Prior discussions: 1) http://inbox.dpdk.org/dev/20210727073121.895620-1-dkozlyuk@nvidia.com/ 2) http://inbox.dpdk.org/dev/20210901085516.3647814-1-dkozlyuk@nvidia.com/ v5: 1. Fix rebase conflicts. 2. Add warnings about experimental status (Andrew). v4: 1. Fix rebase conflicts (CI). 2. State rule behavior when a port is not started or stopped (Ori). 3. Improve wording on rule features, add examples (Andrew). 4. State that rules/actions that cannot be kept while other can be must be destroyed by the application (Andrew/Ori). 5. Add rationale to the cover letter (Andrew). Dmitry Kozlyuk (6): ethdev: add capability to keep flow rules on restart ethdev: add capability to keep shared objects on restart net: advertise no support for keeping flow rules net/mlx5: discover max flow priority using DevX net/mlx5: create drop queue using DevX net/mlx5: preserve indirect actions on restart doc/guides/prog_guide/rte_flow.rst | 67 ++++++ drivers/net/bnxt/bnxt_ethdev.c | 1 + drivers/net/bnxt/bnxt_reps.c | 1 + drivers/net/cnxk/cnxk_ethdev_ops.c | 1 + drivers/net/cxgbe/cxgbe_ethdev.c | 2 + drivers/net/dpaa2/dpaa2_ethdev.c | 1 + drivers/net/e1000/em_ethdev.c | 2 + drivers/net/e1000/igb_ethdev.c | 1 + drivers/net/enic/enic_ethdev.c | 1 + drivers/net/failsafe/failsafe_ops.c | 1 + drivers/net/hinic/hinic_pmd_ethdev.c | 2 + drivers/net/hns3/hns3_ethdev.c | 1 + drivers/net/hns3/hns3_ethdev_vf.c | 1 + drivers/net/i40e/i40e_ethdev.c | 1 + drivers/net/i40e/i40e_vf_representor.c | 2 + drivers/net/iavf/iavf_ethdev.c | 1 + drivers/net/ice/ice_dcf_ethdev.c | 1 + drivers/net/igc/igc_ethdev.c | 1 + drivers/net/ipn3ke/ipn3ke_representor.c | 1 + drivers/net/mlx5/linux/mlx5_os.c | 5 - drivers/net/mlx5/mlx5_devx.c | 211 ++++++++++++++--- drivers/net/mlx5/mlx5_ethdev.c | 1 + drivers/net/mlx5/mlx5_flow.c | 292 ++++++++++++++++++++++-- drivers/net/mlx5/mlx5_flow.h | 6 + drivers/net/mlx5/mlx5_flow_dv.c | 103 +++++++++ drivers/net/mlx5/mlx5_flow_verbs.c | 74 +----- drivers/net/mlx5/mlx5_rx.h | 4 + drivers/net/mlx5/mlx5_rxq.c | 99 +++++++- drivers/net/mlx5/mlx5_trigger.c | 10 + drivers/net/mvpp2/mrvl_ethdev.c | 2 + drivers/net/octeontx2/otx2_ethdev_ops.c | 1 + drivers/net/qede/qede_ethdev.c | 1 + drivers/net/sfc/sfc_ethdev.c | 1 + drivers/net/softnic/rte_eth_softnic.c | 1 + drivers/net/tap/rte_eth_tap.c | 1 + drivers/net/txgbe/txgbe_ethdev.c | 1 + drivers/net/txgbe/txgbe_ethdev_vf.c | 1 + lib/ethdev/rte_ethdev.h | 10 + lib/ethdev/rte_flow.h | 1 + 39 files changed, 781 insertions(+), 133 deletions(-) -- 2.25.1