From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0086.outbound.protection.outlook.com [104.47.0.86]) by dpdk.org (Postfix) with ESMTP id CE73D1B597 for ; Wed, 10 Oct 2018 15:05:55 +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=UqQ4xf0w3BBstLqu45bMbXoFAxpHnTCbwkqY/9RmXe0=; b=nfXid6/C83sAbU1n5+Lfvhs6aXV2gXtkraBWjlea62ROaDc0S95J2nUg/4SuKMcsdFlR9K9vQHW4dqpxnCgQqZjNKz2Lce01l+n6ueonzDMg3Du393KNOt246jJtS8qsZh/CS9G7xz18qSoCcLWGApCR93oQKLFpkw0g92GeAxs= Received: from DB6PR0501MB2023.eurprd05.prod.outlook.com (10.168.9.17) by DB6PR0501MB2327.eurprd05.prod.outlook.com (10.168.56.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.23; Wed, 10 Oct 2018 13:05:54 +0000 Received: from DB6PR0501MB2023.eurprd05.prod.outlook.com ([fe80::b1fb:bad3:b5b1:f913]) by DB6PR0501MB2023.eurprd05.prod.outlook.com ([fe80::b1fb:bad3:b5b1:f913%3]) with mapi id 15.20.1228.020; Wed, 10 Oct 2018 13:05:54 +0000 From: Jack Min To: Adrien Mazarguil , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic CC: "dev@dpdk.org" Thread-Topic: [PATCH v3 2/3] app/testpmd: add commands of modify TTL Thread-Index: AQHUYJn55pwF1KM08EG/u7qELWzifA== Date: Wed, 10 Oct 2018 13:05:54 +0000 Message-ID: <20181010130524.23590-3-jackmin@mellanox.com> References: <20180925143719.23339-1-jackmin@mellanox.com> <20181010130524.23590-1-jackmin@mellanox.com> In-Reply-To: <20181010130524.23590-1-jackmin@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SG2PR01CA0102.apcprd01.prod.exchangelabs.com (2603:1096:3:15::28) To DB6PR0501MB2023.eurprd05.prod.outlook.com (2603:10a6:4:6::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [118.201.220.138] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0501MB2327; 6:Sliy4L8B9uOVfH+wB3AJlCJZ+0DvN8C2mm+Zr1Ef5kElKk04LeV2wb81HV5D3U1tK405JTuUCBLp8KxlF6vJG6CnAvux1LUAJBJJycFUE75nvNK8WTrHJKt947WaesGd32KfuoizQPaCAMYv/n5PDbJHeLwhNNe6u9Dpi2DeDBI6EE5QGzAjhzXUH2UitCAbsaajAh9b3vyx1hoMlXuqRNDa2ltMVabOnD5xvzMd3E75V5k0MvxMJ1S7hXWPrOgYryEVmaCTodD45m/rYdwNCNNWhVpM35xCGqCHLZSDyTs6svPfrZfy34bzjNQ913DonNRUXvg+05+hMW0r0x0JSFFOvU5k5Hch44a5K2r6N7a2Un1sgs8QmoCAcuxSOw1GV78NgIXAgd2ZACiEzypO5FQwlK4v2a4KzdRwKYGxAzswZyqGbZT8P2OwPoDHa2MwPt3RL3CYFa1DDHHqpdQN+Q==; 5:IfTWktDKCBv+0AuDjiZTDIxtF3ysK2lLbYiDTk4/AIevWrOb6rdKPC++koxkgJL4BuV3KFnAlwAD4tAXBhC0Y73KkQgfqQKo+3NIbcz5GVbo4qxckaWKcvVaAKnS9qHp/HaLv9pFemI3DELdjPDLwJzzLSf1eoZPNU18pkbr3TE=; 7:R+rX5F6tIkP7+mGcZLiUvZyTFQsoNOxh+lEmlVvJ+0+3qhtl18WRD4f0VQOuwpnepiKv3Y57f7FplcEuCqoM60YETGCRIJYd/RjUYFHT3s0L5Jwa2PD4FpendFNau9Tk2wC+cRlq83EUNS0JFrY8/oafamX2k5l1FaSScbi5Na6y6GHijgQKEdPWTNhOr19T56smvBx0WnqmSmHW7irnS7xg/nWM11Eacm1SNezntJCwA9EIvJILEZ8E3o6hbAVS x-ms-office365-filtering-correlation-id: 218b0d8a-800f-4f69-8142-08d62eb11c13 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0501MB2327; x-ms-traffictypediagnostic: DB6PR0501MB2327: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr 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)(3002001)(3231355)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051); SRVR:DB6PR0501MB2327; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2327; x-forefront-prvs: 08213D42D3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(366004)(376002)(346002)(136003)(189003)(199004)(97736004)(6486002)(186003)(7736002)(26005)(305945005)(5250100002)(66066001)(71200400001)(68736007)(71190400001)(53936002)(8936002)(102836004)(25786009)(2900100001)(256004)(6436002)(6512007)(36756003)(76176011)(81166006)(446003)(86362001)(316002)(105586002)(1076002)(2906002)(8676002)(3846002)(110136005)(11346002)(386003)(476003)(2616005)(99286004)(478600001)(106356001)(4326008)(5660300001)(6116002)(486006)(14454004)(81156014)(6506007)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2327; H:DB6PR0501MB2023.eurprd05.prod.outlook.com; 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-antispam-message-info: klQiZNvZ7KGnIFFBsj/kNFAMnT1LHD7ZlaE7hGKWlUK8Yp12Byz3hH/PB/c2DOlFCGUEWOaBQolN4K2ygXis2lat4PeNKdnwoBZEdcF6Itps26CKnFKoX8usGO1U/bX3hRLn8f9f8x7k9zrYcmJTU2ltebV6vF7Z3S589f1jMVPfoujilyQpsrZ9/O8P8g6goiOpfs7sSKEu0zwNIvyk5eiHZ0tBpTuuI/lTR/ouyU5JCPeBkmLpGSFlhBz0Z4vR+3CZC+sD+/miNKMuLRWyWHP3Jr8bY+4AhjDf18ee28xfG+uEJayJuETkGn+ZI5pcjulGRg36D+GLrMYvNRf5pl/ZvMNS1aC7Lz9GNzyr1eM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 218b0d8a-800f-4f69-8142-08d62eb11c13 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2018 13:05:54.1195 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2327 Subject: [dpdk-dev] [PATCH v3 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: Wed, 10 Oct 2018 13:05:56 -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 Acked-by: Yongseok Koh --- app/test-pmd/cmdline_flow.c | 34 +++++++++++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 +++ 2 files changed, 39 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, }; =20 /** Maximum size for pattern in struct rte_flow_item_raw. */ @@ -834,6 +837,8 @@ static const enum index next_action[] =3D { ACTION_SET_IPV6_DST, ACTION_SET_TP_SRC, ACTION_SET_TP_DST, + ACTION_DEC_TTL, + ACTION_SET_TTL, ZERO, }; =20 @@ -972,6 +977,12 @@ static const enum index action_set_tp_dst[] =3D { ZERO, }; =20 +static const enum index action_set_ttl[] =3D { + ACTION_SET_TTL_TTL, + ACTION_NEXT, + ZERO, +}; + static const enum index action_jump[] =3D { ACTION_JUMP_GROUP, ACTION_NEXT, @@ -2620,6 +2631,29 @@ static const struct token token_list[] =3D { (struct rte_flow_action_set_tp, port)), .call =3D parse_vc_conf, }, + [ACTION_DEC_TTL] =3D { + .name =3D "dec_ttl", + .help =3D "decrease network TTL if available", + .priv =3D PRIV_ACTION(DEC_TTL, 0), + .next =3D NEXT(NEXT_ENTRY(ACTION_NEXT)), + .call =3D parse_vc, + }, + [ACTION_SET_TTL] =3D { + .name =3D "set_ttl", + .help =3D "set ttl value", + .priv =3D PRIV_ACTION(SET_TTL, + sizeof(struct rte_flow_action_set_ttl)), + .next =3D NEXT(action_set_ttl), + .call =3D parse_vc, + }, + [ACTION_SET_TTL_TTL] =3D { + .name =3D "ttl_value", + .help =3D "new ttl value to set", + .next =3D NEXT(action_set_ttl, NEXT_ENTRY(UNSIGNED)), + .args =3D ARGS(ARGS_ENTRY_HTON + (struct rte_flow_action_set_ttl, ttl_value)), + .call =3D parse_vc_conf, + }, }; =20 /** Remove and return last entry from argument stack. */ diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testp= md_app_ug/testpmd_funcs.rst index 86efed4bf..16cd4468e 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3728,6 +3728,11 @@ This section lists supported actions and their attri= butes, if any. =20 - ``port``: New TCP/UDP destination port number. =20 +- ``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 ~~~~~~~~~~~~~~~~~~~~~ =20 --=20 2.17.1