[dpdk-dev] [PATCH v5 19/26] app/testpmd: add item raw to flow command

Zhao1, Wei wei.zhao1 at intel.com
Tue May 16 07:05:30 CEST 2017


Hi,  Adrien Mazarguil

> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil at 6wind.com]
> Sent: Friday, May 12, 2017 5:13 PM
> To: Zhao1, Wei <wei.zhao1 at intel.com>
> Cc: dev at dpdk.org; Xing, Beilei <beilei.xing at intel.com>; Lu, Wenzhuo
> <wenzhuo.lu at intel.com>
> Subject: Re: [dpdk-dev] [PATCH v5 19/26] app/testpmd: add item raw to flow
> command
> 
> Hi Wei,
> 
> On Thu, May 11, 2017 at 06:53:52AM +0000, Zhao1, Wei wrote:
> > Hi, Adrien
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Adrien
> > > Mazarguil
> > > Sent: Wednesday, December 21, 2016 10:52 PM
> > > To: dev at 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 <adrien.mazarguil at 6wind.com>
> > > Acked-by: Olga Shern <olgas at mellanox.com>
> [...]
> > #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 max length
> of pattern, maybe 128  is more appropriate?
> > Maybe I have not understand your purpose.
> >
> > Thank you.
> 
> It's more or less an arbitrary compromise due to various limitations.
> 
> 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.
> 
> Each flow item always consumes sizeof(struct rte_flow_item) + sizeof(struct
> rte_flow_item_xxx) * 3 (spec, last and mask) + alignment constraints.
> 
> For the raw item, this makes at least:
> 
>  (sizeof(rte_flow_item) +
>   (sizeof(rte_flow_item_raw) + ITEM_RAW_PATTERN_SIZE) * 3)
>  /* (32 + (12 + 36) * 3) => 176 bytes */
> 
> Because space is always consumed regardless of the size of the byte string to
> match for implementation reasons, there is a chance to fill the buffer too
> quickly with a larger ITEM_RAW_PATTERN_SIZE.
> 
> Also, this does not prevent users from specifying larger raw patterns (even
> larger than 128) by combining them, e.g.:
> 
>  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
> 
> Such a pattern ends up matching a single "foobarbarbaz" string.
> 
> To summarize, it is only due to testpmd limitations. Even without PMD
> support for combination, the current ability to provide 36 bytes of raw data
> to match per specified item is plenty to validate basic functionality. We'll
> improve testpmd eventually.
> 

Thank you for your detailed explanation.
Igb flex byte filter will support for that type combination for raw item. 
But this testpmd limitation will make trouble for users and tester.

> --
> Adrien Mazarguil
> 6WIND


More information about the dev mailing list