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.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ee81906b5164..c36c76caf20b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -710,8 +710,10 @@ struct net_device
710 void (*poll_controller)(struct net_device *dev); 710 void (*poll_controller)(struct net_device *dev);
711#endif 711#endif
712 712
713#ifdef CONFIG_NET_NS
713 /* Network namespace this network device is inside */ 714 /* Network namespace this network device is inside */
714 struct net *nd_net; 715 struct net *nd_net;
716#endif
715 717
716 /* bridge stuff */ 718 /* bridge stuff */
717 struct net_bridge_port *br_port; 719 struct net_bridge_port *br_port;
@@ -726,6 +728,10 @@ struct net_device
726 /* rtnetlink link ops */ 728 /* rtnetlink link ops */
727 const struct rtnl_link_ops *rtnl_link_ops; 729 const struct rtnl_link_ops *rtnl_link_ops;
728 730
731 /* for setting kernel sock attribute on TCP connection setup */
732#define GSO_MAX_SIZE 65536
733 unsigned int gso_max_size;
734
729 /* The TX queue control structures */ 735 /* The TX queue control structures */
730 unsigned int egress_subqueue_count; 736 unsigned int egress_subqueue_count;
731 struct net_device_subqueue egress_subqueue[1]; 737 struct net_device_subqueue egress_subqueue[1];
@@ -735,6 +741,29 @@ struct net_device
735#define NETDEV_ALIGN 32 741#define NETDEV_ALIGN 32
736#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) 742#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
737 743
744#ifdef CONFIG_NET
745/*
746 * Net namespace inlines
747 */
748static inline
749struct net *dev_net(const struct net_device *dev)
750{
751#ifdef CONFIG_NET_NS
752 return dev->nd_net;
753#else
754 return &init_net;
755#endif
756}
757
758static inline
759void dev_net_set(struct net_device *dev, struct net *net)
760{
761#ifdef CONFIG_NET_NS
762 dev->nd_net = net;
763#endif
764}
765#endif
766
738/** 767/**
739 * netdev_priv - access network device private data 768 * netdev_priv - access network device private data
740 * @dev: network device 769 * @dev: network device
@@ -798,6 +827,7 @@ struct packet_type {
798extern rwlock_t dev_base_lock; /* Device list lock */ 827extern rwlock_t dev_base_lock; /* Device list lock */
799 828
800 829
830#ifdef CONFIG_NET
801#define for_each_netdev(net, d) \ 831#define for_each_netdev(net, d) \
802 list_for_each_entry(d, &(net)->dev_base_head, dev_list) 832 list_for_each_entry(d, &(net)->dev_base_head, dev_list)
803#define for_each_netdev_safe(net, d, n) \ 833#define for_each_netdev_safe(net, d, n) \
@@ -811,7 +841,7 @@ static inline struct net_device *next_net_device(struct net_device *dev)
811 struct list_head *lh; 841 struct list_head *lh;
812 struct net *net; 842 struct net *net;
813 843
814 net = dev->nd_net; 844 net = dev_net(dev);
815 lh = dev->dev_list.next; 845 lh = dev->dev_list.next;
816 return lh == &net->dev_base_head ? NULL : net_device_entry(lh); 846 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
817} 847}
@@ -821,6 +851,7 @@ static inline struct net_device *first_net_device(struct net *net)
821 return list_empty(&net->dev_base_head) ? NULL : 851 return list_empty(&net->dev_base_head) ? NULL :
822 net_device_entry(net->dev_base_head.next); 852 net_device_entry(net->dev_base_head.next);
823} 853}
854#endif
824 855
825extern int netdev_boot_setup_check(struct net_device *dev); 856extern int netdev_boot_setup_check(struct net_device *dev);
826extern unsigned long netdev_boot_base(const char *prefix, int unit); 857extern 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)
1479 unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); 1510 unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
1480} 1511}
1481 1512
1513static inline void netif_set_gso_max_size(struct net_device *dev,
1514 unsigned int size)
1515{
1516 dev->gso_max_size = size;
1517}
1518
1482/* On bonding slaves other than the currently active slave, suppress 1519/* On bonding slaves other than the currently active slave, suppress
1483 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and 1520 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and
1484 * ARP on active-backup slaves with arp_validate enabled. 1521 * ARP on active-backup slaves with arp_validate enabled.