safe/jmp/linux-2.6
14 years agoCAPI: Switch capiminor list to array
Jan Kiszka [Mon, 8 Feb 2010 10:12:23 +0000 (10:12 +0000)]
CAPI: Switch capiminor list to array

Using a plain array of pointers simplifies the management of capiminors.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Switch NCCI list to standard doubly linked list
Jan Kiszka [Mon, 8 Feb 2010 10:12:22 +0000 (10:12 +0000)]
CAPI: Switch NCCI list to standard doubly linked list

Replace open-coded NCCI list management with standard mechanisms.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Fix racy capi_read
Jan Kiszka [Mon, 8 Feb 2010 10:12:21 +0000 (10:12 +0000)]
CAPI: Fix racy capi_read

capi_read still used interruptible_sleep_on, risking to miss a wakeup
this way. Convert it to wait_event_interruptible.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Use non-atomic allocation during NCCI setup
Jan Kiszka [Mon, 8 Feb 2010 10:12:20 +0000 (10:12 +0000)]
CAPI: Use non-atomic allocation during NCCI setup

Both capincci_alloc and capiminor_alloc run in non-atomic context,
update their memory allocations accordingly.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Rework locking of capidev members
Jan Kiszka [Mon, 8 Feb 2010 10:12:19 +0000 (10:12 +0000)]
CAPI: Rework locking of capidev members

Rename 'ncci_list_mtx' to 'lock', expressing that it now protects a
larger set of capidev members: the NCCI list, ap.applid (ie. the
registration of the application), and modifications of userflags.

We do not need to protect each and every check for ap.applid because,
once an application is registered, it will stay for the whole lifetime
of the device.

Also, there is no need to apply the capidev mutex during release (if
there could be concurrent users, we would crash them anyway by freeing
the device at the end of capi_release).

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Clean up capi_open/release
Jan Kiszka [Mon, 8 Feb 2010 10:12:18 +0000 (10:12 +0000)]
CAPI: Clean up capi_open/release

Fold capidev_alloc and capidev_free into capi_open and capi_release -
there are no other users. Someone pushed a lock_kernel into capi_open.
Drop it, we don't need it. Also remove the useless test from open that
checks for private_data == NULL.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Convert capidev_list_lock into a mutex
Jan Kiszka [Mon, 8 Feb 2010 10:12:17 +0000 (10:12 +0000)]
CAPI: Convert capidev_list_lock into a mutex

No need for anything "harder" here (specifically no need for
irqsave...). Also, make the list removal the first operation of
capidev_free to avoid dumping half-released devices via /proc.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Reduce #ifdef mess around CONFIG_ISDN_CAPI_MIDDLEWARE
Jan Kiszka [Mon, 8 Feb 2010 10:12:16 +0000 (10:12 +0000)]
CAPI: Reduce #ifdef mess around CONFIG_ISDN_CAPI_MIDDLEWARE

Make the code a bit more readable be providing stub functions for the
!CONFIG_ISDN_CAPI_MIDDLEWARE case. Though a few lines are moved around,
this comes with no functional changes.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Rework application locking
Jan Kiszka [Mon, 8 Feb 2010 10:12:15 +0000 (10:12 +0000)]
CAPI: Rework application locking

Drop the application rw-lock in favour of RCU. This synchronizes
capi20_release against capi_ctr_handle_message which may dereference an
application from (soft-)IRQ context. Any other access to the application
list is now protected by the capi_controller_lock as well. This also
allows to safely inspect applications for /proc dumping by holding
capi_controller_lock.

At this chance, drop some useless release_in_progress checks where we
obtained the application pointer from the list (which becomes NULL on
release_in_progress).

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Rework locking of controller data structures
Jan Kiszka [Mon, 8 Feb 2010 10:12:14 +0000 (10:12 +0000)]
CAPI: Rework locking of controller data structures

This patch applies the mutex so far only protecting the controller list
to (almost) all accesses of controller data structures. It also reworks
waiting on state changes in old_capi_manufacturer so that it no longer
poll and holds a module reference to the controller owner while waiting
(the latter was partly done already). Modification and checking of the
blocked state remains racy by design, the caller is responsible for
dealing with this.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Rework controller state notifier
Jan Kiszka [Mon, 8 Feb 2010 10:12:13 +0000 (10:12 +0000)]
CAPI: Rework controller state notifier

Another step towards proper locking: Rework the callback provided to
capidrv for controller state changes. This is so far attached to an
application, which would require us to hold the corresponding lock
across notification calls.

But there is no direct relation between a controller up/down event and
an application, so let's decouple them and provide a notifier call chain
for those events instead. This notifier chain is first of all used
internally. Here we request the highest priority to unsure that
housekeeping work is done before any other notifications. The chain is
exported via [un]register_capictr_notifier to our only user, capidrv, to
replace the racy and unfixable capi20_set_callback.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Rework capi_ctr_ready/down
Jan Kiszka [Mon, 8 Feb 2010 10:12:12 +0000 (10:12 +0000)]
CAPI: Rework capi_ctr_ready/down

This step prepares the application of proper controller locking: Push
all state changing work into the notify handler that are called by
capi_ctr_ready and capi_ctr_down, switch detach_capi_ctr to issue a
synchronous ctr_down. Also ensure that we do not go through any action
if the state did not change.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Convert capi drivers rwlock into mutex
Jan Kiszka [Mon, 8 Feb 2010 10:12:11 +0000 (10:12 +0000)]
CAPI: Convert capi drivers rwlock into mutex

Turn the lock protecting registered capi drivers into a mutex and apply
it consistently.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Call a controller 'controller', not 'card'
Jan Kiszka [Mon, 8 Feb 2010 10:12:10 +0000 (10:12 +0000)]
CAPI: Call a controller 'controller', not 'card'

At least for our internal use, fix the misnomers that refer to a CAPI
controller as 'card'. No functional changes.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Reduce chattiness during module loading/removal
Jan Kiszka [Mon, 8 Feb 2010 10:12:09 +0000 (10:12 +0000)]
CAPI: Reduce chattiness during module loading/removal

The CVS revisions dumped by all CAPI modules are meaningless today. And
that some CAPI module is loaded or removed does not necessarily deserve
a message. Just keep the message of the central module, capi.ko, drop
the rest.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Pin capifs instead of mounting it
Jan Kiszka [Mon, 8 Feb 2010 10:12:08 +0000 (10:12 +0000)]
CAPI: Pin capifs instead of mounting it

Auto-mounting the capifs during module init prevents unloading its
module. Instead, pin the filesystem as long as some NCCI node exists.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Eliminate capifs_root variable
Jan Kiszka [Mon, 8 Feb 2010 10:12:07 +0000 (10:12 +0000)]
CAPI: Eliminate capifs_root variable

capifs_mnt->mnt_sb->s_root already contains what we need.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Sanitize capifs API
Jan Kiszka [Mon, 8 Feb 2010 10:12:06 +0000 (10:12 +0000)]
CAPI: Sanitize capifs API

Instead of looking up the dentry of an NCCI node again in
capifs_free_ncci pass the pointer via the capifs user.

This patch also reduces the #ifdef mess in capi.c a bit as far as capifs
was causing it.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Fix leaks in capifs_new_ncci
Jan Kiszka [Mon, 8 Feb 2010 10:12:05 +0000 (10:12 +0000)]
CAPI: Fix leaks in capifs_new_ncci

When something went wrong during capifs_new_ncci, the looked up dentry
was not properly released. Neither was the allocated inode. Refactor the
function to avoid leaks.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet neigh: Decouple per interface neighbour table controls from binary sysctls
Eric W. Biederman [Sun, 14 Feb 2010 03:27:03 +0000 (03:27 +0000)]
net neigh: Decouple per interface neighbour table controls from binary sysctls

Stop computing the number of neighbour table settings we have by
counting the number of binary sysctls.  This behaviour was silly
and meant that we could not add another neighbour table setting
without also adding another binary sysctl.

Don't pass the binary sysctl path for neighour table entries
into neigh_sysctl_register.  These parameters are no longer
used and so are just dead code.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet ipv4: Decouple ipv4 interface parameters from binary sysctl numbers
Eric W. Biederman [Sun, 14 Feb 2010 03:25:51 +0000 (03:25 +0000)]
net ipv4: Decouple ipv4 interface parameters from binary sysctl numbers

Stop using the binary sysctl enumeartion in sysctl.h as an index into
a per interface array.  This leads to unnecessary binary sysctl number
allocation, and a fragility in data structure and implementation
because of unnecessary coupling.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/pcnet32.c: Checkpatch cleaning
Joe Perches [Mon, 15 Feb 2010 08:34:26 +0000 (08:34 +0000)]
drivers/net/pcnet32.c: Checkpatch cleaning

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/pcnet32.c: Use (pr|netdev|netif)_<levels> macro helpers
Joe Perches [Mon, 15 Feb 2010 08:34:25 +0000 (08:34 +0000)]
drivers/net/pcnet32.c: Use (pr|netdev|netif)_<levels> macro helpers

Make the output logging messages a bit more consistent.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/tehuti.c: trivial checkpatch cleanups
Joe Perches [Mon, 15 Feb 2010 08:34:24 +0000 (08:34 +0000)]
drivers/net/tehuti.c: trivial checkpatch cleanups

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/tehuti.c: Hoist assigns out of ifs
Joe Perches [Mon, 15 Feb 2010 08:34:23 +0000 (08:34 +0000)]
drivers/net/tehuti.c: Hoist assigns out of ifs

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/tehuti.c: Use (pr|netdev|netif)_<levels> macro helpers
Joe Perches [Mon, 15 Feb 2010 08:34:22 +0000 (08:34 +0000)]
drivers/net/tehuti.c: Use (pr|netdev|netif)_<levels> macro helpers

Make the output logging messages a bit more consistent.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/sky2: Convert to use netif_printk macros
Joe Perches [Mon, 15 Feb 2010 08:34:21 +0000 (08:34 +0000)]
drivers/net/sky2: Convert to use netif_printk macros

Some unlikely(netif_msg_<foo>(sky2)) tests are also
removed by this change.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/ixgb: Use netif_printk macros
Joe Perches [Mon, 15 Feb 2010 08:34:20 +0000 (08:34 +0000)]
drivers/net/ixgb: Use netif_printk macros

Convert private DPRINTK macro uses to netif_<level> equivalents
Remove #define DPRINTK

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosparc64: Kill bogus ip_tables.h include.
David S. Miller [Tue, 16 Feb 2010 23:23:23 +0000 (15:23 -0800)]
sparc64: Kill bogus ip_tables.h include.

Fixes the following build failure:

  CC      arch/sparc/kernel/sys_sparc32.o
In file included from include/linux/netfilter_ipv4/ip_tables.h:28,
                 from arch/sparc/kernel/sys_sparc32.c:46:
include/linux/netfilter/x_tables.h:525: error: expected declaration specifiers or ‘...’ before ‘nf_hookfn’

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Update firmwares and update version to 2.0.8.
Michael Chan [Tue, 16 Feb 2010 23:19:42 +0000 (15:19 -0800)]
bnx2: Update firmwares and update version to 2.0.8.

- Increase FTQ depth to 256 to ehnabce performance.
- Fix RV2P context corruption on 5709 when flow control is enabled.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Fix bug when saving statistics.
Patrick Rabau [Mon, 15 Feb 2010 19:42:11 +0000 (19:42 +0000)]
bnx2: Fix bug when saving statistics.

This fixes the problem of dropping the carry when adding 2 32-bit values.
Switch to use array indexing for better readability.

Reported by and fix provided by Patrick Rabau.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Allow user-specified multiple advertisement speed values.
Michael Chan [Mon, 15 Feb 2010 19:42:10 +0000 (19:42 +0000)]
bnx2: Allow user-specified multiple advertisement speed values.

Remove unnecessary code that works around older versions of ethtool
that can pass down invalid advertisement speed values.  This old
code prevents the user from specifying multiple advertisement values.
The new code uses simple masking to mask out invalid advertisment bits.

Reported-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Adjust flow control water marks.
Michael Chan [Mon, 15 Feb 2010 19:42:09 +0000 (19:42 +0000)]
bnx2: Adjust flow control water marks.

The current water marks are too high and can cause unnecessary flow
control frames.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Need to call cnic_setup_cnic_irq_info() after MTU change.
Michael Chan [Mon, 15 Feb 2010 19:42:08 +0000 (19:42 +0000)]
bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change.

New status blocks are allocated during MTU change so we need to
update this information for the cnic driver.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX.
Michael Chan [Mon, 15 Feb 2010 19:42:07 +0000 (19:42 +0000)]
bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX.

Checking the flag is more correct than checking bp->irq_nvecs. By
accident it is not a problem because we always have more than 1
vectors when using MSIX mode.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoatl1c: Add support for Atheros AR8152 and AR8152
Luis R. Rodriguez [Tue, 16 Feb 2010 23:16:45 +0000 (15:16 -0800)]
atl1c: Add support for Atheros AR8152 and AR8152

AR8151 is a Gigabit Ethernet device. AR8152 devices are
Fast Ethernet devices, there are two revisions, a 1.0
and a 2.0 revision.

This has been tested against these devices:

Driver Model-name vendor:device Type
atl1c  AR8131 1969:1063 Gigabit Ethernet
atl1c AR8132 1969:1062 Fast Ethernet
atl1c AR8151(v1.0) 1969:1073 Gigabit Ethernet
atl1c AR8152(v1.1) 1969:2060 Fast Ethernet

This device has no hardware available yet so it goes untested,
but it should work:

atl1c AR8152(v2.0) 1969:2062 Fast Ethernet

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotunnels: fix netns vs proto registration ordering
Alexey Dobriyan [Tue, 16 Feb 2010 09:05:04 +0000 (09:05 +0000)]
tunnels: fix netns vs proto registration ordering

Same stuff as in ip_gre patch: receive hook can be called before netns
setup is done, oopsing in net_generic().

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogre: fix netns vs proto registration ordering
Alexey Dobriyan [Tue, 16 Feb 2010 07:57:44 +0000 (07:57 +0000)]
gre: fix netns vs proto registration ordering

GRE protocol receive hook can be called right after protocol addition is done.
If netns stuff is not yet initialized, we're going to oops in
net_generic().

This is remotely oopsable if ip_gre is compiled as module and packet
comes at unfortunate moment of module loading.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
David S. Miller [Tue, 16 Feb 2010 19:15:13 +0000 (11:15 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-next-2.6

14 years agoethtool: reduce stack usage
Eric Dumazet [Tue, 16 Feb 2010 05:51:33 +0000 (21:51 -0800)]
ethtool: reduce stack usage

dev_ethtool() is currently using 604 bytes of stack, even with gcc-4.4.2

objdump -d vmlinux | scripts/checkstack.pl
...
0xc04bbc33 dev_ethtool [vmlinux]: 604
...
Adding noinline attributes to selected functions can reduce stack usage.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: emaclite: adding MDIO and phy lib support
John Linn [Tue, 16 Feb 2010 05:51:00 +0000 (21:51 -0800)]
net: emaclite: adding MDIO and phy lib support

These changes add MDIO and phy lib support to the driver as the
IP core now supports the MDIO bus.

The MDIO bus and phy are added as a child to the emaclite in the device
tree as illustrated below.

mdio {
#address-cells = <1>;
#size-cells = <0>;
phy0: phy@7 {
compatible = "marvell,88e1111";
reg = <7>;
} ;
}

Signed-off-by: Sadanand Mutyala <Sadanand.Mutyala@xilinx.com>
Signed-off-by: John Linn <john.linn@xilinx.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoX25: Dont let x25_bind use addresses containing characters
andrew hendry [Sun, 14 Feb 2010 02:00:45 +0000 (02:00 +0000)]
X25: Dont let x25_bind use addresses containing characters

Addresses should be all digits.
Stops x25_bind using addresses containing characters.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoX25: Fix x25_create errors for bad protocol and ENOBUFS
andrew hendry [Sun, 14 Feb 2010 02:00:11 +0000 (02:00 +0000)]
X25: Fix x25_create errors for bad protocol and ENOBUFS

alloc_socket failures should return -ENOBUFS
a bad protocol should return -EINVAL

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: implement EEH pci error recovery handlers
Sathya Perla [Sun, 14 Feb 2010 21:22:01 +0000 (21:22 +0000)]
be2net: implement EEH pci error recovery handlers

The code has been tested on IBM pSeries server.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoxfrm: Flushing empty SPD generates false events
jamal [Thu, 11 Feb 2010 00:53:13 +0000 (00:53 +0000)]
xfrm: Flushing empty SPD generates false events

Observed similar behavior on SPD as previouly seen on SAD flushing..
This fixes it.

cheers,
jamal
commit 428b20432dc31bc2e01a94cd451cf5a2c00d2bf4
Author: Jamal Hadi Salim <hadi@cyberus.ca>
Date:   Thu Feb 11 05:49:38 2010 -0500

    xfrm: Flushing empty SPD generates false events

    To see the effect make sure you have an empty SPD.
    On window1 "ip xfrm mon" and on window2 issue "ip xfrm policy flush"
    You get prompt back in window1 and you see the flush event on window2.
    With this fix, you still get prompt on window1 but no event on window2.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoxfrm: Flushing empty SAD generates false events
jamal [Wed, 10 Feb 2010 23:51:27 +0000 (23:51 +0000)]
xfrm: Flushing empty SAD generates false events

To see the effect make sure you have an empty SAD.
-On window1 "ip xfrm mon"
-on window2 issue "ip xfrm state flush"
You get prompt back in window1
and you see the flush event on window2.
With this fix, you still get prompt on window1 but no
event on window2.

I was tempted to return -ESRCH on window1 (which would
show "RTNETLINK answers: No such process") but didnt want
to change current behavior.

cheers,
jamal
commit 5f3dd4a772326166e1bcf54acc2391df00dc7ab5
Author: Jamal Hadi Salim <hadi@cyberus.ca>
Date:   Thu Feb 11 04:41:36 2010 -0500

    xfrm: Flushing empty SAD generates false events

    To see the effect make sure you have an empty SAD.
    On window1 "ip xfrm mon" and on window2 issue "ip xfrm state flush"
    You get prompt back in window1 and you see the flush event on window2.
    With this fix, you still get prompt on window1 but no event on window2.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoIPv6: Delete redundant counter of IPSTATS_MIB_REASMFAILS
Shan Wei [Thu, 11 Feb 2010 00:12:45 +0000 (00:12 +0000)]
IPv6: Delete redundant counter of IPSTATS_MIB_REASMFAILS

When no more memory can be allocated, fq_find() will return NULL and
increase the value of IPSTATS_MIB_REASMFAILS. In this case,
ipv6_frag_rcv() also increase the value of IPSTATS_MIB_REASMFAILS.

So, the patch deletes redundant counter of IPSTATS_MIB_REASMFAILS in fq_find().
and deletes the unused parameter of idev.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/macvtap: fix reference counting
Arnd Bergmann [Thu, 11 Feb 2010 05:55:39 +0000 (05:55 +0000)]
net/macvtap: fix reference counting

The RCU usage in the original code was broken because
there are cases where we possibly sleep with rcu_read_lock
held. As a fix, change the macvtap_file_get_queue to
get a reference on the socket and the netdev instead of
taking the full rcu_read_lock.

Also, change macvtap_file_get_queue failure case to
not require a subsequent macvtap_file_put_queue, as
pointed out by Ed Swierk.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Ed Swierk <eswierk@aristanetworks.com>
Cc: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Ed Swierk <eswierk@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocxgb3: fix link flap
Divy Le Ray [Sat, 13 Feb 2010 09:44:35 +0000 (09:44 +0000)]
cxgb3: fix link flap

The driver is expected to report that the link is up
when the phy Rx signal is established and the mac
has not detected a link fault.
The code is however broken, the driver does not check the link fault
status when the phy link status changes.
The link fault status being checked within a short period of time,
it leads to link up/link down events.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocxgb3: FIx VLAN over Jumbo frames
Divy Le Ray [Sat, 13 Feb 2010 09:44:30 +0000 (09:44 +0000)]
cxgb3: FIx VLAN over Jumbo frames

The mac is expected to auto-inflate the Maximum Frame size for VLAN
tagged frames. It however does not work with jumbo frames.
Work around the bug adding 4 to the Maximum Frame for MTUs
greater than 1536.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Cleanup incorrect header comments
Peter Waskiewicz [Fri, 12 Feb 2010 13:48:44 +0000 (13:48 +0000)]
ixgbe: Cleanup incorrect header comments

The recent n-tuple patches added some comments to the headers
of the Flow Director functions that aren't accurate.  This
cleans them up, and is a purely cosmetic patch.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethtool: Move n-tuple capability check into set_flags
Peter Waskiewicz [Fri, 12 Feb 2010 13:48:25 +0000 (13:48 +0000)]
ethtool: Move n-tuple capability check into set_flags

set_flags should check if the underlying device supports
n-tuple filter programming before setting the device flags
on the netdevice.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethtool: Fix filter addition when caching n-tuple filters
Peter Waskiewicz [Fri, 12 Feb 2010 13:48:05 +0000 (13:48 +0000)]
ethtool: Fix filter addition when caching n-tuple filters

We can allow a filter to be added successfully to the underlying
hardware, but still return an error if the cached list memory
allocation fails.  This patch fixes that condition.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetfilter: CONFIG_COMPAT: allow delta to exceed 32767
Florian Westphal [Mon, 15 Feb 2010 17:17:10 +0000 (18:17 +0100)]
netfilter: CONFIG_COMPAT: allow delta to exceed 32767

with 32 bit userland and 64 bit kernels, it is unlikely but possible
that insertion of new rules fails even tough there are only about 2000
iptables rules.

This happens because the compat delta is using a short int.
Easily reproducible via "iptables -m limit" ; after about 2050
rules inserting new ones fails with -ELOOP.

Note that compat_delta included 2 bytes of padding on x86_64, so
structure size remains the same.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: ebtables: avoid explicit XT_ALIGN() in match/targets
Florian Westphal [Mon, 15 Feb 2010 17:16:26 +0000 (18:16 +0100)]
netfilter: ebtables: avoid explicit XT_ALIGN() in match/targets

This will cause trouble once CONFIG_COMPAT support is added to ebtables.
xt_compat_*_offset() calculate the kernel/userland structure size delta
using:

XT_ALIGN(size) - COMPAT_XT_ALIGN(size)

If the match/target sizes are aligned at registration time,
delta is always zero.

Should have zero effect for existing systems: xtables uses
XT_ALIGN() whenever it deals with match/target sizes.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: ebtables: abort if next_offset is too small
Florian Westphal [Mon, 15 Feb 2010 17:15:55 +0000 (18:15 +0100)]
netfilter: ebtables: abort if next_offset is too small

next_offset must be > 0, otherwise this loops forever.
The offset also contains the size of the ebt_entry structure
itself, so anything smaller is invalid.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: ctnetlink: add zone support
Patrick McHardy [Mon, 15 Feb 2010 17:14:57 +0000 (18:14 +0100)]
netfilter: ctnetlink: add zone support

Parse and dump the conntrack zone in ctnetlink.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: nf_conntrack: add support for "conntrack zones"
Patrick McHardy [Mon, 15 Feb 2010 17:13:33 +0000 (18:13 +0100)]
netfilter: nf_conntrack: add support for "conntrack zones"

Normally, each connection needs a unique identity. Conntrack zones allow
to specify a numerical zone using the CT target, connections in different
zones can use the same identity.

Example:

iptables -t raw -A PREROUTING -i veth0 -j CT --zone 1
iptables -t raw -A OUTPUT -o veth1 -j CT --zone 1

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: nf_conntrack: pass template to l4proto ->error() handler
Patrick McHardy [Mon, 15 Feb 2010 16:45:08 +0000 (17:45 +0100)]
netfilter: nf_conntrack: pass template to l4proto ->error() handler

The error handlers might need the template to get the conntrack zone
introduced in the next patches to perform a conntrack lookup.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: xtables: add const qualifiers
Jan Engelhardt [Fri, 26 Jun 2009 05:51:59 +0000 (07:51 +0200)]
netfilter: xtables: add const qualifiers

This should make it easier to remove redundant arguments later.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: constify args in compat copying functions
Jan Engelhardt [Fri, 26 Jun 2009 06:23:19 +0000 (08:23 +0200)]
netfilter: xtables: constify args in compat copying functions

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xtables: print details on size mismatch
Jan Engelhardt [Thu, 25 Jun 2009 16:32:12 +0000 (18:32 +0200)]
netfilter: xtables: print details on size mismatch

Print which revision has been used and which size are which
(kernel/user) for easier debugging.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: get rid of the grossness in netfilter.h
Jan Engelhardt [Sat, 13 Jun 2009 02:13:26 +0000 (04:13 +0200)]
netfilter: get rid of the grossness in netfilter.h

GCC is now smart enough to follow the inline trail correctly.
vmlinux size remain the same.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: reduce NF_HOOK by one argument
Jan Engelhardt [Fri, 5 Jun 2009 15:31:46 +0000 (17:31 +0200)]
netfilter: reduce NF_HOOK by one argument

No changes in vmlinux filesize.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: iptables: remove unused function arguments
Jan Engelhardt [Sat, 31 Oct 2009 23:36:40 +0000 (00:36 +0100)]
netfilter: iptables: remove unused function arguments

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agonetfilter: xt_recent: inform user when hitcount is too large
Jan Engelhardt [Mon, 15 Feb 2010 15:31:35 +0000 (16:31 +0100)]
netfilter: xt_recent: inform user when hitcount is too large

It is one of these things that iptables cannot catch and which can
cause "Invalid argument" to be printed. Without a hint in dmesg, it is
not going to be helpful.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoniu: Refinements to kernel logging.
David S. Miller [Mon, 15 Feb 2010 08:07:00 +0000 (00:07 -0800)]
niu: Refinements to kernel logging.

Fix unconditional empty kerne log message every interrupt.

Kill some informational log messages that are superfluous
and anyways occur before the netdev is registered.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomac80211: Fix error introduced in netdev_mc_count() changes.
David S. Miller [Mon, 15 Feb 2010 06:49:52 +0000 (22:49 -0800)]
mac80211: Fix error introduced in netdev_mc_count() changes.

Commit 4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5
("net: use netdev_mc_count and netdev_mc_empty when appropriate")
added this hunk to net/mac80211/iface.c:

  __dev_addr_unsync(&local->mc_list, &local->mc_count,
-   &dev->mc_list, &dev->mc_count);
+   &dev->mc_list, dev->mc_count);

which is definitely not correct, introduced a warning (reported
by Stephen Rothwell):

net/mac80211/iface.c: In function 'ieee80211_stop':
net/mac80211/iface.c:416: warning: passing argument 4 of '__dev_addr_unsync' makes pointer from integer without a cast
include/linux/netdevice.h:1967: note: expected 'int *' but argument is of type 'int'

and is thus reverted here.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovhost-net: switch to smp barriers
Michael S. Tsirkin [Mon, 1 Feb 2010 07:21:02 +0000 (07:21 +0000)]
vhost-net: switch to smp barriers

vhost-net only uses memory barriers to control SMP effects
(communication with userspace potentially running on a different CPU),
so it should use SMP barriers and not mandatory barriers for memory
access ordering, as suggested by Documentation/memory-barriers.txt

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoniu: Use pr_<level>, netdev_<level> and netif_<level> macros
Joe Perches [Mon, 15 Feb 2010 06:40:39 +0000 (22:40 -0800)]
niu: Use pr_<level>, netdev_<level> and netif_<level> macros

Remove #define PFX
Add pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Convert printks to pr_<level>
Convert printks without levels to pr_cont
Convert pr_<level> with np->dev to netdev_<level>
Convert dev_<level> to netdev_<level>
Convert niudbg to netif_printk
Convert niuinfo, niuwarn macros to netif_<level>(priv, type, dev...
Coalesce long formats
Convert embedded function names to "%s", __func__
Always use "%s()..." when __func__ is printed

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethtool: Fix includes build break
David S. Miller [Mon, 15 Feb 2010 06:38:54 +0000 (22:38 -0800)]
ethtool: Fix includes build break

Based upon a patch by Oliver Hartkopp <oliver@hartkopp.net>.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Fix first line of kernel-doc for a few functions
Ben Hutchings [Mon, 15 Feb 2010 06:35:47 +0000 (22:35 -0800)]
net: Fix first line of kernel-doc for a few functions

The function name must be followed by a space, hypen, space, and a
short description.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Mon, 15 Feb 2010 06:30:54 +0000 (22:30 -0800)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
net/mac80211/rate.c

14 years agoMerge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Mon, 15 Feb 2010 01:45:59 +0000 (17:45 -0800)]
Merge branch 'master' of ssh:///linux/kernel/git/linville/wireless-next-2.6

14 years agoMerge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Sun, 14 Feb 2010 19:56:38 +0000 (11:56 -0800)]
Merge branch 'master' of ssh:///linux/kernel/git/linville/wireless-2.6

14 years agotg3: Update driver version to 3.107
Matt Carlson [Fri, 12 Feb 2010 14:47:13 +0000 (14:47 +0000)]
tg3: Update driver version to 3.107

This patch updates the tg3 version to 3.107.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Fix AC131 loopback test errors for 5785
Matt Carlson [Fri, 12 Feb 2010 14:47:12 +0000 (14:47 +0000)]
tg3: Fix AC131 loopback test errors for 5785

The AC131 does not enable the forced transmit clock settings
immediately.  The workaround is to read the register again to get the
setting to take effect.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Fix napi assignments in loopback test
Matt Carlson [Fri, 12 Feb 2010 14:47:11 +0000 (14:47 +0000)]
tg3: Fix napi assignments in loopback test

The 57765 lacks TSS support.  This renders the napi assignments
incorrect in the loopback test function.  This patch fixes the problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Reset phy during bringup when using phylib
Matt Carlson [Fri, 12 Feb 2010 14:47:10 +0000 (14:47 +0000)]
tg3: Reset phy during bringup when using phylib

The driver puts the phy into low-power mode when it releases the device.
If the device were to be reacquired, the phy needs a reset to bring it
back to full powered operation.  This patch allows phylib-enabled
devices to reset the phy.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Turn off multiple DMA reads for 5717
Matt Carlson [Fri, 12 Feb 2010 14:47:09 +0000 (14:47 +0000)]
tg3: Turn off multiple DMA reads for 5717

The 5717's DMA read engine has a bug when initiating multiple DMA reads
across the PCIe bus.  This patch disables the feature.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Fix 57765 A0 bootcode race condition
Matt Carlson [Fri, 12 Feb 2010 14:47:08 +0000 (14:47 +0000)]
tg3: Fix 57765 A0 bootcode race condition

On A0 revision of 57765 asic rev devices, the bootcode will perform some
hardware operations, after the magic signature is presented, that will
collide with setup operations performed by the driver.  The best way to
avoid the contention is to have the driver delay an additional 10
milliseconds.  B0 revisions of the chip will make this workaround
unnecessary.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Unwedge stuck MSI-X vectors
Matt Carlson [Fri, 12 Feb 2010 14:47:07 +0000 (14:47 +0000)]
tg3: Unwedge stuck MSI-X vectors

The previous patch changed the code so that new rx buffer submissions to
the hardware stall if a new submission would overwrite data needed by an
unserviced rx packet.  On very busy 5717 and 57765 asic rev devices,
there is a corner case where the hardware will fail to assert an MSI-X
interrupt for rx traffic.  If that vector's interrupt never has another
reason to assert, any rx buffers held will never be serviced.  If the
buffers are never serviced and the hardware consumes all the available
rx packets for other rx rings, deadlock will result.

The most reliable and least intrusive way to work around the problem is
to detect the case where new submissions would overwrite existing data
and force all rx interrupt vectors to fire.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Prevent rx producer ring overruns
Matt Carlson [Fri, 12 Feb 2010 14:47:06 +0000 (14:47 +0000)]
tg3: Prevent rx producer ring overruns

When operating in RSS mode, it is possible for one rx return ring to
submit enough rx buffers back to the hardware such that it inadvertently
overwrites data needed by another rx return ring.  This patch addresses
the problem by looking for non-NULL skb pointers in the
rx_[std|jmb]_buffers rings that parallel the rx producer rings.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotg3: Give MSI-X vec 1 rx backlog space
Matt Carlson [Fri, 12 Feb 2010 14:47:05 +0000 (14:47 +0000)]
tg3: Give MSI-X vec 1 rx backlog space

RSS ring 1 is responsible for submitting new rx buffers to the
hardware on behalf of all the other RSS rx return rings.  Up until now
this ring submitted its new rx buffers to the producer ring directly.
The following patch will require that this ring have a place to put
backlogged rx packets.  As a consequence, it can no longer submit new
buffers to the producer ring.

This patch adds code to allocate an extra shadow producer ring for this
RSS ring and adds RSS ring 1 to the list of rings needing buffer
transfers.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigb: support for VF configuration tools
Williams, Mitch A [Wed, 10 Feb 2010 01:44:24 +0000 (01:44 +0000)]
igb: support for VF configuration tools

Add support to the igb driver for VF configuration mechanisms through the
PF interface.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agortnetlink: Add VF config code to rtnetlink
Williams, Mitch A [Wed, 10 Feb 2010 01:44:05 +0000 (01:44 +0000)]
rtnetlink: Add VF config code to rtnetlink

Add code to allow rtnetlink clients to query and set VF information through
the PF driver.
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Add netdev ops for SR-IOV configuration
Williams, Mitch A [Wed, 10 Feb 2010 01:43:46 +0000 (01:43 +0000)]
net: Add netdev ops for SR-IOV configuration

Add netdev ops for configuring SR-IOV VF devices through the PF driver.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoif_link: Add SR-IOV configuration methods
Williams, Mitch A [Wed, 10 Feb 2010 01:43:24 +0000 (01:43 +0000)]
if_link: Add SR-IOV configuration methods

Add SR-IOV VF management methods to IFLA_LINKINFO. This allows userspace to
use rtnetlink to configure VF network devices.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopci: Add SR-IOV convenience functions and macros
Williams, Mitch A [Wed, 10 Feb 2010 01:43:04 +0000 (01:43 +0000)]
pci: Add SR-IOV convenience functions and macros

Add and export pci_num_vf to allow other subsystems to determine how many
virtual function devices are associated with an SR-IOV physical function
device.
Add macros dev_is_pci, dev_is_ps, and dev_num_vf to make it easier for
non-PCI specific code to determine SR-IOV capabilities.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoudp: remove redundant variable
Gerrit Renker [Wed, 10 Feb 2010 20:26:19 +0000 (20:26 +0000)]
udp: remove redundant variable

The variable 'copied' is used in udp_recvmsg() to emphasize that the passed
'len' is adjusted to fit the actual datagram length. But the same can be
done by adjusting 'len' directly. This patch thus removes the indirection.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodccp: support for passing MSG_TRUNC
Gerrit Renker [Wed, 10 Feb 2010 20:26:18 +0000 (20:26 +0000)]
dccp: support for passing MSG_TRUNC

DCCP is datagram-oriented but lacks UDP's support for MSG_TRUNC as defined in
recvmsg(2)/recv(2). Hence the following 'Hello world\0' receiver

  len = recv(fd, buf, 10, MSG_PEEK | MSG_TRUNC);

wrongly (always) returns 10, while in UDP it returns 12 as expected.
This patch adds the missing MSG_TRUNC support to recvmsg().

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: version 1.27
stephen hemminger [Fri, 12 Feb 2010 06:58:07 +0000 (06:58 +0000)]
sky2: version 1.27

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: Avoid down and up during sky2_reset
Mike McCormack [Fri, 12 Feb 2010 06:58:06 +0000 (06:58 +0000)]
sky2: Avoid down and up during sky2_reset

Rewrite sky2_reset to work with interrupts disabled and
 avoid freeing and reallocing memory.

The old code used sky2_down and sky2_up to implement sky2_reset,
 which meant interrupts could not be disabled, and the transmit and
 receive ring buffers would be free'd and reallocated.

To avoid the interrupt handler waking the transmit queue while
 we're doing a reset, it's better to have interrupts and NAPI
 polls disabled.

Note: Modified Mike's patch to do IRQ disable in sky2_down before
 calling sky2_hw_down - Stephen

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: Refactor sky2_down into two functions
Mike McCormack [Fri, 12 Feb 2010 06:58:05 +0000 (06:58 +0000)]
sky2: Refactor sky2_down into two functions

Create a sky2_hw_down that brings the hardware down.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminber <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: Refactor sky2_up into two functions
Mike McCormack [Fri, 12 Feb 2010 06:58:04 +0000 (06:58 +0000)]
sky2: Refactor sky2_up into two functions

Move hardware initialization into sky2_hw_up.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: Allocate initial skbs in sky2_alloc_buffers
Mike McCormack [Fri, 12 Feb 2010 06:58:03 +0000 (06:58 +0000)]
sky2: Allocate initial skbs in sky2_alloc_buffers

Allocate everything in one place so there's a single point
of failure in sky2_up, and sky2_rx_start can no longer fail.

Don't leave the hardware in a partially initialized state in the
case rx ring allocation fails.

As with the old code, the rx ring still needs to be fully
allocated for sky2_up to succeed.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: Factor out code to calculate packet sizes
Mike McCormack [Fri, 12 Feb 2010 06:58:02 +0000 (06:58 +0000)]
sky2: Factor out code to calculate packet sizes

Move code to calculate receive threshold and packet size out of
sky2_rx_start() so that is can be called from elsewhere easily.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: jumbo packet changes
stephen hemminger [Fri, 12 Feb 2010 06:58:01 +0000 (06:58 +0000)]
sky2: jumbo packet changes

Change how FIFO is programmed in jumbo mode (to match vendor driver).
Mostly cosmetic, the only register change is that the bits 22,23
are not programemd used.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: dont enable PME legacy mode
stephen hemminger [Fri, 12 Feb 2010 06:58:00 +0000 (06:58 +0000)]
sky2: dont enable PME legacy mode

This bit is not changed by vendor driver, and should be left alone.
The documentation implies this a debug bit.
  0 = WAKE# only asserted when VMAIN not available
  1 = WAKE# is depend on wake events and independent of VMAIN.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosky2: WoL changes
stephen hemminger [Fri, 12 Feb 2010 06:57:59 +0000 (06:57 +0000)]
sky2: WoL changes

Change Wake On Lan code to be similar to vendor driver. The definition
of Y2_HW_WOL_ON is confusing; what it means is transition to firmware SPI
setting when doing power change.

Since same code is done for both shutdown and suspend, use common
code path.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>