[NET]: Generalise TSO-specific bits from skb_setup_caps
[deliverable/linux.git] / include / linux / netdevice.h
index aa2d3c12c4d80cffdb6a011ee1d01a0ca57f8af9..6db03ab7cec85bdef4836fa0999b3c4a50b73402 100644 (file)
@@ -313,6 +313,7 @@ struct net_device
 
        /* Segmentation offload features */
 #define NETIF_F_GSO_SHIFT      16
+#define NETIF_F_GSO_MASK       0xffff0000
 #define NETIF_F_TSO            (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
 #define NETIF_F_UFO            (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT)
 #define NETIF_F_GSO_ROBUST     (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT)
@@ -991,13 +992,18 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
 
 extern void linkwatch_run_queue(void);
 
-static inline int skb_gso_ok(struct sk_buff *skb, int features)
+static inline int net_gso_ok(int features, int gso_type)
 {
-       int feature = skb_shinfo(skb)->gso_size ?
-                     skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT : 0;
+       int feature = gso_type << NETIF_F_GSO_SHIFT;
        return (features & feature) == feature;
 }
 
+static inline int skb_gso_ok(struct sk_buff *skb, int features)
+{
+       return net_gso_ok(features, skb_shinfo(skb)->gso_size ?
+                                   skb_shinfo(skb)->gso_type : 0);
+}
+
 static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
 {
        return !skb_gso_ok(skb, dev->features);
This page took 0.027501 seconds and 5 git commands to generate.