All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] iproute2 skbedit: Add support to mark packets
@ 2009-12-03 13:32 jamal
  2009-12-26 19:08 ` Stephen Hemminger
  2010-03-04  0:36 ` Stephen Hemminger
  0 siblings, 2 replies; 8+ messages in thread
From: jamal @ 2009-12-03 13:32 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Alexander Duyck

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

I did this originally because i was getting too many support
questions on ipt with mark. It still makes sense since skbedit
seems to be the mother action of skb metadata (should probably
have been called skbmeta).

cheers,
jamal

[-- Attachment #2: skbeiprt-mark-p --]
[-- Type: text/plain, Size: 3201 bytes --]

commit 90afac29b6e8c62bc1b2a4da7c0dd4407ea9dd3f
Author: Jamal Hadi Salim <hadi@cyberus.ca>
Date:   Thu Dec 3 08:18:41 2009 -0500

    skbedit: Add support to mark packets
    
    This adds support for setting the skb mark.
    
    Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>

diff --git a/include/linux/tc_act/tc_skbedit.h b/include/linux/tc_act/tc_skbedit.h
index a14e461..7a2e910 100644
--- a/include/linux/tc_act/tc_skbedit.h
+++ b/include/linux/tc_act/tc_skbedit.h
@@ -26,6 +26,7 @@
 
 #define SKBEDIT_F_PRIORITY		0x1
 #define SKBEDIT_F_QUEUE_MAPPING		0x2
+#define SKBEDIT_F_MARK			0x4
 
 struct tc_skbedit {
 	tc_gen;
@@ -37,6 +38,7 @@ enum {
 	TCA_SKBEDIT_PARMS,
 	TCA_SKBEDIT_PRIORITY,
 	TCA_SKBEDIT_QUEUE_MAPPING,
+	TCA_SKBEDIT_MARK,
 	__TCA_SKBEDIT_MAX
 };
 #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)
diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c
index ecb1f2d..623dc53 100644
--- a/tc/m_skbedit.c
+++ b/tc/m_skbedit.c
@@ -31,11 +31,13 @@
 static void
 explain(void)
 {
-	fprintf(stderr, "Usage: ... skbedit <[QM] [PM]>\n"
+	fprintf(stderr, "Usage: ... skbedit <[QM] [PM] [MM]>\n"
 			"QM = queue_mapping QUEUE_MAPPING\n"
 			"PM = priority PRIORITY \n"
+			"MM = mark MARK \n"
 			"QUEUE_MAPPING = device transmit queue to use\n"
-			"PRIORITY = classID to assign to priority field\n");
+			"PRIORITY = classID to assign to priority field\n"
+			"MARK = firewall mark to set\n");
 }
 
 static void
@@ -55,7 +57,7 @@ parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 	struct rtattr *tail;
 	unsigned int tmp;
 	__u16 queue_mapping;
-	__u32 flags = 0, priority;
+	__u32 flags = 0, priority, mark;
 	struct tc_skbedit sel = { 0 };
 
 	if (matches(*argv, "skbedit") != 0)
@@ -81,6 +83,14 @@ parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 				return -1;
 			}
 			ok++;
+		} else if (matches(*argv, "mark") == 0) {
+			flags |= SKBEDIT_F_MARK;
+			NEXT_ARG();
+			if (get_tc_classid(&mark, *argv)) {
+				fprintf(stderr, "Illegal mark\n");
+				return -1;
+			}
+			ok++;
 		} else if (matches(*argv, "help") == 0) {
 			usage();
 		} else {
@@ -138,6 +148,9 @@ parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 	if (flags & SKBEDIT_F_PRIORITY)
 		addattr_l(n, MAX_MSG, TCA_SKBEDIT_PRIORITY,
 			  &priority, sizeof(priority));
+	if (flags & SKBEDIT_F_MARK)
+		addattr_l(n, MAX_MSG, TCA_SKBEDIT_MARK,
+			  &mark, sizeof(mark));
 	tail->rta_len = (char *)NLMSG_TAIL(n) - (char *)tail;
 
 	*argc_p = argc;
@@ -151,6 +164,7 @@ static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
 	struct rtattr *tb[TCA_SKBEDIT_MAX + 1];
 	SPRINT_BUF(b1);
 	__u32 *priority;
+	__u32 *mark;
 	__u16 *queue_mapping;
 
 	if (arg == NULL)
@@ -175,6 +189,10 @@ static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
 		priority = RTA_DATA(tb[TCA_SKBEDIT_PRIORITY]);
 		fprintf(f, " priority %s", sprint_tc_classid(*priority, b1));
 	}
+	if (tb[TCA_SKBEDIT_MARK] != NULL) {
+		mark = RTA_DATA(tb[TCA_SKBEDIT_MARK]);
+		fprintf(f, " mark %d", *mark);
+	}
 
 	if (show_stats) {
 		if (tb[TCA_SKBEDIT_TM]) {

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iproute2 skbedit: Add support to mark packets
  2009-12-03 13:32 [PATCH 2/2] iproute2 skbedit: Add support to mark packets jamal
@ 2009-12-26 19:08 ` Stephen Hemminger
  2010-03-04  0:36 ` Stephen Hemminger
  1 sibling, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2009-12-26 19:08 UTC (permalink / raw)
  To: hadi; +Cc: netdev, Alexander Duyck

On Thu, 03 Dec 2009 08:32:48 -0500
jamal <hadi@cyberus.ca> wrote:

> I did this originally because i was getting too many support
> questions on ipt with mark. It still makes sense since skbedit
> seems to be the mother action of skb metadata (should probably
> have been called skbmeta).
> 
> cheers,
> jamal

applied to repository for next version (header changes for 2.6.33
already done)

-- 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iproute2 skbedit: Add support to mark packets
  2009-12-03 13:32 [PATCH 2/2] iproute2 skbedit: Add support to mark packets jamal
  2009-12-26 19:08 ` Stephen Hemminger
@ 2010-03-04  0:36 ` Stephen Hemminger
  2010-03-04  2:51   ` jamal
  1 sibling, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2010-03-04  0:36 UTC (permalink / raw)
  To: hadi; +Cc: netdev, Alexander Duyck

On Thu, 03 Dec 2009 08:32:48 -0500
jamal <hadi@cyberus.ca> wrote:

> I did this originally because i was getting too many support
> questions on ipt with mark. It still makes sense since skbedit
> seems to be the mother action of skb metadata (should probably
> have been called skbmeta).
> 
> cheers,
> jamal


Applied

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iproute2 skbedit: Add support to mark packets
  2010-03-04  0:36 ` Stephen Hemminger
@ 2010-03-04  2:51   ` jamal
  2010-03-04 16:48     ` Stephen Hemminger
  0 siblings, 1 reply; 8+ messages in thread
From: jamal @ 2010-03-04  2:51 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Alexander Duyck

You applied 2/2 but not 1/2.

cheers,
jamal
On Wed, 2010-03-03 at 16:36 -0800, Stephen Hemminger wrote:
> On Thu, 03 Dec 2009 08:32:48 -0500
> jamal <hadi@cyberus.ca> wrote:
> 
> > I did this originally because i was getting too many support
> > questions on ipt with mark. It still makes sense since skbedit
> > seems to be the mother action of skb metadata (should probably
> > have been called skbmeta).
> > 
> > cheers,
> > jamal
> 
> 
> Applied
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iproute2 skbedit: Add support to mark packets
  2010-03-04  2:51   ` jamal
@ 2010-03-04 16:48     ` Stephen Hemminger
  2010-03-04 16:58       ` jamal
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2010-03-04 16:48 UTC (permalink / raw)
  To: hadi; +Cc: netdev, Alexander Duyck

On Wed, 03 Mar 2010 21:51:31 -0500
jamal <hadi@cyberus.ca> wrote:

> You applied 2/2 but not 1/2.
> 
> cheers,
> jamal
> On Wed, 2010-03-03 at 16:36 -0800, Stephen Hemminger wrote:
> > On Thu, 03 Dec 2009 08:32:48 -0500
> > jamal <hadi@cyberus.ca> wrote:
> > 
> > > I did this originally because i was getting too many support
> > > questions on ipt with mark. It still makes sense since skbedit
> > > seems to be the mother action of skb metadata (should probably
> > > have been called skbmeta).
> > > 
> > > cheers,
> > > jamal
> > 

The first was the help message text, and that was already there.
Or was there some other bit.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iproute2 skbedit: Add support to mark packets
  2010-03-04 16:48     ` Stephen Hemminger
@ 2010-03-04 16:58       ` jamal
  2010-03-04 17:43         ` Stephen Hemminger
  0 siblings, 1 reply; 8+ messages in thread
From: jamal @ 2010-03-04 16:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Alexander Duyck

On Thu, 2010-03-04 at 08:48 -0800, Stephen Hemminger wrote:
> On Wed, 03 Mar 2010 21:51:31 -0500
> jamal <hadi@cyberus.ca> wrote:
> 
> > You applied 2/2 but not 1/2.

> > > 
> 
> The first was the help message text, and that was already there.
> Or was there some other bit.

I can see that now. The git logs dont show how that change
made it in - thats how i concluded it wasnt there. How did that 
sneak in there?

cheers,
jamal


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iproute2 skbedit: Add support to mark packets
  2010-03-04 16:58       ` jamal
@ 2010-03-04 17:43         ` Stephen Hemminger
  2010-03-04 18:30           ` jamal
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2010-03-04 17:43 UTC (permalink / raw)
  To: hadi; +Cc: netdev, Alexander Duyck

On Thu, 04 Mar 2010 11:58:32 -0500
jamal <hadi@cyberus.ca> wrote:

> On Thu, 2010-03-04 at 08:48 -0800, Stephen Hemminger wrote:
> > On Wed, 03 Mar 2010 21:51:31 -0500
> > jamal <hadi@cyberus.ca> wrote:
> > 
> > > You applied 2/2 but not 1/2.
> 
> > > > 
> > 
> > The first was the help message text, and that was already there.
> > Or was there some other bit.
> 
> I can see that now. The git logs dont show how that change
> made it in - thats how i concluded it wasnt there. How did that 
> sneak in there?

I put the first bit in back in December. It was too early since
kernel wasn't ready yet, but generally harmless


commit e04dd30a38130a3d85065a747cc33274766a9cb6
Author: Jamal Hadi Salim <hadi@cyberus.ca>
Date:   Sat Dec 26 11:12:43 2009 -0800

    skbedit: Add support to mark packets
    
    This adds support for setting the skb mark.
    
    Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
    Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] iproute2 skbedit: Add support to mark packets
  2010-03-04 17:43         ` Stephen Hemminger
@ 2010-03-04 18:30           ` jamal
  0 siblings, 0 replies; 8+ messages in thread
From: jamal @ 2010-03-04 18:30 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Alexander Duyck

On Thu, 2010-03-04 at 09:43 -0800, Stephen Hemminger wrote:


> I put the first bit in back in December. It was too early since
> kernel wasn't ready yet, but generally harmless

Ah, my bad. git whatchanged didnt show that.

cheers,
jamal


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-04 18:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-03 13:32 [PATCH 2/2] iproute2 skbedit: Add support to mark packets jamal
2009-12-26 19:08 ` Stephen Hemminger
2010-03-04  0:36 ` Stephen Hemminger
2010-03-04  2:51   ` jamal
2010-03-04 16:48     ` Stephen Hemminger
2010-03-04 16:58       ` jamal
2010-03-04 17:43         ` Stephen Hemminger
2010-03-04 18:30           ` jamal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.