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 D68FA41C61; Fri, 10 Feb 2023 16:17:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2ED9842B71; Fri, 10 Feb 2023 16:17:52 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 4BC83427F2 for ; Fri, 10 Feb 2023 16:17:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MpG1TZGJKcEuJP5LO71ysLVrvdGtM+zUOMzaOpdRC7uzSDWZfmFs3Skr/G8J5gyofuRzJgofif6eyeDHSVr5gUuodsC/DxguSk9b2Dpuv1kZ0YB943eBOvBtB7XcfKM0MlFD8PCj4IF3wFODSN2DVUHmToIrBhr7L7RemmLJDRM9DDfxpd+v5uvETHoBhFCzFDTLAXupES3vgbpbFVf13R4rw+AJOTYZX1g7wnO1ooFbQu4M57DQQVmoFfLXR+ug7yjcKKvo61ZhYlqHFAswKNrYMBcgFRwunABDsmaZbDvTiCxMOS+oE8q2SaEDflC8/kyam5SycXM62OV9K7wS0Q== 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=cjLBIc9SvbK3dLoG+W30fwRWPgsgIB5xIUD9gXqTKy4=; b=PB594/IgZj4Oif31Hui/NDGSpkYFQ1lKWg9xwzaCGtNVV5TXULc1s/86bDnThXMB8qEKsVr8S/pDXow3LQXj2h92DnGjoYLg8ogGW45tXJbHkqB0gSgKmOpHdgiYjFrhNGFRGUByNbm5/4sV37V10QmTIKGjehQX/qp6bGN7Xx0Sbd46Ly1EGN1HpqWkuckVazndx7xsRZ7Fcf9blVqqm2Jy/L1B0CvUz3kr71cEIXg6vDlB6ZQYWH9IqzHeR1yIJ8BccDPoMDMKIQfNmAaJcghcilZhxqShHy28RfZnVxFoMr2nbboWlsAt5X/6ljAGQi0RFpBWVXlxEsMzTLJRuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=cjLBIc9SvbK3dLoG+W30fwRWPgsgIB5xIUD9gXqTKy4=; b=Hj8Nm54kf32aUgoO2vf6h7TSzSobtAz3pEUq+NQI4L74VlzL6g/Hmfw4bj5jAuuulM9g4GzfwN7QO/oer6o6fQTyGYnRPmWFXZu5tsr7jx/5y/OOz/wC4fY7ViDj8ZSu4NVUnACmeAdAsYoZDWH6fFtKbyMnHmQV9f595djNIIzhYuFlPD1gmjisMMQEcEY0+FGmGteG2zGoPzwHFBXqTaZuaThnZ8QJx+tlmljcp4sTbuTFlDHEXrLCE7xO4V1DV6ZO3vAquc0qZ439WA+GBCiA1A2pNMsuN/QvopKOS7r8qLBJ9SXE0VsPJlbFgMa9nnTNw6Kiqd1yMyCw985eIw== Received: from BN8PR03CA0021.namprd03.prod.outlook.com (2603:10b6:408:94::34) by CH3PR12MB7570.namprd12.prod.outlook.com (2603:10b6:610:149::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21; Fri, 10 Feb 2023 15:17:49 +0000 Received: from BL02EPF0000EE3D.namprd05.prod.outlook.com (2603:10b6:408:94:cafe::e8) by BN8PR03CA0021.outlook.office365.com (2603:10b6:408:94::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21 via Frontend Transport; Fri, 10 Feb 2023 15:17:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF0000EE3D.mail.protection.outlook.com (10.167.241.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.16 via Frontend Transport; Fri, 10 Feb 2023 15:17:48 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 10 Feb 2023 07:17:37 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 10 Feb 2023 07:17:34 -0800 From: Viacheslav Ovsiienko To: CC: , , , , Subject: [PATCH v3 1/3] ethdev: sharing indirect actions between ports Date: Fri, 10 Feb 2023 17:17:07 +0200 Message-ID: <20230210151709.1619-2-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230210151709.1619-1-viacheslavo@nvidia.com> References: <20230206095229.23027-1-viacheslavo@nvidia.com> <20230210151709.1619-1-viacheslavo@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000EE3D:EE_|CH3PR12MB7570:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e321045-d5e8-4ca0-149d-08db0b79f881 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7RLrxwdqLJdA5BnMKcNKDkxJ1sq7Pl8W+o/PR787wEDDjzDli9rtnzJZcUjEIYnwVhl65nQGM2czN1TSnk6tFXkODFghP6yzH8QQABHUFphlX+x3SNhgnu1Xl4Br1qDG1b2UmeVIICn1gSbaMoB8WkcPqSwsdfLCGoXtLgcGiYqI5wTuUgKOlit97/rbxIGMgSMEkG/e9Xeql95EN7qoC59Mms0g8AFNPed0moMkqFWsn/CBfD5CNSVfrv97eXOCHl1hta6Fk/euk893Txe8Wu/RS4LDevlOouoCbGep4WC6I9lerkVa/EC2svQt4fNnwlx1TKNN4heA9OfVJvmjY60oLSG6yzzdEWwMfPFikjR+sRKkRIhvrJ0/+k5FU6INXUGqSbgUCUl2VT47QvDyPDrVNCbFvpRSCZDDJDbprjRd5afXGTEC5ebPExY3PZs+AYw5CIsP9jbM+ZC/pK8Pspb38SItHGP8YelDhh5lkQSG7ApzXjG1zhDPRtfZx4EXEnFG97ktjfajUpoLFtxMTjoGKNipYT1Crc+fZONz9WDI0RACtgsv+iGvMeJBcmVzQ8HimASJU+OPxoQ36ibEOjmobdsvIWXvqf271DYtMf0pVoluZ2TyeangzLQafELvGfWBgDN/Kf0Ui1sGucchmBo9b9eI+9B5TVpKz5EC8oRTSMR+nf9dj2YOkWFJZHf12ftgjkz13V0AdbMzDKjVpg== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(136003)(396003)(39860400002)(376002)(346002)(451199018)(40470700004)(36840700001)(46966006)(86362001)(36756003)(7636003)(356005)(82740400003)(82310400005)(6916009)(26005)(4326008)(1076003)(8676002)(6286002)(186003)(70206006)(70586007)(8936002)(5660300002)(16526019)(41300700001)(6666004)(55016003)(316002)(478600001)(54906003)(83380400001)(36860700001)(7696005)(40480700001)(336012)(40460700003)(2906002)(47076005)(426003)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 15:17:48.9026 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3e321045-d5e8-4ca0-149d-08db0b79f881 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0000EE3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7570 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 The RTE Flow API implements the concept of shared objects, known as indirect actions (RTE_FLOW_ACTION_TYPE_INDIRECT). An application can create the indirect action of desired type and configuration with rte_flow_action_handle_create call and then specify the obtained action handle in multiple flows. The initial concept supposes the action handle has strict attachment to the port it was created on and to be used exclusively in the flows being installed on the port. Nowadays the multipath network topologies are quite common, packets belonging to the same connection might arrive and be sent over multiple ports, and there is the raising demand to handle these "spread" connections. To fulfil this demand it is proposed to extend indirect action sharing across the multiple ports. This kind of sharing would be extremely useful for the meters and counters, allowing to manage the single connection over the multiple ports. This cross-port object sharing is hard to implement in generic way merely with software on the upper layers, but can be provided by the driver over the single hardware instance, where multiple ports reside on the same physical NIC and share the same hardware context. To allow this action sharing application should specify the "host port" during flow configuring to claim the intention to share the indirect actions. All indirect actions reside within "host port" context and can be shared in flows being installed on the host port and on all the ports referencing this one. If sharing between host and port being configured is not supported the configuration should be rejected with error. There might be multiple independent (mutual exclusive) sharing domains with dedicated host and referencing ports. To manage the shared indirect action any port from sharing domain can be specified. To share or not the created action is up to application, no API change is needed. Signed-off-by: Viacheslav Ovsiienko Acked-by: Ori Kam --- doc/guides/rel_notes/release_23_03.rst | 6 ++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +++- lib/ethdev/rte_flow.c | 6 ++++++ lib/ethdev/rte_flow.h | 11 +++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst index 75c64cafa4..ea12c746e3 100644 --- a/doc/guides/rel_notes/release_23_03.rst +++ b/doc/guides/rel_notes/release_23_03.rst @@ -69,6 +69,12 @@ New Features * Added modify flex item: ``rte_flow_action_modify_data.flex_handle``. +* **Added cross-port indirect action in asynchronous Flow API.** + + * Added ``RTE_FLOW_PORT_FLAG_SHARE_INDIRECT`` flag option to + ``rte_flow_configure``. + * Added ``host_port_id`` to ``rte_flow_port_attr`` structure. + * **Updated AMD axgbe driver.** * Added multi-process support. diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 725062e6b0..c448cf47b3 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3076,7 +3076,9 @@ for asynchronous flow creation/destruction operations. It is bound to [queues_number {number}] [queues_size {size}] [counters_number {number}] [aging_counters_number {number}] - [meters_number {number}] [flags {number}] + [host_port {number}] + [meters_number {number}] + [flags {number}] If successful, it will show:: diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 57bec6f5e1..a5680daa19 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -1597,6 +1597,12 @@ rte_flow_configure(uint16_t port_id, RTE_FLOW_LOG(ERR, "Port %"PRIu16" queue info is NULL.\n", port_id); return -EINVAL; } + if ((port_attr->flags & RTE_FLOW_PORT_FLAG_SHARE_INDIRECT) && + !rte_eth_dev_is_valid_port(port_attr->host_port_id)) { + return rte_flow_error_set(error, ENODEV, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, rte_strerror(ENODEV)); + } if (likely(!!ops->configure)) { ret = ops->configure(dev, port_attr, nb_queue, queue_attr, error); if (ret == 0) diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index f4d8b7d3d5..c78684efb0 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -4992,6 +4992,13 @@ rte_flow_info_get(uint16_t port_id, struct rte_flow_queue_info *queue_info, struct rte_flow_error *error); +/** + * Indicate all steering objects should be created on contexts + * of the host port, providing indirect object sharing between + * ports. + */ +#define RTE_FLOW_PORT_FLAG_SHARE_INDIRECT RTE_BIT32(0) + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. @@ -5021,6 +5028,10 @@ struct rte_flow_port_attr { * @see RTE_FLOW_ACTION_TYPE_CONNTRACK */ uint32_t nb_conn_tracks; + /** + * Port to base shared objects on. + */ + uint16_t host_port_id; /** * Port flags (RTE_FLOW_PORT_FLAG_*). */ -- 2.18.1