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 A729A437A9; Wed, 27 Dec 2023 10:08:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10C74402D6; Wed, 27 Dec 2023 10:08:12 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) by mails.dpdk.org (Postfix) with ESMTP id 115E7402BA for ; Wed, 27 Dec 2023 10:08:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aF7hRtSAB4qF8Y/r1GCIE38/4/wdKeJ1bEXzqvoquiry/ygnEFsmW4RUVd5BAKRnVOnnSbwJZMYevhjX3fw3omOEMUjipourjovTUwosNdzivZBqoNPmo8t/+A3g96dTrmcuNMrLQRF+VRvBysRlOXul1iQvNciyUcPoBdxE6XgJQZ7tgbiUGmx+ZVGQqi1CGIgCq15j9MBxiKdj1Rgsye9kiy4bKHrn2PnzBe+JS8yiw3w145L6yFujTzCtuPVCVVlKnM52ZX1AtKv+F+9F7ECwCOT35AxTZ6iQdThHmGE9LlK+SEAPQtDHv7AU/RWe068562Ss+Sq/3cAk/kDtXg== 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=WeGelobZ2Mi4ZrcVWpUzBIw/3VJ3ArOVC8O5PZjVIDc=; b=Ya6AQUe0N2MLkOD1hghjXddJ7ZMIhsgnb7GcVuSLjNiqheoRW/+JPr1SBy12wJKG+k9CFc+jZAbu9SWefqpkmOENMLI4D5+b1Z7cCwEwxGR9nGFt5+i5Ui/YFHp8n2Y3LpcTmqGAgKgc4KXQzyVziOgT6/4qOz+7vHvEnPpj/2y/4CBilIA1PPy/KGth8Zexkl85b20ORTkMaUply/rQ5WUHNi49yyshJ2vn4Qiry9iHAsIG5dnnPb1R1vu63+GE8V3QczwUiR7Q2Sg2xb2sv1KyQcnW1xmyyY+onbGhMXu4vv4LTykfz0yIEn0P9hnL8MeO+YAolIMSWVMFTC4/4A== 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=WeGelobZ2Mi4ZrcVWpUzBIw/3VJ3ArOVC8O5PZjVIDc=; b=nv2gRwV6d0VCNQb5CucPuUghTacanI+h+Ccth+RHbWLAMJjJCWprJSjD3c0jDsmdGVEglcnz8BhnYzZaUVxGzQcYGa9YjUg7CEB8ly5W64NX69zwFWlADt0rXROnwuVdECGtPZSnzUT69J/OPv6aPKfmmuDfM0klFax7bmHLbsfAnHPupUCIYsmyLHAsXqo3St+7aIwgCXjwIgNMx8mAiNY2eGK/u8cZ58NgiWw49mLMj7FOPk9Q3mFp06Iq4q/pbFdiq6rS+oQ8Bq8wkSZxRSOFNaNAYir9go7yBOjB5SYSu1Oz+rS7eNuYZWUYvT2aBC3efwHJO/2N8ZnZW/C+rg== Received: from CY8PR19CA0026.namprd19.prod.outlook.com (2603:10b6:930:6::27) by BN9PR12MB5306.namprd12.prod.outlook.com (2603:10b6:408:103::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 09:08:08 +0000 Received: from CY4PEPF0000EE33.namprd05.prod.outlook.com (2603:10b6:930:6:cafe::85) by CY8PR19CA0026.outlook.office365.com (2603:10b6:930:6::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27 via Frontend Transport; Wed, 27 Dec 2023 09:08:08 +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 CY4PEPF0000EE33.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.14 via Frontend Transport; Wed, 27 Dec 2023 09:08:08 +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, 27 Dec 2023 01:07:59 -0800 Received: from nvidia.com (10.126.230.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, 27 Dec 2023 01:07:56 -0800 From: Bing Zhao To: , , , , , , , , , , , Subject: [PATCH 2/8] app/testpmd: add support for NAT64 in the command line Date: Wed, 27 Dec 2023 11:07:25 +0200 Message-ID: <20231227090731.2569427-3-bingz@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231227090731.2569427-1-bingz@nvidia.com> References: <20231227090731.2569427-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] 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: CY4PEPF0000EE33:EE_|BN9PR12MB5306:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d6a7ad9-f66f-4392-80fc-08dc06bb57e0 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: P+7Ev7c9Fq+SZhhfmreKhKLNI5FYKe54L4MY+37Q1ruAw3xGg5KfCwC+N/0/N43jHyuaNy11pjdISKCMtbHCYa1XyQhSN2EWsf9PGs/fZgqS5s/4NSvnquo2Igqohh10mfiaSM9CWAYeNZjCaejZDbFatAhgzeOq7Hy4JqMj/4ecbMfM77NJPkbrlueNSLS4aZqmxOBXwKeCiLO91K61JX35EsFfqZugNQJKrYSuCKs/dC8ZHQaOKPhYQ0q4FyeB7sHFYuw7YZnGN3ww8v5a5cQ4kDQYQsUepMLXqX4Dz45oaEdBG4UdAfWMsadqVliUuIPXbJD6mt8zuBsJCDF5MctJJNAjHF1e2N6yKKDgDMGeBU0iIMhj0L2bhxfIWNmVCCAp3rtwTeRgSLZx6bP5QFC5BGjNLLHUeaWnSL274WDK1uWHUTRaSECNEAiMzkZs3dh3m5+DFuNQC/KA//8IE+ekwwt43D1FVH6KHjTNRbov1reKpt84fgfgC+WXEMSuCf16B+NCXQxFx1FtAvkuHFWJenB9+umDPlW4BPVX16vtEq4jwzGBh4i2Kg+BJxTlsCo1uamMSWbkP48q/4j1FxHU2Ar34S7AaJEytK5TVsZdrqkn1/PyUN6fIbikRRuarT7W052AW2yTKqpxe8Nw/hH4Tp+y+ds7Po0PPXm1bj9iDdO211W0+WdZKicNWtt4Ne2I5U58KBf3mTWVfRdx8EJmItPmi8Rh+pax0q7rIrrVPPmkLI1auDH1OWIIHcXd 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)(39860400002)(376002)(136003)(396003)(346002)(230922051799003)(82310400011)(64100799003)(186009)(451199024)(1800799012)(40470700004)(36840700001)(46966006)(40480700001)(55016003)(36756003)(40460700003)(921011)(6666004)(6636002)(70586007)(70206006)(86362001)(7696005)(82740400003)(336012)(7636003)(356005)(26005)(1076003)(83380400001)(47076005)(2616005)(41300700001)(5660300002)(2906002)(16526019)(6286002)(426003)(478600001)(8936002)(36860700001)(316002)(110136005)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 09:08:08.1343 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d6a7ad9-f66f-4392-80fc-08dc06bb57e0 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: CY4PEPF0000EE33.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5306 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 ce71818705..6fb252d3d5 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -728,6 +728,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. */ @@ -2193,6 +2195,7 @@ static const enum index next_action[] = { ACTION_QUOTA_QU, ACTION_IPV6_EXT_REMOVE, ACTION_IPV6_EXT_PUSH, + ACTION_NAT64, ZERO, }; @@ -2534,6 +2537,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); @@ -7022,6 +7031,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 447e28e694..01044043d0 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -4151,6 +4151,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.25.1