openwrt/staging/blogic.git
15 years agoigb: use packet buffer sizes from RXPBS register
Alexander Duyck [Tue, 27 Oct 2009 23:46:38 +0000 (23:46 +0000)]
igb: use packet buffer sizes from RXPBS register

This patch changes the configuration for 82576 so that it uses the actual
value of the 82576 rx packet buffer size instead of just assuming the
value.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: misc cleanups within igb_ethtool.c
Alexander Duyck [Tue, 27 Oct 2009 23:46:20 +0000 (23:46 +0000)]
igb: misc cleanups within igb_ethtool.c

This patch just goes thorugh and does several cleanups on igb_ethtool.c.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: cleanup some of the code related to hw timestamping
Alexander Duyck [Tue, 27 Oct 2009 23:46:01 +0000 (23:46 +0000)]
igb: cleanup some of the code related to hw timestamping

The code for the hw timestamping is a bit bulky and making some of the
functions difficult to read.  In order to clean things up a bit I am moving
the timestamping operations into seperate functions.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: add support for seperate tx-usecs setting in ethtool
Alexander Duyck [Tue, 27 Oct 2009 23:45:42 +0000 (23:45 +0000)]
igb: add support for seperate tx-usecs setting in ethtool

This patch adds support for a seperate tx-usecs interrupt moderation setting
in ethtool which is supported when tx and rx interrupt vectors are sperated.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Really allow RX checksum offload to be disabled
Ben Hutchings [Wed, 28 Oct 2009 09:50:44 +0000 (02:50 -0700)]
sfc: Really allow RX checksum offload to be disabled

We have never checked the efx_nic::rx_checksum_enabled flag everywhere
we should, and since the switch to GRO we don't check it anywhere.
It's simplest to check it in the one place where we initialise the
per-packet checksummed flag.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovxge: Configure the number of transmit descriptors per packet to MAX_SKB_FRAGS + 1.
Sreenivasa Honnur [Wed, 28 Oct 2009 09:46:54 +0000 (02:46 -0700)]
vxge: Configure the number of transmit descriptors per packet to MAX_SKB_FRAGS + 1.

- Configure the number of transmit descriptors per packet to MAX_SKB_FRAGS + 1.

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: fix builds for SYSFS=n or MODULES=n
Randy Dunlap [Mon, 26 Oct 2009 12:09:45 +0000 (12:09 +0000)]
netxen: fix builds for SYSFS=n or MODULES=n

When CONFIG_MODULES=n:
drivers/net/netxen/netxen_nic_main.c:2751: error: dereferencing pointer to incomplete type
drivers/net/netxen/netxen_nic_main.c:2764: error: dereferencing pointer to incomplete type

Also needs addition of <linux/sysfs.h> for sysfs function prototypes or
stubs when CONFIG_SYSFS=n.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogre: Optimize multiple unregistration
Eric Dumazet [Tue, 27 Oct 2009 07:07:16 +0000 (07:07 +0000)]
gre: Optimize multiple unregistration

Speedup module unloading by factorizing synchronize_rcu() calls

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipip: Optimize multiple unregistration
Eric Dumazet [Tue, 27 Oct 2009 07:06:59 +0000 (07:06 +0000)]
ipip: Optimize multiple unregistration

Speedup module unloading by factorizing synchronize_rcu() calls

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovlan: Optimize multiple unregistration
Eric Dumazet [Tue, 27 Oct 2009 07:06:49 +0000 (07:06 +0000)]
vlan: Optimize multiple unregistration

Use unregister_netdevice_many() to speedup master device unregister.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: add a list_head parameter to dellink() method
Eric Dumazet [Tue, 27 Oct 2009 07:06:36 +0000 (07:06 +0000)]
net: add a list_head parameter to dellink() method

Adding a list_head parameter to rtnl_link_ops->dellink() methods
allow us to queue devices on a list, in order to dismantle
them all at once.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Introduce unregister_netdevice_many()
Eric Dumazet [Tue, 27 Oct 2009 07:04:19 +0000 (07:04 +0000)]
net: Introduce unregister_netdevice_many()

Introduce rollback_registered_many() and unregister_netdevice_many()

rollback_registered_many() is able to perform necessary steps at device dismantle
time, factorizing two expensive synchronize_net() calls.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Introduce unregister_netdevice_queue()
Eric Dumazet [Tue, 27 Oct 2009 07:03:04 +0000 (07:03 +0000)]
net: Introduce unregister_netdevice_queue()

This patchs adds an unreg_list anchor to struct net_device, and
introduces an unregister_netdevice_queue() function, able to queue
a net_device to a list instead of immediately unregister it.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: cleanup "todo" code found in igb_ethtool.c
Alexander Duyck [Tue, 27 Oct 2009 15:55:41 +0000 (15:55 +0000)]
igb: cleanup "todo" code found in igb_ethtool.c

This patch moves some defines into the e1000_regs.h file since this is the
correct place for register defines and not inside of igb_ethtool.c

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: add single vector msi-x testing to interrupt test
Alexander Duyck [Tue, 27 Oct 2009 15:55:22 +0000 (15:55 +0000)]
igb: add single vector msi-x testing to interrupt test

This change adds testing of the first msix vector to the interrupt testing.
This should help with determining the cause of interrupt issues when they are
encountered.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: make ethtool use core xmit map and free functionality
Alexander Duyck [Tue, 27 Oct 2009 15:55:02 +0000 (15:55 +0000)]
igb: make ethtool use core xmit map and free functionality

This change adds a clean_rx/tx_irq type function call to the ethtool loopback
testing which allows us to test the core transmit and receive functionality in
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: David S. Miller <davem@davemloft.net>
15 years agoigb: make tx ring map and free functionality non-static
Alexander Duyck [Tue, 27 Oct 2009 15:54:43 +0000 (15:54 +0000)]
igb: make tx ring map and free functionality non-static

This change makes a minor change to the xmit_frame_ring_adv funcition in that
it moves 2 checks from it into the xmit_frame_adv since the checks were not
ring specific.  In addition it exports the xmit_frame_ring_adv and the
unmap_and_free_tx_resource calls so that they can be used by other code such
as the ethtool loopback testing calls.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: re-use ring configuration code in ethtool testing
Alexander Duyck [Tue, 27 Oct 2009 15:54:23 +0000 (15:54 +0000)]
igb: re-use ring configuration code in ethtool testing

Since all of the ring code is now specific to the ring instead of the adapter
struct it is possible to cut a large section of code out of the ethtool
testing configuraiton since we can just use the existing functions to
configure the rings.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: setup vlan tag replication stripping in igb_vmm_control
Alexander Duyck [Tue, 27 Oct 2009 15:54:04 +0000 (15:54 +0000)]
igb: setup vlan tag replication stripping in igb_vmm_control

This update adds vlan tag stripping for inter-vf communications to the
igb_vmm_control configuration function.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: delay VF reset notification until after interrupts are enabed
Alexander Duyck [Tue, 27 Oct 2009 15:53:45 +0000 (15:53 +0000)]
igb: delay VF reset notification until after interrupts are enabed

This update delays the VF reset notification until after interrupts are
enabled.  Otherwise there is a chance of having the VF try to reset itself too
soon and being ignored by the PF as a result.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: move the multiple receive queue configuration into seperate function
Alexander Duyck [Tue, 27 Oct 2009 15:53:25 +0000 (15:53 +0000)]
igb: move the multiple receive queue configuration into seperate function

This patch moves the multiple receive queue configuration into a seperate
function from igb_configure_rx.  We can essentially do the configuration for
the multiple receive queues just prior to enabling the RX and this will allow
us to seperate the queue enablement from the receive queue layout
configuration.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: place a pointer to the netdev struct in the ring itself
Alexander Duyck [Tue, 27 Oct 2009 15:53:06 +0000 (15:53 +0000)]
igb: place a pointer to the netdev struct in the ring itself

This change adds a pointer to the netdev to the ring itself.  The idea being
at some point in the future it will be possible to support multiple netdevs
from a single adapter struct.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: add a flags value to the ring
Alexander Duyck [Tue, 27 Oct 2009 15:52:46 +0000 (15:52 +0000)]
igb: add a flags value to the ring

This patch adds a flags value to the ring that cleans up some of the last
remaining items from the ring in order to help seperate it from the adapter
struct.  By implementing these flags it becomes possible for different rings
to support different functions such as rx checksumming.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: move alloc_failed and csum_err stats into per rx-ring stat
Alexander Duyck [Tue, 27 Oct 2009 15:52:27 +0000 (15:52 +0000)]
igb: move alloc_failed and csum_err stats into per rx-ring stat

The allocation failed and checksum error stats are currently kept as a
global stat.  If we end up allocating the queues to multiple netdevs then
the global counter doesn't make much sense.  For this reason I felt it
necessary to move the alloc_rx_buff_failed stat into the rx_stats
portion of the rx_ring.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: move rx_buffer_len into the ring structure
Alexander Duyck [Tue, 27 Oct 2009 15:52:07 +0000 (15:52 +0000)]
igb: move rx_buffer_len into the ring structure

This patch moves the rx_buffer_len value into the ring structure.  This allows
greater flexibility and the option of doing things such as supporting packet
split only on some queues, or enabling virtualization.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: add pci device pointer to ring structure
Alexander Duyck [Tue, 27 Oct 2009 15:51:47 +0000 (15:51 +0000)]
igb: add pci device pointer to ring structure

This patch adds a pci device pointer to the ring structure.  The main use of
this pointer is for memory mapping/unmapping of the rings.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: change the head and tail offsets into pointers
Alexander Duyck [Tue, 27 Oct 2009 15:51:27 +0000 (15:51 +0000)]
igb: change the head and tail offsets into pointers

Since we are writting to the head/tail pointers frequently we might as well
save ourselves some processing time by converting the head and tail offsets
directly to pointers.  This will shave a few cycles off the rx/tx path and
allows us to move one step closer to the rings being a bit more independant of
each other.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: move SRRCTL register configuration into ring specific config
Alexander Duyck [Tue, 27 Oct 2009 15:51:07 +0000 (15:51 +0000)]
igb: move SRRCTL register configuration into ring specific config

The SRRCTL register exists per ring.  Instead of configuring all of them in
the RCTL configuration which is meant to be global it makes more sense to move
this out into the ring specific configuration.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: remove rx_ps_hdr_len
Alexander Duyck [Tue, 27 Oct 2009 15:50:48 +0000 (15:50 +0000)]
igb: remove rx_ps_hdr_len

This patch removes the rx_ps_hdr_len which isn't really needed since we can
now use rx_buffer_len less than 1K to indicate that we are in a packet split
mode.  We also don't need it since we always use a half page for the data
buffers when receiving so we always know the size to map/unmap.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: move the tx and rx ring specific config into seperate functions
Alexander Duyck [Tue, 27 Oct 2009 15:50:29 +0000 (15:50 +0000)]
igb: move the tx and rx ring specific config into seperate functions

This change makes the tx and rx config a bit cleaner by breaking out the ring
specific configuration from the generic rx and tx configuration.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: increase minimum rx buffer size to 1K
Alexander Duyck [Tue, 27 Oct 2009 15:50:08 +0000 (15:50 +0000)]
igb: increase minimum rx buffer size to 1K

This update increases the minimum rx buffer size to 1K.  The reason for this
change is to support SR-IOV and avoid any conflicts with the rings being able
to set their own MTU sizes.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: remove rx checksum good counter
Alexander Duyck [Tue, 27 Oct 2009 15:49:49 +0000 (15:49 +0000)]
igb: remove rx checksum good counter

Counting packets with a good checksum can cause a significant amount of cache
line bouncing due to the shared counter being written to by all of the queues.
In order to avoid this I am removing the counter since we still have the
checksum failed counter which will tell us if there are any issues.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: add new data structure for handling interrupts and NAPI
Alexander Duyck [Tue, 27 Oct 2009 15:49:27 +0000 (15:49 +0000)]
igb: add new data structure for handling interrupts and NAPI

Add a new igb_q_vector data structure to handle interrupts and NAPI.  This
helps to abstract the rings away from the adapter struct.  In addition it
allows for a bit of consolidation since a tx and rx ring can share a
q_vector.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatl1c: duplicate atl1c_get_tpd
Jie Yang [Wed, 28 Oct 2009 05:31:19 +0000 (22:31 -0700)]
atl1c: duplicate atl1c_get_tpd

remove duplicate atl1c_get_tpd, it may cause hardware to send wrong packets.

Signed-off-by: Jie Yang <jie.yang@atheros.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: Remove bond_dev from xmit_hash_policy call.
Jasper Spaans [Fri, 23 Oct 2009 04:09:24 +0000 (04:09 +0000)]
bonding: Remove bond_dev from xmit_hash_policy call.

Now that the bonding device is no longer used in determining the device to
which to send packets, it can be dropped from the argument list of the various
xmit_hash_policy calls.

Signed-off-by: Jasper Spaans <spaans@fox-it.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Tue, 27 Oct 2009 08:03:26 +0000 (01:03 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/sh_eth.c

15 years agovlan: allow null VLAN ID to be used
Eric Dumazet [Tue, 27 Oct 2009 01:40:35 +0000 (18:40 -0700)]
vlan: allow null VLAN ID to be used

We currently use a 16 bit field (vlan_tci) to store VLAN ID/PRIO on a skb.

Null value is used as a special value, meaning vlan tagging not enabled.
This forbids use of null vlan ID.

As pointed by David, some drivers use the 3 high order bits (PRIO)

As VLAN ID is 12 bits, we can use the remaining bit (CFI) as a flag, and
allow null VLAN ID.

In case future code really wants to use VLAN_CFI_MASK, we'll have to use
a bit outside of vlan_tci.

#define VLAN_PRIO_MASK         0xe000 /* Priority Code Point */
#define VLAN_PRIO_SHIFT        13
#define VLAN_CFI_MASK          0x1000 /* Canonical Format Indicator */
#define VLAN_TAG_PRESENT       VLAN_CFI_MASK
#define VLAN_VID_MASK          0x0fff /* VLAN Identifier */

Reported-by: Gertjan Hofman <gertjan_hofman@yahoo.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocan: sja1000: fix bug using library functions for skb allocation
Kurt Van Dijck [Tue, 27 Oct 2009 00:33:59 +0000 (17:33 -0700)]
can: sja1000: fix bug using library functions for skb allocation

Commit 7b6856a0 "can: provide library functions for skb allocation"
did not properly remove two lines of the SJA1000 driver resulting in
a 'skb_over_panic' when calling skb_put, as reported by Kurt.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: Set the rxq
Krishna Kumar [Fri, 23 Oct 2009 01:13:21 +0000 (01:13 +0000)]
cxgb3: Set the rxq

Set the rxq# for LRO when processing the last fragment of a
frame. This helps in fast txq selection for routing workloads.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosh_eth: Add asm/cacheflush.h
Nobuhiro Iwamatsu [Mon, 26 Oct 2009 13:49:50 +0000 (13:49 +0000)]
sh_eth: Add asm/cacheflush.h

Add include asm/cacheflush.h,  because declaration of __flush_purge_region
moved to asm/cacheflush.h.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoPPPoE: Fix flush/close races.
Michal Ostrowski [Mon, 26 Oct 2009 23:23:20 +0000 (16:23 -0700)]
PPPoE: Fix flush/close races.

Be more careful about the state of pointers during tear-down.
The "pppoe_dev" field can only be looked at safely while holding socket locks.
This subsequently allows for the flush_lock to be killed.

We depend on the PPPOX_CONNECTED state to tell us that that those fields are
valid, so whoever clears that state (pppox_unbind_sock()) is responsible for
the dev_put() call.

We also have to ensure that we delete_item() on all sockets before they are
cleaned up.

The need for these changes has been exposed by scenarios wherein namespace
bindings of ethernet devices change while there are ongoing PPPoE sessions,
which resulted in oopses due to unusual socket connection termination paths,
exposing these issues.

Signed-off-by: Michal Ostrowski <mostrows@gmail.com>
Reviewed-by: Cyril Gorcunov <gorcunov@gmail.com>
Reported-by: Denys Fedoryschenko <denys@visp.net.lb>
Tested-by: Denys Fedoryschenko <denys@visp.net.lb>
15 years agoe1000e: allow for swflag to be held over consecutive PHY accesses
Bruce Allan [Mon, 26 Oct 2009 11:24:02 +0000 (11:24 +0000)]
e1000e: allow for swflag to be held over consecutive PHY accesses

PCH-based parts (82577/82578) and some ICH8-based parts (82566) need to
hold the swflag (sw/fw/hw hardware semaphore) over consecutive PHY accesses
in order to perform sw-driven PHY configuration during initialization to
workaround known hardware issues (see follow-on patch).  This patch
provides new PHY read/write functions (and function pointers) that will
allow accessing the PHY registers assuming the swflag has already been
acquired.  The actual PHY register access code has moved into helper
functions that are called with a flag indicating whether or not the swflag
has already been acquired and acquires/releases it if not.

The functions called from within the updated PHY access functions had to be
updated to assume the swflag was already acquired, and other functions that
called those functions were also updated to acquire/release the swflag.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: separate mutex usage between NVM and PHY/CSR register for ICHx/PCH
Bruce Allan [Mon, 26 Oct 2009 11:23:43 +0000 (11:23 +0000)]
e1000e: separate mutex usage between NVM and PHY/CSR register for ICHx/PCH

Accesses to NVM and PHY/CSR registers on ICHx/PCH-based parts are protected
from concurrent accesses with a mutex that is acquired when the access is
initiated and released when the access has completed.  However, the two
types of accesses should not be protected by the same mutex because the
driver may have to access the NVM while already holding the mutex over
several consecutive PHY/CSR accesses which would result in livelock.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: 82577/82578 requires a different method to configure LPLU
Bruce Allan [Mon, 26 Oct 2009 11:23:25 +0000 (11:23 +0000)]
e1000e: 82577/82578 requires a different method to configure LPLU

Unlike previous ICHx-based parts, the PCH-based parts (82577/82578) require
LPLU (Low Power Link Up, or "reverse auto-negotiation") to be configured in
the PHY rather than the MAC.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: increase swflag acquisition timeout for ICHx/PCH
Bruce Allan [Mon, 26 Oct 2009 11:23:06 +0000 (11:23 +0000)]
e1000e: increase swflag acquisition timeout for ICHx/PCH

In some conditions (e.g. when AMT is enabled on the system), it is possible
to take an extended period of time to for the driver to acquire the sw/fw/hw
hardware semaphore used to protect against concurrent access of a shared
resource (e.g. PHY registers).  This could cause PHY registers to not get
configured properly resulting in link issues.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: clear PHY wakeup bit after LCD reset on 82577/82578
Bruce Allan [Mon, 26 Oct 2009 11:22:47 +0000 (11:22 +0000)]
e1000e: clear PHY wakeup bit after LCD reset on 82577/82578

Performing a dummy read of the PHY Wakeup Control (WUC) register clears the
wakeup enable bit set by an PHY reset.  If this bit remains set, link
problems may occur.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigbvf: fix memory leak when ring size changed while interface down
Alexander Duyck [Mon, 26 Oct 2009 11:32:25 +0000 (11:32 +0000)]
igbvf: fix memory leak when ring size changed while interface down

This patch resolves a memory leak which occurs while changing the ring size
while the interface is down.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: fix memory leak when resizing rings while interface is down
Alexander Duyck [Mon, 26 Oct 2009 11:32:05 +0000 (11:32 +0000)]
ixgbe: fix memory leak when resizing rings while interface is down

This patch resolves a memory leak that occurs when you resize the rings via
the ethtool -G option while the interface is down.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: fix memory leak when setting ring size while interface is down
Alexander Duyck [Mon, 26 Oct 2009 11:31:47 +0000 (11:31 +0000)]
igb: fix memory leak when setting ring size while interface is down

Changing ring sizes while the interface was down was causing a double
allocation of the receive and transmit rings.  This issue is amplified when
there are multiple rings enabled.  To prevent this we need to add an
additional check which will just update the ring counts when the interface
is not up and skip the allocation steps.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: Modify hash transmit policies to use the packet's source MAC address
Jasper Spaans [Fri, 23 Oct 2009 04:08:46 +0000 (04:08 +0000)]
bonding: Modify hash transmit policies to use the packet's source MAC address

Modify bonding hash transmit policies to use the psource MAC address of
the packet instead of the MAC address configured for the bonding device.

The old sitation conflicts with the documentation.

Signed-off-by: Jasper Spaans <spaans@fox-it.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopktgen: Dont leak kernel memory
Eric Dumazet [Sat, 24 Oct 2009 13:55:20 +0000 (06:55 -0700)]
pktgen: Dont leak kernel memory

While playing with pktgen, I realized IP ID was not filled and a
random value was taken, possibly leaking 2 bytes of kernel memory.

We can use an increasing ID, this can help diagnostics anyway.

Also clear packet payload, instead of leaking kernel memory.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoDM9000: Fix revision ID for DM9000B
Ben Dooks [Sat, 24 Oct 2009 13:53:07 +0000 (06:53 -0700)]
DM9000: Fix revision ID for DM9000B

The DM9000B revision ID is 0x1A, not 0x1B as set in the curernt
dm9000.h header.

Fix bug reported by Paolo Zebelloni.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Simtec Linux Team <linux@simtec.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agor8169: fix Ethernet Hangup for RTL8110SC rev d
Simon Wunderlich [Sat, 24 Oct 2009 13:47:33 +0000 (06:47 -0700)]
r8169: fix Ethernet Hangup for RTL8110SC rev d

The 8110SC rev d chip on our board shows a regression which the 8110SB chip
did not have. When inbound traffic is overflowing the receive descriptor queue,
"holes" in the ring buffer may occur which lead to a hangup until the buffer
is filled again. The packets are than completely processed, but the ring
remains porous and no packets are processed until the next overflow. Setting
the interface down and up can fix the problem temporary from userspace.

For some reason we don't know, this behaviour is not occuring if the RxVlan
bit for hardware VLAN untagging is set. There is another "Work around for
AMD plateform" in the current code which checks the VLAN status
word in receive descriptors, but does never come to effect when hardware
VLAN support is enabled. We assume that this is a bug in the chip.

The following patch fixes the problem. Without the patch we could reproduce
the hang within minutes (given other devices also generating lots of
interrupts), without we couldn't reproduce within a few days of long term
testing.

This version contains minor style adjustments and is sent with mutt which
will hopefully not destroy the formatting again.

Signed-off-by: Bernhard Schmidt <bernhard.schmidt@saxnet.de>
Signed-off-by: Simon Wunderlich <simon.wunderlich@saxnet.de>
Acked-by: Francois Romieu <romieu@zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agortnetlink: speedup rtnl_dump_ifinfo()
Eric Dumazet [Sat, 24 Oct 2009 13:13:17 +0000 (06:13 -0700)]
rtnetlink: speedup rtnl_dump_ifinfo()

When handling large number of netdevice, rtnl_dump_ifinfo()
is very slow because it has O(N^2) complexity.

Instead of scanning one single list, we can use the 256 sub lists
of the dev_index hash table.

This considerably speedups "ip link" operations

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogre: convert hash tables locking to RCU
Eric Dumazet [Fri, 23 Oct 2009 06:14:38 +0000 (06:14 +0000)]
gre: convert hash tables locking to RCU

GRE tunnels use one rwlock to protect their hash tables.

This locking scheme can be converted to RCU for free, since netdevice
already must wait for a RCU grace period at dismantle time.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoip6tnl: convert hash tables locking to RCU
Eric Dumazet [Fri, 23 Oct 2009 06:34:34 +0000 (06:34 +0000)]
ip6tnl: convert hash tables locking to RCU

ip6_tunnels use one rwlock to protect their hash tables.

This locking scheme can be converted to RCU for free, since netdevice
already must wait for a RCU grace period at dismantle time.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipip: convert hash tables locking to RCU
Eric Dumazet [Fri, 23 Oct 2009 05:42:02 +0000 (05:42 +0000)]
ipip: convert hash tables locking to RCU

IPIP tunnels use one rwlock to protect their hash tables.

This locking scheme can be converted to RCU for free, since netdevice
already must wait for a RCU grace period at dismantle time.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoxfrm6_tunnel: RCU conversion
Eric Dumazet [Fri, 23 Oct 2009 18:19:19 +0000 (18:19 +0000)]
xfrm6_tunnel: RCU conversion

xfrm6_tunnels use one rwlock to protect their hash tables.

Plain and straightforward conversion to RCU locking to permit better SMP
performance.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv6 sit: RCU conversion phase II
Eric Dumazet [Fri, 23 Oct 2009 17:52:14 +0000 (17:52 +0000)]
ipv6 sit: RCU conversion phase II

SIT tunnels use one rwlock to protect their hash tables.

This locking scheme can be converted to RCU for free, since netdevice
already must wait for a RCU grace period at dismantle time.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv6 sit: RCU conversion phase I
Eric Dumazet [Fri, 23 Oct 2009 17:51:26 +0000 (17:51 +0000)]
ipv6 sit: RCU conversion phase I

SIT tunnels use one rwlock to protect their prl entries.

This first patch adds RCU locking for prl management,
with standard call_rcu() calls.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Rename 'xfp' file and functions to reflect reality
Ben Hutchings [Fri, 23 Oct 2009 08:33:42 +0000 (08:33 +0000)]
sfc: Rename 'xfp' file and functions to reflect reality

The 'XFP' driver is really a driver for the QT2022C2 and QT2025C PHYs,
covering both more and less than XFP.  Rename its functions and
constants to reflect reality and to reduce namespace pollution when
sfc is a built-in driver.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Remove unused code for non-autoneg speed/duplex switching
Ben Hutchings [Fri, 23 Oct 2009 08:33:27 +0000 (08:33 +0000)]
sfc: Remove unused code for non-autoneg speed/duplex switching

The only multi-speed PHY driver using this is 10Xpress, and it does
not support non-autoneg operation.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Merge efx_fc_resolve() into efx_mdio_get_pause()
Ben Hutchings [Fri, 23 Oct 2009 08:33:17 +0000 (08:33 +0000)]
sfc: Merge efx_fc_resolve() into efx_mdio_get_pause()

efx_fc_resolve() is specific to MDIO and is not used by any other
function.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Move MTD probe after netdev registration and name allocation
Ben Hutchings [Fri, 23 Oct 2009 08:33:09 +0000 (08:33 +0000)]
sfc: Move MTD probe after netdev registration and name allocation

The MTD partition is named based on the netdev name, which is set to
'eth%d' before registration.  Also, the MTD partition will currently
be left registered if netdev registration fails.

Fix both these problems by moving the MTD probe after netdev
registration.  Hold the RTNL to serialise this with the netdev
notifier that calls efx_mtd_rename().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Remove unnecessary tests of efx->membase
Ben Hutchings [Fri, 23 Oct 2009 08:33:00 +0000 (08:33 +0000)]
sfc: Remove unnecessary tests of efx->membase

These cleanup functions will never be called if the MMIO region could
not be mapped.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Remove incorrect assertion from efx_pci_remove_main()
Ben Hutchings [Fri, 23 Oct 2009 08:32:51 +0000 (08:32 +0000)]
sfc: Remove incorrect assertion from efx_pci_remove_main()

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Merge falcon_probe_phy() into falcon_probe_port()
Ben Hutchings [Fri, 23 Oct 2009 08:32:42 +0000 (08:32 +0000)]
sfc: Merge falcon_probe_phy() into falcon_probe_port()

MAC and PHY probing are bound up together, as evidenced by the
initialisation of efx_nic::loopback_modes.  Remove the current
arbitrary separation.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Remove pointless abstraction of memory BAR number
Ben Hutchings [Fri, 23 Oct 2009 08:32:33 +0000 (08:32 +0000)]
sfc: Remove pointless abstraction of memory BAR number

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Removed kernel-doc for nonexistent member of efx_phy_operations
Ben Hutchings [Fri, 23 Oct 2009 08:32:22 +0000 (08:32 +0000)]
sfc: Removed kernel-doc for nonexistent member of efx_phy_operations

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Maintain interrupt moderation values in ticks, not microseconds
Ben Hutchings [Fri, 23 Oct 2009 08:32:13 +0000 (08:32 +0000)]
sfc: Maintain interrupt moderation values in ticks, not microseconds

This simplifies the implementation a lot.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Move shared members of struct falcon_nic_data into struct efx_nic
Ben Hutchings [Fri, 23 Oct 2009 08:32:04 +0000 (08:32 +0000)]
sfc: Move shared members of struct falcon_nic_data into struct efx_nic

These will also be used with Siena NICs.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Move efx_xmit_done() declaration into correct stanza
Ben Hutchings [Fri, 23 Oct 2009 08:31:54 +0000 (08:31 +0000)]
sfc: Move efx_xmit_done() declaration into correct stanza

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Remove declarations of nonexistent functions
Ben Hutchings [Fri, 23 Oct 2009 08:31:46 +0000 (08:31 +0000)]
sfc: Remove declarations of nonexistent functions

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Change order of device removal to reverse of probe order
Ben Hutchings [Fri, 23 Oct 2009 08:31:37 +0000 (08:31 +0000)]
sfc: Change order of device removal to reverse of probe order

This makes efx_pci_remove_main() more obviously the inverse of
efx_pci_probe_main(), and matches our out-of-tree driver.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Merge struct efx_blinker into struct efx_board
Ben Hutchings [Fri, 23 Oct 2009 08:31:29 +0000 (08:31 +0000)]
sfc: Merge struct efx_blinker into struct efx_board

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Move all TX DMA length limiting into tx.c
Ben Hutchings [Fri, 23 Oct 2009 08:31:20 +0000 (08:31 +0000)]
sfc: Move all TX DMA length limiting into tx.c

Replace the duplicated logic in efx_enqueue_skb() and
efx_tx_queue_insert() with an inline function, efx_max_tx_len().

Remove the failed attempt at abstracting hardware-specifics and put
all the magic numbers in efx_max_tx_len().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Define DMA address mask explicitly in terms of descriptor field width
Ben Hutchings [Fri, 23 Oct 2009 08:31:07 +0000 (08:31 +0000)]
sfc: Define DMA address mask explicitly in terms of descriptor field width

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Eliminate indirect lookups of queue size constants
Ben Hutchings [Fri, 23 Oct 2009 08:30:58 +0000 (08:30 +0000)]
sfc: Eliminate indirect lookups of queue size constants

Move size and mask definitions into efx.h; calculate page orders in falcon.c.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Rename register I/O header and functions used by both Falcon and Siena
Ben Hutchings [Fri, 23 Oct 2009 08:30:46 +0000 (08:30 +0000)]
sfc: Rename register I/O header and functions used by both Falcon and Siena

While we're at it, use type suffixes of 'd', 'q' and 'o', consistent
with register type names.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Update hardware definitions for Siena
Ben Hutchings [Fri, 23 Oct 2009 08:30:36 +0000 (08:30 +0000)]
sfc: Update hardware definitions for Siena

Siena is still based on the Falcon hardware architecture and will
share many of these definitions, so replace falcon_hwdefs.h with
regs.h.

The new definitions have been generated according to a naming
convention which incorporates the type and revision information.
Update the code accordingly.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Move RX data FIFO thresholds out of struct efx_nic_type
Ben Hutchings [Fri, 23 Oct 2009 08:30:17 +0000 (08:30 +0000)]
sfc: Move RX data FIFO thresholds out of struct efx_nic_type

Since there are now separate blocks of code to set the thresholds for
each NIC type, it is no longer useful to include them in the NIC type
description.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Remove versioned bitfield macros
Ben Hutchings [Fri, 23 Oct 2009 08:30:06 +0000 (08:30 +0000)]
sfc: Remove versioned bitfield macros

These macros are not extensible to more than two NIC types without
repetition of register definitions, and they are only used to deal
with a few fields in RX_CFG_REG and global events which moved between
Falcon rev A1 and B0.

Therefore:
- Move RX_CFG_REG initialisation into its own function which tests the
  NIC revision just once
- Explicitly test the NIC revision when checking the RX_RECOVERY flag in
  global events
- Merge definitions of RX_XOFF_MAC_EN flag, which did not move
- Remove the macro definitions

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Remove boards.h, moving last remaining declaration to falcon.h
Ben Hutchings [Fri, 23 Oct 2009 08:29:51 +0000 (08:29 +0000)]
sfc: Remove boards.h, moving last remaining declaration to falcon.h

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Merge sfe4001.c into falcon_boards.c
Ben Hutchings [Fri, 23 Oct 2009 08:29:33 +0000 (08:29 +0000)]
sfc: Merge sfe4001.c into falcon_boards.c

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Rename Falcon-specific board code and types
Ben Hutchings [Fri, 23 Oct 2009 08:29:16 +0000 (08:29 +0000)]
sfc: Rename Falcon-specific board code and types

Siena will require entirely different board code.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Remove redundant hardware initialisation
Ben Hutchings [Fri, 23 Oct 2009 08:28:53 +0000 (08:28 +0000)]
sfc: Remove redundant hardware initialisation

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Remove redundant header gmii.h
Ben Hutchings [Fri, 23 Oct 2009 08:28:45 +0000 (08:28 +0000)]
sfc: Remove redundant header gmii.h

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopkt_sched: skbedit add support for setting mark
jamal [Thu, 15 Oct 2009 03:09:18 +0000 (03:09 +0000)]
pkt_sched: skbedit add support for setting mark

This adds support for setting the skb mark.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoifb: should not use __dev_get_by_index() without locks
Eric Dumazet [Tue, 20 Oct 2009 02:35:50 +0000 (02:35 +0000)]
ifb: should not use __dev_get_by_index() without locks

At this point (ri_tasklet()), RTNL or dev_base_lock are not held,
we must use dev_get_by_index() instead of __dev_get_by_index()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: au1000_eth: add missing capability.h
Manuel Lauss [Sat, 17 Oct 2009 02:00:07 +0000 (02:00 +0000)]
net: au1000_eth: add missing capability.h

fixes the following build failure:
  CC      drivers/net/au1000_eth.o
/drivers/net/au1000_eth.c: In function 'au1000_set_settings':
/drivers/net/au1000_eth.c:623: error: implicit declaration of function 'capable'
/drivers/net/au1000_eth.c:623: error: 'CAP_NET_ADMIN' undeclared (first use in this function)
/drivers/net/au1000_eth.c:623: error: (Each undeclared identifier is reported only once
/drivers/net/au1000_eth.c:623: error: for each function it appears in.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: improve port type reporting in ethtool
Brice Goglin [Fri, 23 Oct 2009 04:43:43 +0000 (21:43 -0700)]
myri10ge: improve port type reporting in ethtool

Improve the reporting of myri10ge port type in ethtool,
and update for new boards.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: use WARN() for the WARN_ON in commit b6b39e8f3fbbb
Arjan van de Ven [Fri, 23 Oct 2009 04:37:56 +0000 (21:37 -0700)]
net: use WARN() for the WARN_ON in commit b6b39e8f3fbbb

Commit b6b39e8f3fbbb (tcp: Try to catch MSG_PEEK bug) added a printk()
to the WARN_ON() that's in tcp.c. This patch changes this combination
to WARN(); the advantage of WARN() is that the printk message shows up
inside the message, so that kerneloops.org will collect the message.

In addition, this gets rid of an extra if() statement.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe1000e: reset the PHY on 82577/82578 when going to Sx
Bruce Allan [Fri, 23 Oct 2009 04:22:18 +0000 (21:22 -0700)]
e1000e: reset the PHY on 82577/82578 when going to Sx

The PHY on 82577/82578 parts needs a soft reset when transitioning to Sx
state in order for the PHY write which disables gigabit speed to take
effect.  Gigabit speed must be disabled in order for the PHY writes to
registers on page 800 (the wakeup control registers) to work as expected
otherwise the system might not wake via WoL.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: 10Xpress: Report support for pause frames
Ben Hutchings [Fri, 23 Oct 2009 01:31:39 +0000 (18:31 -0700)]
sfc: 10Xpress: Report support for pause frames

Commits 27fbc7d 'mdio: Expose pause frame advertising flags to ethtool'
and c634263 'sfc: 10Xpress: Initialise pause advertising flags'
added to our reported advertising flags.

efx_mdio_set_settings() requires that all advertising flags are
also present in the supported flags, so make sure that is true.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoisdn: fix possible circular locking dependency
Xiaotian Feng [Wed, 21 Oct 2009 23:07:04 +0000 (23:07 +0000)]
isdn: fix possible circular locking dependency

There's a circular locking dependency:

---> isdn_net_get_locked_lp
    --->lock &nd->queue_lock
    --->lock &nd->queue->xmit_lock
    .....................
    ---->unlock &nd->queue_lock

---> isdn_net_writebuf_skb (called with &nd->queue->xmit_lock locked)
    ---->isdn_net_inc_frame_cnt
         ---->isdn_net_device_busy
              ----> lock &nd->queue_lock

This will trigger lockdep warnings:

 =======================================================
 [ INFO: possible circular locking dependency detected ]
 2.6.32-rc4-testing #7
 -------------------------------------------------------
 ipppd/28379 is trying to acquire lock:
 (&netdev->queue_lock){......}, at: [<e62ad0fd>] isdn_net_device_busy+0x2c/0x74 [isdn]

 but task is already holding lock:
 (&netdev->local->xmit_lock){+.....}, at: [<e62aefc2>] isdn_net_write_super+0x3f/0x6e [isdn]

 which lock already depends on the new lock.
 .......

 We don't need to lock nd->queue->xmit_lock to protect single
isdn_net_lp_busy(). This can fix above lockdep warnings.

Reported-and-tested-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Xiaotian Feng <xtfeng@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: avoid undue board config check
Dhananjay Phadke [Wed, 21 Oct 2009 19:39:03 +0000 (19:39 +0000)]
netxen: avoid undue board config check

Old code assumed board config version in the flash to be 1.
When this will get changed by tools, driver just refuses to
attach. This is unnecessary since driver does not have to
parse board config structure directly (maintained by firmware).

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: fix tx timeout handling on firmware hang
Amit Kumar Salecha [Wed, 21 Oct 2009 19:39:02 +0000 (19:39 +0000)]
netxen: fix tx timeout handling on firmware hang

Clear NX_RESETING bit in netxen_tx_timeout_task() so that
the firmware watchdog task can catch need_reset request
from tx timeout.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: fix i2c init
Dhananjay Phadke [Wed, 21 Oct 2009 19:39:01 +0000 (19:39 +0000)]
netxen: fix i2c init

Avoid resetting subsys ID in i2c block. Also remove duplicate
check for address tranlsation error.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agortnetlink: rtnl_setlink() and rtnl_getlink() changes
Eric Dumazet [Wed, 21 Oct 2009 10:59:31 +0000 (10:59 +0000)]
rtnetlink: rtnl_setlink() and rtnl_getlink() changes

rtnl_getlink() & rtnl_setlink() run with RTNL held, we can use
__dev_get_by_index() and __dev_get_by_name() variants and avoid
dev_hold()/dev_put()

Adds to rtnl_getlink() the capability to find a device by its name,
not only by its index.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Add ethtool register dump function.
Ron Mercer [Wed, 21 Oct 2009 11:07:41 +0000 (11:07 +0000)]
qlge: Add ethtool register dump function.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>