From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhao1, Wei" Subject: Re: [PATCH v5 19/26] app/testpmd: add item raw to flow command Date: Tue, 16 May 2017 05:05:30 +0000 Message-ID: References: <180091c2bf814c846abbbfb1c2c50e9ec32d7324.1482331076.git.adrien.mazarguil@6wind.com> <20170512091231.GY16218@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Xing, Beilei" , "Lu, Wenzhuo" To: Adrien Mazarguil Return-path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C7D2E1F5 for ; Tue, 16 May 2017 07:05:34 +0200 (CEST) In-Reply-To: <20170512091231.GY16218@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" Hi, Adrien Mazarguil > -----Original Message----- > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > Sent: Friday, May 12, 2017 5:13 PM > To: Zhao1, Wei > Cc: dev@dpdk.org; Xing, Beilei ; Lu, Wenzhuo > > Subject: Re: [dpdk-dev] [PATCH v5 19/26] app/testpmd: add item raw to flo= w > command >=20 > Hi Wei, >=20 > On Thu, May 11, 2017 at 06:53:52AM +0000, Zhao1, Wei wrote: > > Hi, Adrien > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Adrien > > > Mazarguil > > > Sent: Wednesday, December 21, 2016 10:52 PM > > > To: dev@dpdk.org > > > Subject: [dpdk-dev] [PATCH v5 19/26] app/testpmd: add item raw to > > > flow command > > > > > > Matches arbitrary byte strings with properties: > > > > > > - relative: look for pattern after the previous item. > > > - search: search pattern from offset (see also limit). > > > - offset: absolute or relative offset for pattern. > > > - limit: search area limit for start of pattern. > > > - length: pattern length. > > > - pattern: byte string to look for. > > > > > > Signed-off-by: Adrien Mazarguil > > > Acked-by: Olga Shern > [...] > > #define ITEM_RAW_PATTERN_SIZE 36 > > > > The size of NIC i350 flex byte filter can accommodate the max length > > size of 128 byte, and the reason to Define it as 36 is ?If it is the ma= x length > of pattern, maybe 128 is more appropriate? > > Maybe I have not understand your purpose. > > > > Thank you. >=20 > It's more or less an arbitrary compromise due to various limitations. >=20 > Once parsed, the result of an entire command is stored in a fixed buffer = of > size CMDLINE_PARSE_RESULT_BUFSIZE (8192). Each parsed token ends up > somewhere in that buffer. >=20 > Each flow item always consumes sizeof(struct rte_flow_item) + sizeof(stru= ct > rte_flow_item_xxx) * 3 (spec, last and mask) + alignment constraints. >=20 > For the raw item, this makes at least: >=20 > (sizeof(rte_flow_item) + > (sizeof(rte_flow_item_raw) + ITEM_RAW_PATTERN_SIZE) * 3) > /* (32 + (12 + 36) * 3) =3D> 176 bytes */ >=20 > Because space is always consumed regardless of the size of the byte strin= g to > match for implementation reasons, there is a chance to fill the buffer to= o > quickly with a larger ITEM_RAW_PATTERN_SIZE. >=20 > Also, this does not prevent users from specifying larger raw patterns (ev= en > larger than 128) by combining them, e.g.: >=20 > flow create 0 > pattern eth / raw relative is 1 pattern is foobar / > raw relative is 1 pattern is barbaz / end > actions queue index 42 / end >=20 > Such a pattern ends up matching a single "foobarbarbaz" string. >=20 > To summarize, it is only due to testpmd limitations. Even without PMD > support for combination, the current ability to provide 36 bytes of raw d= ata > to match per specified item is plenty to validate basic functionality. We= 'll > improve testpmd eventually. >=20 Thank you for your detailed explanation. Igb flex byte filter will support for that type combination for raw item.=20 But this testpmd limitation will make trouble for users and tester. > -- > Adrien Mazarguil > 6WIND