From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00058.outbound.protection.outlook.com [40.107.0.58]) by dpdk.org (Postfix) with ESMTP id B58194C96 for ; Tue, 16 Oct 2018 04:03:38 +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=Ivf/5gu4/Wr4DgiuQ78LMjU30Z4tp+w1wrfIBadSBpE=; b=G9j3r+4wowUk0IlKz919cv6RDqMGFFTMBImFDMxpG1nmzOxksjLWH35EnKGkJevPZ+cix5+vQa9kKWeNhQZQLo7OkyYxdU8ut4g4T2e211f8ZFN3i2kaKSQ3WySrfa5BMOIQgRyry2ZSk42U4Nmg/DGgBC2rYr+ihBEf2ai/pE4= Received: from AM5PR0501MB2018.eurprd05.prod.outlook.com (10.167.214.144) by AM5PR0501MB2020.eurprd05.prod.outlook.com (10.167.214.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.26; Tue, 16 Oct 2018 02:03:35 +0000 Received: from AM5PR0501MB2018.eurprd05.prod.outlook.com ([fe80::6199:d023:2807:997d]) by AM5PR0501MB2018.eurprd05.prod.outlook.com ([fe80::6199:d023:2807:997d%3]) with mapi id 15.20.1228.027; Tue, 16 Oct 2018 02:03:35 +0000 From: Jack Min To: Andrew Rybchenko CC: Adrien Mazarguil , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit , "dev@dpdk.org" Thread-Topic: [PATCH v5 1/3] ethdev: add generic TTL rewrite actions Thread-Index: AQHUYqQ5UncSgm+Y502bB2au54DcjaUeW64AgALH2QA= Date: Tue, 16 Oct 2018 02:03:35 +0000 Message-ID: <20181016020318.2efwbgg2ghgawa3e@MTBC-JACKMIN.mtl.com> References: <20181011132641.1000-1-jackmin@mellanox.com> <20181013032348.26380-1-jackmin@mellanox.com> <20181013032348.26380-2-jackmin@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0032.apcprd03.prod.outlook.com (2603:1096:203:2f::20) To AM5PR0501MB2018.eurprd05.prod.outlook.com (2603:10a6:203:1a::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [139.226.41.141] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5PR0501MB2020; 6:oQYctJnLVCvzAVzOlr3/mlSfar1XuS+brFz0cr9v+qEyby3wPZFT2V9prUOYjubi1Mv4ftMKbWQYRia7lfVEUAFSBd4wxukedyHRVxlJcA+hyP7zWjAM6fdd/xtL1IzpuMx5UDcWrSW2ZBuwt9hGAonqWANgkLLdzzdg1yHZrYyV1P/GqJHbD8DXQEQgKI4dABUYfupMelxmTJ2mekx7e+/+mPYaYwQREo1fxi0y2nDcbO27Qu3WlCyyQPJLGU+dPX0jsfQ70ZEvIOKofpEcsLI8zPnFngycMJEPRhu3G44JLqUi6NDASbVIsB1Q5UKoHvwIEJSAF81t/6XFTQdkW4PLYGrq2jUnr3SUq0C8ivMI3/dFbPi9KNN+ilUnU5H/cjr8Z3ci9cXm5VAZb+YlsCr13qYNnClWwRblSzEty9aEJWnY6JNfSNy3WEK1lSq/A19VxpIbmvGyep4XZDcGpA==; 5:ZGYvdfgVyyCBa/Rd0fIqNvDzaxdhNbZa9GbLIJMmXrFgTZgausm9qvVgEhJslO3JeqlVb3su4S98CQApOFm5F4InYjxdZSYAPgc1sX0YwK4waNuET/fW1kh9ki8r0mjVlu8TrLeprO9oAy4U7nMmRVxPyt8bqfEGryV5VDQmhWw=; 7:1Nfge0g7jjZbVwOLkk2akSkcldSQSlo+PfW52JKS3qMpm4Obgj1mBn/qwUmBF+yIQENQcqerPXbz4b/Ke5l7JKTojQlqMed0P3CpPEqSqVZQYoFArR9078sgrx5lMjcXJo3yevOw9ZZkElB0lDCPH0KJqV5XjgGRVqIRRkBLRUeODloZkZVpG4GMOFoh8lZUG2lH5LBtoobLNpsTQWKK+PzpG62R5Kv63Tx9IPfGPj1x3Jh2dCS5t+NWDP1PHhh2 x-ms-office365-filtering-correlation-id: 138b314e-9a4a-4951-56e1-08d6330b9411 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM5PR0501MB2020; x-ms-traffictypediagnostic: AM5PR0501MB2020: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(45079756050767)(189930954265078); 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)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM5PR0501MB2020; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2020; x-forefront-prvs: 0827D7ACB9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(346002)(396003)(376002)(199004)(189003)(9686003)(6306002)(575784001)(81156014)(86362001)(81166006)(68736007)(8676002)(97736004)(66066001)(93886005)(53936002)(478600001)(45080400002)(316002)(6512007)(305945005)(2906002)(6116002)(8936002)(3846002)(1076002)(71190400001)(7736002)(71200400001)(99286004)(106356001)(6436002)(14454004)(105586002)(5660300001)(6486002)(966005)(54906003)(102836004)(6916009)(52116002)(25786009)(186003)(26005)(5250100002)(256004)(33896004)(53546011)(476003)(6506007)(486006)(386003)(4326008)(2900100001)(6246003)(11346002)(446003)(76176011)(229853002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2020; H:AM5PR0501MB2018.eurprd05.prod.outlook.com; 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-antispam-message-info: XBxYP2TQeFdwlCkDAhSEFvWe5+lHFV4d37J1cXHtC5s/6YJun8CxGMhtl0L9EDAlzupJ0ff4Tt3s/jM7z5uENhEgK77ZSMNv3lwWulHfIRScQBO6CYsu7VMo1cJH156DCCG78AyBMo7UnKYkZUEcuC2Ct6EvbOFO8/7TXiUIZKLBh8KBpPOXud4Vzhv0JMOdNVfmuLeaYDlhaIVbumFP6qQ7oxfmhiYkhxGhjI7HZFEY1tW0aCbfI54bKn3njXy/0PSR2IBoTuQ74Hm5IlHy852u+d5oKYhgECt8yysNfw53etQ6u+9Eq+fZBOaNjAQ1fBtf6HTOytpwafq5ubOk0GJdstU4xduG8HtjZiiK90w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 138b314e-9a4a-4951-56e1-08d6330b9411 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2018 02:03:35.1384 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2020 Subject: Re: [dpdk-dev] [PATCH v5 1/3] ethdev: add generic TTL rewrite actions 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, 16 Oct 2018 02:03:39 -0000 On 18-10-14 10:35:30, Andrew Rybchenko wrote: > On 13.10.2018 06:24, Jack Min wrote: > > rewrite TTL by decrease or just set it directly > > it's not necessary to check if the final result > > is zero or not > >=20 > > This is slightly different from the one defined > > by openflow and more generic > >=20 > > Signed-off-by: Xiaoyu Min > > Acked-by: Yongseok Koh > > --- >=20 > [...] >=20 > > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.= h > > index 68bbf57d0..f102e6939 100644 > > --- a/lib/librte_ethdev/rte_flow.h > > +++ b/lib/librte_ethdev/rte_flow.h > > @@ -1579,6 +1579,26 @@ enum rte_flow_action_type { > > * No associated configuration structure. > > */ > > RTE_FLOW_ACTION_TYPE_MAC_SWAP, > > + > > + /** > > + * Decrease TTL value directly > > + * > > + * If flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_IPV4, or > > + * RTE_FLOW_ITEM_TYPE_IPV6, the PMD should return a > > + * RTE_FLOW_ERROR_TYPE_ACTION error. > > + */ > > + RTE_FLOW_ACTION_TYPE_DEC_TTL, > > + > > + /** > > + * Set TTL value > > + * > > + * If flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_IPV4, or > > + * RTE_FLOW_ITEM_TYPE_IPV6, the PMD should return a > > + * RTE_FLOW_ERROR_TYPE_ACTION error. > > + * > > + * See struct rte_flow_action_set_ttl > > + */ > > + RTE_FLOW_ACTION_TYPE_SET_TTL, > > }; > > /** >=20 > As I understand it is one more case where the following note from Adrien > is applicable [1]: >=20 > >=20 > Another problem is that you must not require actions to rely on specific > pattern content: >=20 > [...] > * > * Decapsulate outer most tunnel from matched flow. > * > * The flow pattern must have a valid tunnel header > */ > RTE_FLOW_ACTION_TYPE_TUNNEL_DECAP, >=20 > For maximum flexibility, all actions should be usable on their own on emp= ty > pattern. On the other hand, you can document undefined behavior when > performing some action on traffic that doesn't contain something. >=20 > Reason is that invalid traffic may have already been removed by other flo= w > rules (or whatever happens) before such a rule is reached; it's a user's > responsibility to provide such guarantee. >=20 > When parsing an action, a PMD is not supposed to look at the pattern. Act= ion > list should contain all the needed info, otherwise it means the API is ba= dly > defined. >=20 > I'm aware the above makes it tough to implement something like > RTE_FLOW_ACTION_TYPE_TUNNEL_DECAP as defined in this series, but that's > unfortunately why I think it must not be defined like that. >=20 > >=20 > [1] https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2F= mails.dpdk.org%2Farchives%2Fdev%2F2018-October%2F115267.html&data=3D02%= 7C01%7Cjackmin%40mellanox.com%7C8297d07c910e4aa6b4f508d631a7ab8e%7Ca652971c= 7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636750993538615097&sdata=3Dq0ywvMqqt= Rr%2BHp%2FBHLGtMF3x84kwPooZ7eYfdxmHtUs%3D&reserved=3D0 >=20 Alright, I'will document this as PMD's limitation not API's. -Jack