aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2011-08-14 15:45:55 -0400
committerDavid S. Miller <davem@davemloft.net>2011-08-17 23:06:03 -0400
commitbdeab991918663aed38757904219e8398214334c (patch)
treebc6c02da7ed88e3e568677b4a35fb4e55de363de /include/net/sock.h
parent792df22cd0499b4e662d4618b0008fdcfef8b04e (diff)
rps: Add flag to skb to indicate rxhash is based on L4 tuple
The l4_rxhash flag was added to the skb structure to indicate that the rxhash value was computed over the 4 tuple for the packet which includes the port information in the encapsulated transport packet. This is used by the stack to preserve the rxhash value in __skb_rx_tunnel. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 8e4062f165b8..5ac682f73d63 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -686,16 +686,25 @@ static inline void sock_rps_reset_flow(const struct sock *sk)
686#endif 686#endif
687} 687}
688 688
689static inline void sock_rps_save_rxhash(struct sock *sk, u32 rxhash) 689static inline void sock_rps_save_rxhash(struct sock *sk,
690 const struct sk_buff *skb)
690{ 691{
691#ifdef CONFIG_RPS 692#ifdef CONFIG_RPS
692 if (unlikely(sk->sk_rxhash != rxhash)) { 693 if (unlikely(sk->sk_rxhash != skb->rxhash)) {
693 sock_rps_reset_flow(sk); 694 sock_rps_reset_flow(sk);
694 sk->sk_rxhash = rxhash; 695 sk->sk_rxhash = skb->rxhash;
695 } 696 }
696#endif 697#endif
697} 698}
698 699
700static inline void sock_rps_reset_rxhash(struct sock *sk)
701{
702#ifdef CONFIG_RPS
703 sock_rps_reset_flow(sk);
704 sk->sk_rxhash = 0;
705#endif
706}
707
699#define sk_wait_event(__sk, __timeo, __condition) \ 708#define sk_wait_event(__sk, __timeo, __condition) \
700 ({ int __rc; \ 709 ({ int __rc; \
701 release_sock(__sk); \ 710 release_sock(__sk); \