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 398BFA0C4B; Thu, 21 Oct 2021 08:35:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BE674118F; Thu, 21 Oct 2021 08:35:36 +0200 (CEST) Received: from AZHDRRW-EX01.nvidia.com (azhdrrw-ex01.nvidia.com [20.51.104.162]) by mails.dpdk.org (Postfix) with ESMTP id 41F634118C for ; Thu, 21 Oct 2021 08:35:35 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.44) 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; Wed, 20 Oct 2021 23:35:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hLHlVtivjmA4Kat/z89WUa4PuS/i+EPwCWzjfCHpzexJ07pKf5P37Mq16Rq/vAe/G0UI9SF6PHds9XPvSRG4S5gtApMQT/1kxnDj2VRHisbMGzrdQ/jJzu98BBaxb+w8cbs4Ppsh9gRWvbjJHGIdkAFVEBZKegz2AR+lBAsmhcwO1tojXT8QU8WNi3IETs5VeGR1zQrawX4yjGH8puN+ezDcgU4OMUBEdwsx08WACyDYFhgQasJv3A6EgZIw/BSEBecXaxTXgVjJ4wsvqr80jAqvNmDXrg9GyBgrusvcxje7aMKvLmkDYBln+ZZ7AZvM4HimnUcYM6bkkR41pOLaWw== 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=t/br6Wc9V0u21QrBpQDUH6Yh/0Ba/pgUWaG662r47I0=; b=bssPkcBIRfX1VhyvSURAPwANq8LEwpsABikBqNeXp+Hg99xvRBcGPmD6J3ykH/tr2qOY0Vbz4Fnteiz1yuRpFHPuHlgVCQdidg650aXIz462u9uT3Uts1pV0XdGK2BgLHUVx9XJPBtcU+m6G6zOPVVbvCbO7B0CZBaXM5yjTx2D/O8KMzM4VTrW/JoaEzLLHGeziQWdGQ5kbOTjD870SXWDM0OkO3iuF2YkUmCVZE6VcS3IFc4/50Hgb3TppK4UwmHoWgYk0mCsfHJ4UPjgxeSGdxpJCAWJIEqJb/oVpRAYSYrVSiJFZ3NcAmITxC/Gs2mCtIFAKHqhcR/T3kOfxDA== 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=t/br6Wc9V0u21QrBpQDUH6Yh/0Ba/pgUWaG662r47I0=; b=VoQ9Hn4h6TDnUzr8ryGTxgU99cYfvKOHGBQz0/Z85RvjRiDygD4QpeI1M5ggmAKKVXiLTlDJHxfRL1C2arkF2CR6BmKT8CHobFpMOU8FvOdX1AdXrdwx9Kk3CXCVQKVY9FW/PZFFKL8c0tjG3VNgBFR63YEJcygBu+qbP6pAwOdyKzCmco+ETy46y9/NWyMX2pkmtrdrtEaMzKljVKb1CZDqWV2aUezvYjlypEWVbIW5zK0ZebG+0Kf+A/SdEr3v/0gWAKCAvhXOYoqQW34Pw/hn69r74VInn7sXNqK0iYSeocukYcDyevLekGZGXsO3bisW3iki5GQjR+8zZ3aVdg== Received: from BN9PR03CA0298.namprd03.prod.outlook.com (2603:10b6:408:f5::33) by MN2PR12MB3837.namprd12.prod.outlook.com (2603:10b6:208:166::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Thu, 21 Oct 2021 06:35:33 +0000 Received: from BN8NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f5:cafe::e4) by BN9PR03CA0298.outlook.office365.com (2603:10b6:408:f5::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16 via Frontend Transport; Thu, 21 Oct 2021 06:35:33 +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 BN8NAM11FT048.mail.protection.outlook.com (10.13.177.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4628.16 via Frontend Transport; Thu, 21 Oct 2021 06:35:32 +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; Thu, 21 Oct 2021 06:35:19 +0000 From: Dmitry Kozlyuk To: CC: Ori Kam Date: Thu, 21 Oct 2021 09:34:57 +0300 Message-ID: <20211021063503.3632732-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211019123722.3414694-1-dkozlyuk@nvidia.com> References: <20211019123722.3414694-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: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0deb5ab7-9fdb-49d3-6c68-08d9945cfbc2 X-MS-TrafficTypeDiagnostic: MN2PR12MB3837: 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: h6I4STR5fgqraO3+6dZhn+4V64UPWzknHF1fjv5T7HeVqBixLvnDFSUcePargrItEc1gkOKpcfSzTFbBhxR7oRy/EZEyKcfhstll7VW2BP5dr8tbO4z8iplTQPiWGbnHtqZqkq8Vkfvoilc69T448xyH+hDSppAKGPH2+g1doM2zLvG/iJsvUwBrk5OrGiQlvV7AUzyiuif7m+wT/fD87zBk51wtJEkBxYgchwTkMEbkzhj/+2zA6cClLOLvQrAYynjgkwFle2QHSawk9uTqhKJa4l7YA2u1YjGug/eHgO6+rJHbdmZfW7IjdHsOZzan5EB8mTCJM38Tik0KLNQQ41Vm835ipJCIg2O2Svux2sMh0jU+2AwRj/xdy5uMpCaeIzpwJ180UItRWYXUi/OXAbLBDuctC7d+BnglmhDCsW95oWoHVegSJEjv0r9X1EDdyB7L1TFZnCoKpehH58MXMGFdOotIV7YKUUvziReXjhlinUkvIDW6n7m3a3Arrr10ERSN1kaccRrakoR5DbSkKJ/XaKSH+MQEgoIKSxcyJ42dZaTyGFOa/pSAmr2SqHodsw4ngtAueCZm+RpTDVwGsSoC4BjJeVq07cVpZzEDN96+6DRDx2v/yEC0KgT5xtF6aWbiOv+QHWPsDoJDey/H6SnLlPQDFEZlLZOKEGgrqP1aFuP7vQQNkjHacqdRGqQVq1pOL2BR2qy9iP4SJyDE6diwQVOf1trcdzPRUPoc0f5itoSg39O3kkeo6We/kuxc0fpXQ3OSm+UfMaMTROJ4czjIJxLPoa4GoC5IDkzY+J8= 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)(2616005)(36906005)(316002)(86362001)(55016002)(356005)(36756003)(426003)(70586007)(966005)(70206006)(83380400001)(508600001)(36860700001)(8676002)(107886003)(336012)(16526019)(6666004)(82310400003)(4326008)(47076005)(26005)(7636003)(186003)(7696005)(5660300002)(8936002)(2906002)(1076003)(6916009)(6286002); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2021 06:35:32.8722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0deb5ab7-9fdb-49d3-6c68-08d9945cfbc2 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: BN8NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3837 Subject: [dpdk-dev] [PATCH v4 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/ 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 | 57 +++++ 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 | 77 +------ 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, 770 insertions(+), 137 deletions(-) -- 2.25.1