netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cls_u32 u32_classify()
@ 2008-01-30 13:16 Dzianis Kahanovich
  2008-02-19  5:46 ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Dzianis Kahanovich @ 2008-01-30 13:16 UTC (permalink / raw)
  To: netdev

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

Currently fine u32 "hashkey ... at ..." not work with relative offsets.
There are simpliest fix to use "eat".

-- 
WBR,
Denis Kaganovich,  mahatma@eu.by  http://mahatma.bspu.unibel.by

[-- Attachment #2: cls_u32.diff --]
[-- Type: text/plain, Size: 985 bytes --]

diff -pruN linux-2.6.orig/net/sched/cls_u32.c linux-2.6/net/sched/cls_u32.c
--- linux-2.6.orig/net/sched/cls_u32.c	2008-01-29 23:02:50.000000000 +0200
+++ linux-2.6/net/sched/cls_u32.c	2008-01-30 10:56:11.000000000 +0200
@@ -181,11 +181,13 @@ check_terminal:
 
 		ht = n->ht_down;
 		sel = 0;
-		if (ht->divisor)
-			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
 
-		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
+		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) {
+			if (!ht->divisor)
+				goto next_ht;
+			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
 			goto next_ht;
+		}
 
 		if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
 			off2 = n->sel.off + 3;
@@ -198,6 +200,9 @@ check_terminal:
 			off2 = 0;
 		}
 
+		if (ht->divisor)
+			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
+
 		if (ptr < skb_tail_pointer(skb))
 			goto next_ht;
 	}

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] cls_u32 u32_classify() +
@ 2008-01-30 13:31 Dzianis Kahanovich
  2008-01-31 13:30 ` jamal
  0 siblings, 1 reply; 7+ messages in thread
From: Dzianis Kahanovich @ 2008-01-30 13:31 UTC (permalink / raw)
  To: netdev

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

Currently fine u32 "hashkey ... at ..." not work with relative offsets.
There are simpliest fix to use "eat".
(sorry, v2)

-- 
WBR,
Denis Kaganovich,  mahatma@eu.by  http://mahatma.bspu.unibel.by



[-- Attachment #2: cls_u32.diff --]
[-- Type: text/plain, Size: 1029 bytes --]

diff -pruN linux-2.6.orig/net/sched/cls_u32.c linux-2.6/net/sched/cls_u32.c
--- linux-2.6.orig/net/sched/cls_u32.c	2008-01-29 23:02:50.000000000 +0200
+++ linux-2.6/net/sched/cls_u32.c	2008-01-30 11:28:00.000000000 +0200
@@ -181,11 +181,13 @@ check_terminal:
 
 		ht = n->ht_down;
 		sel = 0;
-		if (ht->divisor)
-			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
 
-		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
+		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) {
+			if (!ht->divisor)
+				goto next_ht;
+			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
 			goto next_ht;
+		}
 
 		if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
 			off2 = n->sel.off + 3;
@@ -198,6 +200,9 @@ check_terminal:
 			off2 = 0;
 		}
 
+		if (ht->divisor && ptr+n->sel.hoff < skb_tail_pointer(skb))
+			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
+
 		if (ptr < skb_tail_pointer(skb))
 			goto next_ht;
 	}


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] cls_u32 u32_classify() ++
@ 2008-01-30 13:38 Dzianis Kahanovich
  0 siblings, 0 replies; 7+ messages in thread
From: Dzianis Kahanovich @ 2008-01-30 13:38 UTC (permalink / raw)
  To: netdev

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

Currently fine u32 "hashkey ... at ..." not work with relative offsets.
There are simpliest fix to use "eat".
(sorry, i'm idiot)

-- 
WBR,
Denis Kaganovich,  mahatma@eu.by  http://mahatma.bspu.unibel.by





[-- Attachment #2: cls_u32.diff --]
[-- Type: text/plain, Size: 1031 bytes --]

diff -pruN linux-2.6.orig/net/sched/cls_u32.c linux-2.6/net/sched/cls_u32.c
--- linux-2.6.orig/net/sched/cls_u32.c	2008-01-29 23:02:50.000000000 +0200
+++ linux-2.6/net/sched/cls_u32.c	2008-01-30 11:37:31.000000000 +0200
@@ -181,11 +181,13 @@ check_terminal:
 
 		ht = n->ht_down;
 		sel = 0;
-		if (ht->divisor)
-			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
 
-		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
+		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT))) {
+			if (!ht->divisor)
+				goto next_ht;
+			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
 			goto next_ht;
+		}
 
 		if (n->sel.flags&(TC_U32_OFFSET|TC_U32_VAROFFSET)) {
 			off2 = n->sel.off + 3;
@@ -198,6 +200,9 @@ check_terminal:
 			off2 = 0;
 		}
 
+		if (ht->divisor && ptr+n->sel.hoff+4 < skb_tail_pointer(skb))
+			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
+
 		if (ptr < skb_tail_pointer(skb))
 			goto next_ht;
 	}


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

end of thread, other threads:[~2008-02-21  6:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-30 13:16 [PATCH] cls_u32 u32_classify() Dzianis Kahanovich
2008-02-19  5:46 ` David Miller
2008-02-19 11:54   ` jamal
2008-02-21  6:43     ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2008-01-30 13:31 [PATCH] cls_u32 u32_classify() + Dzianis Kahanovich
2008-01-31 13:30 ` jamal
2008-01-30 13:38 [PATCH] cls_u32 u32_classify() ++ Dzianis Kahanovich

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).