netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dzianis Kahanovich <mahatma@bspu.unibel.by>
To: netdev@vger.kernel.org
Subject: [PATCH] cls_u32 u32_classify() ++
Date: Wed, 30 Jan 2008 11:38:53 -0200	[thread overview]
Message-ID: <47A07DED.5000907@bspu.unibel.by> (raw)

[-- 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;
 	}


             reply	other threads:[~2008-01-30  9:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 13:38 Dzianis Kahanovich [this message]
  -- 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: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

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=47A07DED.5000907@bspu.unibel.by \
    --to=mahatma@bspu.unibel.by \
    --cc=mahatma@eu.by \
    --cc=netdev@vger.kernel.org \
    /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).