From ded7090a13cc40a62a88b8a22ec04d314806dccc Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Mon, 28 Nov 2011 05:25:02 +0000 Subject: [PATCH] --- yaml --- r: 277999 b: refs/heads/master c: a00bd469b6604aa5f165dcc4d07dc07499439a6b h: refs/heads/master i: 277997: f6dd0f313148372331b5ce3663399683b5e8b979 277995: 38bb23dcaf1e2126cb06a02540abdff2bb159fcd 277991: a2e077a3ef8a9b61908e2e49efb6446e5420aac6 277983: c87c7c686cd329342dc496451fc31054f1e38c5e v: v3 --- [refs] | 2 +- trunk/net/sched/sch_sfb.c | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index efaa53a80c9d..9d596d468d05 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6bd2a9af17cc3b153de45390b54c7d64a773beee +refs/heads/master: a00bd469b6604aa5f165dcc4d07dc07499439a6b diff --git a/trunk/net/sched/sch_sfb.c b/trunk/net/sched/sch_sfb.c index e83c272c0325..96e42cae4c7a 100644 --- a/trunk/net/sched/sch_sfb.c +++ b/trunk/net/sched/sch_sfb.c @@ -26,6 +26,7 @@ #include #include #include +#include /* * SFB uses two B[l][n] : L x N arrays of bins (L levels, N bins per level) @@ -286,6 +287,7 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch) u32 minqlen = ~0; u32 r, slot, salt, sfbhash; int ret = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; + struct flow_keys keys; if (unlikely(sch->q.qlen >= q->limit)) { sch->qstats.overlimits++; @@ -309,13 +311,19 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch) /* If using external classifiers, get result and record it. */ if (!sfb_classify(skb, q, &ret, &salt)) goto other_drop; + keys.src = salt; + keys.dst = 0; + keys.ports = 0; } else { - salt = skb_get_rxhash(skb); + skb_flow_dissect(skb, &keys); } slot = q->slot; - sfbhash = jhash_1word(salt, q->bins[slot].perturbation); + sfbhash = jhash_3words((__force u32)keys.dst, + (__force u32)keys.src, + (__force u32)keys.ports, + q->bins[slot].perturbation); if (!sfbhash) sfbhash = 1; sfb_skb_cb(skb)->hashes[slot] = sfbhash; @@ -347,7 +355,10 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch) if (unlikely(p_min >= SFB_MAX_PROB)) { /* Inelastic flow */ if (q->double_buffering) { - sfbhash = jhash_1word(salt, q->bins[slot].perturbation); + sfbhash = jhash_3words((__force u32)keys.dst, + (__force u32)keys.src, + (__force u32)keys.ports, + q->bins[slot].perturbation); if (!sfbhash) sfbhash = 1; sfb_skb_cb(skb)->hashes[slot] = sfbhash;