* [dpdk-dev] [RFC 0/2] ethdev: add new attribute for signature match @ 2017-05-14 19:50 Qi Zhang 2017-05-14 19:50 ` [dpdk-dev] [RFC 1/2] rte_flow: add " Qi Zhang ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Qi Zhang @ 2017-05-14 19:50 UTC (permalink / raw) To: adrien.mazarguil; +Cc: dev, wenzhuo.lu, beilei.xing, Qi Zhang We try to enable ixgbe's signature match with rte_flow, but didn't find a way with current APIs, so the RFC propose to add a new flow attribute "sig_match" to indicate if current flow is "perfect match" or "signature match" With perfect match (by default), if a packet does not match pattern, actions will not be taken. (this is identical with current behavior) With signature match, if a packet does not match pattern, it still has the possibility to trigger the actions, this happens when device think the signature of the pattern is matched. Signature match is expected to have better performance than perfect match with the cost of accuracy. When a flow rule with this attribute set, identical behavior can ONLY be guaranteed if packet matches the pattern, since different device may have different implementation of signature calculation algorithm. Driver of device that does not support signature match is not required to return error, but just simply igore this attribute, because the default "perfect match" still can be regarded as a speical case of "signature match". Qi Zhang (2): rte_flow: add attribute for signature match doc/guides/prog_guide: add new rte_flow attribute app/test-pmd/cmdline_flow.c | 11 +++++++++++ doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++ lib/librte_ether/rte_flow.h | 3 ++- 3 files changed, 25 insertions(+), 1 deletion(-) -- 2.7.4 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [RFC 1/2] rte_flow: add attribute for signature match 2017-05-14 19:50 [dpdk-dev] [RFC 0/2] ethdev: add new attribute for signature match Qi Zhang @ 2017-05-14 19:50 ` Qi Zhang 2017-05-14 19:50 ` [dpdk-dev] [RFC 2/2] doc/guides/prog_guide: add new flow attribute Qi Zhang 2017-05-17 10:32 ` [dpdk-dev] [RFC 0/2] ethdev: add new attribute for signature match Adrien Mazarguil 2 siblings, 0 replies; 5+ messages in thread From: Qi Zhang @ 2017-05-14 19:50 UTC (permalink / raw) To: adrien.mazarguil; +Cc: dev, wenzhuo.lu, beilei.xing, Qi Zhang Add new attribute "sig_match" to rte_flow_attr. This attribute indicate if current flow take "perfect match" or "signature match". With perfect match (by default), if a packet does not match pattern, actions will not be taken. (this is identical with current behavior ) With signature match, if a packet does not match pattern, it still has the possibility to trigger the actions, this happens when device think the signature of the pattern is matched. Signature match is expected to have better performance than perfect match, but the cost is accuracy. When a flow rule with this attribute set, identical behavior can ONLY be guaranteed if packet matches the pattern, since different device may have different implementation of signature calculation algorithm. Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> --- app/test-pmd/cmdline_flow.c | 11 +++++++++++ lib/librte_ether/rte_flow.h | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 0fd69f9..512f817 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -95,6 +95,7 @@ enum index { PRIORITY, INGRESS, EGRESS, + SIG_MATCH, /* Validate/create pattern. */ PATTERN, @@ -397,6 +398,7 @@ static const enum index next_vc_attr[] = { PRIORITY, INGRESS, EGRESS, + SIG_MATCH, PATTERN, ZERO, }; @@ -896,6 +898,12 @@ static const struct token token_list[] = { .next = NEXT(next_vc_attr), .call = parse_vc, }, + [SIG_MATCH] = { + .name = "sig_match", + .help = "affect rule to match", + .next = NEXT(next_vc_attr), + .call = parse_vc, + }, /* Validate/create pattern. */ [PATTERN] = { .name = "pattern", @@ -1728,6 +1736,9 @@ parse_vc(struct context *ctx, const struct token *token, case EGRESS: out->args.vc.attr.egress = 1; return len; + case SIG_MATCH: + out->args.vc.attr.sig_match = 1; + return len; case PATTERN: out->args.vc.pattern = (void *)RTE_ALIGN_CEIL((uintptr_t)(out + 1), diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index c47edbc..8ba3c36 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -95,7 +95,8 @@ struct rte_flow_attr { uint32_t priority; /**< Priority level within group. */ uint32_t ingress:1; /**< Rule applies to ingress traffic. */ uint32_t egress:1; /**< Rule applies to egress traffic. */ - uint32_t reserved:30; /**< Reserved, must be zero. */ + uint32_t sig_match:1; /**< only use hash signagure to match. */ + uint32_t reserved:29; /**< Reserved, must be zero. */ }; /** -- 2.7.4 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [RFC 2/2] doc/guides/prog_guide: add new flow attribute 2017-05-14 19:50 [dpdk-dev] [RFC 0/2] ethdev: add new attribute for signature match Qi Zhang 2017-05-14 19:50 ` [dpdk-dev] [RFC 1/2] rte_flow: add " Qi Zhang @ 2017-05-14 19:50 ` Qi Zhang 2017-05-16 9:11 ` Mcnamara, John 2017-05-17 10:32 ` [dpdk-dev] [RFC 0/2] ethdev: add new attribute for signature match Adrien Mazarguil 2 siblings, 1 reply; 5+ messages in thread From: Qi Zhang @ 2017-05-14 19:50 UTC (permalink / raw) To: adrien.mazarguil; +Cc: dev, wenzhuo.lu, beilei.xing, Qi Zhang Update the programming guide for the new attribute of rte_flow Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> --- doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index b587ba9..5207eec 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -181,6 +181,18 @@ directions. At least one direction must be specified. Specifying both directions at once for a given rule is not recommended but may be valid in a few cases (e.g. shared counters). +Attribute: Match hint +^^^^^^^^^^^^^^^^^^^^^ + +This is a attribute to hint different pattern match accuracy. + +Perfect match: +- Actions will be taken if input packet's pattern matches flow's pattern. + +Signature match: +- Actions will be taken if the signature of input packet's pattern matches + the signature of flow's pattern. + Pattern item ~~~~~~~~~~~~ -- 2.7.4 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [RFC 2/2] doc/guides/prog_guide: add new flow attribute 2017-05-14 19:50 ` [dpdk-dev] [RFC 2/2] doc/guides/prog_guide: add new flow attribute Qi Zhang @ 2017-05-16 9:11 ` Mcnamara, John 0 siblings, 0 replies; 5+ messages in thread From: Mcnamara, John @ 2017-05-16 9:11 UTC (permalink / raw) To: Zhang, Qi Z, adrien.mazarguil; +Cc: dev, Lu, Wenzhuo, Xing, Beilei, Zhang, Qi Z > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qi Zhang > Sent: Sunday, May 14, 2017 8:50 PM > To: adrien.mazarguil@6wind.com > Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Xing, Beilei > <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com> > Subject: [dpdk-dev] [RFC 2/2] doc/guides/prog_guide: add new flow > attribute > > Update the programming guide for the new attribute of rte_flow > > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> > --- > doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index b587ba9..5207eec 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -181,6 +181,18 @@ directions. At least one direction must be specified. > Specifying both directions at once for a given rule is not recommended > but may be valid in a few cases (e.g. shared counters). > > +Attribute: Match hint > +^^^^^^^^^^^^^^^^^^^^^ > + > +This is a attribute to hint different pattern match accuracy. > + > +Perfect match: > +- Actions will be taken if input packet's pattern matches flow's pattern. > + > +Signature match: > +- Actions will be taken if the signature of input packet's pattern > +matches > + the signature of flow's pattern. > + There should be a blank line before the list items, otherwise it will cause an RST warning. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [RFC 0/2] ethdev: add new attribute for signature match 2017-05-14 19:50 [dpdk-dev] [RFC 0/2] ethdev: add new attribute for signature match Qi Zhang 2017-05-14 19:50 ` [dpdk-dev] [RFC 1/2] rte_flow: add " Qi Zhang 2017-05-14 19:50 ` [dpdk-dev] [RFC 2/2] doc/guides/prog_guide: add new flow attribute Qi Zhang @ 2017-05-17 10:32 ` Adrien Mazarguil 2 siblings, 0 replies; 5+ messages in thread From: Adrien Mazarguil @ 2017-05-17 10:32 UTC (permalink / raw) To: Qi Zhang; +Cc: dev, wenzhuo.lu, beilei.xing On Sun, May 14, 2017 at 03:50:04PM -0400, Qi Zhang wrote: > We try to enable ixgbe's signature match with rte_flow, but didn't > find a way with current APIs, so the RFC propose to add a new flow > attribute "sig_match" to indicate if current flow is "perfect match" > or "signature match" > With perfect match (by default), if a packet does not match pattern, > actions will not be taken. (this is identical with current behavior) > With signature match, if a packet does not match pattern, it still > has the possibility to trigger the actions, this happens when device > think the signature of the pattern is matched. > Signature match is expected to have better performance than perfect > match with the cost of accuracy. > When a flow rule with this attribute set, identical behavior can ONLY > be guaranteed if packet matches the pattern, since different device > may have different implementation of signature calculation algorithm. > Driver of device that does not support signature match is not required to > return error, but just simply igore this attribute, because the default > "perfect match" still can be regarded as a speical case of > "signature match". > > Qi Zhang (2): > rte_flow: add attribute for signature match > doc/guides/prog_guide: add new rte_flow attribute > > app/test-pmd/cmdline_flow.c | 11 +++++++++++ > doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++ > lib/librte_ether/rte_flow.h | 3 ++- > 3 files changed, 25 insertions(+), 1 deletion(-) As discussed offline, modifying struct rte_flow_attr for this purpose is not ideal. We've agreed that a new meta pattern item should be defined instead, as described in the FDIR rules conversion section (8.9.7) of the documentation [1]. [1] http://dpdk.org/doc/guides/prog_guide/rte_flow.html#fdir-to-most-item-types-queue-drop-passthru -- Adrien Mazarguil 6WIND ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-05-17 10:32 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-05-14 19:50 [dpdk-dev] [RFC 0/2] ethdev: add new attribute for signature match Qi Zhang 2017-05-14 19:50 ` [dpdk-dev] [RFC 1/2] rte_flow: add " Qi Zhang 2017-05-14 19:50 ` [dpdk-dev] [RFC 2/2] doc/guides/prog_guide: add new flow attribute Qi Zhang 2017-05-16 9:11 ` Mcnamara, John 2017-05-17 10:32 ` [dpdk-dev] [RFC 0/2] ethdev: add new attribute for signature match Adrien Mazarguil
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).