aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2011-07-21ipv6: unshare inetpeersEric Dumazet1-13/+20
We currently cow metrics a bit too soon in IPv6 case : All routes are tied to a single inetpeer entry. Change ip6_rt_copy() to get destination address as second argument, so that we fill rt6i_dst before the dst_copy_metrics() call. icmp6_dst_alloc() must set rt6i_dst before calling dst_metric_set(), or else the cow is done while rt6i_dst is still NULL. If orig route points to readonly metrics, we can share the pointer instead of performing the memory allocation and copy. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21ethtool: Allow zero-length register dumps againBen Hutchings1-2/+2
Some drivers (ab)use the ethtool_ops::get_regs operation to expose only a hardware revision ID. Commit a77f5db361ed9953b5b749353ea2c7fed2bf8d93 ('ethtool: Allocate register dump buffer with vmalloc()') had the side-effect of breaking these, as vmalloc() returns a null pointer for size=0 whereas kmalloc() did not. For backward-compatibility, allow zero-length dumps again. Reported-by: Kalle Valo <[email protected]> Signed-off-by: Ben Hutchings <[email protected]> Cc: [email protected] [2.6.37+] Signed-off-by: David S. Miller <[email protected]>
2011-07-21skbuff: fix error handling in pskb_copy()Dan Carpenter1-1/+2
There are two problems: 1) "n" was allocated with alloc_skb() so we should free it with kfree_skb() instead of regular kfree(). 2) We return the freed pointer instead of NULL. Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21vlan: move vlan_group_[gs]et_device to public headerJiri Pirko1-0/+19
there are no users outside vlan code Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21vlan: kill ndo_vlan_rx_registerJiri Pirko1-4/+0
has no users so remove it Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21vlan: kill vlan_gro_frags and vlan_gro_receiveJiri Pirko1-16/+0
Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21vlan: kill __vlan_hwaccel_rx and vlan_hwaccel_rxJiri Pirko1-9/+0
Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21lro: do vlan cleanupJiri Pirko1-28/+11
- remove useless vlan parameters and pointers Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21lro: kill lro_vlan_hwaccel_receive_fragsJiri Pirko1-20/+0
Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21lro: kill lro_vlan_hwaccel_receive_skbJiri Pirko1-15/+0
no longer used Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21vlan: introduce __vlan_find_dev_deep()Jiri Pirko1-0/+21
Since vlan_group_get_device and vlan_group is not going to be accessible from device drivers, introduce function which substitutes it. Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-21Merge branch 'master' of ↵David S. Miller4-23/+28
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: net/bluetooth/l2cap_core.c
2011-07-21Merge branch 'master' of ↵David S. Miller10-76/+215
git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
2011-07-21treewide: fix potentially dangerous trailing ';' in #defined values/expressionsPhil Carmody1-10/+10
All these are instances of #define NAME value; or #define NAME(params_opt) value; These of course fail to build when used in contexts like if(foo $OP NAME) while(bar $OP NAME) and may silently generate the wrong code in contexts such as foo = NAME + 1; /* foo = value; + 1; */ bar = NAME - 1; /* bar = value; - 1; */ baz = NAME & quux; /* baz = value; & quux; */ Reported on comp.lang.c, Message-ID: <ab0d55fe-25e5-482b-811e-c475aa6065c3@c29g2000yqd.googlegroups.com> Initial analysis of the dangers provided by Keith Thompson in that thread. There are many more instances of more complicated macros having unnecessary trailing semicolons, but this pile seems to be all of the cases of simple values suffering from the problem. (Thus things that are likely to be found in one of the contexts above, more complicated ones aren't.) Signed-off-by: Phil Carmody <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2011-07-21net, netfilter: Remove redundant goto in ebt_ulog_packetJesper Juhl1-1/+0
In net/bridge/netfilter/ebt_ulog.c:ebt_ulog_packet() the 'goto unlock' before the 'alloc_failure' label is completely redundant. This patch removes it. Signed-off-by: Jesper Juhl <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2011-07-21netfilter: ipset: hash:net,iface fixed to handle overlapping nets behind ↵Jozsef Kadlecsik7-20/+56
different interfaces If overlapping networks with different interfaces was added to the set, the type did not handle it properly. Example ipset create test hash:net,iface ipset add test 192.168.0.0/16,eth0 ipset add test 192.168.0.0/24,eth1 Now, if a packet was sent from 192.168.0.0/24,eth0, the type returned a match. In the patch the algorithm is fixed in order to correctly handle overlapping networks. Limitation: the same network cannot be stored with more than 64 different interfaces in a single set. Signed-off-by: Jozsef Kadlecsik <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2011-07-20net,rcu: Convert call_rcu(xt_rateest_free_rcu) to kfree_rcu()Paul E. McKenney1-7/+1
The RCU callback xt_rateest_free_rcu() just calls kfree(), so we can use kfree_rcu() instead of call_rcu(). This also allows us to dispense with an rcu_barrier() call, speeding up unloading of this module. Signed-off-by: Paul E. McKenney <[email protected]> Cc: Patrick McHardy <[email protected]> Reviewed-by: Josh Triplett <[email protected]>
2011-07-20cfg80211: fix scan crash on single-band cardsJohannes Berg3-2/+8
commit 58389c69150e6032504dfcd3edca6b1975c8b5bc Author: Johannes Berg <[email protected]> Date: Mon Jul 18 18:08:35 2011 +0200 cfg80211: allow userspace to control supported rates in scan made single-band cards crash since it would always access all wiphy->bands[]. Fix this and reject any attempts in the new helper ieee80211_get_ratemask() to do the same, rejecting rates configuration for unsupported bands. Reported-by: Pavel Roskin <[email protected]> Tested-by: Pavel Roskin <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-07-20mac80211: check sta_info_get() return valueEliad Peller1-1/+9
ieee80211_stop_rx_ba_session() was calling sta_info_get() without rcu locking, and the return value was not checked. This resulted in the following panic: [<bf05726c>] (ieee80211_stop_rx_ba_session+0x0/0x60 [mac80211]) [<bf0abd94>] (wl1271_event_handle+0x0/0xdc8 [wl12xx]) [<bf0a7308>] (wl1271_irq+0x0/0x4a0 [wl12xx]) [<c00c40a8>] (irq_thread+0x0/0x254) [<c00a7398>] (kthread+0x0/0x8c) Signed-off-by: Eliad Peller <[email protected]> Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-07-20cfg80211: enter psm when working as p2p_cliEliad Peller1-1/+2
cfg80211_netdev_notifier_call() is configuring psm in case of NL80211_IFTYPE_STATION interface type (on NETDEV_UP). do the same for NL80211_IFTYPE_P2P_CLIENT interface type. Signed-off-by: Eliad Peller <[email protected]> Reviewed-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-07-20mac80211: sync driver before TXJohannes Berg5-3/+122
In P2P client mode, the GO (AP) to connect to might have periods of time where it is not available due to powersave. To allow the driver to sync with it and send frames to the GO only when it is available add a new callback tx_sync (and the corresponding finish_tx_sync). These callbacks can sleep unlike the actual TX. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-07-20switch vfs_path_lookup() to struct pathAl Viro1-6/+5
Signed-off-by: Al Viro <[email protected]>
2011-07-20new helpers: kern_path_create/user_path_createAl Viro1-21/+17
combination of kern_path_parent() and lookup_create(). Does *not* expose struct nameidata to caller. Syscalls converted to that... Signed-off-by: Al Viro <[email protected]>
2011-07-19Merge branch 'for-linus' of ↵Linus Torvalds1-7/+10
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: ceph: fix file mode calculation
2011-07-19mac80211: implement scan supported ratesJohannes Berg5-15/+15
Scanning currently uses the TX rate mask to restrict the rate set, which is bogus. Make it use the new set of rates from userspace. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-07-19cfg80211: allow userspace to control supported rates in scanJohannes Berg4-19/+73
Some P2P scans are not allowed to advertise 11b rates, but that is a rather special case so instead of having that, allow userspace to request the rate sets (per band) that are advertised in scan probe request frames. Since it's needed in two places now, factor out some common code parsing a rate array. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-07-19ceph: fix file mode calculationSage Weil1-7/+10
open(2) must always include one of O_RDONLY, O_WRONLY, or O_RDWR. No need for any O_APPEND special case. Passing O_WRONLY|O_RDWR is undefined according to the man page, but the Linux VFS interprets this as O_RDWR, so we'll do the same. This fixes open(2) with flags O_RDWR|O_APPEND, which was incorrectly being translated to readonly. Reported-by: Fyodor Ustinov <[email protected]> Signed-off-by: Sage Weil <[email protected]>
2011-07-19netfilter: nfnetlink_queue: batch verdict supportFlorian Westphal1-12/+103
Introduces a new nfnetlink type that applies a given verdict to all queued packets with an id <= the id in the verdict message. If a mark is provided it is applied to all matched packets. This reduces the number of verdicts that have to be sent. Applications that make use of this feature need to maintain a timeout to send a batchverdict periodically to avoid starvation. Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2011-07-19netfilter: nfnetlink_queue: assert monotonic packet idsEric Dumazet1-11/+15
Packet identifier is currently setup in nfqnl_build_packet_message(), using one atomic_inc_return(). Problem is that since several cpus might concurrently call nfqnl_enqueue_packet() for the same queue, we can deliver packets to consumer in non monotonic way (packet N+1 being delivered after packet N) This patch moves the packet id setup from nfqnl_build_packet_message() to nfqnl_enqueue_packet() to guarantee correct delivery order. This also removes one atomic operation. Signed-off-by: Eric Dumazet <[email protected]> CC: Florian Westphal <[email protected]> CC: Pablo Neira Ayuso <[email protected]> CC: Eric Leblond <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2011-07-18mac80211: reconfigure tx on device reconfigurationEliad Peller4-1/+12
Add tx_conf array to save the current tx queues configuration, and reconfig it on resume (ieee80211_reconfig). On resume, the driver is being reconfigured. Without reconfiguring the tx queues as well, the driver might configure the device to use wrong ac params (e.g. ps-poll instead of uapsd). Signed-off-by: Eliad Peller <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-07-18ipv4: save cpu cycles from check_leaf()Eric Dumazet1-6/+6
Compiler is not smart enough to avoid double BSWAP instructions in ntohl(inet_make_mask(plen)). Lets cache this value in struct leaf_info, (fill a hole on 64bit arches) With route cache disabled, this saves ~2% of cpu in udpflood bench on x86_64 machine. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-07-18netfilter: nfnetlink_queue: provide rcu enabled callbacksEric Dumazet1-29/+12
nenetlink_queue operations on SMP are not efficent if several queues are used, because of nfnl_mutex contention when applications give packet verdict. Use new call_rcu field in struct nfnl_callback to advertize a callback that is called under rcu_read_lock instead of nfnl_mutex. On my 2x4x2 machine, I was able to reach 2.000.000 pps going through user land returning NF_ACCEPT verdicts without losses, instead of less than 500.000 pps before patch. Signed-off-by: Eric Dumazet <[email protected]> CC: Florian Westphal <[email protected]> CC: Eric Leblond <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2011-07-18netfilter: nfnetlink: add RCU in nfnetlink_rcv_msg()Eric Dumazet1-10/+30
Goal of this patch is to permit nfnetlink providers not mandate nfnl_mutex being held while nfnetlink_rcv_msg() calls them. If struct nfnl_callback contains a non NULL call_rcu(), then nfnetlink_rcv_msg() will use it instead of call() field, holding rcu_read_lock instead of nfnl_mutex Signed-off-by: Eric Dumazet <[email protected]> CC: Florian Westphal <[email protected]> CC: Eric Leblond <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2011-07-18net: Add ->neigh_lookup() operation to dst_opsDavid S. Miller5-7/+46
In the future dst entries will be neigh-less. In that environment we need to have an easy transition point for current users of dst->neighbour outside of the packet output fast path. Signed-off-by: David S. Miller <[email protected]>
2011-07-17net: Abstract dst->neighbour accesses behind helpers.David S. Miller17-72/+85
dst_{get,set}_neighbour() Signed-off-by: David S. Miller <[email protected]>
2011-07-17ipv6: Get rid of rt6i_nexthop macro.David S. Miller4-19/+19
It just makes it harder to see 1) what the code is doing and 2) grep for all users of dst{->,.}neighbour Signed-off-by: David S. Miller <[email protected]>
2011-07-17neigh: Pass neighbour entry to output ops.David S. Miller7-36/+40
This will get us closer to being able to do "neigh stuff" completely independent of the underlying dst_entry for protocols (ipv4/ipv6) that wish to do so. We will also be able to make dst entries neigh-less. Signed-off-by: David S. Miller <[email protected]>
2011-07-17SUNRPC: Replace xprt->resend and xprt->sending with a priority queueTrond Myklebust1-21/+21
Signed-off-by: Trond Myklebust <[email protected]>
2011-07-17SUNRPC: Allow caller of rpc_sleep_on() to select priority levelsTrond Myklebust1-9/+29
Currently, the caller has to change the value of task->tk_priority if it wants to select on which priority level the task will sleep. This patch allows the caller to select a priority level at sleep time rather than always using task->tk_priority. Signed-off-by: Trond Myklebust <[email protected]>
2011-07-17SUNRPC: Support dynamic slot allocation for TCP connectionsTrond Myklebust3-18/+102
Allow the number of available slots to grow with the TCP window size. Signed-off-by: Trond Myklebust <[email protected]>
2011-07-17SUNRPC: Clean up the slot table allocationTrond Myklebust1-27/+37
Signed-off-by: Trond Myklebust <[email protected]>
2011-07-17SUNRPC: Initalise the struct xprt upon allocationTrond Myklebust1-30/+37
Signed-off-by: Trond Myklebust <[email protected]>
2011-07-17SUNRPC: Ensure that we grab the XPRT_LOCK before calling xprt_alloc_slotTrond Myklebust3-27/+46
This throttles the allocation of new slots when the socket is busy reconnecting and/or is out of buffer space. Signed-off-by: Trond Myklebust <[email protected]>
2011-07-17net: vlan, qlcnic: make vlan_find_dev privateDavid Lamparter1-0/+12
there is only one user of vlan_find_dev outside of the actual vlan code: qlcnic uses it to iterate over some VLANs it knows. let's just make vlan_find_dev private to the VLAN code and have the iteration in qlcnic be a bit more direct. (a few rcu dereferences less too) Signed-off-by: David Lamparter <[email protected]> Cc: Patrick McHardy <[email protected]> Cc: Amit Kumar Salecha <[email protected]> Cc: Anirban Chakraborty <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
2011-07-16neigh: Kill ndisc_ops->queue_xmitDavid S. Miller5-16/+5
It is always dev_queue_xmit(). Signed-off-by: David S. Miller <[email protected]>
2011-07-16neigh: Kill hh_cache->hh_outputDavid S. Miller2-26/+5
It's just taking on one of two possible values, either neigh_ops->output or dev_queue_xmit(). And this is purely depending upon whether nud_state has NUD_CONNECTED set or not. Signed-off-by: David S. Miller <[email protected]>
2011-07-16neigh: Kill neigh_ops->hh_outputDavid S. Miller5-13/+2
It's always dev_queue_xmit(). Signed-off-by: David S. Miller <[email protected]>
2011-07-16neigh: Simply destroy handling wrt. hh_cache.David S. Miller1-9/+0
Now that hh_cache entries are embedded inside of neighbour entries, their lifetimes and accesses are now synchronous to that of the encompassing neighbour object. Therefore we don't need to hook up the blackhole op to hh_output on destroy. Signed-off-by: David S. Miller <[email protected]>
2011-07-16net: Create and use new helper, neigh_output().David S. Miller2-14/+6
Signed-off-by: David S. Miller <[email protected]>
2011-07-16ipv6: Use calculated 'neigh' instead of re-evaluating dst->neighbourDavid S. Miller1-1/+1
Signed-off-by: David S. Miller <[email protected]>