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 8AC2E43A1A; Wed, 31 Jan 2024 10:39:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B09442D0B; Wed, 31 Jan 2024 10:38:57 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2059.outbound.protection.outlook.com [40.107.102.59]) by mails.dpdk.org (Postfix) with ESMTP id 93FE0427E7 for ; Wed, 31 Jan 2024 10:38:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EcTxPyyj96g8YPacJ/URTvapk/GZTRFYX/1m0KTbRtB3pBDjBlrDZeFKXOZf412fhJ21lGmDA8fcoTTpFwrM8hi9AltzTxbo0btIEHll2WCo3vgpCtDitddJ9YEBi6zjh10uYfXosRAZ4KFpOE5CO+UQP07YbQSgN2wAfoPZstLxcWc5PGGsI5HCk/JzNOx7vMeXbJjiBFi37xLRWQ9e5y1KS2cF/PobWnbOcvl5q5i0/LiCzkkDGAtDRLT3FpK8kj1AjVi/B/Q1QDw7dPg3ZqJlDykRWtnlKE0HDyFlyBau7fT6RGu7da08itNrESxfcDZR4CGuz4JZZ10NvjE0EQ== 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=r5knkG83eLGz7TzJe/29PF9WrJXIU1ubDSXeRFI9FX8=; b=TAaTUi4OJ8qL3+J7k1yzmfwPQdvPT8tN4azcxwhBpwUOUU1gBjC7qpCQVr35Gv5T9KfSr3jxrsuUi9nu7Nime32peAuI6feybnJbhs1S1lu99u2qevHUQFgSDBzYS7s9om4jorZy7zBF0+aQaRCjuLCn/Nd18ZfNQGmWTczyM+CaEi7vU0nQEk3Z3Ik7Urww9eUs2k0f8yF3bernOUqrqdHJOgooHrLb/ctmwzmM/74c0NyBXWeJW21CNoka27l2U0afhAGcJQtVdSbcnJFL9+T6VkaYiSNjSuPgmNDkUMqnlW8b/VLCab/BLeEUyahp3SYMZkvXHEflYXw8oFLmFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com 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 (0) 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=r5knkG83eLGz7TzJe/29PF9WrJXIU1ubDSXeRFI9FX8=; b=tZe5KyF2VecA0v3waZ6FPxBYmFxuVNnjQsCpDESMr+u9xJtks257BMEgC43n0I1lD1EOEtNno6U1uPdUgH/7fy/WdPHyv0tU/czgg0NtbDZAc4EpmraKFq8+3vcfpiI7RpUVxS3w+5il752SejHFg/JJGrFIFiXbGQZj3Ss4xY4V2Er6JfKZd5hjMgiHJAopZNH/plFrhp+P0rK9PKVWf9Y5gD/+oklPmwuZ1GC5KvAXBHMCrDmbyxQ5QeMziF9gQjpsWy6W5Y+YrNlm3joyihhScunVKROR0AN26c2pQyr8TDQYUdr9GyzWk3pzt1JiiV03O9MJfIYFPwtlls/ciA== Received: from MN2PR16CA0004.namprd16.prod.outlook.com (2603:10b6:208:134::17) by SA3PR12MB7806.namprd12.prod.outlook.com (2603:10b6:806:31d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.22; Wed, 31 Jan 2024 09:38:51 +0000 Received: from BL6PEPF0001AB71.namprd02.prod.outlook.com (2603:10b6:208:134:cafe::c5) by MN2PR16CA0004.outlook.office365.com (2603:10b6:208:134::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.22 via Frontend Transport; Wed, 31 Jan 2024 09:38:51 +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 BL6PEPF0001AB71.mail.protection.outlook.com (10.167.242.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.16 via Frontend Transport; Wed, 31 Jan 2024 09:38:50 +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.41; Wed, 31 Jan 2024 01:38:38 -0800 Received: from nvidia.com (10.126.231.35) 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.41; Wed, 31 Jan 2024 01:38:35 -0800 From: Bing Zhao To: , , , , , , , , , , , Subject: [PATCH v2 2/2] app/testpmd: add support for NAT64 in the command line Date: Wed, 31 Jan 2024 11:38:04 +0200 Message-ID: <20240131093804.357465-3-bingz@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240131093804.357465-1-bingz@nvidia.com> References: <20231227090731.2569427-1-bingz@nvidia.com> <20240131093804.357465-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB71:EE_|SA3PR12MB7806:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fdfb4f0-6b90-4a5d-a036-08dc22406ec1 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: 4Ge9l4VjTNquf009n6b6Y+iFnGC1YmiFkNjoaPtKWL6E0WSGYkTkWogVd8xLp8o8B+M6HSTpb9rExQvSTxtr1jUO4Qw9Or+RDpHlgTjOji5UViriO3OBZtYYtgH0FHZKLhTWIQ5snR5oLG8iNNCdphPm7yJ0Oh/TVVOvFvH4SKrIExiEaDBNZ5lboDYGZ59NkCaRO4GXUFN5jwjmX4QHdwFFJPdyeEILjJy6v/S+onsc0tgYHZqLPHhweEQwqueNG5YpISUkV32ukA2f+GjKpFwOfhg2XBoYspsNN+FIWUUUIo4FmG68ef4H/U6HD/UaE+gSyJM+HY06jIELjW4XYNMa9NawWSGFfW/pVCWEOqyRbrJn1nPm9VUttfuCWekmy7BiJp+vBHEm3R/yW/pDc56fq8fULZ2SSxTY0W3oMJICAEom0dRXBVOreo1uWYd/JZocHUL6KmxR5+8KR6qW4vFjOyZnEeXWh8pv28/9J5Qj23H9PPc/+smG0ljcvK9Gs4jk/ZY+tW90tyQVhCXXy0eIozYqNDayfyxlCx1/kfOPdr4Edy7Ucb4wnvyOgUn/tjRRuBHJqJ/8XoVCsGWdn8lS7jU0RdNW93CLNocBZaCfWzImCDhhNBWz7Pxf+AsdI9D+Sz3AsHaR8s/yVkMYiWNQFr9hsnSVKAlE5qYEmei+PqHPkaUqV/0WTr6ecl68DzXXhzuEiZtjgHTDlsjHjkHaYPZYQ+k+5KoI8iZ0YKDeC9og+UqVbhnvh7nDiNVq 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:(13230031)(4636009)(376002)(346002)(396003)(39860400002)(136003)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(82310400011)(40470700004)(46966006)(36840700001)(41300700001)(8676002)(110136005)(2906002)(5660300002)(8936002)(86362001)(70586007)(70206006)(316002)(36756003)(36860700001)(6636002)(356005)(47076005)(82740400003)(7636003)(7696005)(478600001)(6666004)(83380400001)(26005)(6286002)(1076003)(16526019)(2616005)(426003)(336012)(921011)(55016003)(40460700003)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 09:38:50.9171 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fdfb4f0-6b90-4a5d-a036-08dc22406ec1 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: BL6PEPF0001AB71.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7806 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 type of NAT64 action will be parsed. Usage example with template API: ... flow actions_template 0 create ingress actions_template_id 1 \ template count / nat64 / jump / end mask count / nat64 / \ jump / end flow template_table 0 create group 1 priority 0 ingress table_id \ 0x1 rules_number 8 pattern_template 0 actions_template 1 flow queue 0 create 2 template_table 0x1 pattern_template 0 \ actions_template 0 postpone no pattern eth / end actions count / \ nat64 type 1 / jump group 2 / end ... Signed-off-by: Bing Zhao --- app/test-pmd/cmdline_flow.c | 23 +++++++++++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 4062879552..d26986a9ab 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -733,6 +733,8 @@ enum index { ACTION_IPV6_EXT_PUSH, ACTION_IPV6_EXT_PUSH_INDEX, ACTION_IPV6_EXT_PUSH_INDEX_VALUE, + ACTION_NAT64, + ACTION_NAT64_MODE, }; /** Maximum size for pattern in struct rte_flow_item_raw. */ @@ -2209,6 +2211,7 @@ static const enum index next_action[] = { ACTION_QUOTA_QU, ACTION_IPV6_EXT_REMOVE, ACTION_IPV6_EXT_PUSH, + ACTION_NAT64, ZERO, }; @@ -2550,6 +2553,12 @@ static const enum index action_represented_port[] = { ZERO, }; +static const enum index action_nat64[] = { + ACTION_NAT64_MODE, + ACTION_NEXT, + ZERO, +}; + static int parse_set_raw_encap_decap(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); @@ -7077,6 +7086,20 @@ static const struct token token_list[] = { .call = parse_vc_action_ipv6_ext_push_index, .comp = comp_set_ipv6_ext_index, }, + [ACTION_NAT64] = { + .name = "nat64", + .help = "NAT64 IP headers translation", + .priv = PRIV_ACTION(NAT64, sizeof(struct rte_flow_action_nat64)), + .next = NEXT(action_nat64), + .call = parse_vc, + }, + [ACTION_NAT64_MODE] = { + .name = "type", + .help = "NAT64 translation type", + .next = NEXT(action_nat64, NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY(struct rte_flow_action_nat64, type)), + .call = parse_vc_conf, + }, /* Top level command. */ [SET] = { .name = "set", diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 38ab421547..d1801c1b26 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -4169,6 +4169,10 @@ This section lists supported actions and their attributes, if any. - ``src_ptr``: pointer to source immediate value. - ``width``: number of bits to copy. +- ``nat64``: NAT64 IP headers translation + + - ``type {unsigned}``: NAT64 translation type + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~ -- 2.34.1