diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index fae6a7ececdb..3b54f8a2c055 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,27 @@ 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 | /* | ||
745 | * Net namespace inlines | ||
746 | */ | ||
747 | static inline | ||
748 | struct net *dev_net(const struct net_device *dev) | ||
749 | { | ||
750 | #ifdef CONFIG_NET_NS | ||
751 | return dev->nd_net; | ||
752 | #else | ||
753 | return &init_net; | ||
754 | #endif | ||
755 | } | ||
756 | |||
757 | static inline | ||
758 | void dev_net_set(struct net_device *dev, struct net *net) | ||
759 | { | ||
760 | #ifdef CONFIG_NET_NS | ||
761 | dev->nd_net = net; | ||
762 | #endif | ||
763 | } | ||
764 | |||
738 | /** | 765 | /** |
739 | * netdev_priv - access network device private data | 766 | * netdev_priv - access network device private data |
740 | * @dev: network device | 767 | * @dev: network device |
@@ -811,7 +838,7 @@ static inline struct net_device *next_net_device(struct net_device *dev) | |||
811 | struct list_head *lh; | 838 | struct list_head *lh; |
812 | struct net *net; | 839 | struct net *net; |
813 | 840 | ||
814 | net = dev->nd_net; | 841 | net = dev_net(dev); |
815 | lh = dev->dev_list.next; | 842 | lh = dev->dev_list.next; |
816 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); | 843 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); |
817 | } | 844 | } |
@@ -1477,6 +1504,12 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | |||
1477 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 1504 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
1478 | } | 1505 | } |
1479 | 1506 | ||
1507 | static inline void netif_set_gso_max_size(struct net_device *dev, | ||
1508 | unsigned int size) | ||
1509 | { | ||
1510 | dev->gso_max_size = size; | ||
1511 | } | ||
1512 | |||
1480 | /* On bonding slaves other than the currently active slave, suppress | 1513 | /* On bonding slaves other than the currently active slave, suppress |
1481 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | 1514 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and |
1482 | * ARP on active-backup slaves with arp_validate enabled. | 1515 | * ARP on active-backup slaves with arp_validate enabled. |