]> err.no Git - linux-2.6/log
linux-2.6
16 years agovlan: TCI related type and naming cleanups
Patrick McHardy [Tue, 8 Jul 2008 10:24:44 +0000 (03:24 -0700)]
vlan: TCI related type and naming cleanups

The VLAN code contains multiple spots that use tag, id and tci as
identifiers for arguments and variables incorrectly and they actually
contain or are expected to contain something different. Additionally
types are used inconsistently (unsigned short vs u16) and identifiers
are sometimes capitalized.

- consistently use u16 for storing TCI, ID or QoS values
- consistently use vlan_id and vlan_tci for storing the respective values
- remove capitalization
- add kdoc comment to netif_hwaccel_{rx,receive_skb}

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agovlan: remove useless struct hlist_node declaration from if_vlan.h
Patrick McHardy [Tue, 8 Jul 2008 10:24:14 +0000 (03:24 -0700)]
vlan: remove useless struct hlist_node declaration from if_vlan.h

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agovlan: move struct vlan_dev_info to private header
Patrick McHardy [Tue, 8 Jul 2008 10:23:57 +0000 (03:23 -0700)]
vlan: move struct vlan_dev_info to private header

Hide struct vlan_dev_info from drivers to prevent them from growing
more creative ways to use it. Provide accessors for the two drivers
that currently use it.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agovlan: uninline __vlan_hwaccel_rx
Patrick McHardy [Tue, 8 Jul 2008 10:23:36 +0000 (03:23 -0700)]
vlan: uninline __vlan_hwaccel_rx

The function is huge and included at least once in every VLAN acceleration
capable driver. Uninline it; to avoid having drivers depend on the VLAN
module, the function is always built in statically when VLAN is enabled.

With all VLAN acceleration capable drivers that build on x86_64 enabled,
this results in:

   text    data     bss     dec     hex filename
6515227  854044  343968 7713239  75b1d7 vmlinux.inlined
6505637  854044  343968 7703649  758c61 vmlinux.uninlined
----------------------------------------------------------
  -9590

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agovlan: Add ethtool support
Patrick McHardy [Tue, 8 Jul 2008 10:22:42 +0000 (03:22 -0700)]
vlan: Add ethtool support

Add ethtool support for querying the device for offload settings.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agovlan: Use is_vlan_dev()
Joonwoo Park [Tue, 8 Jul 2008 10:22:16 +0000 (03:22 -0700)]
vlan: Use is_vlan_dev()

Use simplified is_vlan_dev function.

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agovlan: fix network_header/mac_header adjustments
Patrick McHardy [Tue, 8 Jul 2008 10:21:27 +0000 (03:21 -0700)]
vlan: fix network_header/mac_header adjustments

Lennert Buytenhek points out that the VLAN code incorrectly adjusts
skb->network_header to point in the middle of the VLAN header and
additionally tries to adjust skb->mac_header without checking for
validity.

The network_header should not be touched at all since we're only
adding headers in front of it, mac_header adjustments are not
necessary at all.

Based on patch by Lennert Buytenhek <buytenh@wantstofly.org>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoirda: Remove useless pm_dev references
Rafael J. Wysocki [Tue, 8 Jul 2008 10:08:16 +0000 (03:08 -0700)]
irda: Remove useless pm_dev references

Some IRDA headers contain references to 'struct pm_dev' that are not
necessary any more and may be removed.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv4: remove flush_mutex from ipv4_sysctl_rtcache_flush
Denis V. Lunev [Tue, 8 Jul 2008 10:05:28 +0000 (03:05 -0700)]
ipv4: remove flush_mutex from ipv4_sysctl_rtcache_flush

It is possible to avoid locking at all in ipv4_sysctl_rtcache_flush by
defining local ctl_table on the stack.

The patch is based on the suggestion from Eric W. Biederman.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: remove padding from struct socket on 64bit & increase objects/cache
Richard Kennedy [Tue, 8 Jul 2008 10:03:01 +0000 (03:03 -0700)]
net: remove padding from struct socket on 64bit & increase objects/cache

remove padding from struct socket reducing its size by 8 bytes.

This allows more objects/cache in sock_inode_cache
12 objects/cache when cacheline size is 128 (generic x86_64)

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: fix string extension for case insensitive pattern matching
Joonwoo Park [Tue, 8 Jul 2008 09:38:56 +0000 (02:38 -0700)]
netfilter: fix string extension for case insensitive pattern matching

The flag XT_STRING_FLAG_IGNORECASE indicates case insensitive string
matching. netfilter can find cmd.exe, Cmd.exe, cMd.exe and etc easily.

A new revision 1 was added, in the meantime invert of xt_string_info
was moved into flags as a flag. If revision is 1, The flag
XT_STRING_FLAG_INVERT indicates invert matching.

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotextsearch: convert kmalloc + memset to kzalloc
Joonwoo Park [Tue, 8 Jul 2008 09:38:40 +0000 (02:38 -0700)]
textsearch: convert kmalloc + memset to kzalloc

convert kmalloc + memset to kzalloc for alloc_ts_config

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotextsearch: ts_fsm: return error on request for case insensitive search
Joonwoo Park [Tue, 8 Jul 2008 09:38:27 +0000 (02:38 -0700)]
textsearch: ts_fsm: return error on request for case insensitive search

For fsm text search, handle case insensitive parameter as -EINVAL.

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotextsearch: ts_kmp: support case insensitive searching in Knuth-Morris-Pratt algorithm
Joonwoo Park [Tue, 8 Jul 2008 09:38:09 +0000 (02:38 -0700)]
textsearch: ts_kmp: support case insensitive searching in Knuth-Morris-Pratt algorithm

Add support for case insensitive search to Knuth-Morris-Pratt algorithm.

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotextsearch: ts_bm: support case insensitive searching in Boyer-Moore algorithm
Joonwoo Park [Tue, 8 Jul 2008 09:37:54 +0000 (02:37 -0700)]
textsearch: ts_bm: support case insensitive searching in Boyer-Moore algorithm

Add support for case insensitive search to Boyer-Moore algorithm.

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotextsearch: support for case insensitive searching
Joonwoo Park [Tue, 8 Jul 2008 09:37:31 +0000 (02:37 -0700)]
textsearch: support for case insensitive searching

The function textsearch_prepare has a new flag to support case
insensitive searching.

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: ebt_nflog: fix Kconfig typo
Patrick McHardy [Tue, 8 Jul 2008 09:37:07 +0000 (02:37 -0700)]
netfilter: ebt_nflog: fix Kconfig typo

The help text should refer to nflog instead of ulog. Noticed by
Krzysztof Halasa <khc@pm.waw.pl>.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: cleanup netfilter_ipv6.h userspace header
Adrian Bunk [Tue, 8 Jul 2008 09:36:40 +0000 (02:36 -0700)]
netfilter: cleanup netfilter_ipv6.h userspace header

Kernel functions are not for userspace.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: ip6table_filter in netns for real
Alexey Dobriyan [Tue, 8 Jul 2008 09:36:18 +0000 (02:36 -0700)]
netfilter: ip6table_filter in netns for real

One still needs to remove checks in nf_hook_slow() and nf_sockopt_find()
to test this, though.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: nf_conntrack: add allocation flag to nf_conntrack_alloc
Pablo Neira Ayuso [Tue, 8 Jul 2008 09:35:55 +0000 (02:35 -0700)]
netfilter: nf_conntrack: add allocation flag to nf_conntrack_alloc

ctnetlink does not need to allocate the conntrack entries with GFP_ATOMIC
as its code is executed in user context.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: Get rid of refrences to no longer existant Fast NAT.
Russ Dill [Tue, 8 Jul 2008 09:35:27 +0000 (02:35 -0700)]
netfilter: Get rid of refrences to no longer existant Fast NAT.

Get rid of refrences to no longer existant Fast NAT.

IP_ROUTE_NAT support was removed in August of 2004, but references to Fast
NAT were left in a couple of config options.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetfilter: use correct namespace in ip6table_security
Alexey Dobriyan [Tue, 8 Jul 2008 09:34:52 +0000 (02:34 -0700)]
netfilter: use correct namespace in ip6table_security

Signed-off-by: Alexey Dobriyan <adobriyan@parallels.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoamd8111e: delete non NAPI code from the driver.
Francois Romieu [Mon, 7 Jul 2008 03:55:12 +0000 (20:55 -0700)]
amd8111e: delete non NAPI code from the driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agostarfire: delete non NAPI code from the driver.
Francois Romieu [Mon, 7 Jul 2008 03:54:45 +0000 (20:54 -0700)]
starfire: delete non NAPI code from the driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetdev: remove unused S2IO_NAPI
Francois Romieu [Mon, 7 Jul 2008 03:50:16 +0000 (20:50 -0700)]
netdev: remove unused S2IO_NAPI

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetdrv: don't truncate VLAN TCI with VLAN stripping
Patrick McHardy [Mon, 7 Jul 2008 03:48:41 +0000 (20:48 -0700)]
netdrv: don't truncate VLAN TCI with VLAN stripping

The vlan_hwaccel_{rx,receive_skb} functions expect the full TCI field
for priority mappings, don't truncate the upper 4 bits.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: fix dev_set_promiscuity() breakage
Patrick McHardy [Sun, 6 Jul 2008 22:49:08 +0000 (15:49 -0700)]
net: fix dev_set_promiscuity() breakage

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 <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet-sched: consolidate default fifo qdisc setup
Patrick McHardy [Sun, 6 Jul 2008 06:40:21 +0000 (23:40 -0700)]
net-sched: consolidate default fifo qdisc setup

Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet-sched: sch_htb: remove write-only qdisc filter_cnt
Patrick McHardy [Sun, 6 Jul 2008 06:23:27 +0000 (23:23 -0700)]
net-sched: sch_htb: remove write-only qdisc filter_cnt

The filter_cnt is supposed to count filter references to a class.
Since the qdisc can't be the target of a filter, it doesn't need
a filter_cnt. In fact the counter is never decreased since cls_api
considers a return value of zero a failure and doesn't unbind again.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet-sched: sch_htb: remove child and sibling lists
Patrick McHardy [Sun, 6 Jul 2008 06:22:53 +0000 (23:22 -0700)]
net-sched: sch_htb: remove child and sibling lists

Now that the qdisc isn't destroyed in hierarchical order anymore,
the only user of the child lists left is htb_parent_last_child().
This can be easily changed to use a counter of children to save
a few bytes.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet-sched: sch_htb: use dynamic class hash helpers
Patrick McHardy [Sun, 6 Jul 2008 06:22:35 +0000 (23:22 -0700)]
net-sched: sch_htb: use dynamic class hash helpers

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet-sched: sch_htb: move hash and sibling list removal to htb_delete
Patrick McHardy [Sun, 6 Jul 2008 06:22:19 +0000 (23:22 -0700)]
net-sched: sch_htb: move hash and sibling list removal to htb_delete

Hash list removal currently happens twice (once in htb_delete, once
in htb_destroy_class), which makes it harder to use the dynamically
sized class hash without adding special cases for HTB. The reason is
that qdisc destruction destroys classes in hierarchical order, which
is not necessary if filters are destroyed in a separate iteration
during qdisc destruction.

Adjust qdisc destruction to follow the same scheme as other hierarchical
qdiscs by first performing a filter destruction pass, then destroying
all classes in hash order.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet-sched: sch_cbq: use dynamic class hash helpers
Patrick McHardy [Sun, 6 Jul 2008 06:22:05 +0000 (23:22 -0700)]
net-sched: sch_cbq: use dynamic class hash helpers

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet-sched: sch_hfsc: use dynamic class hash helpers
Patrick McHardy [Sun, 6 Jul 2008 06:21:47 +0000 (23:21 -0700)]
net-sched: sch_hfsc: use dynamic class hash helpers

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet-sched: add dynamically sized qdisc class hash helpers
Patrick McHardy [Sun, 6 Jul 2008 06:21:31 +0000 (23:21 -0700)]
net-sched: add dynamically sized qdisc class hash helpers

Currently all qdiscs which allow to create classes uses a fixed sized hash
table with size 16 to hash the classes. This causes a large bottleneck
when using thousands of classes and unbound filters.

Add helpers for dynamically sized class hashes to fix this. The following
patches will convert the qdiscs to use them.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Sun, 6 Jul 2008 06:08:07 +0000 (23:08 -0700)]
Merge branch 'master' of 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

16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireles...
David S. Miller [Sun, 6 Jul 2008 04:41:53 +0000 (21:41 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-next-2.6

16 years agovlan: Add GVRP support
Patrick McHardy [Sun, 6 Jul 2008 04:26:57 +0000 (21:26 -0700)]
vlan: Add GVRP support

Add GVRP support for dynamically registering VLANs with switches.

By default GVRP is disabled because we only support the applicant-only
participant model, which means it should not be enabled on vlans that
are members of a bridge. Since there is currently no way to cleanly
determine that, the user is responsible for enabling it.

The code is pretty small and low impact, its wrapped in a config
option though because it depends on the GARP implementation and
the STP core.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agovlan: Move device unregistration before lower dev cleanup
Patrick McHardy [Sun, 6 Jul 2008 04:26:41 +0000 (21:26 -0700)]
vlan: Move device unregistration before lower dev cleanup

Move the unregister_netdevice() call for the VLAN device before cleanup
for the lower device. This is needed by GVRP so it can send a leave
message before the applicant on the lower device is cleaned up.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agovlan: Change vlan_dev_set_vlan_flag() to handle multiple flags at once
Patrick McHardy [Sun, 6 Jul 2008 04:26:27 +0000 (21:26 -0700)]
vlan: Change vlan_dev_set_vlan_flag() to handle multiple flags at once

Change vlan_dev_set_vlan_flag() to handle multiple flags at once and
rename to vlan_dev_change_flags(). This allows to to use it from the
netlink interface, which in turn allows to handle necessary adjustments
when changing flags centrally.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: Add GARP applicant-only participant
Patrick McHardy [Sun, 6 Jul 2008 04:26:13 +0000 (21:26 -0700)]
net: Add GARP applicant-only participant

Add an implementation of the GARP (Generic Attribute Registration Protocol)
applicant-only participant. This will be used by the following patch to
add GVRP support to the VLAN code.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agobridge: Use STP demux
Patrick McHardy [Sun, 6 Jul 2008 04:25:56 +0000 (21:25 -0700)]
bridge: Use STP demux

Use the STP demux layer for receiving STP PDUs instead of directly
registering with LLC.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: Add STP demux layer
Patrick McHardy [Sun, 6 Jul 2008 04:25:39 +0000 (21:25 -0700)]
net: Add STP demux layer

Add small STP demux layer for demuxing STP PDUs based on MAC address.
This is needed to run both GARP and STP in parallel (or even load the
modules) since both use LLC_SAP_BSPAN.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMIB: add struct net to UDP6_INC_STATS_BH
Pavel Emelyanov [Sun, 6 Jul 2008 04:19:40 +0000 (21:19 -0700)]
MIB: add struct net to UDP6_INC_STATS_BH

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMIB: add struct net to UDP6_INC_STATS_USER
Pavel Emelyanov [Sun, 6 Jul 2008 04:19:20 +0000 (21:19 -0700)]
MIB: add struct net to UDP6_INC_STATS_USER

As simple as the patch #1 in this set.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMIB: add struct net to UDP_INC_STATS_BH
Pavel Emelyanov [Sun, 6 Jul 2008 04:18:48 +0000 (21:18 -0700)]
MIB: add struct net to UDP_INC_STATS_BH

Two special cases here - one is rxrpc - I put init_net there
explicitly, since we haven't touched this part yet. The second
place is in __udp4_lib_rcv - we already have a struct net there,
but I have to move its initialization above to make it ready
at the "drop" label.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMIB: add struct net to UDP_INC_STATS_USER
Pavel Emelyanov [Sun, 6 Jul 2008 04:18:07 +0000 (21:18 -0700)]
MIB: add struct net to UDP_INC_STATS_USER

Nothing special - all the places already have a struct sock
at hands, so use the sock_net() net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'davem-next' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
David S. Miller [Sun, 6 Jul 2008 04:03:31 +0000 (21:03 -0700)]
Merge branch 'davem-next' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

16 years agonetns: selective flush of rt_cache
Denis V. Lunev [Sun, 6 Jul 2008 02:06:12 +0000 (19:06 -0700)]
netns: selective flush of rt_cache

dst cache is marked as expired on the per/namespace basis by previous
path. Right now we have to implement selective cache shrinking. This
procedure has been ported from older OpenVz codebase.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetns: place rt_genid into struct net
Denis V. Lunev [Sun, 6 Jul 2008 02:04:32 +0000 (19:04 -0700)]
netns: place rt_genid into struct net

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv4: pass current value of rt_genid into rt_hash
Denis V. Lunev [Sun, 6 Jul 2008 02:04:09 +0000 (19:04 -0700)]
ipv4: pass current value of rt_genid into rt_hash

Basically, there is no difference to atomic_read internally or pass it as
a parameter as rt_hash is inline.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetns: add struct net parameter to rt_cache_invalidate
Denis V. Lunev [Sun, 6 Jul 2008 02:03:31 +0000 (19:03 -0700)]
netns: add struct net parameter to rt_cache_invalidate

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetns: make rt_secret_rebuild timer per namespace
Denis V. Lunev [Sun, 6 Jul 2008 02:02:59 +0000 (19:02 -0700)]
netns: make rt_secret_rebuild timer per namespace

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetns: register net.ipv4.route.flush in each namespace
Denis V. Lunev [Sun, 6 Jul 2008 02:02:33 +0000 (19:02 -0700)]
netns: register net.ipv4.route.flush in each namespace

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoipv4: remove static flush_delay variable
Denis V. Lunev [Sun, 6 Jul 2008 02:02:06 +0000 (19:02 -0700)]
ipv4: remove static flush_delay variable

flush delay is used as an external storage for net.ipv4.route.flush sysctl
entry. It is write-only.

The ctl_table->data for this entry is used once. Fix this case to point
to the stack to remove global variable. Do this to avoid additional
variable on struct net in the next patch.

Possible race (as it was before) accessing this local variable is removed
using flush_mutex.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonet: add fib_rules_ops to flush_cache method
Denis V. Lunev [Sun, 6 Jul 2008 02:01:28 +0000 (19:01 -0700)]
net: add fib_rules_ops to flush_cache method

This is required to pass namespace context into rt_cache_flush called from
->flush_cache.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agonetns: add namespace parameter to rt_cache_flush
Denis V. Lunev [Sun, 6 Jul 2008 02:00:44 +0000 (19:00 -0700)]
netns: add namespace parameter to rt_cache_flush

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago8390: Split 8390 support into a pausing and a non pausing driver core
Alan Cox [Fri, 4 Jul 2008 06:43:12 +0000 (23:43 -0700)]
8390: Split 8390 support into a pausing and a non pausing driver core

Only a few ISA controllers need the pausing version of the 8390 core
while PCMCIA, later ISA and PCI do not. More importantly the ISA delays
can break non ISA boxes so we must use a different build of 8390.c for
the two sets of controllers.

No changes since last time as all the points of concerns raised proved to
be invalid

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoWAN: Remove no longer needed pvc_desc in FR code.
Krzysztof Halasa [Tue, 1 Jul 2008 12:42:07 +0000 (14:42 +0200)]
WAN: Remove no longer needed pvc_desc in FR code.

Remove no longer needed struct pvc_desc in FR code.
Requires "WAN: convert drivers to use built-in netdev_stats" patch.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoWAN: convert drivers to use built-in netdev_stats
Krzysztof Halasa [Mon, 30 Jun 2008 21:26:53 +0000 (23:26 +0200)]
WAN: convert drivers to use built-in netdev_stats

There is no point in using separate net_device_stats structs when
the one in struct net_device is present. Compiles.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoigb: add NAPI Rx queue support
PJ Waskiewicz [Fri, 27 Jun 2008 18:00:39 +0000 (11:00 -0700)]
igb: add NAPI Rx queue support

Update the NAPI implementation to use the new napi_struct infrstructure.
This removes the need of multiple net_device structs to implement a
multiqueue NAPI.

Signed-off-by: PJ Waskiewicz <peter.p.waskiewicz.jr.@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoigb: fix init on 82575 with MNG enabled
Alexander Duyck [Fri, 27 Jun 2008 18:00:29 +0000 (11:00 -0700)]
igb: fix init on 82575 with MNG enabled

This patch resolves an issue seen on 82575 adapters with managability
pass-thru enabled, which could cause the system to panic.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoigb: eliminate hw from the hw_dbg macro arguments
Auke Kok [Fri, 27 Jun 2008 18:00:18 +0000 (11:00 -0700)]
igb: eliminate hw from the hw_dbg macro arguments

Various cosmetic cleanups. Comment fixes. Eliminate the hw part out
of the hw_dbg macro since it's always used.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoigb: fix parameter options
Alexander Duyck [Fri, 27 Jun 2008 18:00:07 +0000 (11:00 -0700)]
igb: fix parameter options

Currently there are items in the driver to support parameters, but there
are no parameters being added to the driver.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoigb: cleanup function header comments
Jeff Kirsher [Fri, 27 Jun 2008 17:59:59 +0000 (10:59 -0700)]
igb: cleanup function header comments

Function header comments do not match function name.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoigb: Remove adapter struct from these function call parameters
Mitch Williams [Fri, 27 Jun 2008 17:59:48 +0000 (10:59 -0700)]
igb: Remove adapter struct from these function call parameters

Simplify a bunch of calls to these functions by moving the adapter
struct out of the function arguments since that is not needed.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoigb: limit EEPROM access
Jeff Kirsher [Fri, 27 Jun 2008 17:59:33 +0000 (10:59 -0700)]
igb: limit EEPROM access

EEPROM access beyond the base eeprom page is unsupported.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoipg: run-time configurable jumbo frame support
Pekka Enberg [Mon, 23 Jun 2008 11:36:56 +0000 (14:36 +0300)]
ipg: run-time configurable jumbo frame support

Make jumbo frame support configurable via ifconfig mtu option as suggested by
Stephen Hemminger.

Cc: Stephen Hemminger <stephen.hemminger@vyatta.com>
Tested-by: Andrew Savchenko <Bircoph@list.ru>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoipg: per-device max_rxframe_size
Pekka Enberg [Mon, 23 Jun 2008 11:36:35 +0000 (14:36 +0300)]
ipg: per-device max_rxframe_size

Add a ->max_rxframe member to struct ipg_nic_private and convert the users of
IPG_MAX_RXFRAME_SIZE to use it instead to enable per-device jumbo frame
configuration.

Tested-by: Andrew Savchenko <Bircoph@list.ru>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoipg: per-device rxsupport_size
Pekka Enberg [Mon, 23 Jun 2008 11:36:18 +0000 (14:36 +0300)]
ipg: per-device rxsupport_size

Add a ->max_rxframe member to struct ipg_nic_private and convert the users of
IPG_RXSUPPORT_SIZE to use it instead to enable per-device jumbo frame
configuration.

Tested-by: Andrew Savchenko <Bircoph@list.ru>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoipg: per-device rxfrag_size
Pekka Enberg [Mon, 23 Jun 2008 11:36:00 +0000 (14:36 +0300)]
ipg: per-device rxfrag_size

Add a ->max_rxframe member to struct ipg_nic_private and convert the users of
IPG_RXFRAG_SIZE to use it instead to enable per-device jumbo frame
configuration.

Tested-by: Andrew Savchenko <Bircoph@list.ru>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoipg: remove jumbo frame #ifdef from mtu
Pekka Enberg [Mon, 23 Jun 2008 11:35:37 +0000 (14:35 +0300)]
ipg: remove jumbo frame #ifdef from mtu

Remove JUMBO_FRAME #ifdef from dev->mtu setting in ipg_nic_open() so that we
can make IPG_TXFRAG_SIZE configurable.

Tested-by: Andrew Savchenko <Bircoph@list.ru>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoipg: always compile in jumbo frame support
Pekka Enberg [Mon, 23 Jun 2008 11:35:16 +0000 (14:35 +0300)]
ipg: always compile in jumbo frame support

Add a ->is_jumbo boolean to struct ipg_nic_private and fix up
ipg_interrupt_handler() to call the jumbo frame version of ipg_nic_rx() if the
boolean is set to true. Also remove the JUMBO_FRAME #ifdefs so we can always
compile in support for jumbo frames.

Tested-by: Andrew Savchenko <Bircoph@list.ru>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoMerge branch 'r8169-next' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu...
Jeff Garzik [Fri, 4 Jul 2008 12:35:57 +0000 (08:35 -0400)]
Merge branch 'r8169-next' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6 into upstream-next

16 years agofs_enet: restore promiscuous and multicast settings in restart()
Laurent Pinchart [Thu, 26 Jun 2008 09:48:22 +0000 (11:48 +0200)]
fs_enet: restore promiscuous and multicast settings in restart()

The restart() function is called when the link state changes and resets
multicast and promiscuous settings. This patch restores those settings at the
end of restart().

Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoibm_newemac: Fixes entry of short packets
Sathya Narayanan [Tue, 1 Jul 2008 08:58:19 +0000 (10:58 +0200)]
ibm_newemac: Fixes entry of short packets

Short packets has to be discarded by the driver. So this patch addresses the
issue of discarding the short packets of size lesser then ethernet header
size.

Signed-off-by: Sathya Narayanan <sathyan@teamf1.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoibm_newemac: Fixes kernel crashes when speed of cable connected changes
Sathya Narayanan [Tue, 1 Jul 2008 08:58:05 +0000 (10:58 +0200)]
ibm_newemac: Fixes kernel crashes when speed of cable connected changes

The descriptor pointers were not initialized to NIL values, so it was
poiniting to some random addresses which was completely invalid. This
fix takes care of initializing the descriptor to NIL values and clearing
the valid descriptors on clean ring operation.

Signed-off-by: Sathya Narayanan <sathyan@teamf1.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agopasemi_mac: Access iph->tot_len with correct endianness
Roland Dreier [Tue, 1 Jul 2008 17:22:45 +0000 (10:22 -0700)]
pasemi_mac: Access iph->tot_len with correct endianness

iph->tot_len is stored in network byte order, so access it using
ntohs().  This doesn't have any real world impact on pasemi_mac, since
the device only exists as part of a big-endian system-on-chip, but
fixing this gets rid of a sparse warning and avoids having a bad example
in the tree.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoehea: Access iph->tot_len with correct endianness
Roland Dreier [Tue, 1 Jul 2008 17:20:33 +0000 (10:20 -0700)]
ehea: Access iph->tot_len with correct endianness

iph->tot_len is stored in network byte order, so access it using
ntohs().  This doesn't have any real world impact on ehea, since ehea
only exists for big-endian platfroms (at the moment at least) but fixing
this gets rid of a sparse warning and avoids having a bad example in the
tree.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoehea: fix race condition
Jan-Bernd Themann [Thu, 3 Jul 2008 14:18:51 +0000 (15:18 +0100)]
ehea: fix race condition

When ehea_stop is called the function
cancel_work_sync(&port->reset_task) is used to ensure
that the reset task is not running anymore. We need an
additional flag to ensure that it can not be scheduled
after this call again for a certain time.

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoehea: add MODULE_DEVICE_TABLE
Jan-Bernd Themann [Thu, 3 Jul 2008 14:18:48 +0000 (15:18 +0100)]
ehea: add MODULE_DEVICE_TABLE

Required to allow distros to easily detect when ehea
module needs to be loaded

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoehea: fix might sleep problem
Jan-Bernd Themann [Thu, 3 Jul 2008 14:18:45 +0000 (15:18 +0100)]
ehea: fix might sleep problem

A mutex has to be replaced by spinlocks as it can be called from
a context which does not allow sleeping.
The kzalloc flag GFP_KERNEL has to be replaced by GFP_ATOMIC
for the same reason.

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoforcedeth: fix lockdep warning on ethtool -s
Tobias Diedrich [Fri, 4 Jul 2008 06:54:56 +0000 (23:54 -0700)]
forcedeth: fix lockdep warning on ethtool -s

After enabling CONFIG_LOCKDEP and CONFIG_PROVE_LOCKING I get the
following warning when ethtool -s is first called on one of the
forcedeth ports:

=================================
[ INFO: inconsistent lock state ]
2.6.26-rc4 #28
---------------------------------
inconsistent {in-hardirq-W} -> {hardirq-on-W} usage.
ethtool/1985 [HC0[0]:SC0[1]:HE1:SE0] takes:
 (&np->lock){++..}, at: [<ffffffffa000c5fd>] nv_set_settings+0xc8/0x3de [forcedeth]
{in-hardirq-W} state was registered at:
  [<ffffffffffffffff>] 0xffffffffffffffff
irq event stamp: 3606
hardirqs last  enabled at (3605): [<ffffffff8068106f>] _spin_unlock_irqrestore+0x3f/0x68
hardirqs last disabled at (3604): [<ffffffff80680d38>] _spin_lock_irqsave+0x13/0x46
softirqs last  enabled at (3534): [<ffffffff80246ba5>] __do_softirq+0xbc/0xc5
softirqs last disabled at (3606): [<ffffffff80680b33>] _spin_lock_bh+0x11/0x41

other info that might help us debug this:
2 locks held by ethtool/1985:
 #0:  (rtnl_mutex){--..}, at: [<ffffffff80596072>] rtnl_lock+0x12/0x14
 #1:  (_xmit_ETHER){-+..}, at: [<ffffffffa000c5e8>] nv_set_settings+0xb3/0x3de [forcedeth]
stack backtrace:
Pid: 1985, comm: ethtool Not tainted 2.6.26-rc4 #28
Call Trace:
 [<ffffffff8025f190>] print_usage_bug+0x162/0x173
 [<ffffffff8025fa8b>] mark_lock+0x231/0x41f
 [<ffffffff802607cf>] __lock_acquire+0x4e7/0xcac
 [<ffffffff8025fe64>] ? trace_hardirqs_on+0xf1/0x115
 [<ffffffff80272c3a>] ? disable_irq_nosync+0x6f/0x7b
 [<ffffffff80261375>] lock_acquire+0x55/0x6e
 [<ffffffffa000c5fd>] ? :forcedeth:nv_set_settings+0xc8/0x3de
 [<ffffffff80680b15>] _spin_lock+0x2f/0x3c
 [<ffffffffa000c5fd>] :forcedeth:nv_set_settings+0xc8/0x3de
 [<ffffffff8058f8bb>] dev_ethtool+0x186/0xea3
 [<ffffffff8067f446>] ? mutex_lock_nested+0x243/0x275
 [<ffffffff8025df2b>] ? debug_mutex_free_waiter+0x46/0x4a
 [<ffffffff8067f469>] ? mutex_lock_nested+0x266/0x275
 [<ffffffff8058e1ce>] dev_ioctl+0x4eb/0x600
 [<ffffffff8068106f>] ? _spin_unlock_irqrestore+0x3f/0x68
 [<ffffffff80580f91>] sock_ioctl+0x1f5/0x202
 [<ffffffff802a322e>] vfs_ioctl+0x2a/0x77
 [<ffffffff802a34d6>] do_vfs_ioctl+0x25b/0x270
 [<ffffffff806807b6>] ? trace_hardirqs_on_thunk+0x35/0x3a
 [<ffffffff802a352d>] sys_ioctl+0x42/0x65
 [<ffffffff8021fffb>] system_call_after_swapgs+0x7b/0x80

This is caused by the following snippet in nv_set_settings:

netif_carrier_off(dev);
if (netif_running(dev)) {
nv_disable_irq(dev);
netif_tx_lock_bh(dev);
spin_lock(&np->lock);
/* stop engines */
nv_stop_rxtx(dev);
spin_unlock(&np->lock);
netif_tx_unlock_bh(dev);
}

Because of nv_disable_irq this is probably not really a problem
though (I guess) and replacing the spin_lock with spin_lock_irqsave
could keep interrupts disabled for a longer period of time because
of delays in nv_stop_rx and nv_stop_tx.

Signed-off-by: Tobias Diedrich <ranma+kernel@tdiedrich.de>
Cc: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoAdd missing skb->dev assignment in Frame Relay RX code
Krzysztof Halasa [Sun, 29 Jun 2008 19:48:11 +0000 (21:48 +0200)]
Add missing skb->dev assignment in Frame Relay RX code

Commit 4c13eb6657fe9ef7b4dc8f1a405c902e9e5234e0 ([ETH]: Make
eth_type_trans set skb->dev like the other *_type_trans) removed
skb->dev assignment from hdlc_fr.c:fr_rx(). Unfortunately it was also
needed for cases other than eth_type_trans().

Adding it back.

It's quite serious and may be a security risk as it causes a wrong
input interface indication (the physical hdlcX instead of logical
pvcX). Probably -stable class fix.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agobridge: fix use-after-free in br_cleanup_bridges()
Patrick McHardy [Thu, 3 Jul 2008 10:53:42 +0000 (03:53 -0700)]
bridge: fix use-after-free in br_cleanup_bridges()

Unregistering a bridge device may cause virtual devices stacked on the
bridge, like vlan or macvlan devices, to be unregistered as well.
br_cleanup_bridges() uses for_each_netdev_safe() to iterate over all
devices during cleanup. This is not enough however, if one of the
additionally unregistered devices is next in the list to the bridge
device, it will get freed as well and the iteration continues on
the freed element.

Restart iteration after each bridge device removal from the beginning to
fix this, similar to what rtnl_link_unregister() does.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotun: Allow GSO using virtio_net_hdr
Rusty Russell [Thu, 3 Jul 2008 10:48:02 +0000 (03:48 -0700)]
tun: Allow GSO using virtio_net_hdr

Add a IFF_VNET_HDR flag.  This uses the same ABI as virtio_net
(ie. prepending struct virtio_net_hdr to packets) to indicate GSO and
checksum information.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Max Krasnyansky <maxk@qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotun: TUNSETFEATURES to set gso features.
Rusty Russell [Thu, 3 Jul 2008 10:46:16 +0000 (03:46 -0700)]
tun: TUNSETFEATURES to set gso features.

ethtool is useful for setting (some) device fields, but it's
root-only.  Finer feature control is available through a tun-specific
ioctl.

(Includes Mark McLoughlin <markmc@redhat.com>'s fix to hold rtnl sem).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Max Krasnyansky <maxk@qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotun: Interface to query tun/tap features.
Rusty Russell [Thu, 3 Jul 2008 10:45:32 +0000 (03:45 -0700)]
tun: Interface to query tun/tap features.

The problem with introducing checksum offload and gso to tun is they
need to set dev->features to enable GSO and/or checksumming, which is
supposed to be done before register_netdevice(), ie. as part of
TUNSETIFF.

Unfortunately, TUNSETIFF has always just ignored flags it doesn't
understand, so there's no good way of detecting whether the kernel
supports new IFF_ flags.

This patch implements a TUNGETFEATURES ioctl which returns all the valid IFF
flags.  It could be extended later to include other features.

Here's an example program which uses it:

#include <linux/if_tun.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <err.h>
#include <stdio.h>

static struct {
unsigned int flag;
const char *name;
} known_flags[] = {
{ IFF_TUN, "TUN" },
{ IFF_TAP, "TAP" },
{ IFF_NO_PI, "NO_PI" },
{ IFF_ONE_QUEUE, "ONE_QUEUE" },
};

int main()
{
unsigned int features, i;

int netfd = open("/dev/net/tun", O_RDWR);
if (netfd < 0)
err(1, "Opening /dev/net/tun");

if (ioctl(netfd, TUNGETFEATURES, &features) != 0) {
printf("Kernel does not support TUNGETFEATURES, guessing\n");
features = (IFF_TUN|IFF_TAP|IFF_NO_PI|IFF_ONE_QUEUE);
}
printf("Available features are: ");
for (i = 0; i < sizeof(known_flags)/sizeof(known_flags[0]); i++) {
if (features & known_flags[i].flag) {
features &= ~known_flags[i].flag;
printf("%s ", known_flags[i].name);
}
}
if (features)
printf("(UNKNOWN %#x)", features);
printf("\n");
return 0;
}

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Max Krasnyansky <maxk@qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotcp: fix a size_t < 0 comparison in tcp_read_sock
Octavian Purdila [Thu, 3 Jul 2008 10:31:21 +0000 (03:31 -0700)]
tcp: fix a size_t < 0 comparison in tcp_read_sock

<used> should be of type int (not size_t) since recv_actor can return
negative values and it is also used in a < 0 comparison.

Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agotcp: net/ipv4/tcp.c needs linux/scatterlist.h
Andrew Morton [Thu, 3 Jul 2008 10:22:02 +0000 (03:22 -0700)]
tcp: net/ipv4/tcp.c needs linux/scatterlist.h

alpha:

net/ipv4/tcp.c: In function 'tcp_calc_md5_hash':
net/ipv4/tcp.c:2479: error: implicit declaration of function 'sg_init_table'    net/ipv4/tcp.c:2482: error: implicit declaration of function 'sg_set_buf'
net/ipv4/tcp.c:2507: error: implicit declaration of function 'sg_mark_end'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMerge branch 'net-next-2.6-v6ready-20080703' of git://git.linux-ipv6.org/gitroot...
David S. Miller [Thu, 3 Jul 2008 10:07:58 +0000 (03:07 -0700)]
Merge branch 'net-next-2.6-v6ready-20080703' of git://git.linux-ipv6.org/gitroot/yoshfuji/linux-2.6-next

16 years agoipv4,ipv6 mroute: Add some helper inline functions to remove ugly ifdefs.
YOSHIFUJI Hideaki [Thu, 3 Jul 2008 07:51:22 +0000 (16:51 +0900)]
ipv4,ipv6 mroute: Add some helper inline functions to remove ugly ifdefs.

ip{,v6}_mroute_{set,get}sockopt() should not matter by optimization but
it would be better not to depend on optimization semantically.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years agoipv4: Do cleanup for ip_mr_init
Wang Chen [Thu, 3 Jul 2008 04:13:36 +0000 (12:13 +0800)]
ipv4: Do cleanup for ip_mr_init

Same as ip6_mr_init(), make ip_mr_init() return errno if fails.
But do not do error handling in inet_init(), just print a msg.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years agoipv6: Do cleanup for ip6_mr_init.
Wang Chen [Thu, 3 Jul 2008 04:13:30 +0000 (12:13 +0800)]
ipv6: Do cleanup for ip6_mr_init.

If do not do it, we will get following issues:
1. Leaving junks after inet6_init failing halfway.
2. Leaving proc and notifier junks after ipv6 modules unloading.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years agoipv6 route: Prefer outgoing interface with source address assigned.
YOSHIFUJI Hideaki [Wed, 2 Jul 2008 09:30:18 +0000 (18:30 +0900)]
ipv6 route: Prefer outgoing interface with source address assigned.

Outgoing interface is selected by the route decision if unspecified.
Let's prefer routes via interface(s) with the address assigned if we
have multiple routes with same cost.
With help from Naohiro Ooiwa <nooiwa@miraclelinux.com>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years agoipv6 addrconf: add accept_dad sysctl to control DAD operation.
YOSHIFUJI Hideaki [Sat, 28 Jun 2008 05:18:38 +0000 (14:18 +0900)]
ipv6 addrconf: add accept_dad sysctl to control DAD operation.

- If 0, disable DAD.
- If 1, perform DAD (default).
- If >1, perform DAD and disable IPv6 operation if DAD for MAC-based
  link-local address has been failed (RFC4862 5.4.5).

We do not follow RFC4862 by default.  Refer to the netdev thread entitled
"Linux IPv6 DAD not full conform to RFC 4862 ?"
http://www.spinics.net/lists/netdev/msg52027.html

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years agoipv6: Add disable_ipv6 sysctl to disable IPv6 operaion on specific interface.
YOSHIFUJI Hideaki [Sat, 28 Jun 2008 05:17:11 +0000 (14:17 +0900)]
ipv6: Add disable_ipv6 sysctl to disable IPv6 operaion on specific interface.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years agoipv6: Assume the loopback address in link-local scope.
YOSHIFUJI Hideaki [Wed, 25 Jun 2008 07:58:17 +0000 (16:58 +0900)]
ipv6: Assume the loopback address in link-local scope.

Handle interface property strictly when looking up a route
for the loopback address (RFC4291 2.5.3).

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years agoipv6: Do not forward packets with the unspecified source address.
YOSHIFUJI Hideaki [Wed, 25 Jun 2008 07:55:26 +0000 (16:55 +0900)]
ipv6: Do not forward packets with the unspecified source address.

RFC4291 2.5.2.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
16 years agoipv6: Do not assign non-valid address on interface.
YOSHIFUJI Hideaki [Wed, 25 Jun 2008 07:26:47 +0000 (16:26 +0900)]
ipv6: Do not assign non-valid address on interface.

Check the type of the address when adding a new one on interface.
- the unspecified address (::) is always disallowed (RFC4291 2.5.2)
- the loopback address is disallowed unless the interface is (one of)
  loopback (RFC4291 2.5.3).
- multicast addresses are disallowed.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>