aboutsummaryrefslogtreecommitdiff
path: root/net/core
AgeCommit message (Collapse)AuthorFilesLines
2008-07-21net: In __netif_schedule() use WARN_ON instead of BUG_ONLinus Torvalds1-1/+2
Signed-off-by: David S. Miller <[email protected]>
2008-07-21net: Improve simple_tx_hash().David S. Miller1-13/+21
Based upon feedback from Eric Dumazet and Andi Kleen. Cure several deficiencies in simple_tx_hash() by using jhash + reciprocol multiply. 1) Eliminates expensive modulus operation. 2) Makes hash less attackable by using random seed. 3) Eliminates endianness hash distribution issues. Signed-off-by: David S. Miller <[email protected]>
2008-07-21Merge branch 'linus' into cpus4096-for-linusIngo Molnar14-295/+529
Conflicts: net/sunrpc/svc.c Signed-off-by: Ingo Molnar <[email protected]>
2008-07-20net_sched: Add qdisc_enqueue wrapperJussi Kivilinna1-2/+2
Signed-off-by: Jussi Kivilinna <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-19net: Use standard structures for generic socket address structures.YOSHIFUJI Hideaki1-1/+1
Use sockaddr_storage{} for generic socket address storage and ensures proper alignment. Use sockaddr{} for pointers to omit several casts. Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-19netns: Use net_eq() to compare net-namespaces for optimization.YOSHIFUJI Hideaki1-1/+1
Without CONFIG_NET_NS, namespace is always &init_net. Compiler will be able to omit namespace comparisons with this patch. Signed-off-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-18pkt_sched: Manage qdisc list inside of root qdisc.David S. Miller1-2/+0
Idea is from Patrick McHardy. Instead of managing the list of qdiscs on the device level, manage it in the root qdisc of a netdev_queue. This solves all kinds of visibility issues during qdisc destruction. The way to iterate over all qdiscs of a netdev_queue is to visit the netdev_queue->qdisc, and then traverse it's list. The only special case is to ignore builting qdiscs at the root when dumping or doing a qdisc_lookup(). That was not needed previously because builtin qdiscs were not added to the device's qdisc_list. Signed-off-by: David S. Miller <[email protected]>
2008-07-18Merge branch 'master' of ↵David S. Miller2-3/+3
master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: Documentation/powerpc/booting-without-of.txt drivers/atm/Makefile drivers/net/fs_enet/fs_enet-main.c drivers/pci/pci-acpi.c net/8021q/vlan.c net/iucv/iucv.c
2008-07-17pkt_sched: Kill netdev_queue lock.David S. Miller1-4/+5
We can simply use the qdisc->q.lock for all of the qdisc tree synchronization. Signed-off-by: David S. Miller <[email protected]>
2008-07-17netdevice: Move qdisc_list back into net_device proper.David S. Miller1-0/+2
And give it it's own lock. Signed-off-by: David S. Miller <[email protected]>
2008-07-17pkt_sched: Schedule qdiscs instead of netdev_queue.David S. Miller1-40/+28
When we have shared qdiscs, packets come out of the qdiscs for multiple transmit queues. Therefore it doesn't make any sense to schedule the transmit queue when logically we cannot know ahead of time the TX queue of the SKB that the qdisc->dequeue() will give us. Just for sanity I added a BUG check to make sure we never get into a state where the noop_qdisc is scheduled. Signed-off-by: David S. Miller <[email protected]>
2008-07-17net: Implement simple sw TX hashing.David S. Miller1-0/+52
It just xor hashes over IPv4/IPv6 addresses and ports of transport. The only assumption it makes is that skb_network_header() is set correctly. With bug fixes from Eric Dumazet. Signed-off-by: David S. Miller <[email protected]>
2008-07-17netdev: Add netdev->select_queue() method.David S. Miller1-3/+6
Devices or device layers can set this to control the queue selection performed by dev_pick_tx(). This function runs under RCU protection, which allows overriding functions to have some way of synchronizing with things like dynamic ->real_num_tx_queues adjustments. This makes the spinlock prefetch in dev_queue_xmit() a little bit less effective, but that's the price right now for correctness. Signed-off-by: David S. Miller <[email protected]>
2008-07-17net: Use queue aware tests throughout.David S. Miller3-51/+70
This effectively "flips the switch" by making the core networking and multiqueue-aware drivers use the new TX multiqueue structures. Non-multiqueue drivers need no changes. The interfaces they use such as netif_stop_queue() degenerate into an operation on TX queue zero. So everything "just works" for them. Code that really wants to do "X" to all TX queues now invokes a routine that does so, such as netif_tx_wake_all_queues(), netif_tx_stop_all_queues(), etc. pktgen and netpoll required a little bit more surgery than the others. In particular the pktgen changes, whilst functional, could be largely improved. The initial check in pktgen_xmit() will sometimes check the wrong queue, which is mostly harmless. The thing to do is probably to invoke fill_packet() earlier. The bulk of the netpoll changes is to make the code operate solely on the TX queue indicated by by the SKB queue mapping. Setting of the SKB queue mapping is entirely confined inside of net/core/dev.c:dev_pick_tx(). If we end up needing any kind of special semantics (drops, for example) it will be implemented here. Finally, we now have a "real_num_tx_queues" which is where the driver indicates how many TX queues are actually active. With IGB changes from Jeff Kirsher. Signed-off-by: David S. Miller <[email protected]>
2008-07-17netdev: Allocate multiple queues for TX.David S. Miller2-10/+32
alloc_netdev_mq() now allocates an array of netdev_queue structures for TX, based upon the queue_count argument. Furthermore, all accesses to the TX queues are now vectored through the netdev_get_tx_queue() and netdev_for_each_tx_queue() interfaces. This makes it easy to grep the tree for all things that want to get to a TX queue of a net device. Problem spots which are not really multiqueue aware yet, and only work with one queue, can easily be spotted by grepping for all netdev_get_tx_queue() calls that pass in a zero index. Signed-off-by: David S. Miller <[email protected]>
2008-07-16core: add stat to track unresolved discards in neighbor cacheNeil Horman1-3/+5
in __neigh_event_send, if we have a neighbour entry which is in NUD_INCOMPLETE state, we enqueue any outbound frames to that neighbour to the neighbours arp_queue, which is default capped to a length of 3 skbs. If that queue exceeds its set length, it will drop an skb on the queue to enqueue the newly arrived skb. This results in a drop for which we have no statistics incremented. This patch adds an unresolved_discards stat to /proc/net/stat/ndisc_cache to track these lost frames. Signed-off-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-16sock: add net to prot->enter_memory_pressure callbackPavel Emelyanov1-1/+1
The tcp_enter_memory_pressure calls NET_INC_STATS, but doesn't have where to get the net from. I decided to add a sk argument, not the net itself, only to factor all the required sock_net(sk) calls inside the enter_memory_pressure callback itself. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-16net: make __skb_splice_bits staticHarvey Harrison1-1/+1
net/core/skbuff.c:1335:5: warning: symbol '__skb_splice_bits' was not declared. Should it be static? Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-16Merge branch 'linus' into cpus4096Ingo Molnar2-3/+3
Conflicts: arch/x86/xen/smp.c kernel/sched_rt.c net/iucv/iucv.c Signed-off-by: Ingo Molnar <[email protected]>
2008-07-15Merge branch 'generic-ipi' into generic-ipi-for-linusIngo Molnar1-1/+1
Conflicts: arch/powerpc/Kconfig arch/s390/kernel/time.c arch/x86/kernel/apic_32.c arch/x86/kernel/cpu/perfctr-watchdog.c arch/x86/kernel/i8259_64.c arch/x86/kernel/ldt.c arch/x86/kernel/nmi_64.c arch/x86/kernel/smpboot.c arch/x86/xen/smp.c include/asm-x86/hw_irq_32.h include/asm-x86/hw_irq_64.h include/asm-x86/mach-default/irq_vectors.h include/asm-x86/mach-voyager/irq_vectors.h include/asm-x86/smp.h kernel/Makefile Signed-off-by: Ingo Molnar <[email protected]>
2008-07-15net: refactor tcp splice receive path to improve readabilityOctavian Purdila1-92/+61
- move all of the details on offsets, lengths and buffers into a single function instead of doing these operation from multiple places - use a bottom up approach: try to avoid details in the high level functions, introduce them gradually as we go deeper in the function call stack With helpful feedback from Jarek Poplawski. Signed-off-by: Octavian Purdila <[email protected]> Acked-by: Jarek Poplawski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-15netdev: Do not use TX lock to protect address lists.David S. Miller2-48/+22
Now that we have a specific lock to protect the network device unicast and multicast lists, remove extraneous grabs of the TX lock in cases where the code only needs address list protection. Signed-off-by: David S. Miller <[email protected]>
2008-07-15netdev: Add netdev->addr_list_lock protection.David S. Miller2-0/+26
Add netif_addr_{lock,unlock}{,_bh}() helpers. Use them to protect operations that operate on or read the network device unicast and multicast address lists. Also use them in cases where the code simply wants to block calls into the driver's ->set_rx_mode() and ->set_multicast_list() methods. Signed-off-by: David S. Miller <[email protected]>
2008-07-15netdev: Add addr_list_lock to struct net_device.David S. Miller1-0/+1
This will be used to protect the per-device unicast and multicast address lists, as well as the callbacks into the drivers which configure such state such as ->set_rx_mode() and ->set_multicast_list(). Signed-off-by: David S. Miller <[email protected]>
2008-07-14vlan: deliver packets received with VLAN acceleration to network tapsPatrick McHardy1-0/+27
When VLAN header stripping is used, packets currently bypass packet sockets (and other network taps) completely. For locally existing VLANs, they appear directly on the VLAN device, for unknown VLANs they are silently dropped. Add a new function netif_nit_deliver() to deliver incoming packets to all network interface taps and use it in __vlan_hwaccel_rx() to make VLAN packets visible on the underlying device. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-14vlan: Don't store VLAN tag in cbPatrick McHardy1-0/+3
Use a real skb member to store the skb to avoid clashes with qdiscs, which are allowed to use the cb area themselves. As currently only real devices that consume the skb set the NETIF_F_HW_VLAN_TX flag, no explicit invalidation is neccessary. The new member fills a hole on 64 bit, the skb layout changes from: __u32 mark; /* 172 4 */ sk_buff_data_t transport_header; /* 176 4 */ sk_buff_data_t network_header; /* 180 4 */ sk_buff_data_t mac_header; /* 184 4 */ sk_buff_data_t tail; /* 188 4 */ /* --- cacheline 3 boundary (192 bytes) --- */ sk_buff_data_t end; /* 192 4 */ /* XXX 4 bytes hole, try to pack */ to __u32 mark; /* 172 4 */ __u16 vlan_tci; /* 176 2 */ /* XXX 2 bytes hole, try to pack */ sk_buff_data_t transport_header; /* 180 4 */ sk_buff_data_t network_header; /* 184 4 */ Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-14Merge branch 'core/softirq' of ↵Linus Torvalds1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'core/softirq' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: softirq: remove irqs_disabled warning from local_bh_enable softirq: remove initialization of static per-cpu variable Remove argument from open_softirq which is always NULL
2008-07-14wext: make sysfs bits optional and deprecate themJohannes Berg1-2/+2
The /sys/class/net/*/wireless/ direcory is, as far as I know, not used by anyone. Additionally, the same data is available via wext ioctls. Hence the sysfs files are pretty much useless. This patch makes them optional and schedules them for removal. Signed-off-by: Johannes Berg <[email protected]> Cc: Jean Tourrilhes <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-07-08netdev: Move _xmit_lock and xmit_lock_owner into netdev_queue.David S. Miller1-8/+20
Accesses are mostly structured such that when there are multiple TX queues the code transformations will be a little bit simpler. Signed-off-by: David S. Miller <[email protected]>
2008-07-08pkt_sched: Make qdisc_run take a netdev_queue.David S. Miller1-2/+2
This allows us to use this calling convention all the way down into qdisc_restart(). Signed-off-by: David S. Miller <[email protected]>
2008-07-08netdev: Make netif_schedule() routines work with netdev_queue objects.David S. Miller1-4/+5
Only plain netif_schedule() remains taking a net_device, mostly as a compatability item while we transition the rest of these interfaces. Everything else calls netif_schedule_queue() or __netif_schedule(), both of which take a netdev_queue pointer. Signed-off-by: David S. Miller <[email protected]>
2008-07-08net: Clean up explicit ->tx_queue references in link watch.David S. Miller1-10/+5
First, we add a qdisc_tx_changing() helper which returns true if the qdisc attachment is in transition. Second, we remove an assertion warning which is of limited value and is hard to express precisely in a multiqueue environment. Signed-off-by: David S. Miller <[email protected]>
2008-07-08netdev: Move next_sched into struct netdev_queue.David S. Miller1-8/+7
We schedule queues, not the device, for output queue processing in BH. Signed-off-by: David S. Miller <[email protected]>
2008-07-08netdev: Kill qdisc_ingress, use netdev->rx_queue.qdisc instead.David S. Miller1-2/+2
Now that our qdisc management is bi-directional, per-queue, and fully orthogonal, there is no reason to have a special ingress qdisc pointer in struct net_device. Signed-off-by: David S. Miller <[email protected]>
2008-07-08netdev: Move rest of qdisc state into struct netdev_queueDavid S. Miller3-6/+12
Now qdisc, qdisc_sleeping, and qdisc_list also live there. Signed-off-by: David S. Miller <[email protected]>
2008-07-08netdev: The ingress_lock member is no longer needed.David S. Miller1-5/+7
Every qdisc is assosciated with a queue, and in the case of ingress qdiscs that will now be netdev->rx_queue so using that queue's lock is the thing to do. Signed-off-by: David S. Miller <[email protected]>
2008-07-08netdev: Move queue_lock into struct netdev_queue.David S. Miller1-11/+22
The lock is now an attribute of the device queue. One thing to notice is that "suspicious" places emerge which will need specific training about multiple queue handling. They are so marked with explicit "netdev->rx_queue" and "netdev->tx_queue" references. Signed-off-by: David S. Miller <[email protected]>
2008-07-08netdev: Create netdev_queue abstraction.David S. Miller1-0/+8
A netdev_queue is an entity managed by a qdisc. Currently there is one RX and one TX queue, and a netdev_queue merely contains a backpointer to the net_device. The Qdisc struct is augmented with a netdev_queue pointer as well. Eventually the 'dev' Qdisc member will go away and we will have the resulting hierarchy: net_device --> netdev_queue --> Qdisc Also, qdisc_alloc() and qdisc_create_dflt() now take a netdev_queue pointer argument. Signed-off-by: David S. Miller <[email protected]>
2008-07-06net: fix dev_set_promiscuity() breakagePatrick McHardy1-1/+1
Commit dad9b335 (netdevice: Fix promiscuity and allmulti overflow) broke dev_set_promiscuity() by returning on success without reprogramming the device. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-06Merge commit 'v2.6.26-rc9' into cpus4096Ingo Molnar8-27/+61
2008-07-05Merge branch 'master' of ↵David S. Miller3-5/+4
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: Documentation/feature-removal-schedule.txt drivers/net/wan/hdlc_fr.c drivers/net/wireless/iwlwifi/iwl-4965.c drivers/net/wireless/iwlwifi/iwl3945-base.c
2008-07-05net: add fib_rules_ops to flush_cache methodDenis V. Lunev1-1/+1
This is required to pass namespace context into rt_cache_flush called from ->flush_cache. Signed-off-by: Denis V. Lunev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-02netdev: Add support for rx flow hash configuration, using ethtool.Santwona Behera1-0/+37
Added new interfaces to ethtool to configure receive network flow distribution across multiple rx rings using hashing. Signed-off-by: Santwona Behera <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-01net: fib_rules: fix error code for unsupported familiesPatrick McHardy1-2/+2
The errno code returned must be negative. Fixes "RTNETLINK answers: Unknown error 18446744073709551519". Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-01netdevice: Fix wrong string handle in kernel command line parsingWang Chen1-2/+2
v1->v2: Use strlcpy() to ensure s[i].name be null-termination. 1. In netdev_boot_setup_add(), a long name will leak. ex. : dev=21,0x1234,0x1234,0x2345,eth123456789verylongname......... 2. In netdev_boot_setup_check(), mismatch will happen if s[i].name is a substring of dev->name. ex. : dev=...eth1 dev=...eth11 [ With feedback from Ben Hutchings. ] Signed-off-by: Wang Chen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-07-01net: Tyop of sk_filter() commentWang Chen1-1/+0
Parameter "needlock" no long exists. Signed-off-by: Wang Chen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-06-28Merge branch 'master' of ↵David S. Miller3-6/+20
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/wireless/iwlwifi/iwl4965-base.c
2008-06-27netdevice: Fix typo of dev_unicast_add() commentWang Chen1-1/+1
Signed-off-by: Wang Chen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-06-27tcp: fix for splice receive when used with software LROOctavian Purdila1-5/+12
If an skb has nr_frags set to zero but its frag_list is not empty (as it can happen if software LRO is enabled), and a previous tcp_read_sock has consumed the linear part of the skb, then __skb_splice_bits: (a) incorrectly reports an error and (b) forgets to update the offset to account for the linear part Any of the two problems will cause the subsequent __skb_splice_bits call (the one that handles the frag_list skbs) to either skip data, or, if the unadjusted offset is greater then the size of the next skb in the frag_list, make tcp_splice_read loop forever. Signed-off-by: Octavian Purdila <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-06-26smp_call_function: get rid of the unused nonatomic/retry argumentJens Axboe1-1/+1
It's never used and the comments refer to nonatomic and retry interchangably. So get rid of it. Acked-by: Jeremy Fitzhardinge <[email protected]> Signed-off-by: Jens Axboe <[email protected]>