Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133921
b: refs/heads/master
c: d5a9e24
h: refs/heads/master
i:
  133919: 861298c
v: v3
  • Loading branch information
David S. Miller committed Jan 28, 2009
1 parent ac8c7af commit 93d390e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a73efd0a8552927ebe5dff84936f7fdac4f7e314
refs/heads/master: d5a9e24afb4ab38110ebb777588ea0bd0eacbd0a
15 changes: 15 additions & 0 deletions trunk/include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,21 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu
to->queue_mapping = from->queue_mapping;
}

static inline void skb_record_rx_queue(struct sk_buff *skb, u16 rx_queue)
{
skb->queue_mapping = rx_queue + 1;
}

static inline u16 skb_get_rx_queue(struct sk_buff *skb)
{
return skb->queue_mapping - 1;
}

static inline bool skb_rx_queue_recorded(struct sk_buff *skb)
{
return (skb->queue_mapping != 0);
}

#ifdef CONFIG_XFRM
static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
{
Expand Down
8 changes: 8 additions & 0 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,13 @@ static u16 simple_tx_hash(struct net_device *dev, struct sk_buff *skb)
simple_tx_hashrnd_initialized = 1;
}

if (skb_rx_queue_recorded(skb)) {
u32 val = skb_get_rx_queue(skb);

hash = jhash_1word(val, simple_tx_hashrnd);
goto out;
}

switch (skb->protocol) {
case htons(ETH_P_IP):
if (!(ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)))
Expand Down Expand Up @@ -1759,6 +1766,7 @@ static u16 simple_tx_hash(struct net_device *dev, struct sk_buff *skb)

hash = jhash_3words(addr1, addr2, ports, simple_tx_hashrnd);

out:
return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32);
}

Expand Down

0 comments on commit 93d390e

Please sign in to comment.