From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shahaf Shuler Subject: Re: [PATCH v3 3/4] ethdev: add TTL change actions in flow API Date: Mon, 16 Apr 2018 08:56:37 +0000 Message-ID: References: <1522279780-34842-1-git-send-email-qi.z.zhang@intel.com> <20180416051639.188034-1-qi.z.zhang@intel.com> <20180416051639.188034-4-qi.z.zhang@intel.com> <20180416081226.GU4957@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Qi Zhang , "dev@dpdk.org" , "declan.doherty@intel.com" , "sugesh.chandran@intel.com" , "michael.j.glynn@intel.com" , "yu.y.liu@intel.com" , "konstantin.ananyev@intel.com" , "bruce.richardson@intel.com" , Thomas Monjalon To: Adrien Mazarguil Return-path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40056.outbound.protection.outlook.com [40.107.4.56]) by dpdk.org (Postfix) with ESMTP id DDF491B1B1 for ; Mon, 16 Apr 2018 10:56:40 +0200 (CEST) In-Reply-To: <20180416081226.GU4957@6wind.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Monday, April 16, 2018 11:12 AM, Adrien Mazarguil: > Subject: Re: [dpdk-dev] [PATCH v3 3/4] ethdev: add TTL change actions in > flow API >=20 > Hi Shahaf, >=20 > On Mon, Apr 16, 2018 at 05:48:19AM +0000, Shahaf Shuler wrote: > > Hi Qi, > > > > Am wondering if we can make the below more generic and not tailored for > specific use cases. >=20 > Regarding this, please see my previous answer [1] where I asked Qi to mak= e > his changes more focused on the use case at hand when it became clear all > this work was targeting OpenFlow. OK, I missed that. Sorry for jumping in late. >=20 > The OF specification [2] defines the behavior associated with each action= , for > instance when a TTL is 0 or decrementing it would yield 0, the packet mus= t be > dropped. Translating this to a generic decrement action for any packet fi= eld is > not so easy and not convenient. I am not sure I understand why. It is to set -1 in the TTL field of the gen= eric action.=20 We can define the corner cases more carefully as part of the actions. For e= xample - no wrap around.=20 I did not understood the drop if TTL is 0 is part of the action (it is not = described the action description[1]). Is this the case?=20 I think it is wrong approach to introduce a "combo" actions (both decrement= s and drops if value) in rte_flow.=20 I would model such operation by a set of (pseudo code) 1. ACTION_FIELD_DEC_INC , ACTION_GO_TO_GROUP 2. (in next group) matching on the TTL , ACTION_DROP=20 >=20 > Therefore my opinion is that if OF actions as defined by this specificati= on are > supported as hardware capabilities, it makes sense to define dedicated > rte_flow actions for each of them (although "OF" should be part of their > name for clarity). I still think we may need in the future to support copy/increment/decrement= of fields not specifically related to OF.=20 It is better to have APIs which will not change or have double meaning.=20 [1] [1] +Action: ``IP_TTL_DEC`` +^^^^^^^^^^^^^^^^^^^^^^ + +Decrement IPv4 TTL or IPv6 hop limit field and update the IP checksum,=20 +only applies to packets that contain specific MPLS headers. + +.. _table_rte_flow_action_ip_ttl_dec: + +.. table:: IP_TTL_DEC >=20 > I'll comment the patch proper in a separate message. >=20 > [1] > https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fdpd > k.org%2Fml%2Farchives%2Fdev%2F2018- > April%2F096857.html&data=3D02%7C01%7Cshahafs%40mellanox.com%7C6d2b > 747ae47841bc55e508d5a371d2f4%7Ca652971c7d2e4d9ba6a4d149256f461b%7 > C0%7C0%7C636594631626247567&sdata=3D3oTbKT6QwS1WiAIrkF885dEU76ep4 > xreuHoHiwDA2Ec%3D&reserved=3D0 > [2] > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fw > ww.opennetworking.org%2Fimages%2Fstories%2Fdownloads%2Fsdn- > resources%2Fonf-specifications%2Fopenflow%2Fopenflow-spec- > v1.3.0.pdf&data=3D02%7C01%7Cshahafs%40mellanox.com%7C6d2b747ae4784 > 1bc55e508d5a371d2f4%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C1% > 7C636594631626247567&sdata=3De6uelVwIu1poE2uIvEJELuIzela8H%2B8HclQE5 > EdKEaM%3D&reserved=3D0 >=20 > -- > Adrien Mazarguil > 6WIND