From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80041.outbound.protection.outlook.com [40.107.8.41]) by dpdk.org (Postfix) with ESMTP id 60F541B1E8 for ; Tue, 25 Sep 2018 15:48:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kwbu4W+Srd388MPosE7QzdYZXqTSBLpflXrvD5RYOsk=; b=q3puUScc/CtveDX1CG4pAnue0qHDVpd6wGKeaKKwiz/1TJUY0R0NBxjadjbK8ZUB5nSK86M6dBSlQYdOD+8r5lqNyYTz0/rnQDoeR2t35JdnJtt0H1csHCQTZGnb6HyC/4GbFPeeUXntnMs7YWr1r5fiaiy6BHxukpM4ovN4q+U= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; Received: from dev-r630-08.mtbc.labs.mlnx (118.201.220.138) by DB6PR0501MB2023.eurprd05.prod.outlook.com (2603:10a6:4:6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.22; Tue, 25 Sep 2018 13:47:54 +0000 From: Xiaoyu Min To: ferruh.yigit@intel.com, Adrien Mazarguil , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic Cc: dev@dpdk.org Date: Tue, 25 Sep 2018 21:47:17 +0800 Message-Id: <20180925134718.18945-3-jackmin@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925134718.18945-1-jackmin@mellanox.com> References: <20180925134718.18945-1-jackmin@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [118.201.220.138] X-ClientProxiedBy: HK0PR03CA0050.apcprd03.prod.outlook.com (2603:1096:203:52::14) To DB6PR0501MB2023.eurprd05.prod.outlook.com (2603:10a6:4:6::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f50df53-a1e8-447a-eb70-08d622ed811a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0501MB2023; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2023; 3:pkSEnx1B6JudJIbgZZpHDLj/VD3UA5Eh6hmYfhYhgJayS86vl/8P+7VvFT/CkoD2beuv1P90dsDN6HZVZK2p2g7pM+IBVuyWAh7Ng1UChwbSwQ/3rKhcEISAYYYYDluXm5sjvFrxQX7yGS3dRj7ZTmbXdLwiFOnlXI5YJ68MlL1Rh6CVt8xUkKsKWka44JU3sVuseBDmKEEU62iEvWXBC/9iY6B1qv7ASD+Z1RinHRG2lX4npEksZ1mzGtQGt6TQ; 25:ygi1px6HSRBQTE1vvkq/OSrNgZYQvvxTiR66jDLVPaLF0n2mWaeMJrmUwMiUhFhI+0sy7dmL1bIYIXNiIS1fYaXS5VzPqbctdN+GSYGePo1WfNC/JswSBl/IH9JI+n37dSlDiSKGQrvB42C6roCC4zm6CpY9JVl+FQtj/abJDZuvUnpqqG+hpQjKEMcrm06Y9wi+GoAiIcRtWcUfyJA1uA9I2CNt+jO7FNZRHNlcNIRRtR4SEoltAuChToLtm6sIJNXWkM+0X6iFL1QkfvcfrKytSPuEONpQq1auFXG2LC+nS8AS6hzElg7FMQ/srG3K/uyybFtcFGr0F7cdF/0XkA==; 31:f2KM3z9xwdYI83f3/Mt/CfMGHnyqOCMZXOxIUv2zaUIjF4HE0vw7tdEuITAK8NwgDKNYuJt4b9IyntPdvwacAEQPLIXWwLrZv1SZ/9bHaCP8bwXxfm2DyX+IfVKda7iy6eIoU8bByixAWQl3vjRBYiWDtKBHO+ItBVLzJ0wSJ/l7rOxC6yuE+It/Pz3a8ziY9yj3h65PAP++7qCiArVnR+7fPtsd0ODE9PJLtuZhZNI= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2023: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2023; 20:e+xsCRAdDeUt/LX6EJ9lTVuQopgoPSmxA5gz3haYouhMouSKZ30NtTtVj+hhKWv7Wfyf1hrQjrtpIuP1KJlnGQjnxrArfMFKofJk1qrtI9dl857HMqYsXwwMQ2LhrOLazf35crdzNj71CQgikP4p/lhehNxj+Tj/pvbgIIfLAfovBtmZKAaqoT2UEhHOljBvey1Rq0fIpqp6fUEFtkhLUn00O4LQutNlubif6+0iWM3o2CpZqtUMuRmqKRPFpkBoDkT3dRzh23bRA4QNifVA9CQyfxMGxaCsh4ibfopZ8mwIKAenUg9+Jow8fmTJLQwybgl3BqBOmDTEjr5fnUmfs5s8aYHGTpSGX2fEXi32xlAQM7l2zN9Lpn8TyXPdJFMHNLzhhhwTq3B56d15wVMmr0sXDO/7LQC4bjw4q33ciP4kvYqsXOAEOfN0j/TIScFMWwy09wdr/fdRXkf961bTvevyHAX0bhftKMl7RgI+qbKD6zOEMKaWvl+8a3RFR83M; 4:kSXLpLlBXMASrRxwExKyOtpPiSFxboigoeUUHERzgGryIoyeXlVqv+2cUU0QebJ9HqyPKKl81EK+2Qun66DSMB77mAynNbiAuni+03klgqD+kMW1lm/8dYIrgBxF9fcCDIhDHP709CjblGz3ogtSdB2EWA5nhY+pCNUF7XMycZ3avhypXrXWb2mxXBzZKhcZWjtpr25AtN6konWslmlTIYB8k4BJJQG6vGhyIZ1+imXMsA8FMmDRWQ+6WpTRdPV3Ok+C2n5u3M7N2KVU5kKWbw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231355)(944501410)(52105095)(10201501046)(3002001)(6055026)(149066)(150027)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051); SRVR:DB6PR0501MB2023; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2023; X-Forefront-PRVS: 08062C429B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(136003)(396003)(39860400002)(376002)(199004)(189003)(6512007)(4326008)(446003)(68736007)(11346002)(476003)(486006)(86362001)(2616005)(16586007)(956004)(3846002)(14444005)(5660300001)(25786009)(6506007)(316002)(106356001)(26005)(110136005)(105586002)(6666003)(6116002)(386003)(1076002)(50226002)(186003)(16526019)(2906002)(36756003)(478600001)(81156014)(305945005)(7736002)(50466002)(52116002)(48376002)(81166006)(51416003)(8676002)(97736004)(76176011)(66066001)(53936002)(47776003)(6486002)(8936002)(34290500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2023; H:dev-r630-08.mtbc.labs.mlnx; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0501MB2023; 23:6kNPLnDLLHi8scbE1Et3fWmQzH+5/fDTS3eGjp+?= =?us-ascii?Q?OE1xtfF1DgVRG20/Jx3Ehyq12P1DkSXXtOb/1ZJFnIgoprFoJzeX6eSQqlG6?= =?us-ascii?Q?CSvdrUsKrCJMdMZ2SvoutCUv1UBYQfq1ZdAX+v6bGL6aJ1+gaQwPCfuhJCDV?= =?us-ascii?Q?Il17b9DeN4V0JDMY6I8vlDBAGvWSRN7RS9cSdCoRsNnPDcXFD8GsTBLQvXoS?= =?us-ascii?Q?83sMe3k4zalXzX1qXNxAHOns42zjIluZYSiiERfYbTbhoIPsU7uRcXvpNkbb?= =?us-ascii?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KRuXwjLfgsEhVRt08swH2rVJGFKHWJ0O3k+yyRW46a1nEPh+zy/yoX2oRm9poJZ0lfaSvyQzfS07YKToIgwxJSCIjF/+vQoGi4fBeY=; 7:EO0AG5NeDsHNRms0oDyBx4d6MoUQjNfcM+A67C74slScQu9zqRwe4Ono+UaaQa92fVhQS1ibISg8ls+UMHN1h5iiHaTAK9z7THJoSRL8RFkar5WK1c4TlWmLtZHlSy28D3+5GjQBhWRkwQ7wfEUUcFkSPa2hQQwzqTBf6dO0cf5TvW4qy1jAI/YHatA0rsDfHiEMrvjXBmn0LLhtQN3o5O6yowG3ZfFEC5x0Ph7RxAalVkMryeHd7Gd43nS0r+JU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2018 13:47:54.9417 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f50df53-a1e8-447a-eb70-08d622ed811a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2023 Subject: [dpdk-dev] [PATCH 2/3] app/testpmd: add commands of modify TTL X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2018 13:48:00 -0000 add commands which supports following TTL actions: - RTE_FLOW_ACTION_TYPE_DEC_TTL - RTE_FLOW_ACTION_TYPE_SET_TTL Signed-off-by: Xiaoyu Min --- app/test-pmd/cmdline_flow.c | 34 +++++++++++++++++++++ app/test-pmd/config.c | 3 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 +++ 3 files changed, 42 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 3935539cb..fae825462 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -255,6 +255,9 @@ enum index { ACTION_SET_TP_SRC_TP_SRC, ACTION_SET_TP_DST, ACTION_SET_TP_DST_TP_DST, + ACTION_DEC_TTL, + ACTION_SET_TTL, + ACTION_SET_TTL_TTL, }; /** Maximum size for pattern in struct rte_flow_item_raw. */ @@ -834,6 +837,8 @@ static const enum index next_action[] = { ACTION_SET_IPV6_DST, ACTION_SET_TP_SRC, ACTION_SET_TP_DST, + ACTION_DEC_TTL, + ACTION_SET_TTL, ZERO, }; @@ -972,6 +977,12 @@ static const enum index action_set_tp_dst[] = { ZERO, }; +static const enum index action_set_ttl[] = { + ACTION_SET_TTL_TTL, + ACTION_NEXT, + ZERO, +}; + static const enum index action_jump[] = { ACTION_JUMP_GROUP, ACTION_NEXT, @@ -2620,6 +2631,29 @@ static const struct token token_list[] = { (struct rte_flow_action_set_tp, port)), .call = parse_vc_conf, }, + [ACTION_DEC_TTL] = { + .name = "dec_ttl", + .help = "decrease network TTL if available", + .priv = PRIV_ACTION(DEC_TTL, 0), + .next = NEXT(NEXT_ENTRY(ACTION_NEXT)), + .call = parse_vc, + }, + [ACTION_SET_TTL] = { + .name = "set_ttl", + .help = "set ttl value", + .priv = PRIV_ACTION(SET_TTL, + sizeof(struct rte_flow_action_set_ttl)), + .next = NEXT(action_set_ttl), + .call = parse_vc, + }, + [ACTION_SET_TTL_TTL] = { + .name = "ttl_value", + .help = "new ttl value to set", + .next = NEXT(action_set_ttl, NEXT_ENTRY(UNSIGNED)), + .args = ARGS(ARGS_ENTRY_HTON + (struct rte_flow_action_set_ttl, ttl_value)), + .call = parse_vc_conf, + }, }; /** Remove and return last entry from argument stack. */ diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index d1028d03e..d28b6ed14 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1174,6 +1174,9 @@ static const struct { sizeof(struct rte_flow_action_set_tp)), MK_FLOW_ACTION(SET_TP_DST, sizeof(struct rte_flow_action_set_tp)), + MK_FLOW_ACTION(DEC_TTL, 0), + MK_FLOW_ACTION(SET_TTL, + sizeof(struct rte_flow_action_set_ttl)), }; /** Compute storage space needed by action configuration and copy it. */ diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index f60be0862..e2674292b 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3721,6 +3721,11 @@ This section lists supported actions and their attributes, if any. - ``port``: New TCP/UDP destination port number. +- ``dec_ttl``: Performs a decrease TTL vaule action + +- ``set_ttl``: Set TTL value with specificed value + - ``ttl_value {unsigned}``: The new TTL value to be set + Destroying flow rules ~~~~~~~~~~~~~~~~~~~~~ -- 2.17.1