Skip to content
Permalink
Browse files

Move the hash override a bit earlier

Need to set the hash overrides before the flow_hash is set from the host
hashes in hosts-only hashing mode, otherwise only setting the host classid
in this mode is going to break.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
  • Loading branch information
tohojo committed Aug 21, 2018
1 parent b6c21ad commit 9f052d92953501b8808928a3b0c89b27742e0de2
Showing with 8 additions and 8 deletions.
  1. +8 −8 sch_cake.c
@@ -778,14 +778,6 @@ static u32 cake_hash(struct cake_tin_data *q, const struct sk_buff *skb,
flow_hash = flow_hash_from_keys(&keys);
#endif

if (!(flow_mode & CAKE_FLOW_FLOWS)) {
if (flow_mode & CAKE_FLOW_SRC_IP)
flow_hash ^= srchost_hash;

if (flow_mode & CAKE_FLOW_DST_IP)
flow_hash ^= dsthost_hash;
}

skip_hash:
if (flow_override)
flow_hash = flow_override - 1;
@@ -794,6 +786,14 @@ static u32 cake_hash(struct cake_tin_data *q, const struct sk_buff *skb,
srchost_hash = host_override - 1;
}

if (!(flow_mode & CAKE_FLOW_FLOWS)) {
if (flow_mode & CAKE_FLOW_SRC_IP)
flow_hash ^= srchost_hash;

if (flow_mode & CAKE_FLOW_DST_IP)
flow_hash ^= dsthost_hash;
}

reduced_hash = flow_hash % CAKE_QUEUES;

/* set-associative hashing */

0 comments on commit 9f052d9

Please sign in to comment.
You can’t perform that action at this time.