diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-12 20:17:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-12 20:17:55 -0500 |
commit | 9457b24a0955bbdd2e89220a75de69fe09501bba (patch) | |
tree | cb484848e14cc2705c4513ad3ec1f0420a4d55db /include | |
parent | 80ef913f5e6a84551545016cea709f5e96d0cda6 (diff) | |
parent | 0597d1b99fcfc2c0eada09a698f85ed413d4ba84 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (66 commits)
can-bcm: fix minor heap overflow
gianfar: Do not call device_set_wakeup_enable() under a spinlock
ipv6: Warn users if maximum number of routes is reached.
docs: Add neigh/gc_thresh3 and route/max_size documentation.
axnet_cs: fix resume problem for some Ax88790 chip
ipv6: addrconf: don't remove address state on ifdown if the address is being kept
tcp: Don't change unlocked socket state in tcp_v4_err().
x25: Prevent crashing when parsing bad X.25 facilities
cxgb4vf: add call to Firmware to reset VF State.
cxgb4vf: Fail open if link_start() fails.
cxgb4vf: flesh out PCI Device ID Table ...
cxgb4vf: fix some errors in Gather List to skb conversion
cxgb4vf: fix bug in Generic Receive Offload
cxgb4vf: don't implement trivial (and incorrect) ndo_select_queue()
ixgbe: Look inside vlan when determining offload protocol.
bnx2x: Look inside vlan when determining checksum proto.
vlan: Add function to retrieve EtherType from vlan packets.
virtio-net: init link state correctly
ucc_geth: Fix deadlock
ucc_geth: Do not bring the whole IF down when TX failure.
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if_vlan.h | 25 | ||||
-rw-r--r-- | include/linux/netdevice.h | 5 | ||||
-rw-r--r-- | include/linux/netfilter.h | 2 | ||||
-rw-r--r-- | include/net/dn.h | 2 | ||||
-rw-r--r-- | include/net/dst_ops.h | 1 | ||||
-rw-r--r-- | include/net/sock.h | 4 | ||||
-rw-r--r-- | include/net/tcp.h | 6 | ||||
-rw-r--r-- | include/net/udp.h | 4 |
8 files changed, 40 insertions, 9 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index c2f3a72712ce..635e1faec412 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -339,6 +339,31 @@ static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | |||
339 | } | 339 | } |
340 | } | 340 | } |
341 | 341 | ||
342 | /** | ||
343 | * vlan_get_protocol - get protocol EtherType. | ||
344 | * @skb: skbuff to query | ||
345 | * | ||
346 | * Returns the EtherType of the packet, regardless of whether it is | ||
347 | * vlan encapsulated (normal or hardware accelerated) or not. | ||
348 | */ | ||
349 | static inline __be16 vlan_get_protocol(const struct sk_buff *skb) | ||
350 | { | ||
351 | __be16 protocol = 0; | ||
352 | |||
353 | if (vlan_tx_tag_present(skb) || | ||
354 | skb->protocol != cpu_to_be16(ETH_P_8021Q)) | ||
355 | protocol = skb->protocol; | ||
356 | else { | ||
357 | __be16 proto, *protop; | ||
358 | protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr, | ||
359 | h_vlan_encapsulated_proto), | ||
360 | sizeof(proto), &proto); | ||
361 | if (likely(protop)) | ||
362 | protocol = *protop; | ||
363 | } | ||
364 | |||
365 | return protocol; | ||
366 | } | ||
342 | #endif /* __KERNEL__ */ | 367 | #endif /* __KERNEL__ */ |
343 | 368 | ||
344 | /* VLAN IOCTLs are found in sockios.h */ | 369 | /* VLAN IOCTLs are found in sockios.h */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 072652d94d9f..d8fd2c23a1b9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1554,6 +1554,11 @@ static inline void netif_tx_wake_all_queues(struct net_device *dev) | |||
1554 | 1554 | ||
1555 | static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) | 1555 | static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) |
1556 | { | 1556 | { |
1557 | if (WARN_ON(!dev_queue)) { | ||
1558 | printk(KERN_INFO "netif_stop_queue() cannot be called before " | ||
1559 | "register_netdev()"); | ||
1560 | return; | ||
1561 | } | ||
1557 | set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | 1562 | set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); |
1558 | } | 1563 | } |
1559 | 1564 | ||
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 89341c32631a..03317c8d4077 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -215,7 +215,7 @@ NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb, | |||
215 | int ret; | 215 | int ret; |
216 | 216 | ||
217 | if (!cond || | 217 | if (!cond || |
218 | (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1)) | 218 | ((ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN)) == 1)) |
219 | ret = okfn(skb); | 219 | ret = okfn(skb); |
220 | return ret; | 220 | return ret; |
221 | } | 221 | } |
diff --git a/include/net/dn.h b/include/net/dn.h index e5469f7b67a3..a514a3cf4573 100644 --- a/include/net/dn.h +++ b/include/net/dn.h | |||
@@ -225,7 +225,7 @@ extern int decnet_di_count; | |||
225 | extern int decnet_dr_count; | 225 | extern int decnet_dr_count; |
226 | extern int decnet_no_fc_max_cwnd; | 226 | extern int decnet_no_fc_max_cwnd; |
227 | 227 | ||
228 | extern int sysctl_decnet_mem[3]; | 228 | extern long sysctl_decnet_mem[3]; |
229 | extern int sysctl_decnet_wmem[3]; | 229 | extern int sysctl_decnet_wmem[3]; |
230 | extern int sysctl_decnet_rmem[3]; | 230 | extern int sysctl_decnet_rmem[3]; |
231 | 231 | ||
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index 1fa5306e3e23..51665b3461b8 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _NET_DST_OPS_H | 2 | #define _NET_DST_OPS_H |
3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
4 | #include <linux/percpu_counter.h> | 4 | #include <linux/percpu_counter.h> |
5 | #include <linux/cache.h> | ||
5 | 6 | ||
6 | struct dst_entry; | 7 | struct dst_entry; |
7 | struct kmem_cachep; | 8 | struct kmem_cachep; |
diff --git a/include/net/sock.h b/include/net/sock.h index c7a736228ca2..a6338d039857 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -762,7 +762,7 @@ struct proto { | |||
762 | 762 | ||
763 | /* Memory pressure */ | 763 | /* Memory pressure */ |
764 | void (*enter_memory_pressure)(struct sock *sk); | 764 | void (*enter_memory_pressure)(struct sock *sk); |
765 | atomic_t *memory_allocated; /* Current allocated memory. */ | 765 | atomic_long_t *memory_allocated; /* Current allocated memory. */ |
766 | struct percpu_counter *sockets_allocated; /* Current number of sockets. */ | 766 | struct percpu_counter *sockets_allocated; /* Current number of sockets. */ |
767 | /* | 767 | /* |
768 | * Pressure flag: try to collapse. | 768 | * Pressure flag: try to collapse. |
@@ -771,7 +771,7 @@ struct proto { | |||
771 | * is strict, actions are advisory and have some latency. | 771 | * is strict, actions are advisory and have some latency. |
772 | */ | 772 | */ |
773 | int *memory_pressure; | 773 | int *memory_pressure; |
774 | int *sysctl_mem; | 774 | long *sysctl_mem; |
775 | int *sysctl_wmem; | 775 | int *sysctl_wmem; |
776 | int *sysctl_rmem; | 776 | int *sysctl_rmem; |
777 | int max_header; | 777 | int max_header; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 4fee0424af7e..e36c874c7fb1 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -224,7 +224,7 @@ extern int sysctl_tcp_fack; | |||
224 | extern int sysctl_tcp_reordering; | 224 | extern int sysctl_tcp_reordering; |
225 | extern int sysctl_tcp_ecn; | 225 | extern int sysctl_tcp_ecn; |
226 | extern int sysctl_tcp_dsack; | 226 | extern int sysctl_tcp_dsack; |
227 | extern int sysctl_tcp_mem[3]; | 227 | extern long sysctl_tcp_mem[3]; |
228 | extern int sysctl_tcp_wmem[3]; | 228 | extern int sysctl_tcp_wmem[3]; |
229 | extern int sysctl_tcp_rmem[3]; | 229 | extern int sysctl_tcp_rmem[3]; |
230 | extern int sysctl_tcp_app_win; | 230 | extern int sysctl_tcp_app_win; |
@@ -247,7 +247,7 @@ extern int sysctl_tcp_cookie_size; | |||
247 | extern int sysctl_tcp_thin_linear_timeouts; | 247 | extern int sysctl_tcp_thin_linear_timeouts; |
248 | extern int sysctl_tcp_thin_dupack; | 248 | extern int sysctl_tcp_thin_dupack; |
249 | 249 | ||
250 | extern atomic_t tcp_memory_allocated; | 250 | extern atomic_long_t tcp_memory_allocated; |
251 | extern struct percpu_counter tcp_sockets_allocated; | 251 | extern struct percpu_counter tcp_sockets_allocated; |
252 | extern int tcp_memory_pressure; | 252 | extern int tcp_memory_pressure; |
253 | 253 | ||
@@ -280,7 +280,7 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && | 282 | if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && |
283 | atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) | 283 | atomic_long_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) |
284 | return true; | 284 | return true; |
285 | return false; | 285 | return false; |
286 | } | 286 | } |
diff --git a/include/net/udp.h b/include/net/udp.h index 200b82848c9a..bb967dd59bf7 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -105,10 +105,10 @@ static inline struct udp_hslot *udp_hashslot2(struct udp_table *table, | |||
105 | 105 | ||
106 | extern struct proto udp_prot; | 106 | extern struct proto udp_prot; |
107 | 107 | ||
108 | extern atomic_t udp_memory_allocated; | 108 | extern atomic_long_t udp_memory_allocated; |
109 | 109 | ||
110 | /* sysctl variables for udp */ | 110 | /* sysctl variables for udp */ |
111 | extern int sysctl_udp_mem[3]; | 111 | extern long sysctl_udp_mem[3]; |
112 | extern int sysctl_udp_rmem_min; | 112 | extern int sysctl_udp_rmem_min; |
113 | extern int sysctl_udp_wmem_min; | 113 | extern int sysctl_udp_wmem_min; |
114 | 114 | ||