diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ee81906b5164..7c1d4466583b 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,28 @@ 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 | release_net(dev->nd_net); | ||
762 | dev->nd_net = hold_net(net); | ||
763 | #endif | ||
764 | } | ||
765 | |||
738 | /** | 766 | /** |
739 | * netdev_priv - access network device private data | 767 | * netdev_priv - access network device private data |
740 | * @dev: network device | 768 | * @dev: network device |
@@ -811,7 +839,7 @@ static inline struct net_device *next_net_device(struct net_device *dev) | |||
811 | struct list_head *lh; | 839 | struct list_head *lh; |
812 | struct net *net; | 840 | struct net *net; |
813 | 841 | ||
814 | net = dev->nd_net; | 842 | net = dev_net(dev); |
815 | lh = dev->dev_list.next; | 843 | lh = dev->dev_list.next; |
816 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); | 844 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); |
817 | } | 845 | } |
@@ -1479,6 +1507,12 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | |||
1479 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 1507 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
1480 | } | 1508 | } |
1481 | 1509 | ||
1510 | static inline void netif_set_gso_max_size(struct net_device *dev, | ||
1511 | unsigned int size) | ||
1512 | { | ||
1513 | dev->gso_max_size = size; | ||
1514 | } | ||
1515 | |||
1482 | /* On bonding slaves other than the currently active slave, suppress | 1516 | /* On bonding slaves other than the currently active slave, suppress |
1483 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | 1517 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and |
1484 | * ARP on active-backup slaves with arp_validate enabled. | 1518 | * ARP on active-backup slaves with arp_validate enabled. |