From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0085.outbound.protection.outlook.com [104.47.0.85]) by dpdk.org (Postfix) with ESMTP id 59CA61B3AD for ; Tue, 25 Sep 2018 16:38:34 +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=+kkxSXC6TXH5III+Bhr2jOr6K/6Uw3bqk+U/CXXDAlw=; b=TH5ZOroXvWDlw0GlUIrn4KySe/ESq68QLV8eCTJTOApycp7adP38Bi23pffEaNGrSFiFnvKIQ8vi/nFE8788dtxDlnMuI9Lif0OXz/sFSBTErlqkwS2Ox0csBVtM1p1hlpM4P4qLDnSS52No027dUEsndNLVZ6hyKiox8VFL8ew= 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 AM5PR0501MB2020.eurprd05.prod.outlook.com (2603:10a6:203:1a::18) 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 14:38:29 +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 22:37:18 +0800 Message-Id: <20180925143719.23339-3-jackmin@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925143719.23339-1-jackmin@mellanox.com> References: <20180925134718.18945-1-jackmin@mellanox.com> <20180925143719.23339-1-jackmin@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [118.201.220.138] X-ClientProxiedBy: HK2PR04CA0045.apcprd04.prod.outlook.com (2603:1096:202:14::13) To AM5PR0501MB2020.eurprd05.prod.outlook.com (2603:10a6:203:1a::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc794a04-8ba7-4f73-3114-08d622f491d6 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:AM5PR0501MB2020; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2020; 3:80aR7ywI6Xxs5Tan12yXrDf4JHYP020is6u48gjOtroDIuNOnbcOI0qgMxoKTtvrx+/gJ6GQSSO/SVNDAtdU8OipzoKrOJnFyQOdWE2g6drzwA1pma4LR3rfv6QrJBi5Vv2Dmg+TH4NzSxEnaPicOsmCPEzndxN9Nq439f49WAW7if0ho/8LGSWSlEay564aNIkzXB3pTede18wynUrmFRWNdytn/30aLpOWa0gsr1By50GTj15yMA6NBfb3Bx70; 25:Z5Mc9Vn35OQGu5d4y0NMi015jyhVZWywT6GG4Gv3EELWJ4ljpL0kYDZ13ObQBoWR+uBEaQuyHnOXwqorSbHuhf4mCSzZOItm6QJdpsUQopW2RW3qZX0eHC2JUuJcrFRVRjau/K4neQXAQa4wkpjwPqMpgVCtdiiHFSbZG6DqvsS9odeYgu3xZZBYfgF0leK4+Fw6iYgUTknoTGAoY4keQNw6f8Ma6JwgdesK+PmqjN4bi1xQinQLmi/5kVjV2gtpjwghJJpiRiY72zxqZHDX7wmxfysuYLaLhMuWWY3cv4fMOuafLzdpV4OfdaLe7tEaHH2KnRUgBgorpeBQ36tJJw==; 31:8UvvemPc5V2hbyx0QuEu00VTFW39xnD79uJjyQQ510/N2NYITmZBhwQacIcUhCFooNa1ZHky+VjwVE6SepMOMu+h7vlwwp8K6cK6UQIKRzcK4jAWHr4BlxxmLnnkNUpeIC3S6oopd7KwiI3ge5UQzQ0bZeZwytH5XER+Esyt9zLxvR5+7W0NfeSGWBoxJ1rpQNVKIVeeFs4jVGK0nwdN+nHLxM4+FWTMoRTFmZ+fzvo= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2020: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2020; 20:ob4w2myJKwBhYERaDvQ/rK/GA6CLAXtHc0ZdAdZUtqMLultbA11xCegZfj5DJWLFmsbhMFQd/fjQPLHqqkLgAFEr2IMTGr34ctxakth+fAxep/fJQ2MVvYMwHwjoU3zk1A3l75qmZRyg9XrK78z29tBPWqF6SboElpExr9+wGAqpgbDicB+Nv3owWH83ePaC+d8iGEK0osqWfZtp1/qwZ9zHtV90JKcbZb5p0DGKnZFBQGOAZ6SOZlUeyLx0tTUafvKTo2uLWkllXZFBK4up8nWvoQv1R3FOVkUu0XiPO6fQGRBwH8p8NYS0+lBwDdw01jdw/FUCOciSFe4c4sWsg/a4u1WFbtHj+A48C+BqGcZKnJ92AfR50Aq0jsxxp191L5lhe45FzvI2UCxHYiAY5gQcRra1mLikacl3XmJnvhFQS0TW/7GdBH3TmSQUESyWv6tCGafuGgLvtE7dpsNxjAULgyeF57VbBAo2aYnjjy9rPyiFuuX3WN3JQXHiSUFs; 4:PhO9wzIr+8sG8caMWhrqIzR+apB9AdTNJzBto40puanMHpxbtRYrLmdGKWZk7orMjnvsGnBKx7i7wouLUpsHjzow31xbLlHz7qev1ndgtjSA0ohuiPXD+bjIrAs+hApmghhNzKE5nJPGUmcqMCK4lFDL8bQczf8dMWeoESiyZj8mhWri5cWzqBT3gkP/uf8Hd7RPo5SnUDbozGgS1v2JLdbrzZAnGg8wzzOikH0oRMvxqyDuSqgQ2HPe9aUhk3/mpDsCDOmW88oKkgRZ2dePjQ== 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)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(6055026)(149066)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(201708071742011)(7699051); SRVR:AM5PR0501MB2020; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2020; X-Forefront-PRVS: 08062C429B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(396003)(136003)(366004)(189003)(199004)(6512007)(478600001)(48376002)(14444005)(6486002)(476003)(50226002)(6116002)(486006)(2616005)(3846002)(956004)(53936002)(68736007)(8936002)(16586007)(97736004)(110136005)(386003)(305945005)(81156014)(4326008)(1076002)(25786009)(6506007)(16526019)(186003)(36756003)(2906002)(26005)(316002)(7736002)(81166006)(47776003)(76176011)(11346002)(51416003)(86362001)(52116002)(446003)(66066001)(6666003)(50466002)(105586002)(8676002)(5660300001)(106356001)(34290500001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2020; H:dev-r630-08.mtbc.labs.mlnx; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0501MB2020; 23:79RuCvTnV4Gl+NF1lj+O1+w0TVA7WFgjmrEW+et?= =?us-ascii?Q?5khNNKhW9uL22udmaf9a+UgrW1su0KM0nllC/lyaLtHImhxVJ6H/30N22l31?= =?us-ascii?Q?lMLsI6I3G6w1dbd22n82HhbzYK6XcKIEt12uf3Uu7IiVMdgef4tqm0M+3eC7?= =?us-ascii?Q?MdyyGHAa2jDR7Hs8/IuJ/XkIMiiamOzEHyoux6HsPPTxESiA/yQfnYaOmGyx?= =?us-ascii?Q?5Jks7Jx/c3ZZobHfMat+WyGpin2WO7v7UmuIPt2JY65hr3qHHoPxO6e/4/b8?= =?us-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4UmHIH7Gy+KEtAMe4hq9zMSeUD6uQULpmB0noiDz7w/yzVeXJzclKBchsbuBp2gZUpE2nBZ+3W+MsElPNawQ8knO88Z4W0Jp26foEc=; 7:AniuzutvfNnsbdfddJ4kpAja/KoyUz7tTpKEPuRf6YZYnMs4O8/4kUzQdrUg1Fc8nC2GIeOh/tm9Hv3IKgpVauwOtCk9rI4qXqK+c34cDDi22xIiPbbDk8k1JjJIJn8M9p4GRRPodynInsHFl3e25SkE1ECgyf3xPq0l6Nzzz1VVV0NOOU5F7XYas0qfPOq93DQ/F34uqJ/dpwN3dmVPt3naNHZ2bDFRaFgbNbl6nuK+dp55mj/CblzN3kxfrhsB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2018 14:38:29.8963 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc794a04-8ba7-4f73-3114-08d622f491d6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2020 Subject: [dpdk-dev] [PATCH v2 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 14:38:34 -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..db68c4346 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 value 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