From patchwork Fri Feb 10 15:17:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 123686 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 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_*). */ From patchwork Fri Feb 10 15:17:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 123687 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7331D41C61; Fri, 10 Feb 2023 16:17:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5FC5F42C4D; Fri, 10 Feb 2023 16:17:58 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2058.outbound.protection.outlook.com [40.107.237.58]) by mails.dpdk.org (Postfix) with ESMTP id 4476542BD9 for ; Fri, 10 Feb 2023 16:17:57 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MaMf/u77B/yDnk6w2BY40WDDsTZfB3M3BsmdFVbx+mTL6Ua79h1uoG9WYcumWE4R+KiajZALnp4iQCiuglrJIafbFrG+Mj0/6Q7humns6qlApUFBAY5hqeP/a7l/6kWT9PVzNa0QRvN3ngM8jloPvVsEoFIauw6JKUzr/CWxX4xRwGY8AKE9STbA98BKVgndLn190fnoiNP66Js05hCf3R9v+om5LI8DEDUJLKALYSVDYMSF5+Dpu6I43gMx5Dv9zAx1Y2QwuPNW4mvYfJEE4sUuFi+pqPsz+P1hkmjz6GN9oCHEMTlgnhQDQ7RaeBhgpPrSoiegMyKfZjHxWefPbA== 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=Ce20dYlDuj4fApGrVry8j/eHtBrRhE9Zm2/cVUDHAYM=; b=MlLyibo671TRIEtfRFpF7afTCGsfxPjxyohYJPpkVY6ig/gKIJXvnRUryIW3xveedpcfe/InBZtOl0hzkBMT8fYsKhaGvYFgQTh44YxnMF/3HnggTbCWZKnsjVf05Vi7wtdrVvrn8NPF9RZy4DjEdGQXWCU+E+irjfZrXhbdaQumjpQPAHva0dZsWkZO2LAlolDsoSA3o4G5W11SxmldnFery94L4HpGd96vWpf/0D0MZDWyPc9pGco2RMZt6kEJmcpKRz40Wgtv57fwIgdbzPDKBCw3WgZPrh/UdaLLn0OLrqgivYJ8Xt+xJHJR7z6X5Dujxa3xH1OZ+BPCzAR3KA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=Ce20dYlDuj4fApGrVry8j/eHtBrRhE9Zm2/cVUDHAYM=; b=ka7iCdgSx5d4w+UpmswtXHYdyl1OBPZS8noIGdEXLHkB0BPEORjK+C1qhuDkMxHWXeYkWsRAd9VmRV6MjOq35oG5VnCWqXalCtCj8u0qWbVIbyOTHB3GPLnvlcD6OIw1mhnETaeuJt0rbS89CkGHi8oMYCv00MLwtDs/dPSYW4glVB35ysD0O2/GAl/3+8GmMo/4RvitWbYUJEMeIiFUL1Q+Sv1Ev0IYrXjIA4hrBxbkNcd8jelRx0XrnBcxU3jBzYi9rKbtqKybrotrBCdu2SR5OzN0gcEqrM7Fzy6+1gyGbkx/+ygxp0Sz9DIR/J2jCcHnfiJLvOYHGDCM4g2KJA== Received: from MW4PR03CA0108.namprd03.prod.outlook.com (2603:10b6:303:b7::23) by SJ1PR12MB6195.namprd12.prod.outlook.com (2603:10b6:a03:457::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 15:17:55 +0000 Received: from CO1NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b7:cafe::dd) by MW4PR03CA0108.outlook.office365.com (2603:10b6:303:b7::23) 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:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT012.mail.protection.outlook.com (10.13.175.192) 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:55 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) 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:42 -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:39 -0800 From: Viacheslav Ovsiienko To: CC: , , , , Subject: [PATCH v3 2/3] app/testpmd: add host port parameter into flow config Date: Fri, 10 Feb 2023 17:17:08 +0200 Message-ID: <20230210151709.1619-3-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 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: CO1NAM11FT012:EE_|SJ1PR12MB6195:EE_ X-MS-Office365-Filtering-Correlation-Id: 109c16f1-63c6-4797-6caa-08db0b79fc1d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UOFX5TEDxbJOIu1JqbOJqPbDSdm8U9whrZDDmjATo6X5t1RU6qXXDOCVAFmzewNBg3ZXz4jb4UZuL2/ib+ZGJOBlpeFeq6J6vi03rLhgNF7AoEx8fbiCejGG5x5aQWO2stDf2Cw6hnVfV3ohyPJM54I9BSV1qrvf8v4IuRh6d+nJG3d0Wma5PiJb7cyLEVZjCOmtKXPp9+CuiyIal7tngzBFj5QsSSHzLb9XbB95/BBxYfnDg6mRdSUuHn9hPZu3dAzhczy7ObiI1rKZrMJs5YXumESE4bU078SQWXB/lVYSpjKv7GGFlmTHz3onZqHm+0yt3kHm63I7Qe5XT7qg+WIPXOcsNjjpFFkdQx1FaQV1+bp7D97z9rPTN5vbKVULbKL6KsMYWeaFfHwaLaj2vEsY3DPxnRGE6Hwa0cGvYqKSkZoJIZCIXSUefHdl61Ow2khja1ddwfNwqIW8EqCC+NZzZYuJzQuC1qVYbDk4u8KHiGxNx5z//JXvm938rsZj6R2G84uYbHsZM3SkCu4j7TvwqS+BEk0aZyM3/CChDBqSeJI7CX4mfdO6MPkOxgLSD1g/tXjch3xFKAhf9K98tU1Pogg/sug59gFjEl1rkAsEUFcNL50FgrpOTsfVLwJlricRS6rGelB+iQi3QpK8X9jlkT9bGDyodZLFKX4CAAMe4ZpVFxa9ofOZ5iC+V7gxaMdPzbV+Njj2lzSAmTl5QQ== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(39860400002)(346002)(396003)(451199018)(40470700004)(46966006)(36840700001)(356005)(86362001)(36756003)(7636003)(82740400003)(82310400005)(26005)(36860700001)(2616005)(426003)(336012)(47076005)(186003)(16526019)(1076003)(6286002)(6666004)(478600001)(7696005)(316002)(8936002)(41300700001)(54906003)(5660300002)(2906002)(70206006)(40480700001)(4326008)(8676002)(6916009)(40460700003)(55016003)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 15:17:55.0229 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 109c16f1-63c6-4797-6caa-08db0b79fc1d 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6195 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 Host port id parameter is added to "flow configure" command. Signed-off-by: Viacheslav Ovsiienko Acked-by: Ori Kam --- app/test-pmd/cmdline_flow.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 3b846ae73f..7778828919 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -230,6 +230,7 @@ enum index { CONFIG_METERS_NUMBER, CONFIG_CONN_TRACK_NUMBER, CONFIG_FLAGS, + CONFIG_HOST_PORT, /* Indirect action arguments */ INDIRECT_ACTION_CREATE, @@ -1114,6 +1115,7 @@ static const enum index next_config_attr[] = { CONFIG_METERS_NUMBER, CONFIG_CONN_TRACK_NUMBER, CONFIG_FLAGS, + CONFIG_HOST_PORT, END, ZERO, }; @@ -2767,6 +2769,14 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct buffer, args.configure.port_attr.flags)), }, + [CONFIG_HOST_PORT] = { + .name = "host_port", + .help = "host port for shared objects", + .next = NEXT(next_config_attr, + NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY(struct buffer, + args.configure.port_attr.host_port_id)), + }, /* Top-level command. */ [PATTERN_TEMPLATE] = { .name = "pattern_template", From patchwork Fri Feb 10 15:17:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 123688 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C505541C61; Fri, 10 Feb 2023 16:18:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3F3342D16; Fri, 10 Feb 2023 16:18:00 +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 08B3142D0B for ; Fri, 10 Feb 2023 16:17:59 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IelWZHXckx/Rexl1B4o6NUXglXlGA5PPGovoutnW8DrFEgAj1StbNsw5zqizB0+CpLcHxgxrgWDQKhMsa6MZIQOf3e58iojzvBqmZEaSTYJ4jrFEIlikN2e7Z7egQo3yeJEV3s5ALChIIi+qjx1cbAoA0Usr0YvAjnhY8uI/deaG4wZsIWIfDf4dieSHh/Sql48Sx9+uWz0kOwFyQjPL31qTL4n9cNj6fRHDvlE7mJs4qO7i8gTUHeZYAlEnT6yvrRhn/bPY4LZOd+DGe/STkRwFOesFpSNSXFxENxFFwJ7OvW4+uLff9ipa0a1Lx+6UdOwfiAcDNvqSv+JPk9UxGg== 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=tckNMrm2fuSRwjemKipf1gUTnwiteN2UYy3v78P0K/I=; b=XyWySigEVf5SJOf8uo/F3vYaIHd+ygqxUeU3igBRp+6wmq9kicQB3+wPUs7n00HCStIWOGDePRJb4hu7O4WRe74LCjoK2/6q0/PnnJ/n2KHQ6Gq+ZEyMyLgMReoqifQWiB1iovHZdJY0KHQaCa9MwlOabjxwVOg5cf8XjCg2eJ6M8kNqAAAjivuaZVPI3uUR18x9CI5vpFm96ajc7Oe6B7OfvrP/tx1Pj5Qh3C2Hfzz17EBsoxvbfhhQPkbXyle5DRm4nGog1aITchELrqgs7t6ZwHu7HRWJ9uNEVjRyg7d8bQhx5B/L6+bCh2obFmPI/FZ6hMHDNMPIy9WyBPogDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=tckNMrm2fuSRwjemKipf1gUTnwiteN2UYy3v78P0K/I=; b=T6PrW8RSh4g5W1X6aT6AF7aQaRoyUuD9muqg786CrxT0RpLIecPEowxLAZAcNcSMOPHptxzwcBJUS2+tEvd3nDjVaqTwmR4RLrujYYwJs48OzACNHOJxtX3BPn3m7x6lvZ6w6iEUnPqYfyTWiADLEsHPCairu+MxpcBjnmNcbru9q5O8uzVG34406lNuBs8m3OFrsvm3MEwEjAjp4dejnssZmVXPXpgKfNa8OpuyZeB1cWoEgu6dEHoPyLb/J22tCyC7yE4/NN4rjPijIrSGlB0OGlD7LrQ/kabozWp5DJsSEC99XJFh96P9uSDpp4gdf2308ST42pcsOsjIXbDphg== Received: from MW4PR03CA0094.namprd03.prod.outlook.com (2603:10b6:303:b7::9) by DS0PR12MB7827.namprd12.prod.outlook.com (2603:10b6:8:146::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 15:17:57 +0000 Received: from CO1NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b7:cafe::3f) by MW4PR03CA0094.outlook.office365.com (2603:10b6:303:b7::9) 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:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT012.mail.protection.outlook.com (10.13.175.192) 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:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) 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:45 -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:43 -0800 From: Viacheslav Ovsiienko To: CC: , , , , Subject: [PATCH v3 3/3] app/testpmd: add shared indirect action support Date: Fri, 10 Feb 2023 17:17:09 +0200 Message-ID: <20230210151709.1619-4-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 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: CO1NAM11FT012:EE_|DS0PR12MB7827:EE_ X-MS-Office365-Filtering-Correlation-Id: 8aeb37c7-5a2c-49c9-bcfe-08db0b79fd36 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5dcEpeaQFRtLkaGC2NHC51RdEHc5UFQ6bhZ/wz4Cv8jY4Yg4FI4Zdb1tsW9oG8D5BaLtw2peOlq3KOR8DIS1gF8WHh1sHyIHWDI1fUPhFYqOQcvDTgbhgO9SycYC5Ip/rAOLRQfWub4davNY61rdyj+bk3Z43ihmUAdZz7tNggwpxzoIMGlAsWvVZawDXaMxQ6W78WvkzKEAlrHa405U+lceL4HVQEch/iIRIrRsxhM457Busm6j/cMnquRdzz92nVMgtKUgtE5JqFjLlJRMPPR92qlf3Ap+NJvUFhFd1epyFZ/swDrQvprmoBn+OW0UNXbIdHRphYDDCOm/5m+H01WR3ProYWUgxwD4rpdXTeVyfmk30ibBzVcPGLKmoROKemH/AB7Fne8dTfqPMwuM2gZZ68+dz6j0VUcFY66c241xT4EyhVAjqnXf7N7e709Rf5/VJ1jQkD2EwJOwtatHdzCwRl28Bakos1dMOkI9/J+h86bR/x5aqYbGwHZfL8aj1eznKdxf/Zxgf8ISOkPfeF0TyI3vDRgsDG7aoZjSq1qB7BPbtaZCcgfCxcKwWlWPoHtJZZAx5q8wNcb64qmHagN/bOR8yu9+FeEvuhMd3FzbtYtjqw74wg5f+eSGmV3BSmGQN7lUOMpgQSnVmlRDOBeFzGefKVV3NlXNVvktBqV/ZPXzM2c7wrlNQ6PeXb0K/A/vtqvGuRDJeZTb/rysDw== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(396003)(136003)(346002)(39860400002)(376002)(451199018)(40470700004)(46966006)(36840700001)(5660300002)(6286002)(36860700001)(26005)(82740400003)(7636003)(186003)(8936002)(40460700003)(1076003)(356005)(2906002)(16526019)(41300700001)(6666004)(70586007)(6916009)(70206006)(8676002)(4326008)(2616005)(86362001)(336012)(316002)(83380400001)(47076005)(478600001)(55016003)(82310400005)(54906003)(426003)(36756003)(40480700001)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 15:17:56.8666 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8aeb37c7-5a2c-49c9-bcfe-08db0b79fd36 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7827 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 shared indirect action can be shared between ports, action should be created on single port and the handle can be used in the templates and flows on multiple ports, example: flow configure 0 queues_number 1 queues_size 64 counters_number 64 flow configure 1 queues_number 1 queues_size 64 counters_number 0 \ host_port 0 flags 1 flow indirect_action 0 create ingress action_id 0 action count / end flow actions_template 0 create ingress actions_template_id 8 template indirect 0 / queue index 0 / end mask count / queue index 0 / end flow actions_template 1 create ingress actions_template_id 18 template shared_indirect 0 0 / queue index 0 / end mask count / queue index 0 / end Signed-off-by: Viacheslav Ovsiienko Acked-by: Ori Kam --- app/test-pmd/cmdline_flow.c | 53 ++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 7778828919..f2403622d6 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -607,6 +607,8 @@ enum index { ACTION_SAMPLE_INDEX, ACTION_SAMPLE_INDEX_VALUE, ACTION_INDIRECT, + ACTION_SHARED_INDIRECT, + INDIRECT_ACTION_PORT, INDIRECT_ACTION_ID2PTR, ACTION_MODIFY_FIELD, ACTION_MODIFY_FIELD_OP, @@ -1926,6 +1928,7 @@ static const enum index next_action[] = { ACTION_AGE_UPDATE, ACTION_SAMPLE, ACTION_INDIRECT, + ACTION_SHARED_INDIRECT, ACTION_MODIFY_FIELD, ACTION_CONNTRACK, ACTION_CONNTRACK_UPDATE, @@ -2435,6 +2438,9 @@ static int parse_ia_destroy(struct context *ctx, const struct token *token, static int parse_ia_id2ptr(struct context *ctx, const struct token *token, const char *str, unsigned int len, void *buf, unsigned int size); +static int parse_ia_port(struct context *ctx, const struct token *token, + const char *str, unsigned int len, void *buf, + unsigned int size); static int parse_mp(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); @@ -6522,6 +6528,23 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_ARB(0, sizeof(uint32_t))), .call = parse_vc, }, + [ACTION_SHARED_INDIRECT] = { + .name = "shared_indirect", + .help = "apply indirect action by id and port", + .priv = PRIV_ACTION(INDIRECT, 0), + .next = NEXT(NEXT_ENTRY(INDIRECT_ACTION_PORT)), + .args = ARGS(ARGS_ENTRY_ARB(0, sizeof(uint32_t)), + ARGS_ENTRY_ARB(0, sizeof(uint32_t))), + .call = parse_vc, + }, + [INDIRECT_ACTION_PORT] = { + .name = "{indirect_action_port}", + .type = "INDIRECT_ACTION_PORT", + .help = "indirect action port", + .next = NEXT(NEXT_ENTRY(INDIRECT_ACTION_ID2PTR)), + .call = parse_ia_port, + .comp = comp_none, + }, [INDIRECT_ACTION_ID2PTR] = { .name = "{action_id}", .type = "INDIRECT_ACTION_ID", @@ -10006,6 +10029,31 @@ parse_port(struct context *ctx, const struct token *token, return ret; } +/** Parse tokens for shared indirect actions. */ +static int +parse_ia_port(struct context *ctx, const struct token *token, + const char *str, unsigned int len, + void *buf, unsigned int size) +{ + struct rte_flow_action *action = ctx->object; + uint32_t id; + int ret; + + (void)buf; + (void)size; + ctx->objdata = 0; + ctx->object = &id; + ctx->objmask = NULL; + ret = parse_int(ctx, token, str, len, ctx->object, sizeof(id)); + ctx->object = action; + if (ret != (int)len) + return ret; + /* set indirect action */ + if (action) + action->conf = (void *)(uintptr_t)id; + return ret; +} + static int parse_ia_id2ptr(struct context *ctx, const struct token *token, const char *str, unsigned int len, @@ -10026,7 +10074,10 @@ parse_ia_id2ptr(struct context *ctx, const struct token *token, return ret; /* set indirect action */ if (action) { - action->conf = port_action_handle_get_by_id(ctx->port, id); + portid_t port_id = ctx->port; + if (ctx->prev == INDIRECT_ACTION_PORT) + port_id = (portid_t)(uintptr_t)action->conf; + action->conf = port_action_handle_get_by_id(port_id, id); ret = (action->conf) ? ret : -1; } return ret;