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 93E79A0C58; Wed, 1 Sep 2021 10:55:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78D94410F6; Wed, 1 Sep 2021 10:55:44 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2054.outbound.protection.outlook.com [40.107.101.54]) by mails.dpdk.org (Postfix) with ESMTP id 4C30D410F2 for ; Wed, 1 Sep 2021 10:55:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V9dyRGMehL3AF8wQ7nWNTeZ/l8mYiJDGAMhI6INFdGL94AHfH9zp6Q+HGEDsvsT2alLHSsDRXuXQaqlSqd2oNBJG9NAMulQnToJFtGHJGbUwfBZYzYd0StX+SfsUNDbA7d0wssXqklg1hbKuglnAeu2rHCIDfzOP96gEEPTAIVrO9Bm7snvRLxGwZRc+bylBZCidQaxBUf3zMwix9bjt3WcbsoIxGa80gl98z2mksPX/tMEZdWghKOmmQtHO0rbw8iRzoXYBhHAz9wUEgHKRdbfRaQHGcPAFmGvzFAfc/xqylpI5ay4EUfD1Q2fueLSsSXdLLn6tb65sE90Y5cr5mA== 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; bh=QL3MZwbD8KqEmu2fIRxSw89HtT4FiXumt+e15JZVeZM=; b=UV50vZx3XQ7rnHurRf8zOl9B+SMdR2a5+s3AgnzxSiejPKyIg7e7/GGw71KQh1HA0VLoLtc7ZLaUgxMp4fGD5HZS5BaiJ1mQBwuJk1JipSGCiwBDF80iJ+fLOtoeBSErKWfMZRIiagJC6P3RqY7GVCnnoER3rV+BFZ0/dhAlZL7twxNcG4jFJzZy4Ltdw1D6n+/IbyaH15KFg/h6/SGrOy+nevmswAgXVLL9e31MH510ullJ1hcat2bQayLC0GN0HbWZug53z/g/iEOwnNAL2cikIJx3S8inpUAI0DkhUdQMbK+otEFbkXYXwNFd74ABRJVm6lsul8DVyekaBck25g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=oktetlabs.ru 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=QL3MZwbD8KqEmu2fIRxSw89HtT4FiXumt+e15JZVeZM=; b=Wv4S7LNSM0wi8/yHJZZDRsiTR1txouxmjyyVCWlAcbyyBA12DpHr8X6bsx1wh2HNSiG35Y+wqpYubt579BDXr+qI6BK06l8JTy1xQDsXEISn6Zc1mHdOMSudfs6rdk4xg/WJZwl06VI6WiD0g05VJPX+qxGqSQOwHWhrwTCwh4LD9HQSvFr5e3BLhkQPglM0927HOSX/86lspcmr2QfCokaXayzrulW8lu9xnbObzN8Fp8fOocaqppcwnSf/EAN9fpNaL730/H1Tcpzq/38A40U6g+EvyKlyv86gcr48cnbgHhI3jt5Zs6/CoNlFlCUCEFsDEb+Eg4syvINexRrs5w== Received: from CO1PR15CA0071.namprd15.prod.outlook.com (2603:10b6:101:20::15) by CY4PR12MB1846.namprd12.prod.outlook.com (2603:10b6:903:11b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17; Wed, 1 Sep 2021 08:55:38 +0000 Received: from CO1NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:101:20:cafe::df) by CO1PR15CA0071.outlook.office365.com (2603:10b6:101:20::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Wed, 1 Sep 2021 08:55:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by CO1NAM11FT008.mail.protection.outlook.com (10.13.175.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4478.19 via Frontend Transport; Wed, 1 Sep 2021 08:55:38 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Sep 2021 08:55:37 +0000 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 1 Sep 2021 08:55:35 +0000 From: Dmitry Kozlyuk To: CC: Matan Azrad , Ori Kam , "Thomas Monjalon" , Ferruh Yigit , "Andrew Rybchenko" Date: Wed, 1 Sep 2021 11:55:16 +0300 Message-ID: <20210901085516.3647814-3-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210901085516.3647814-1-dkozlyuk@nvidia.com> References: <20210901085516.3647814-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 DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef90198b-783c-4092-0238-08d96d2644e8 X-MS-TrafficTypeDiagnostic: CY4PR12MB1846: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CUKIjDR4uaHOE1NRf+8BaeB8MCsfZfYLlf+l6t/ibpZ06JCIIThRGPG+itxJBQV6JRedCxB2d7/tGtWVU4VUq/o9KBs+YwhQk2Dr0JezrVJ4YVIhkzJNj03oRsp1hvo71Rgt5uDVL+VBUko2GiMPGyIyGWrEjYwnKlkeSVBSbb/aeDltXAeGoXs3yk/KGvx764arkTpxUtX/qocJ/B0oNitCLROrK6D/MVZoNnr7qFs0LmxgaCQLiJrM9Bip/dzdXSNc/Jyt03TPMBP8R1JugU6wcCvJhRlXbwEMCVkRLW4KEJBxVY5FL9bB16+qFgf/TsCUqgx9nHMF7T94KdW61eNIGAJPS7ZxHdRt/vByNTL4U4W6kGdRn0hJzp4LTxiF9aqPl0kZD5hBlYXF94PAZX/26R4Xuzj8xkVfKBcgLU+xu2KlthfC3+W3Xi7d7jLKC0Qr1+xugohyaQBwsgXlYopnredILOm7Ju07lBTdagxm1FfMPwmsaD5Coq6MvY4UJ3tlxjWoPAtWL4r5Qvj2XkUJv/nyVnXkIHMhxZ+ybz1J7hDvevymTrd8DmFxYCKo0RqdEaVOnNYTFwlL5R8p0sLLd29Bg+EA1ug/ELheA0Ii/3WCkiWrI4sN76jITW8bdsMEt3WpuUfaVzYPZ1XJOxAO9ENfx8IqZrODrsehcObwIqR4dRiaAwNkM3mkukuvoPbJQKgZGl8jSCI5Cch6vA== X-Forefront-Antispam-Report: CIP:216.228.112.36; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid05.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(186003)(336012)(2906002)(55016002)(26005)(36906005)(36860700001)(426003)(16526019)(316002)(4326008)(54906003)(70586007)(1076003)(7636003)(47076005)(70206006)(5660300002)(508600001)(6286002)(82310400003)(356005)(83380400001)(36756003)(8936002)(6916009)(2616005)(86362001)(8676002)(7696005)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2021 08:55:38.0706 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef90198b-783c-4092-0238-08d96d2644e8 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.36]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1846 Subject: [dpdk-dev] [RFC PATCH 2/2] ethdev: add capability to keep indirect actions 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" rte_flow_action_handle_create() did not mention what happens with an indirect action when a device is stopped, possibly reconfigured, and started again. It is natural for some indirect actions to be persistent, like counters and meters; keeping others just saves application time and complexity. However, not all PMDs can support it. It is proposed to add a device capability to indicate if indirect actions are kept across the above sequence or implicitly destroyed. It may happen that in the future a PMD acquires support for a type of indirect actions that it cannot keep across a restart. It is undesirable to stop advertising the capability so that applications that don't use actions of the problematic type can still take advantage of it. This is why PMDs are allowed to keep only a subset of indirect actions provided that the vendor mandatorily documents it. If the device is being reconfigured in a way that is incompatible with an existing indirect action, PMD is required to report an error. 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. For example, if queue count changes and RSS indirect action specifies queues that are going away, the user must update the action before removing the queues or remove the action and all flow rules that were using it. Signed-off-by: Dmitry Kozlyuk Acked-by: Matan Azrad Acked-by: Ori Kam --- doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++ lib/ethdev/rte_ethdev.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 0a03097a7c..da90b52f48 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2794,6 +2794,18 @@ 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()``. +By default indirect actions are destroyed when the device is stopped. +If the device advertises ``RTE_ETH_DEV_CAPA_FLOW_INDIRECT_ACTION_KEEP``, +indirect actions persist across the device stop and start with possible +reconfiguration in between. Some configuration changes may be incompatible +with existing indirect actions, in this case ``rte_eth_dev_configure()`` and/or +``rte_eth_rx/tx_queue_setup()`` will fail. At this point PMD developers +are encouraged to log errors identical to the ones that would be emitted by +``rte_flow_action_handle_create()`` if the new configuration was active. +Even if this capability is advertised, there may be kinds of indirect actions +that the device cannot keep. They are implicitly destroyed at device stop. +PMD developers must document such kinds of actions if applicable. + .. _table_rte_flow_action_handle: .. table:: INDIRECT diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 1616bdf2dd..c3be5afcb2 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -1450,6 +1450,11 @@ struct rte_eth_conf { #define RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002 /** Device keeps flow rules across restart and reconfiguration. */ #define RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP 0x00000004 +/** + * Device keeps indirect actions across restart and reconfiguration. + * For a specific PMD this may not be applicable to certain action types. + */ +#define RTE_ETH_DEV_CAPA_FLOW_INDIRECT_ACTION_KEEP 0x00000008 /**@}*/ /* -- 2.25.1