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 301C5A0C4E; Tue, 2 Nov 2021 18:01:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E900340A4B; Tue, 2 Nov 2021 18:01:54 +0100 (CET) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id DFE4F40689 for ; Tue, 2 Nov 2021 18:01:52 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.173) by mxs.oss.nvidia.com (10.13.234.37) 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 10:01:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fo3TF8GTjMh7f0ASrzSH6/1kYwuPyeU7DNAoBwqhHMXxqBrqkFxi+pMemynb3+SWYhfq78CWbU2rB772T5vFwdFi/y+j6IG4/g/b1duRXUhhPmS0BKOlj6+kXSiTkImsI5g9XaOnTMYe4NHGR5tzvTzIFpVDzTJ0XnyaSr3LfmYj+h50lt8kvbFEabjJeh+dCQOWYnwtmxW8OMC3URgt53lOGAfL32Ai/XvTHvoLW3gjd9ReVsI/dLVI6Dw252PsntwNcaSjTRDw0BrDTM3uKQm1laU0hvW/xI190tN8mloExKcUx/ogtExZ27YcUMOpM6Zaszfm/GYAEb8hZLAWgw== 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=V2jnm3soar0m7IucnYt0x9I5njicDz8MN+TLQtctry8=; b=hTPuFV19+6nzUV71AYmod6ssHp0BP2pupxvpQe8gONicfhQ/RLJ8JvCkKFvqsxJfIcBsNDe2mHQxar1gu/AXuKlG6BpnTH2AyqOBcVZTwAXu8+b0so6/bM9+mSTdffoUfXqgK+y8Up3nqfOiJO+ZOP98N+KQw7hHxRSHSImO+yJgo+ML+Q0iHPAuY5H+RSzNPWNUBTf8zpkNrl9ayGop9KqsWMxWJXcaEUCLtQ/1s3txYAeZ68asFpMhyunA0wwGhc7aJM+zqVZdCtZ3dOsAFP+9LTsOyRgUuChLCVucRfLzLlcv6npEuD1x6A++6uqiwPVUO7R/qsi8CS4q/3+h7A== 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=V2jnm3soar0m7IucnYt0x9I5njicDz8MN+TLQtctry8=; b=MIyBorsK5Uedn6P4fMNyULiWEfnIwocxfyDDpQ1saYEMdqInpwKDR2DcH5kaSDYNxMCSYNNi+O52R8OD/HqwFwDtm5UsTVR7wG4KWsmhLfxEB+nPj1gN0uOkJuFd8VJUJhHc2u8zmgp+LnrbKnIyUCZpTBFDWOd+/jkKI8kE1fAu9+5yoqvTar2KtrkfItZil8/eosTJu3bkZ8RfVLFr8Nb/HwMTUZkBtncCrFPSA+svN6ZccbNVFmEvYQNUuiAyhn0QGyinN5/4Db7Z0hnJNcKr2HB0H+p0bdFhCtd1vwEEmEkOUoJH7ADifVrpIaLZnw3TzJWPxaD5iIYhkHz3/w== Received: from BN9PR03CA0556.namprd03.prod.outlook.com (2603:10b6:408:138::21) by DM5PR12MB1676.namprd12.prod.outlook.com (2603:10b6:4:8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.17; Tue, 2 Nov 2021 17:01:50 +0000 Received: from BN8NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:408:138:cafe::e9) by BN9PR03CA0556.outlook.office365.com (2603:10b6:408:138::21) 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 17:01:50 +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 BN8NAM11FT043.mail.protection.outlook.com (10.13.177.218) 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 17:01:50 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 2 Nov 2021 17:01:48 +0000 From: Dmitry Kozlyuk To: Date: Tue, 2 Nov 2021 19:01:29 +0200 Message-ID: <20211102170135.959380-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211102135415.944050-1-dkozlyuk@nvidia.com> References: <20211102135415.944050-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] 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: 69bf7aac-a520-4dff-8f56-08d99e22767e X-MS-TrafficTypeDiagnostic: DM5PR12MB1676: 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: l/FJ3Ffb/UfiUvlCf8ieEjkSXeK1bwjb77FYesg2nBHroyT39IXaYA4MidfSogvkkX7iQ8Vh/AtPyNiA0IB89AkZtfGt5DFgcALr0uXeH6bvQ+ZqZv3w79zQknnHA5+crLHjqyJdQKOjyy+CFQG6aphRyXxuZdCs8BzhFW6yh3Q/QVqeERjI95tVZpMuk0RKf/mtILSk4cgUxOR+CbRJLv54I8Cvb1Ou8IifmzmZacCzlOHabyd6FdA1avyaxtNRZNrCeGfWgE/aykwZ9pVBIDMpaTwaWHcG5WVIKQ24dE8IKnA96cL+unKldWS+vYvpQqhb/MXu2yvjOyROnaoq/j6I/EL7Nj/gGf2II/c5c6qFGECtqoz0B9+N4orkbeURe+OSVBksoRhUr1zc1h9XZAf+fOqve58gM68MzfMdWpu4S740GGv5y7EpvrvTnKj4bnsQJ4GSVAKdp6yN96XGgF7uqAEC4/wWD5YvIeG520+UCg72mg9u0WJuOyCTNKmDWSQe4zf+S/aNMitilyibh7uyv8YXW7Sg8AC/dHQXLRmn4Ugeh/BoExB55Zh8tB5M7pFt1wKkCdJqm6r9JDxXY+ycPSJ6ZogECrg3KBH0IfiSQgrCwae/Ml9mdztTIX+wH/bIL96C8t4L7eK0rUOeJ54qhg//pk1O7cEbA6/tp6NWCqfLcyG7Ddhns2Y0xcf5F2ObpeolgBJVaYB1dy6ca13zzpV54ZQIYtt2yPYfwhVNs9Yoda5WhIVkAIhId2TPJayUSjQu+3OPj7IOGSVY6S0CGz+pbed40X2zGMeZnlnphazqxC2qWCkw+MISxkajml9I5U4QnIwjJwI/zhXHmA== 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)(46966006)(36840700001)(966005)(2616005)(26005)(426003)(83380400001)(8936002)(336012)(70586007)(5660300002)(6916009)(16526019)(82310400003)(70206006)(86362001)(6666004)(356005)(7696005)(2906002)(6286002)(186003)(8676002)(55016002)(1076003)(508600001)(7636003)(36860700001)(47076005)(36756003)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2021 17:01:50.1479 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 69bf7aac-a520-4dff-8f56-08d99e22767e 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: BN8NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1676 Subject: [dpdk-dev] [PATCH v6 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/ v6: Rebase on next-net commit 87f4496c74e6 and fix conflicts. 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 | 4 - 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(+), 132 deletions(-) -- 2.25.1