DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: adrien.mazarguil@6wind.com
Cc: dev@dpdk.org, wenzhuo.lu@intel.com, beilei.xing@intel.com,
	Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [RFC 1/2] rte_flow: add attribute for signature match
Date: Sun, 14 May 2017 15:50:05 -0400	[thread overview]
Message-ID: <1494791406-3594-2-git-send-email-qi.z.zhang@intel.com> (raw)
In-Reply-To: <1494791406-3594-1-git-send-email-qi.z.zhang@intel.com>

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

  reply	other threads:[~2017-05-15  2:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-14 19:50 [dpdk-dev] [RFC 0/2] ethdev: add new " Qi Zhang
2017-05-14 19:50 ` Qi Zhang [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494791406-3594-2-git-send-email-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).