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 9C697A0C4D; Tue, 27 Jul 2021 09:32:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC1ED41143; Tue, 27 Jul 2021 09:31:49 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2061.outbound.protection.outlook.com [40.107.92.61]) by mails.dpdk.org (Postfix) with ESMTP id 3DBDB41139; Tue, 27 Jul 2021 09:31:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LGtYBbEmvc8AzbOOyKUvoB6jcbVVdd3/T97RnJnP+gFlZOvcWJNUChGh4nNjIDh+gf5sGntl5idRjmLb0/SmCk8lQpHJyRWbqFro1Mt0RVMTUTidl8eC+xM91tuoYbWeDygdYu/Px3XnRqQPSqhnxKEw2VSrUY+Z9y3joSNVwGICGsbSqq3jqwoLZmffhP7PBe1K5YS62dVJY4G2heBlGVWpMN5iiyUBEPPHxaYuX8oa2bNGkeI+crPe/kng7b92oL14ZdQpj/Q+zEsjXD9WwQ6Mgju2bxMglXldqHE78VilRcMzVXAi8XK3gNaX2JZPaimbqKQzJxcCRp74sWg37Q== 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-SenderADCheck; bh=aYpqHTdRd30ZZadSwK2VsyTjt+8RDvwVblF9z7iOH3w=; b=JU0mvGegNGhvgSBUZhqoPfErUqHOrP5dz+rQvmff7xlyRgRo1KZcXdoonRw1/7bB2Kjk5HKVD5zzy36JbKOqTMaIn3ayym5G64uuHjvleSP8GrMJfehsfP+I/IP3+ADXDRYYwepQL3Av4cPHGzRu4oiIgAgYszE0XQU4bdEpSlkvl4Xll5BDnCMMzfe/ErXRg+24PGxUKQ9Ad4mWv1Zx1XsT+PkKJlz1mhBYk4mIEZuI+ANHuPitzD4dNwAHEfJR4XF8bAcP+vz3iABzR5+MZVAoAnQ1iEDbGJ6AayBvIWRAK8c/yLCk+7KFA6Dtg77c20I5w5QmkkInCtPHt+OwHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none 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=aYpqHTdRd30ZZadSwK2VsyTjt+8RDvwVblF9z7iOH3w=; b=GKrsUizvXgegM4BwoQBB1crWA3Mo1qEDBwHSU0nh05U+tPJEMm9j3VgVW5VID9akSV7pBJ1grbekuAZN+fTAjS47qAKeZXlHx7+D4JOUfR73E6HGOmI/WKFYzwyBxjjeXRxRu8p4y8ZEFyXfeAaRMqYKusQ4ueVZiZbodXuCq0xSykcLmoarO5X3MkBWRA6vsm+bSqoj2pDL1/r6SwTawi6ECkLAJVueVyPljm6nkHtN/PPVlJ2a2Uqe/deG/AhasseHPmMYGlLOhBzWzSxdysQnNCySL22ZA5SKmV9wltmn7HkmC7rOmlx4/G9brnXicXP6B2xr+BXhYaCXh1YwPw== Received: from BN0PR02CA0019.namprd02.prod.outlook.com (2603:10b6:408:e4::24) by BN7PR12MB2707.namprd12.prod.outlook.com (2603:10b6:408:2f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.17; Tue, 27 Jul 2021 07:31:46 +0000 Received: from BN8NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e4:cafe::79) by BN0PR02CA0019.outlook.office365.com (2603:10b6:408:e4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25 via Frontend Transport; Tue, 27 Jul 2021 07:31:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; 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 BN8NAM11FT056.mail.protection.outlook.com (10.13.177.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4352.24 via Frontend Transport; Tue, 27 Jul 2021 07:31:45 +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.2; Tue, 27 Jul 2021 07:31:43 +0000 From: Dmitry Kozlyuk To: CC: David Marchand , , , Matan Azrad , Ori Kam , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Date: Tue, 27 Jul 2021 10:31:20 +0300 Message-ID: <20210727073121.895620-5-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210727073121.895620-1-dkozlyuk@nvidia.com> References: <20210727073121.895620-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: ed37b56f-5536-41eb-d9c8-08d950d096b5 X-MS-TrafficTypeDiagnostic: BN7PR12MB2707: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 36uRb9eUe2PCM1PX8MqJo7CEkgrszfwS6NR9jWIW+nky7zJFOiocZ+jQxUyZxmNQw9FakDzyFqQAyf5RYF5VjFsJx+hLYrAEvLnRh4TB0LgFoii53WoN93I2hCEY7L3zHMmSbo8RdHwvnO4Ot9lBAPIhY6lwUWv+5j/lpsLi9byeR6CCp6T26m0XUxjv0u9oUcIYlLhf5KQQXPrdhuI6xxItyVDMJMXSkuvXCVjt8unN7JhSwTh4glmpadWStsYDU8cRMQz/1Oa6kmalrBsPOS5uqsd077FULAjttq1iayh12AKar024Bqbt6pQi7q8y6lmNa6GUD3VW4j8E7rlZ9mmP1ScivK6wIMq0c8Fj3l5/L5qccSRlLb59VI7dQkAe1jM4KLoDTzkr+DUvcElKebVYqAojsOLYy+jFkJSY1fS5+jaY5uaQCshP+1Psfz9BbVB06Q9Q3tzwNvc2J2DmaOrVxA6kTyicEJpqyIFCEJVjemgAkgwqG2WxvCUdNIGChxkCYNHZik6Qg8fFoneEJxKyuWCMqRGC5JmRbanqh3ijN+PVY3wq2AmDCoIBnJrWXdGehWxC4W+ZlPJT8p5GLJ/TQ1lashtGs2sv6xmjxhOW9E2EhxRg9+4URadIO7Gv3ilh7IwKkhlNbpgKz205eyvoFTlwn0x2AW9EVHUhSCNj6cL1tnT5h/9+g6QEupqI3xsuEyR5WnvoOs54e7WUPw== 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)(70586007)(5660300002)(426003)(36756003)(6916009)(54906003)(8676002)(83380400001)(55016002)(36906005)(316002)(70206006)(2616005)(4326008)(86362001)(7696005)(2906002)(82310400003)(508600001)(26005)(6666004)(1076003)(6286002)(8936002)(36860700001)(7636003)(356005)(47076005)(336012)(186003)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2021 07:31:45.9986 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed37b56f-5536-41eb-d9c8-08d950d096b5 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: BN8NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2707 Subject: [dpdk-dev] [PATCH 4/4] ethdev: document indirect flow action life cycle 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" rte_flow_action_handle_create() did not specify what happens with an indirect action when device is stopped, possibly reconfigured, and started again. It is proposed that indirect actions persisted across such a sequence. This allows for easier API usage and better HW resources utilization by saving indirect actions flush and re-creation with associated error handling and rollback. If between stop and start a device is reconfigured in a way that is incompatible with an existing indirect action, PMD is required to report an error at the device start. This is mandatory, because flow API does not supply users with capabilities, so this is the only way for a user to learn that configuration is invalid. Errors are not reported at configuration stage to give the user a chance to remove or change offending actions. For example, if number of queues changes and an RSS indirect action specifies queues that went away, user must update the action before starting the device. PMD is not allowed to silently adjust indirect actions (in the same example, to remove queues from the RSS), so that all configuration is explicit. Fixes: 4b61b8774be9 ("ethdev: introduce indirect flow action") Cc: bingz@nvidia.com Cc: stable@dpdk.org Signed-off-by: Dmitry Kozlyuk Acked-by: Matan Azrad --- doc/guides/prog_guide/rte_flow.rst | 10 ++++++++++ lib/ethdev/rte_flow.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 2b42d5ec8c..06dd06d9a6 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2785,6 +2785,16 @@ updated depend on the type of the ``action`` and different for every type. The indirect action specified data (e.g. counter) can be queried by ``rte_flow_action_handle_query()``. +Indirect actions persist across device configure, stop, and start. +If a new configuration is incompatible with an existing indirect action, +the start operation will fail. "Incompatible" means that if this action +was destroyed and created again, creation would fail. +It is a programmer's responsibility to remove or update offending actions. + +PMD developers should use the same diagnostics for ``rte_eth_dev_start()`` +as for ``rte_flow_action_handle_create()``. PMD is not allowed to silently +ignore or correct offending actions. + .. _table_rte_flow_action_handle: .. table:: INDIRECT diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 70f455d47d..f571a27fe7 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -3969,6 +3969,10 @@ struct rte_flow_indir_action_conf { * The created object handle has single state and configuration * across all the flow rules using it. * + * Indirect actions persist across device configure, stop, and start. + * If a new configuration is incompatible with an existing indirect + * action, rte_eth_dev_start() will fail. + * * @param[in] port_id * The port identifier of the Ethernet device. * @param[in] conf -- 2.25.1