aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorKrishna Kumar <krkumar2@in.ibm.com>2010-08-04 02:15:52 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-17 00:06:24 -0400
commitbfb564e7391340638afe4ad67744a8f3858e7566 (patch)
tree7f079d9c3f020d52efb555db414476c463584967 /include/linux/skbuff.h
parent6891dd25d3f82e50979b27fde1980aa96320b975 (diff)
core: Factor out flow calculation from get_rps_cpu
Factor out flow calculation code from get_rps_cpu, since other functions can use the same code. Revisions: v2 (Ben): Separate flow calcuation out and use in select queue. v3 (Arnd): Don't re-implement MIN. v4 (Changli): skb->data points to ethernet header in macvtap, and make a fast path. Tested macvtap with this patch. v5 (Changli): - Cache skb->rxhash in skb_get_rxhash - macvtap may not have pow(2) queues, so change code for queue selection. (Arnd): - Use first available queue if all fails. Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 77eb60d2b496..d8050382b189 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -558,6 +558,15 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
558 unsigned int to, struct ts_config *config, 558 unsigned int to, struct ts_config *config,
559 struct ts_state *state); 559 struct ts_state *state);
560 560
561extern __u32 __skb_get_rxhash(struct sk_buff *skb);
562static inline __u32 skb_get_rxhash(struct sk_buff *skb)
563{
564 if (!skb->rxhash)
565 skb->rxhash = __skb_get_rxhash(skb);
566
567 return skb->rxhash;
568}
569
561#ifdef NET_SKBUFF_DATA_USES_OFFSET 570#ifdef NET_SKBUFF_DATA_USES_OFFSET
562static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 571static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
563{ 572{