netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: [PATCH IPROUTE]: cls_flow: add perturbation support
Date: Mon, 14 Jul 2008 14:42:48 +0200	[thread overview]
Message-ID: <487B49C8.6030607@trash.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 01.diff --]
[-- Type: text/x-diff, Size: 1893 bytes --]

commit 337628b9aca63fda7622701191d6304c83438909
Author: Patrick McHardy <kaber@trash.net>
Date:   Fri Jul 4 04:54:56 2008 +0200

    cls_flow: add perturbation support
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 99efbed..7cf7824 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -374,6 +374,7 @@ enum
 	TCA_FLOW_ACT,
 	TCA_FLOW_POLICE,
 	TCA_FLOW_EMATCHES,
+	TCA_FLOW_PERTURB,
 	__TCA_FLOW_MAX
 };
 
diff --git a/tc/f_flow.c b/tc/f_flow.c
index 1537ade..84b45c9 100644
--- a/tc/f_flow.c
+++ b/tc/f_flow.c
@@ -24,7 +24,7 @@ static void explain(void)
 "Usage: ... flow ...\n"
 "\n"
 " [mapping mode]: map key KEY [ OPS ] ...\n"
-" [hashing mode]: hash keys KEY-LIST ...\n"
+" [hashing mode]: hash keys KEY-LIST ... [ perturb SECS ]\n"
 "\n"
 "                 [ divisor NUM ] [ baseclass ID ] [ match EMATCH_TREE ]\n"
 "                 [ police POLICE_SPEC ] [ action ACTION_SPEC ]\n"
@@ -211,6 +211,13 @@ static int flow_parse_opt(struct filter_util *fu, char *handle,
 				return -1;
 			}
 			addattr32(n, 4096, TCA_FLOW_BASECLASS, tmp);
+		} else if (matches(*argv, "perturb") == 0) {
+			NEXT_ARG();
+			if (get_u32(&tmp, *argv, 0)) {
+				fprintf(stderr, "Illegal \"perturb\"\n");
+				return -1;
+			}
+			addattr32(n, 4096, TCA_FLOW_PERTURB, tmp);
 		} else if (matches(*argv, "police") == 0) {
 			NEXT_ARG();
 			if (parse_police(&argc, &argv, TCA_FLOW_POLICE, n)) {
@@ -331,6 +338,10 @@ static int flow_print_opt(struct filter_util *fu, FILE *f, struct rtattr *opt,
 		fprintf(f, "baseclass %s ",
 			sprint_tc_classid(*(__u32 *)RTA_DATA(tb[TCA_FLOW_BASECLASS]), b1));
 
+	if (tb[TCA_FLOW_PERTURB])
+		fprintf(f, "perturb %usec ",
+			*(__u32 *)RTA_DATA(tb[TCA_FLOW_PERTURB]));
+
 	if (tb[TCA_FLOW_EMATCHES])
 		print_ematch(f, tb[TCA_FLOW_EMATCHES]);
 	if (tb[TCA_FLOW_POLICE])

                 reply	other threads:[~2008-07-14 12:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=487B49C8.6030607@trash.net \
    --to=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.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).