From patchwork Wed Feb 22 14:11:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 124356 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 4527341D3D; Wed, 22 Feb 2023 15:12:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5983243016; Wed, 22 Feb 2023 15:12:13 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2083.outbound.protection.outlook.com [40.107.223.83]) by mails.dpdk.org (Postfix) with ESMTP id 3572D42FCC for ; Wed, 22 Feb 2023 15:12:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cB5WaVaQlQGZL7XnvIto6mOfo4Ep0tod5arMntn6hWT7oo5X7LSQceygzfm0fxDY/Mg/v40MneqRVfo7NM0i02YsADbPWKUJXxEZTnulusKj3LWwKzO1Gu5u7C0HWMElgw84D+fqP9YGeqnB4UY7c7FAOW8c2OKwmMilHeALtacAsyqxaVc/oxsVEjxsDY9h4sLtI1eZuFG9XNTmCv/ojD9UScsz9EY8y1skIjy3bsIdHgBjAmwXhNOo1Z95n7t6vXJCZwfmCOCe4X9dRMFkneKG1XSjM5nfaaAh3ABCu0Lh2naXOYYXmqGgXJOLNhdC1aYNFQzgYis1GaY2rg3WUw== 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=+F/PfXumau6cdLa2vsJZH5Pw2Q6PHLh0wuv6yFQYtKs=; b=hCTxzZ22uQPAF4XiuKd39xDm2WIZsbFiHvNQZv4IkEGvAaaURr4Ac7EyCtprGapYVVzZTl+fbpTiGX7mxgKxuyvqrW8IiVYBBhvPHGLE5hL6GDHIvLeKQ4aLZHz1aF1ThbtSGwVdbhGk/YpP0FbjhwQoO9eMa8dlIwsUeKMKDjzCACVEysEaxT1CsbeMBr4TNZXiBbJEqYIYP4GOLDl97/ApD4dPHuWivmXo87SDrAAL7UhzxBhvmtJo7nOxqQiEnfMKwo3cQdsfOwH6N33tg+ELq7XmJmVrmpJ4FruETotXzj2dKjKd5QHwMq/iaxcARmUxHAPOnezuDbgIHZbNFA== 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=+F/PfXumau6cdLa2vsJZH5Pw2Q6PHLh0wuv6yFQYtKs=; b=HkZ48TcaB3n9KITPI3z0H6Wj+Ji/uqqpwXvwmT6Z0Nb1qCwTLDp3gWIrjadTP29o9DGgNsnUQUwCjNdpo1AjMI/gftn2ijr0PT07IyDCss8FIkMVkKE4XjwxLz8huppxP7xDxubcyuIq1tyS3QLxdyTabf/KhDGfYw03guS78c5RaamfQdkFYjU5unVv/px9OqSHxJu6iWUpByz4VVHvdFxF/BudQWEL9PfElZj2SvpzbHswMxJQkuKQM5RwFMhCXa7W5pL7VnSNQXomc0gLGs8LRiZs7H4NWCTIKus/5YEyXxSwQC/KweIpR3M44vZsxJrevOzNs/uqDI5ZPUTzvA== Received: from BN9PR03CA0753.namprd03.prod.outlook.com (2603:10b6:408:13a::8) by PH0PR12MB7908.namprd12.prod.outlook.com (2603:10b6:510:28e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Wed, 22 Feb 2023 14:12:09 +0000 Received: from BN8NAM11FT098.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13a:cafe::4e) by BN9PR03CA0753.outlook.office365.com (2603:10b6:408:13a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.19 via Frontend Transport; Wed, 22 Feb 2023 14:12:08 +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 BN8NAM11FT098.mail.protection.outlook.com (10.13.177.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.19 via Frontend Transport; Wed, 22 Feb 2023 14:12:08 +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; Wed, 22 Feb 2023 06:11:56 -0800 Received: from nvidia.com (10.126.230.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; Wed, 22 Feb 2023 06:11:53 -0800 From: Eli Britstein To: CC: , Thomas Monjalon , Eli Britstein , Ori Kam , Aman Singh , Yuying Zhang Subject: [PATCH 1/2] app/testpmd: change rule type Date: Wed, 22 Feb 2023 16:11:37 +0200 Message-ID: <20230222141139.3233715-1-elibr@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT098:EE_|PH0PR12MB7908:EE_ X-MS-Office365-Filtering-Correlation-Id: eb1e1709-ec76-499e-1d7a-08db14dec8f1 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SvMkkk1JFCPEVEMt6EQRFno7CQ1U87+YidOzOaCcVRc1nGJIerd+li1EbqOT1jWLJx8zbYtCYIt+p9Hqc3jP5MhmRBH6YLpwVoFziWundg0x2CBpb4fY+3jgaxwkjHV7USijT66i4/lJc7m0HUDDuQOweP1uN3AHGPaFbEt091Jey+n18G+W6s2x+j7YbraS7ZRaJawWmfhOQLuHgCHs3u1aJ4HX/aE7LSP+4RGswNpMZ176wmplxnBHeXFIgZ5Cf0zBI/JDbFs/HXP9bRdAvSID0/waXXYBm8SHbK/bNvTI9/MDvLwu4A61eToADZF3Cwe1gu1jflA8wQcPUSb2g9cb2stjYQ6MNNP7eBqLBXauQ0KnjQkBByjdtJkx0Ssik1h4QediKjtxb5ggFcrBz15UARkM62tGTkT0fVBWN6pGOdNJI1bwSer2NdklNw3W/egSVz0th0HGWOO2LiUbovDjalW/oN7kgn5qIjTJmqTTULIw602uv2g1azfxsb7pFiVMtPWrRG8csYS7vMOlTOx0wC7GVyjK1c3eUXVVdsRsLm2Wx3HeuIEieE32PH+IwEcxcQ5ps3MmeHAet2v7C9PX14sUI5xS280g3f7gIha/mDeqnPoyIlft9opjFB8vzAbUcq+cZVd3Ic5Evvh7xhLwPQYj4YVv9nM7sRkVJk9sEFhDkf1oSkv+RvCzyW53fSlxJd9wRetdSHfI/J6MA5RLwsp1asiEeA3bgIz2vHo= 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)(346002)(136003)(376002)(396003)(39860400002)(451199018)(46966006)(36840700001)(40470700004)(83380400001)(70586007)(478600001)(6286002)(16526019)(6666004)(86362001)(186003)(40480700001)(26005)(1076003)(55016003)(36756003)(426003)(70206006)(316002)(8676002)(47076005)(54906003)(7696005)(2616005)(40460700003)(41300700001)(2906002)(82310400005)(356005)(7636003)(8936002)(82740400003)(5660300002)(34020700004)(336012)(36860700001)(6916009)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2023 14:12:08.7722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb1e1709-ec76-499e-1d7a-08db14dec8f1 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: BN8NAM11FT098.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7908 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 Change rule type to be uintptr_t (instead of currently uint32_t) to be able to accomodate larger IDs, as a pre-step towards allowing user-id to flows. Signed-off-by: Eli Britstein --- app/test-pmd/cmdline_flow.c | 12 ++++++------ app/test-pmd/config.c | 34 ++++++++++++++++++---------------- app/test-pmd/testpmd.h | 10 +++++----- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 9309607f11..a2709e8aa9 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -1085,16 +1085,16 @@ struct buffer { uint8_t *data; } vc; /**< Validate/create arguments. */ struct { - uint32_t *rule; - uint32_t rule_n; + uintptr_t *rule; + uintptr_t rule_n; } destroy; /**< Destroy arguments. */ struct { char file[128]; bool mode; - uint32_t rule; + uintptr_t rule; } dump; /**< Dump arguments. */ struct { - uint32_t rule; + uintptr_t rule; struct rte_flow_action action; } query; /**< Query arguments. */ struct { @@ -9683,7 +9683,7 @@ parse_qo_destroy(struct context *ctx, const struct token *token, void *buf, unsigned int size) { struct buffer *out = buf; - uint32_t *flow_id; + uintptr_t *flow_id; /* Token name must match. */ if (parse_default(ctx, token, str, len, NULL, 0) < 0) @@ -10899,7 +10899,7 @@ comp_rule_id(struct context *ctx, const struct token *token, port = &ports[ctx->port]; for (pf = port->flow_list; pf != NULL; pf = pf->next) { if (buf && i == ent) - return snprintf(buf, size, "%u", pf->id); + return snprintf(buf, size, "%"PRIu64, pf->id); ++i; } if (buf) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 4121c5c9bb..167cb246c5 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2723,7 +2723,7 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id, flow = rte_flow_async_create_by_index(port_id, queue_id, &op_attr, pt->table, rule_idx, actions, actions_idx, job, &error); if (!flow) { - uint32_t flow_id = pf->id; + uintptr_t flow_id = pf->id; port_queue_flow_destroy(port_id, queue_id, true, 1, &flow_id); free(job); return port_flow_complain(&error); @@ -2734,14 +2734,14 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id, pf->flow = flow; job->pf = pf; port->flow_list = pf; - printf("Flow rule #%u creation enqueued\n", pf->id); + printf("Flow rule #%"PRIu64" creation enqueued\n", pf->id); return 0; } /** Enqueue number of destroy flow rules operations. */ int port_queue_flow_destroy(portid_t port_id, queueid_t queue_id, - bool postpone, uint32_t n, const uint32_t *rule) + bool postpone, uint32_t n, const uintptr_t *rule) { struct rte_flow_op_attr op_attr = { .postpone = postpone }; struct rte_port *port; @@ -2788,7 +2788,8 @@ port_queue_flow_destroy(portid_t port_id, queueid_t queue_id, ret = port_flow_complain(&error); continue; } - printf("Flow rule #%u destruction enqueued\n", pf->id); + printf("Flow rule #%"PRIu64" destruction enqueued\n", + pf->id); *tmp = pf->next; break; } @@ -3087,7 +3088,7 @@ port_queue_flow_push(portid_t port_id, queueid_t queue_id) /** Pull queue operation results from the queue. */ static int port_queue_aged_flow_destroy(portid_t port_id, queueid_t queue_id, - const uint32_t *rule, int nb_flows) + const uintptr_t *rule, int nb_flows) { struct rte_port *port = &ports[port_id]; struct rte_flow_op_result *res; @@ -3150,7 +3151,7 @@ port_queue_flow_aged(portid_t port_id, uint32_t queue_id, uint8_t destroy) { void **contexts; int nb_context, total = 0, idx; - uint32_t *rules = NULL; + uintptr_t *rules = NULL; struct rte_port *port; struct rte_flow_error error; enum age_action_context_type *type; @@ -3206,7 +3207,7 @@ port_queue_flow_aged(portid_t port_id, uint32_t queue_id, uint8_t destroy) switch (*type) { case ACTION_AGE_CONTEXT_TYPE_FLOW: ctx.pf = container_of(type, struct port_flow, age_type); - printf("%-20s\t%" PRIu32 "\t%" PRIu32 "\t%" PRIu32 + printf("%-20s\t%" PRIuPTR "\t%" PRIu32 "\t%" PRIu32 "\t%c%c%c\t\n", "Flow", ctx.pf->id, @@ -3354,13 +3355,13 @@ port_flow_create(portid_t port_id, port->flow_list = pf; if (tunnel_ops->enabled) port_flow_tunnel_offload_cmd_release(port_id, tunnel_ops, pft); - printf("Flow rule #%u created\n", pf->id); + printf("Flow rule #%"PRIu64" created\n", pf->id); return 0; } /** Destroy a number of flow rules. */ int -port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule) +port_flow_destroy(portid_t port_id, uint32_t n, const uintptr_t *rule) { struct rte_port *port; struct port_flow **tmp; @@ -3389,7 +3390,7 @@ port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule) ret = port_flow_complain(&error); continue; } - printf("Flow rule #%u destroyed\n", pf->id); + printf("Flow rule #%"PRIu64" destroyed\n", pf->id); *tmp = pf->next; free(pf); break; @@ -3434,7 +3435,7 @@ port_flow_flush(portid_t port_id) /** Dump flow rules. */ int -port_flow_dump(portid_t port_id, bool dump_all, uint32_t rule_id, +port_flow_dump(portid_t port_id, bool dump_all, uintptr_t rule_id, const char *file_name) { int ret = 0; @@ -3463,7 +3464,8 @@ port_flow_dump(portid_t port_id, bool dump_all, uint32_t rule_id, } } if (found == false) { - fprintf(stderr, "Failed to dump to flow %d\n", rule_id); + fprintf(stderr, "Failed to dump to flow %"PRIu64"\n", + rule_id); return -EINVAL; } } @@ -3493,7 +3495,7 @@ port_flow_dump(portid_t port_id, bool dump_all, uint32_t rule_id, /** Query a flow rule. */ int -port_flow_query(portid_t port_id, uint32_t rule, +port_flow_query(portid_t port_id, uintptr_t rule, const struct rte_flow_action *action) { struct rte_flow_error error; @@ -3515,7 +3517,7 @@ port_flow_query(portid_t port_id, uint32_t rule, if (pf->id == rule) break; if (!pf) { - fprintf(stderr, "Flow rule #%u not found\n", rule); + fprintf(stderr, "Flow rule #%"PRIu64" not found\n", rule); return -ENOENT; } ret = rte_flow_conv(RTE_FLOW_CONV_OP_ACTION_NAME_PTR, @@ -3622,7 +3624,7 @@ port_flow_aged(portid_t port_id, uint8_t destroy) switch (*type) { case ACTION_AGE_CONTEXT_TYPE_FLOW: ctx.pf = container_of(type, struct port_flow, age_type); - printf("%-20s\t%" PRIu32 "\t%" PRIu32 "\t%" PRIu32 + printf("%-20s\t%" PRIu64 "\t%" PRIu32 "\t%" PRIu32 "\t%c%c%c\t\n", "Flow", ctx.pf->id, @@ -3700,7 +3702,7 @@ port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group) const struct rte_flow_action *action = pf->rule.actions; const char *name; - printf("%" PRIu32 "\t%" PRIu32 "\t%" PRIu32 "\t%c%c%c\t", + printf("%" PRIu64 "\t%" PRIu32 "\t%" PRIu32 "\t%c%c%c\t", pf->id, pf->rule.attr->group, pf->rule.attr->priority, diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 329a6378a1..ba29d97293 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -215,7 +215,7 @@ struct port_table { struct port_flow { struct port_flow *next; /**< Next flow in list. */ struct port_flow *tmp; /**< Temporary linking. */ - uint32_t id; /**< Flow rule ID. */ + uintptr_t id; /**< Flow rule ID. */ struct rte_flow *flow; /**< Opaque flow object returned by PMD. */ struct rte_flow_conv_rule rule; /**< Saved flow rule description. */ enum age_action_context_type age_type; /**< Age action context type. */ @@ -948,7 +948,7 @@ int port_queue_flow_create(portid_t port_id, queueid_t queue_id, const struct rte_flow_item *pattern, const struct rte_flow_action *actions); int port_queue_flow_destroy(portid_t port_id, queueid_t queue_id, - bool postpone, uint32_t n, const uint32_t *rule); + bool postpone, uint32_t n, const uintptr_t *rule); int port_queue_action_handle_create(portid_t port_id, uint32_t queue_id, bool postpone, uint32_t id, const struct rte_flow_indir_action_conf *conf, @@ -984,11 +984,11 @@ int port_action_handle_query(portid_t port_id, uint32_t id); void update_age_action_context(const struct rte_flow_action *actions, struct port_flow *pf); int mcast_addr_pool_destroy(portid_t port_id); -int port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule); +int port_flow_destroy(portid_t port_id, uint32_t n, const uintptr_t *rule); int port_flow_flush(portid_t port_id); int port_flow_dump(portid_t port_id, bool dump_all, - uint32_t rule, const char *file_name); -int port_flow_query(portid_t port_id, uint32_t rule, + uintptr_t rule, const char *file_name); +int port_flow_query(portid_t port_id, uintptr_t rule, const struct rte_flow_action *action); void port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group); void port_flow_aged(portid_t port_id, uint8_t destroy); From patchwork Wed Feb 22 14:11:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Britstein X-Patchwork-Id: 124355 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 446FE41D3D; Wed, 22 Feb 2023 15:12:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB9C940693; Wed, 22 Feb 2023 15:12:10 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2063.outbound.protection.outlook.com [40.107.95.63]) by mails.dpdk.org (Postfix) with ESMTP id 8E98640689 for ; Wed, 22 Feb 2023 15:12:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HJ8U+xH3oiz1qA0RE4ip7ByChTT+EjztI5ygEvamCdYEj11qQtM8GD+kgaVdD4PF4P54rB1Vz2yxi7AyjAdicrmyTKi+cSvKgJVBcyhpEDMomiCXtkySak1adTSuPpWijfWyYw0dETAzqjn8xLvov71P8oFl3AwB8zHXxzqQ+yStzF3SqBvdeVH13r7CHEKwNhtlmwdKGosa7tVnDaD7HyPfkyyKNW0Pi4j2+T8bMMn2wgUwn7lGGMe0qd1v2ea+IhnBXt/OemWVA0KrU1w2TNqDiBCcflThY9FE4PtUjMjtFJMw9Rb84p6M3ktCh3uU7U5kc28tbiWa5Rqv2mgZbw== 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=CaMMk0H9l+srtJiJ58K6l7+fUvFs+J9ijyg2uVeyFfU=; b=lNfyrYQlfr1HYya95YU9qcuVPlHT9JFnd9a7cUQMHKaO6k+FsgwK5VchIniqq/bjoJTYGj+yTskKS5iQNjQAisVmS8yfjXTvvOBJ3QBUZIb6W8oa60sI8LmTachxRPAsEDNbWAjkLOy+HHTmZmkfLbvCFennCKvAotDmPEDEgMvNe14m5+qfp91OglJXh98RP+oA455RS50TSg6mqhD9S+NJaVCjvnMHC89BEBGzzjfFywxXgpjj4+hN/Wrn22wxAVkCZqFI13qFmBQgwjuwCcB+zBK9GPdt4R0gdIlhumbYnKrRoia25G6Qcb56EStf6eRqlup5RzcmoUWHsvpF0Q== 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=CaMMk0H9l+srtJiJ58K6l7+fUvFs+J9ijyg2uVeyFfU=; b=sSSHqFy/qBw/WdNsV6XSusFwAkaL5HPpykGpDoVWB+iQCtgaYl/ALSwDgYAR9OSZNDGmIed1HBogEj9guRn5MCnDW6CJBdWB9cb6aO6W96YHphgVnCO7PeGRThaM/kb1JUt7lAcvylozsLTXG+2pXSYwWQIzMQANLVkK25RRPaO+MufIrt64fdWYnutvY+FylESf0NXk6WyRyR+D1fTDa/vLU3wEYcPOzD8gtFrlAVmcWkhZkUvaIJuPoMfS/MPNW0PwWEIljnW4lQw5aObn/I7OcX2DrZoVfcN7m/3uN88qbAfaaCSACigirOxzzD294NhcVFVeaTJSgE2sJs5BQw== Received: from DS7PR03CA0024.namprd03.prod.outlook.com (2603:10b6:5:3b8::29) by SJ0PR12MB5456.namprd12.prod.outlook.com (2603:10b6:a03:3ae::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21; Wed, 22 Feb 2023 14:12:07 +0000 Received: from DM6NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::4c) by DS7PR03CA0024.outlook.office365.com (2603:10b6:5:3b8::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.21 via Frontend Transport; Wed, 22 Feb 2023 14:12:07 +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 DM6NAM11FT042.mail.protection.outlook.com (10.13.173.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.17 via Frontend Transport; Wed, 22 Feb 2023 14:12:07 +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; Wed, 22 Feb 2023 06:11:58 -0800 Received: from nvidia.com (10.126.230.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; Wed, 22 Feb 2023 06:11:56 -0800 From: Eli Britstein To: CC: , Thomas Monjalon , Eli Britstein , Ori Kam , Aman Singh , Yuying Zhang Subject: [PATCH 2/2] app/testpmd: user assigned flow ID to flows Date: Wed, 22 Feb 2023 16:11:38 +0200 Message-ID: <20230222141139.3233715-2-elibr@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230222141139.3233715-1-elibr@nvidia.com> References: <20230222141139.3233715-1-elibr@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT042:EE_|SJ0PR12MB5456:EE_ X-MS-Office365-Filtering-Correlation-Id: 702c4d75-baae-4b7d-5a98-08db14dec7fb X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: roV2GKFa3cEz3xvBpz4pfBYUEk9hAdimgLo3MwsbGJrWwb55MSvPvmltfgMtHISXjbKKOUEcmJdqSE3sXFBvIZKJdcT0FXazQS9fr7iKZGH8F1p1bRbDAO1PVmKjlMgUTj46dd9WJbyUKV0DV4k9tqjTWKbkmYBCGx6DGaRYr2r6YeJ6rGvRVLPU5o0pfKUvO4ZiSGSKFaFInaVk+jR3pyO7rgweeWq8yrvtzvUd3F1uQ5Wbp+JqHwm0ed6LhejkeAD+1jeWKE5W846wp5ND5D9NkiIOSB+jCFx+xpeYjnEl1q1ISghN5vO3AoijBI/RCMD4+3eRm7w00vubW0VzXtPxzBDEe5PcW13biWLwuVO1WwTYgzXEj/RFeLNL0qJPLJUuuo1JehzGfFHLmrDcIHdtJPjrnaDkX1ENOwPDCxoQ1iTif7aFbWG/Psb6t3SBuqBncRa/+68YZ7ABnMZRxTrjULZJ+BzdrnXQ9OxvRjIPezwfLd1U5eEpuJqjj/txc9C9R90HIqiiuSK5C26ini50fmI4sPhi33MzAexGag0BM1rchYwjODdz9/h6VGD2FGoB9wSJdQe78XvsUhBSXWMTsT56W8ESEpOpAI/ni8CxZgxW5ILnb7H7Esoub6X6xSKCUwInNi7e2UFDYzlMmdoXT9elrycYtVWPRs8mGeJ4Em3d+Q44zkaiz0TE3fPiajFwqbpyM9/2oq161drAZOhf3ZL52Dy+Kbhl9lR6JiQ= 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)(376002)(346002)(39860400002)(451199018)(46966006)(36840700001)(40470700004)(30864003)(356005)(5660300002)(82740400003)(47076005)(8936002)(41300700001)(36860700001)(82310400005)(2906002)(34020700004)(2616005)(478600001)(86362001)(8676002)(4326008)(6916009)(70586007)(70206006)(426003)(54906003)(316002)(7636003)(6666004)(36756003)(26005)(6286002)(16526019)(1076003)(40480700001)(7696005)(336012)(83380400001)(40460700003)(186003)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2023 14:12:07.1928 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 702c4d75-baae-4b7d-5a98-08db14dec7fb 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: DM6NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5456 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 Currently, testpmd assigns its own IDs, as indices, to created flows. Later, the flow index is used as the ID for flow operations (query, destroy, dump). Allow the user to assign a user-id, to be later used as an alternative to the flow index testpmd assigns. Example: testpmd> flow create 0 ingress user_id 0x1234 pattern eth / end actions count / drop / end Flow rule #0 created, user-id 0x1234 testpmd> flow query 0 0x1234 count user_id testpmd> flow dump 0 user_id rule 0x1234 testpmd> flow destroy 0 rule 0x1234 user_id Flow rule user_id 0x1234 destroyed testpmd> flow destroy 0 rule 0x1234 user_id Flow rule #0 destroyed, user-id 0x1234 Signed-off-by: Eli Britstein --- app/test-pmd/cmdline_flow.c | 72 +++++++++++++++++++-- app/test-pmd/config.c | 34 +++++++--- app/test-pmd/testpmd.h | 12 ++-- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 14 ++-- 4 files changed, 108 insertions(+), 24 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index a2709e8aa9..758ca03966 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -206,9 +206,11 @@ enum index { /* Destroy arguments. */ DESTROY_RULE, + DESTROY_IS_USER_ID, /* Query arguments. */ QUERY_ACTION, + QUERY_IS_USER_ID, /* List arguments. */ LIST_GROUP, @@ -224,10 +226,12 @@ enum index { VC_TRANSFER, VC_TUNNEL_SET, VC_TUNNEL_MATCH, + VC_USER_ID, /* Dump arguments */ DUMP_ALL, DUMP_ONE, + DUMP_IS_USER_ID, /* Configure arguments */ CONFIG_QUEUES_NUMBER, @@ -1077,6 +1081,7 @@ struct buffer { uint32_t act_templ_id; struct rte_flow_attr attr; struct tunnel_ops tunnel_ops; + uintptr_t user_id; struct rte_flow_item *pattern; struct rte_flow_action *actions; struct rte_flow_action *masks; @@ -1087,15 +1092,18 @@ struct buffer { struct { uintptr_t *rule; uintptr_t rule_n; + bool is_user_id; } destroy; /**< Destroy arguments. */ struct { char file[128]; bool mode; uintptr_t rule; + bool is_user_id; } dump; /**< Dump arguments. */ struct { uintptr_t rule; struct rte_flow_action action; + bool is_user_id; } query; /**< Query arguments. */ struct { uint32_t *group; @@ -1319,6 +1327,7 @@ static const enum index next_ia_qu_attr[] = { static const enum index next_dump_subcmd[] = { DUMP_ALL, DUMP_ONE, + DUMP_IS_USER_ID, ZERO, }; @@ -1339,12 +1348,14 @@ static const enum index next_vc_attr[] = { VC_TRANSFER, VC_TUNNEL_SET, VC_TUNNEL_MATCH, + VC_USER_ID, ITEM_PATTERN, ZERO, }; static const enum index next_destroy_attr[] = { DESTROY_RULE, + DESTROY_IS_USER_ID, END, ZERO, }; @@ -1355,6 +1366,12 @@ static const enum index next_dump_attr[] = { ZERO, }; +static const enum index next_query_attr[] = { + QUERY_IS_USER_ID, + END, + ZERO, +}; + static const enum index next_list_attr[] = { LIST_GROUP, END, @@ -3533,7 +3550,7 @@ static const struct token token_list[] = { [DESTROY] = { .name = "destroy", .help = "destroy specific flow rules", - .next = NEXT(NEXT_ENTRY(DESTROY_RULE), + .next = NEXT(next_destroy_attr, NEXT_ENTRY(COMMON_PORT_ID)), .args = ARGS(ARGS_ENTRY(struct buffer, port)), .call = parse_destroy, @@ -3555,7 +3572,7 @@ static const struct token token_list[] = { [QUERY] = { .name = "query", .help = "query an existing flow rule", - .next = NEXT(NEXT_ENTRY(QUERY_ACTION), + .next = NEXT(next_query_attr, NEXT_ENTRY(QUERY_ACTION), NEXT_ENTRY(COMMON_RULE_ID), NEXT_ENTRY(COMMON_PORT_ID)), .args = ARGS(ARGS_ENTRY(struct buffer, args.query.action.type), @@ -3674,6 +3691,12 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_PTR(struct buffer, args.destroy.rule)), .call = parse_destroy, }, + [DESTROY_IS_USER_ID] = { + .name = "user_id", + .help = "rule identifier is user-id", + .next = NEXT(next_destroy_attr), + .call = parse_destroy, + }, /* Dump arguments. */ [DUMP_ALL] = { .name = "all", @@ -3690,6 +3713,12 @@ static const struct token token_list[] = { ARGS_ENTRY(struct buffer, args.dump.rule)), .call = parse_dump, }, + [DUMP_IS_USER_ID] = { + .name = "user_id", + .help = "rule identifier is user-id", + .next = NEXT(next_dump_subcmd), + .call = parse_dump, + }, /* Query arguments. */ [QUERY_ACTION] = { .name = "{action}", @@ -3698,6 +3727,12 @@ static const struct token token_list[] = { .call = parse_action, .comp = comp_action, }, + [QUERY_IS_USER_ID] = { + .name = "user_id", + .help = "rule identifier is user-id", + .next = NEXT(next_query_attr), + .call = parse_query, + }, /* List arguments. */ [LIST_GROUP] = { .name = "group", @@ -3759,6 +3794,13 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct tunnel_ops, id)), .call = parse_vc, }, + [VC_USER_ID] = { + .name = "user_id", + .help = "specify a user id to create", + .next = NEXT(next_vc_attr, NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY(struct buffer, args.vc.user_id)), + .call = parse_vc, + }, /* Validate/create pattern. */ [ITEM_PATTERN] = { .name = "pattern", @@ -7415,11 +7457,15 @@ parse_vc(struct context *ctx, const struct token *token, case VC_TUNNEL_MATCH: ctx->object = &out->args.vc.tunnel_ops; break; + case VC_USER_ID: + ctx->object = out; + break; } ctx->objmask = NULL; switch (ctx->curr) { case VC_GROUP: case VC_PRIORITY: + case VC_USER_ID: return len; case VC_TUNNEL_SET: out->args.vc.tunnel_ops.enabled = 1; @@ -9109,6 +9155,10 @@ parse_destroy(struct context *ctx, const struct token *token, sizeof(double)); return len; } + if (ctx->curr == DESTROY_IS_USER_ID) { + out->args.destroy.is_user_id = true; + return len; + } if (((uint8_t *)(out->args.destroy.rule + out->args.destroy.rule_n) + sizeof(*out->args.destroy.rule)) > (uint8_t *)out + size) return -1; @@ -9179,6 +9229,9 @@ parse_dump(struct context *ctx, const struct token *token, ctx->object = out; ctx->objmask = NULL; return len; + case DUMP_IS_USER_ID: + out->args.dump.is_user_id = true; + return len; default: return -1; } @@ -9208,6 +9261,10 @@ parse_query(struct context *ctx, const struct token *token, ctx->object = out; ctx->objmask = NULL; } + if (ctx->curr == QUERY_IS_USER_ID) { + out->args.query.is_user_id = true; + return len; + } return len; } @@ -11602,11 +11659,12 @@ cmd_flow_parsed(const struct buffer *in) case CREATE: port_flow_create(in->port, &in->args.vc.attr, in->args.vc.pattern, in->args.vc.actions, - &in->args.vc.tunnel_ops); + &in->args.vc.tunnel_ops, in->args.vc.user_id); break; case DESTROY: port_flow_destroy(in->port, in->args.destroy.rule_n, - in->args.destroy.rule); + in->args.destroy.rule, + in->args.destroy.is_user_id); break; case FLUSH: port_flow_flush(in->port); @@ -11614,11 +11672,13 @@ cmd_flow_parsed(const struct buffer *in) case DUMP_ONE: case DUMP_ALL: port_flow_dump(in->port, in->args.dump.mode, - in->args.dump.rule, in->args.dump.file); + in->args.dump.rule, in->args.dump.file, + in->args.dump.is_user_id); break; case QUERY: port_flow_query(in->port, in->args.query.rule, - &in->args.query.action); + &in->args.query.action, + in->args.query.is_user_id); break; case LIST: port_flow_list(in->port, in->args.list.group_n, diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 167cb246c5..51cc480762 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3303,7 +3303,8 @@ port_flow_create(portid_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item *pattern, const struct rte_flow_action *actions, - const struct tunnel_ops *tunnel_ops) + const struct tunnel_ops *tunnel_ops, + uintptr_t user_id) { struct rte_flow *flow; struct rte_port *port; @@ -3351,17 +3352,23 @@ port_flow_create(portid_t port_id, } pf->next = port->flow_list; pf->id = id; + pf->user_id = user_id; pf->flow = flow; port->flow_list = pf; if (tunnel_ops->enabled) port_flow_tunnel_offload_cmd_release(port_id, tunnel_ops, pft); - printf("Flow rule #%"PRIu64" created\n", pf->id); + if (user_id) + printf("Flow rule #%"PRIu64" created, user-id 0x%"PRIx64"\n", + pf->id, pf->user_id); + else + printf("Flow rule #%"PRIu64" created\n", pf->id); return 0; } /** Destroy a number of flow rules. */ int -port_flow_destroy(portid_t port_id, uint32_t n, const uintptr_t *rule) +port_flow_destroy(portid_t port_id, uint32_t n, const uintptr_t *rule, + bool is_user_id) { struct rte_port *port; struct port_flow **tmp; @@ -3379,7 +3386,7 @@ port_flow_destroy(portid_t port_id, uint32_t n, const uintptr_t *rule) struct rte_flow_error error; struct port_flow *pf = *tmp; - if (rule[i] != pf->id) + if (rule[i] != (is_user_id ? pf->user_id : pf->id)) continue; /* * Poisoning to make sure PMDs update it in case @@ -3390,7 +3397,13 @@ port_flow_destroy(portid_t port_id, uint32_t n, const uintptr_t *rule) ret = port_flow_complain(&error); continue; } - printf("Flow rule #%"PRIu64" destroyed\n", pf->id); + if (is_user_id) + printf("Flow rule #%"PRIu64" destroyed, " + "user-id 0x%"PRIx64"\n", + pf->id, pf->user_id); + else + printf("Flow rule #%"PRIu64" destroyed\n", + pf->id); *tmp = pf->next; free(pf); break; @@ -3436,7 +3449,7 @@ port_flow_flush(portid_t port_id) /** Dump flow rules. */ int port_flow_dump(portid_t port_id, bool dump_all, uintptr_t rule_id, - const char *file_name) + const char *file_name, bool is_user_id) { int ret = 0; FILE *file = stdout; @@ -3454,7 +3467,8 @@ port_flow_dump(portid_t port_id, bool dump_all, uintptr_t rule_id, port = &ports[port_id]; pflow = port->flow_list; while (pflow) { - if (rule_id != pflow->id) { + if (rule_id != + (is_user_id ? pflow->user_id : pflow->id)) { pflow = pflow->next; } else { tmpFlow = pflow->flow; @@ -3496,7 +3510,7 @@ port_flow_dump(portid_t port_id, bool dump_all, uintptr_t rule_id, /** Query a flow rule. */ int port_flow_query(portid_t port_id, uintptr_t rule, - const struct rte_flow_action *action) + const struct rte_flow_action *action, bool is_user_id) { struct rte_flow_error error; struct rte_port *port; @@ -3514,7 +3528,7 @@ port_flow_query(portid_t port_id, uintptr_t rule, return -EINVAL; port = &ports[port_id]; for (pf = port->flow_list; pf; pf = pf->next) - if (pf->id == rule) + if ((is_user_id ? pf->user_id : pf->id) == rule) break; if (!pf) { fprintf(stderr, "Flow rule #%"PRIu64" not found\n", rule); @@ -3634,7 +3648,7 @@ port_flow_aged(portid_t port_id, uint8_t destroy) ctx.pf->rule.attr->egress ? 'e' : '-', ctx.pf->rule.attr->transfer ? 't' : '-'); if (destroy && !port_flow_destroy(port_id, 1, - &ctx.pf->id)) + &ctx.pf->id, false)) total++; break; case ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION: diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index ba29d97293..b18ebeaf83 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -216,6 +216,7 @@ struct port_flow { struct port_flow *next; /**< Next flow in list. */ struct port_flow *tmp; /**< Temporary linking. */ uintptr_t id; /**< Flow rule ID. */ + uintptr_t user_id; /**< User rule ID. */ struct rte_flow *flow; /**< Opaque flow object returned by PMD. */ struct rte_flow_conv_rule rule; /**< Saved flow rule description. */ enum age_action_context_type age_type; /**< Age action context type. */ @@ -979,17 +980,20 @@ int port_flow_create(portid_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item *pattern, const struct rte_flow_action *actions, - const struct tunnel_ops *tunnel_ops); + const struct tunnel_ops *tunnel_ops, + uintptr_t user_id); int port_action_handle_query(portid_t port_id, uint32_t id); void update_age_action_context(const struct rte_flow_action *actions, struct port_flow *pf); int mcast_addr_pool_destroy(portid_t port_id); -int port_flow_destroy(portid_t port_id, uint32_t n, const uintptr_t *rule); +int port_flow_destroy(portid_t port_id, uint32_t n, const uintptr_t *rule, + bool is_user_id); int port_flow_flush(portid_t port_id); int port_flow_dump(portid_t port_id, bool dump_all, - uintptr_t rule, const char *file_name); + uintptr_t rule, const char *file_name, + bool is_user_id); int port_flow_query(portid_t port_id, uintptr_t rule, - const struct rte_flow_action *action); + const struct rte_flow_action *action, bool is_user_id); void port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group); void port_flow_aged(portid_t port_id, uint8_t destroy); const char *port_flow_tunnel_type(struct rte_flow_tunnel *tunnel); diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 5a88933635..92cf7d5adf 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3010,12 +3010,14 @@ following sections. flow create {port_id} [group {group_id}] [priority {level}] [ingress] [egress] [transfer] - pattern {item} [/ {item} [...]] / end + [user_id {user_id}] pattern {item} [/ {item} [...]] / end actions {action} [/ {action} [...]] / end - Destroy specific flow rules:: - flow destroy {port_id} rule {rule_id} [...] + flow destroy {port_id} rule {rule_id} [...] [user_id] + [user_id] is used as an optional flag to indicate the rule_id is the + user_id assigned in "flow create". - Destroy all flow rules:: @@ -3023,7 +3025,9 @@ following sections. - Query an existing flow rule:: - flow query {port_id} {rule_id} {action} + flow query {port_id} {rule_id} {action} [user_id] + [user_id] is used as an optional flag to indicate the rule_id is the + user_id assigned in "flow create". - List existing flow rules sorted by priority, filtered by group identifiers:: @@ -3040,7 +3044,9 @@ following sections. for one flow:: - flow dump {port_id} rule {rule_id} {output_file} + flow dump {port_id} rule {rule_id} {output_file} [user_id] + [user_id] is used as an optional flag to indicate the rule_id is the + user_id assigned in "flow create". - List and destroy aged flow rules::