diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 6c86c7edafa7..ddd47c3a757d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1957,7 +1957,10 @@ struct napi_gro_cb { | |||
1957 | /* Used in foo-over-udp, set in udp[46]_gro_receive */ | 1957 | /* Used in foo-over-udp, set in udp[46]_gro_receive */ |
1958 | u8 is_ipv6:1; | 1958 | u8 is_ipv6:1; |
1959 | 1959 | ||
1960 | /* 7 bit hole */ | 1960 | /* Number of gro_receive callbacks this packet already went through */ |
1961 | u8 recursion_counter:4; | ||
1962 | |||
1963 | /* 3 bit hole */ | ||
1961 | 1964 | ||
1962 | /* used to support CHECKSUM_COMPLETE for tunneling protocols */ | 1965 | /* used to support CHECKSUM_COMPLETE for tunneling protocols */ |
1963 | __wsum csum; | 1966 | __wsum csum; |
@@ -1968,6 +1971,25 @@ struct napi_gro_cb { | |||
1968 | 1971 | ||
1969 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) | 1972 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) |
1970 | 1973 | ||
1974 | #define GRO_RECURSION_LIMIT 15 | ||
1975 | static inline int gro_recursion_inc_test(struct sk_buff *skb) | ||
1976 | { | ||
1977 | return ++NAPI_GRO_CB(skb)->recursion_counter == GRO_RECURSION_LIMIT; | ||
1978 | } | ||
1979 | |||
1980 | typedef struct sk_buff **(*gro_receive_t)(struct sk_buff **, struct sk_buff *); | ||
1981 | static inline struct sk_buff **call_gro_receive(gro_receive_t cb, | ||
1982 | struct sk_buff **head, | ||
1983 | struct sk_buff *skb) | ||
1984 | { | ||
1985 | if (gro_recursion_inc_test(skb)) { | ||
1986 | NAPI_GRO_CB(skb)->flush |= 1; | ||
1987 | return NULL; | ||
1988 | } | ||
1989 | |||
1990 | return cb(head, skb); | ||
1991 | } | ||
1992 | |||
1971 | struct packet_type { | 1993 | struct packet_type { |
1972 | __be16 type; /* This is really htons(ether_type). */ | 1994 | __be16 type; /* This is really htons(ether_type). */ |
1973 | struct net_device *dev; /* NULL is wildcarded here */ | 1995 | struct net_device *dev; /* NULL is wildcarded here */ |