]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/netdevice.h
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[karo-tx-linux.git] / include / linux / netdevice.h
index ee81906b5164deccb24ed396f95697b4a79638b2..c36c76caf20b88204a002b14cbe800571cbd4da5 100644 (file)
@@ -710,8 +710,10 @@ struct net_device
        void                    (*poll_controller)(struct net_device *dev);
 #endif
 
+#ifdef CONFIG_NET_NS
        /* Network namespace this network device is inside */
        struct net              *nd_net;
+#endif
 
        /* bridge stuff */
        struct net_bridge_port  *br_port;
@@ -726,6 +728,10 @@ struct net_device
        /* rtnetlink link ops */
        const struct rtnl_link_ops *rtnl_link_ops;
 
+       /* for setting kernel sock attribute on TCP connection setup */
+#define GSO_MAX_SIZE           65536
+       unsigned int            gso_max_size;
+
        /* The TX queue control structures */
        unsigned int                    egress_subqueue_count;
        struct net_device_subqueue      egress_subqueue[1];
@@ -735,6 +741,29 @@ struct net_device
 #define        NETDEV_ALIGN            32
 #define        NETDEV_ALIGN_CONST      (NETDEV_ALIGN - 1)
 
+#ifdef CONFIG_NET
+/*
+ * Net namespace inlines
+ */
+static inline
+struct net *dev_net(const struct net_device *dev)
+{
+#ifdef CONFIG_NET_NS
+       return dev->nd_net;
+#else
+       return &init_net;
+#endif
+}
+
+static inline
+void dev_net_set(struct net_device *dev, struct net *net)
+{
+#ifdef CONFIG_NET_NS
+       dev->nd_net = net;
+#endif
+}
+#endif
+
 /**
  *     netdev_priv - access network device private data
  *     @dev: network device
@@ -798,6 +827,7 @@ struct packet_type {
 extern rwlock_t                                dev_base_lock;          /* Device list lock */
 
 
+#ifdef CONFIG_NET
 #define for_each_netdev(net, d)                \
                list_for_each_entry(d, &(net)->dev_base_head, dev_list)
 #define for_each_netdev_safe(net, d, n)        \
@@ -811,7 +841,7 @@ static inline struct net_device *next_net_device(struct net_device *dev)
        struct list_head *lh;
        struct net *net;
 
-       net = dev->nd_net;
+       net = dev_net(dev);
        lh = dev->dev_list.next;
        return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
 }
@@ -821,6 +851,7 @@ static inline struct net_device *first_net_device(struct net *net)
        return list_empty(&net->dev_base_head) ? NULL :
                net_device_entry(net->dev_base_head.next);
 }
+#endif
 
 extern int                     netdev_boot_setup_check(struct net_device *dev);
 extern unsigned long           netdev_boot_base(const char *prefix, int unit);
@@ -1479,6 +1510,12 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
                unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
 }
 
+static inline void netif_set_gso_max_size(struct net_device *dev,
+                                         unsigned int size)
+{
+       dev->gso_max_size = size;
+}
+
 /* On bonding slaves other than the currently active slave, suppress
  * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and
  * ARP on active-backup slaves with arp_validate enabled.