diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netdevice.h | 17 | ||||
| -rw-r--r-- | include/linux/skbuff.h | 6 |
2 files changed, 16 insertions, 7 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index aa2d3c12c4d8..85f99f60deea 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -313,10 +313,12 @@ struct net_device | |||
| 313 | 313 | ||
| 314 | /* Segmentation offload features */ | 314 | /* Segmentation offload features */ |
| 315 | #define NETIF_F_GSO_SHIFT 16 | 315 | #define NETIF_F_GSO_SHIFT 16 |
| 316 | #define NETIF_F_GSO_MASK 0xffff0000 | ||
| 316 | #define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT) | 317 | #define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT) |
| 317 | #define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT) | 318 | #define NETIF_F_UFO (SKB_GSO_UDP << NETIF_F_GSO_SHIFT) |
| 318 | #define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT) | 319 | #define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT) |
| 319 | #define NETIF_F_TSO_ECN (SKB_GSO_TCPV4_ECN << NETIF_F_GSO_SHIFT) | 320 | #define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT) |
| 321 | #define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT) | ||
| 320 | 322 | ||
| 321 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) | 323 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) |
| 322 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) | 324 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) |
| @@ -991,13 +993,18 @@ extern void dev_seq_stop(struct seq_file *seq, void *v); | |||
| 991 | 993 | ||
| 992 | extern void linkwatch_run_queue(void); | 994 | extern void linkwatch_run_queue(void); |
| 993 | 995 | ||
| 994 | static inline int skb_gso_ok(struct sk_buff *skb, int features) | 996 | static inline int net_gso_ok(int features, int gso_type) |
| 995 | { | 997 | { |
| 996 | int feature = skb_shinfo(skb)->gso_size ? | 998 | int feature = gso_type << NETIF_F_GSO_SHIFT; |
| 997 | skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT : 0; | ||
| 998 | return (features & feature) == feature; | 999 | return (features & feature) == feature; |
| 999 | } | 1000 | } |
| 1000 | 1001 | ||
| 1002 | static inline int skb_gso_ok(struct sk_buff *skb, int features) | ||
| 1003 | { | ||
| 1004 | return net_gso_ok(features, skb_shinfo(skb)->gso_size ? | ||
| 1005 | skb_shinfo(skb)->gso_type : 0); | ||
| 1006 | } | ||
| 1007 | |||
| 1001 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | 1008 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) |
| 1002 | { | 1009 | { |
| 1003 | return !skb_gso_ok(skb, dev->features); | 1010 | return !skb_gso_ok(skb, dev->features); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 59918be91d0a..57d7d4965f9a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -171,13 +171,15 @@ enum { | |||
| 171 | 171 | ||
| 172 | enum { | 172 | enum { |
| 173 | SKB_GSO_TCPV4 = 1 << 0, | 173 | SKB_GSO_TCPV4 = 1 << 0, |
| 174 | SKB_GSO_UDPV4 = 1 << 1, | 174 | SKB_GSO_UDP = 1 << 1, |
| 175 | 175 | ||
| 176 | /* This indicates the skb is from an untrusted source. */ | 176 | /* This indicates the skb is from an untrusted source. */ |
| 177 | SKB_GSO_DODGY = 1 << 2, | 177 | SKB_GSO_DODGY = 1 << 2, |
| 178 | 178 | ||
| 179 | /* This indicates the tcp segment has CWR set. */ | 179 | /* This indicates the tcp segment has CWR set. */ |
| 180 | SKB_GSO_TCPV4_ECN = 1 << 3, | 180 | SKB_GSO_TCP_ECN = 1 << 3, |
| 181 | |||
| 182 | SKB_GSO_TCPV6 = 1 << 4, | ||
| 181 | }; | 183 | }; |
| 182 | 184 | ||
| 183 | /** | 185 | /** |
