aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 03cd7551a7a1..85f99f60deea 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -313,8 +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)
319#define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << 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)
318 322
319#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)
320#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)
@@ -543,7 +547,8 @@ struct packet_type {
543 struct net_device *, 547 struct net_device *,
544 struct packet_type *, 548 struct packet_type *,
545 struct net_device *); 549 struct net_device *);
546 struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg); 550 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
551 int features);
547 void *af_packet_priv; 552 void *af_packet_priv;
548 struct list_head list; 553 struct list_head list;
549}; 554};
@@ -968,7 +973,7 @@ extern int netdev_max_backlog;
968extern int weight_p; 973extern int weight_p;
969extern int netdev_set_master(struct net_device *dev, struct net_device *master); 974extern int netdev_set_master(struct net_device *dev, struct net_device *master);
970extern int skb_checksum_help(struct sk_buff *skb, int inward); 975extern int skb_checksum_help(struct sk_buff *skb, int inward);
971extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg); 976extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features);
972#ifdef CONFIG_BUG 977#ifdef CONFIG_BUG
973extern void netdev_rx_csum_fault(struct net_device *dev); 978extern void netdev_rx_csum_fault(struct net_device *dev);
974#else 979#else
@@ -988,11 +993,21 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
988 993
989extern void linkwatch_run_queue(void); 994extern void linkwatch_run_queue(void);
990 995
996static inline int net_gso_ok(int features, int gso_type)
997{
998 int feature = gso_type << NETIF_F_GSO_SHIFT;
999 return (features & feature) == feature;
1000}
1001
1002static 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
991static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) 1008static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
992{ 1009{
993 int feature = skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT; 1010 return !skb_gso_ok(skb, dev->features);
994 return skb_shinfo(skb)->gso_size &&
995 (dev->features & feature) != feature;
996} 1011}
997 1012
998#endif /* __KERNEL__ */ 1013#endif /* __KERNEL__ */