diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 21:02:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 21:02:35 -0400 |
commit | 334d094504c2fe1c44211ecb49146ae6bca8c321 (patch) | |
tree | d3c0f68e4b9f8e3d2ccc39e7dfe5de0534a5fad9 /include/linux/netdevice.h | |
parent | d1a4be630fb068f251d64b62919f143c49ca8057 (diff) | |
parent | d1643d24c61b725bef399cc1cf2944b4c9c23177 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26: (1090 commits)
[NET]: Fix and allocate less memory for ->priv'less netdevices
[IPV6]: Fix dangling references on error in fib6_add().
[NETLABEL]: Fix NULL deref in netlbl_unlabel_staticlist_gen() if ifindex not found
[PKT_SCHED]: Fix datalen check in tcf_simp_init().
[INET]: Uninline the __inet_inherit_port call.
[INET]: Drop the inet_inherit_port() call.
SCTP: Initialize partial_bytes_acked to 0, when all of the data is acked.
[netdrvr] forcedeth: internal simplifications; changelog removal
phylib: factor out get_phy_id from within get_phy_device
PHY: add BCM5464 support to broadcom PHY driver
cxgb3: Fix __must_check warning with dev_dbg.
tc35815: Statistics cleanup
natsemi: fix MMIO for PPC 44x platforms
[TIPC]: Cleanup of TIPC reference table code
[TIPC]: Optimized initialization of TIPC reference table
[TIPC]: Remove inlining of reference table locking routines
e1000: convert uint16_t style integers to u16
ixgb: convert uint16_t style integers to u16
sb1000.c: make const arrays static
sb1000.c: stop inlining largish static functions
...
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. |