From: Herbert Xu <herbert@gondor.apana.org.au> Date: Wed, 27 May 2009 15:31:08 +1000 Subject: [net] netpoll: backport netpoll_rx_on Message-id: E1M9BjI-0002AO-Mj@gondolin.me.apana.org.au O-Subject: [PATCH 4/17] netpoll: Backport netpoll_rx_on Bugzilla: 499347 RH-Acked-by: David Miller <davem@redhat.com> RH-Acked-by: Neil Horman <nhorman@redhat.com> RH-Acked-by: Thomas Graf <tgraf@redhat.com> RHEL5 bugzilla #499347 netpoll: Backport netpoll_rx_on This patch backports netpoll_rx_on which checks whether netpoll RX is enabled which would bypass GRO. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 1efe60c..5e3a929 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -63,6 +63,13 @@ static inline int netpoll_rx(struct sk_buff *skb) return ret; } +static inline int netpoll_rx_on(struct sk_buff *skb) +{ + struct netpoll_info *npinfo = skb->dev->npinfo; + + return npinfo && (npinfo->rx_np || npinfo->rx_flags); +} + static inline void *netpoll_poll_lock(struct net_device *dev) { rcu_read_lock(); /* deal with race on ->npinfo */ @@ -87,6 +94,7 @@ static inline void netpoll_poll_unlock(void *have) #else #define netpoll_rx(a) 0 +#define netpoll_rx_on(a) 0 #define netpoll_poll_lock(a) NULL #define netpoll_poll_unlock(a) #endif