Tom Herbert [Mon, 18 Oct 2010 18:04:39 +0000 (18:04 +0000)]
net: allocate tx queues in register_netdevice
This patch introduces netif_alloc_netdev_queues which is called from
register_device instead of alloc_netdev_mq. This makes TX queue
allocation symmetric with RX allocation. Also, queue locks allocation
is done in netdev_init_one_queue. Change set_real_num_tx_queues to
fail if requested number < 1 or greater than number of allocated
queues.
Signed-off-by: Tom Herbert <therbert@google.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Mon, 18 Oct 2010 18:00:16 +0000 (18:00 +0000)]
net: cleanups in RX queue allocation
Clean up in RX queue allocation. In netif_set_real_num_rx_queues
return error on attempt to set zero queues, or requested number is
greater than number of allocated queues. In netif_alloc_rx_queues,
do BUG_ON if queue_count is zero.
Signed-off-by: Tom Herbert <therbert@google.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Neil Horman [Tue, 19 Oct 2010 07:04:26 +0000 (07:04 +0000)]
netpoll: Revert napi_poll fix for bonding driver
In an erlier patch I modified napi_poll so that devices with IFF_MASTER polled
the per_cpu list instead of the device list for napi. I did this because the
bonding driver has no napi instances to poll, it instead expects to check the
slave devices napi instances, which napi_poll was unaware of. Looking at this
more closely however, I now see this isn't strictly needed. As the bond driver
poll_controller calls the slaves poll_controller via netpoll_poll_dev, which
recursively calls poll_napi on each slave, allowing those napi instances to get
serviced. The earlier patch isn't at all harmfull, its just not needed, so lets
revert it to make the code cleaner. Sorry for the noise,
Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: WANG Cong <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
It occurs because of my recent netpoll blocking patches, which I added to avoid
recursive deadlock in the bonding driver. It relies on some per cpu bits, but
the shutdown path forces some rescheduling as we cancel workqueues for the
driver and wait for some device refcounts. If after the forced reschedule, we
wind up on a different cpu we trigger the bughalt in unblock_netpoll_tx.
The fix is to remove the netpoll block/unblock calls from bond_release_all.
This is safe to do because bond_uninit, which is called via ndo_uninit in
rollback_registered_many, doesn't occur until we send a NETDEV_UNREGISTER event,
which triggers netconsole to remove us as a netpoll client, so we are guaranteed
not to recurse into our own tx path here.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: WANG Cong <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Dmitry Kravkov [Tue, 19 Oct 2010 05:13:00 +0000 (05:13 +0000)]
bnx2x: update version to 1.60.00-3
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Dmitry Kravkov [Tue, 19 Oct 2010 05:13:05 +0000 (05:13 +0000)]
bnx2x: fix possible deadlock in HC hw block
The possible deadlock (on 57710 devices only) will prevent from the
device to generate interrupts.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Paul Gortmaker [Thu, 14 Oct 2010 14:21:51 +0000 (14:21 +0000)]
3c52x: remove IRQF_SAMPLE_RANDOM from legacy MCA drivers.
If you are genuinely using one of these legacy MCA drivers
then you are tragically on hardware where you really don't
have the extra CPU cycles to be wasting on this.
In addition, it makes two less cases for people to inadvertently
blindly copy flags from without explicitly thinking whether it
makes sense -- see the addition to feature-removal.txt as per
commit 9d9b8fb0e5ebf4b0398e579f6061d4451fea3242.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Neil Horman [Wed, 13 Oct 2010 16:01:53 +0000 (16:01 +0000)]
bonding: Re-enable netpoll over bonding
With the inclusion of previous fixup patches, netpoll over bonding apears to
work reliably with failover conditions. This reverts Gospos previous commit c22d7ac844f1cb9c6a5fd20f89ebadc2feef891b, and allows access again to the netpoll
functionality in the bonding driver.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Neil Horman [Wed, 13 Oct 2010 16:01:52 +0000 (16:01 +0000)]
bonding: Fix netconsole to not deadlock on rmmod
Netconsole calls netpoll_cleanup on receipt of a NETDEVICE_UNREGISTER event.
The notifier subsystem calls these event handlers with rtnl_lock held, which
netpoll_cleanup also takes, resulting in deadlock. Fix this by calling the
__netpoll_cleanup interior function instead, and fixing up the additional
pointers.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Neil Horman [Wed, 13 Oct 2010 16:01:51 +0000 (16:01 +0000)]
bonding: Fix napi poll for bonding driver
Usually the netpoll path, when preforming a napi poll can get away with just
polling all the napi instances of the configured device. Thats not the case for
the bonding driver however, as the napi instances which may wind up getting
flagged as needing polling after the poll_controller call don't belong to the
bonded device, but rather to the slave devices. Fix this by checking the device
in question for the IFF_MASTER flag, if set, we know we need to check the full
poll list for this cpu, rather than just the devices napi instance list.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Neil Horman [Wed, 13 Oct 2010 16:01:50 +0000 (16:01 +0000)]
bonding: Fix deadlock in bonding driver resulting from internal locking when using netpoll
The monitoring paths in the bonding driver take write locks that are shared by
the tx path. If netconsole is in use, these paths can call printk which puts us
in the netpoll tx path, which, if netconsole is attached to the bonding driver,
result in deadlock (the xmit_lock guards are useless in netpoll_send_skb, as the
monitor paths in the bonding driver don't claim the xmit_lock, nor should they).
The solution is to use a per cpu flag internal to the driver to indicate when a
cpu is holding the lock in a path that might recusrse into the tx path for the
driver via netconsole. By checking this flag on transmit, we can defer the
sending of the netconsole frames until a later time using the retransmit feature
of netpoll_send_skb that is triggered on the return code NETDEV_TX_BUSY. I've
tested this and am able to transmit via netconsole while causing failover
conditions on the bond slave links.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Neil Horman [Wed, 13 Oct 2010 16:01:49 +0000 (16:01 +0000)]
bonding: Fix bonding drivers improper modification of netpoll structure
The bonding driver currently modifies the netpoll structure in its xmit path
while sending frames from netpoll. This is racy, as other cpus can access the
netpoll structure in parallel. Since the bonding driver points np->dev to a
slave device, other cpus can inadvertently attempt to send data directly to
slave devices, leading to improper locking with the bonding master, lost frames,
and deadlocks. This patch fixes that up.
This patch also removes the real_dev pointer from the netpoll structure as that
data is really only used by bonding in the poll_controller, and we can emulate
its behavior by check each slave for IS_UP.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Carolyn Wyborny [Fri, 15 Oct 2010 17:35:31 +0000 (17:35 +0000)]
e1000e: Fix for offline diag test failure at first call
Move link test call to later in the offline sequence, move the
restore settings block to afterwards and add another reset to ensure
the hardware is in a known state afterwards.
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Acked-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Fri, 15 Oct 2010 17:26:47 +0000 (17:26 +0000)]
igbvf: Remove unneeded pm_qos* calls
Power Management Quality of Service is not supported or used by the VF
driver.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Fri, 15 Oct 2010 17:27:10 +0000 (17:27 +0000)]
igb: fix stats handling
There are currently some problems with igb.
- On 32bit arches, maintaining 64bit counters without proper
synchronization between writers and readers.
- Stats updated every two seconds, as reported by Jesper.
(Jesper provided a patch for this)
- Potential problem between worker thread and ethtool -S
This patch uses u64_stats_sync, and convert everything to be 64bit safe,
SMP safe, even on 32bit arches. It integrates Jesper idea of providing
accurate stats at the time user reads them.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Tested-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Rajesh Borundia [Mon, 18 Oct 2010 02:03:41 +0000 (02:03 +0000)]
netxen: fix race in tx stop queue
There is race between netif_stop_queue and netif_stopped_queue
check.So check once again if buffers are available to avoid race.
With above logic we can also get rid of tx lock in process_cmd_ring.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Andy Walls [Sun, 17 Oct 2010 15:11:22 +0000 (15:11 +0000)]
IPv4: route.c: Change checks against 0xffffffff to ipv4_is_lbcast()
Change a few checks against the hardcoded broadcast address,
0xffffffff, to ipv4_is_lbcast(). Remove some existing checks
using ipv4_is_lbcast() that are now obviously superfluous.
Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Dmitry Kravkov [Sun, 17 Oct 2010 23:08:55 +0000 (23:08 +0000)]
bnx2x: update version to 1.60.00-2
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Dmitry Kravkov [Sun, 17 Oct 2010 23:09:30 +0000 (23:09 +0000)]
bnx2x: Use correct FW constant for header padding
the value of the constant is the same, but it's clearer to use original
constant provided by HSI
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Dmitry Kravkov [Sun, 17 Oct 2010 23:05:09 +0000 (23:05 +0000)]
bnx2x: remove redundant commands during error handling
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
bnx2x: Optimized the branching in the bnx2x_rx_int()
Optimized the branching in the bnx2x_rx_int() based on the fact
that FP CQE will always have at least one of START or STOP flags set,
so if not both bits are set and START bit is not set,
then it's a STOP bit that is set.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
can: mcp251x: Don't use pdata->model for chip selection anymore
Since commit e446630c960946b5c1762e4eadb618becef599e7, i.e. v2.6.35-rc1,
the mcp251x chip model can be selected via the modalias member in the
struct spi_board_info. The driver stores the actual model in the
struct mcp251x_platform_data.
From the driver point of view the platform_data should be read only.
Since all in-tree users of the mcp251x have already been converted to
the modalias method, this patch moves the "model" member from the
struct mcp251x_platform_data to the driver's private data structure.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Cc: Christian Pellegrin <chripell@fsfe.org> Cc: Marc Zyngier <maz@misterjones.org>
can: mcp251x: read-modify-write eflag only when needed
Use read-modify-write instead of a simple write to change the register
contents, to close existing the race window between the original manual
read and write.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Dan Carpenter [Wed, 13 Oct 2010 09:18:53 +0000 (09:18 +0000)]
ns83820: spin_lock_irq() => spin_lock()
This is essentially cosmetic. At this point the IRQs are already
disabled because we called spin_lock_irq(&dev->rx_info.lock).
The real bug here was fixed back in 2006 in 3a10ccebe: "[PATCH] lock
validator: fix ns83820.c irq-flags bug". Prior to that patch, it was
a "spin_lock_irq is not nestable" type bug. The 2006 patch changes the
unlock to not re-enable IRQs, which eliminates the potential deadlock.
But this bit was missed. We should change the lock function as well so
it balances nicely.
Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Allan Stephens [Thu, 14 Oct 2010 13:58:26 +0000 (13:58 +0000)]
tipc: Simplify bearer shutdown logic
Optimize processing in TIPC's bearer shutdown code, including:
1. Remove an unnecessary check to see if TIPC bearer's can exist.
2. Don't release spinlocks before calling a media-specific disabling
routine, since the routine can't sleep.
3. Make bearer_disable() operate directly on a struct bearer, instead
of needlessly taking a name and then mapping that to the struct.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Reviewed-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Thu, 14 Oct 2010 10:37:45 +0000 (10:37 +0000)]
tg3: Update version to 3.115
This patch updates the tg3 version to 3.115.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Thu, 14 Oct 2010 10:37:44 +0000 (10:37 +0000)]
tg3: Report invalid link from tg3_get_settings()
Currently the tg3 driver leaves the speed and duplex fields
uninitialized in tg3_get_settings() if the device is not up. This can
lead to some strange deductions in certain versions of ethtool. When
the device is up and the link is down, the driver reports SPEED_INVALID
and DUPLEX_INVALID for these fields. This patch makes the presentation
consistent by returning SPEED_INVALID and DUPLEX_INVALID when the device
has not been brought up as well.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Thu, 14 Oct 2010 10:37:43 +0000 (10:37 +0000)]
tg3: Don't allocate jumbo ring for 5780 class devs
The 5714, 5715, and 5780 devices do not have a separate rx jumbo
producer ring. This patch changes the code so that resources are not
allocated for it.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Thu, 14 Oct 2010 10:37:42 +0000 (10:37 +0000)]
tg3: Cleanup tg3_alloc_rx_skb()
src_map is no longer used in tg3_alloc_rx_skb(). Remove it.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Thu, 14 Oct 2010 10:37:41 +0000 (10:37 +0000)]
tg3: Add EEE support
This patch adds Energy Efficient Ethernet (EEE) support for the 5718
device ID and the 57765 B0 asic revision.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Thu, 14 Oct 2010 10:37:40 +0000 (10:37 +0000)]
tg3: Add clause 45 register accessor methods
This patch adds clause 45 register access methods. They will be used in
the following patch.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Thu, 14 Oct 2010 10:37:39 +0000 (10:37 +0000)]
tg3: Disable unused transmit rings
This patch allows the driver to disable the additional transmit rings
available on the 5717 and 5719 devices. This is not strictly necessary,
but is done anyways for correctness.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Thu, 14 Oct 2010 10:37:38 +0000 (10:37 +0000)]
tg3: Add support for selfboot format 1 v6
5718 B0 and 5719 devices will use a new selfboot firmware format. This
patch adds code to detect the new format so that bootcode versions get
reported correctly.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Thu, 14 Oct 2010 20:53:04 +0000 (20:53 +0000)]
fib_hash: embed initial hash table in fn_zone
While looking for false sharing problems, I noticed
sizeof(struct fn_zone) was small (28 bytes) and possibly sharing a cache
line with an often written kernel structure.
Most of the time, fn_zone uses its initial hash table of 16 slots.
We can avoid the false sharing problem by embedding this initial hash
table in fn_zone itself, so that sizeof(fn_zone) > L1_CACHE_BYTES
We did a similar optimization in commit a6501e080c (Reduce memory needs
and speedup lookups)
Add a fz_revorder field to speedup fn_hash() a bit.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Thu, 14 Oct 2010 05:56:18 +0000 (05:56 +0000)]
netns: reorder fields in struct net
In a network bench, I noticed an unfortunate false sharing between
'loopback_dev' and 'count' fields in "struct net".
'count' is written each time a socket is created or destroyed, while
loopback_dev might be often read in routing code.
Move loopback_dev in a read mostly section of "struct net"
Note: struct netns_xfrm is cache line aligned on SMP.
(It contains a "struct dst_ops")
Move it at the end to avoid holes, and reduce sizeof(struct net) by 128
bytes on ia32.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ilpo Järvinen [Thu, 14 Oct 2010 01:52:09 +0000 (01:52 +0000)]
tcp: use correct counters in CA_CWR state too
As CWR is stronger than CA_Disorder state, we can miscount
SACK/Reno failure into other timeouts. Not a bad problem as
it can happen only due to ECN, FRTO detecting spurious RTO
or xmit error which are the only callers of tcp_enter_cwr.
And even then losses and RTO must still follow thereafter
to actually end up into the relevant code paths.
Compile tested.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Ilpo Järvinen [Thu, 14 Oct 2010 01:42:30 +0000 (01:42 +0000)]
tcp: sack lost marking fixes
When only fast rexmit should be done, tcp_mark_head_lost marks
L too far. Also, sacked_upto below 1 is perfectly valid number,
the packets == 0 then needs to be trapped elsewhere.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
stmmac: remove ifdef NETIF_F_TSO from stmmac_ethtool.c
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Reported-by: Armando Visconti <armando.visconti@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Harvey Harrison [Wed, 13 Oct 2010 18:59:13 +0000 (18:59 +0000)]
niu: introduce temp variables to avoid sparse warnings when swapping in-situ
Suppress a large block of warnings like:
drivers/net/niu.c:7094:38: warning: incorrect type in assignment (different base types)
drivers/net/niu.c:7094:38: expected restricted __be32 [usertype] ip4src
drivers/net/niu.c:7094:38: got unsigned long long
drivers/net/niu.c:7104:17: warning: cast from restricted __be32
...
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Randy Dunlap [Wed, 13 Oct 2010 15:18:59 +0000 (15:18 +0000)]
net: move MII outside of NET_ETHERNET, fix kconfig warning
We have USB, PCMCIA, and gigabit ethernet drivers that select
MII even though NET_ETHERNET is not enabled, so make MII not
be dependent on NET_ETHERNET. It is still dependent on NET
and NETDEVICES.
Fixes kconfig unmet dependency warning (shortened, was very long string):
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Jeff Garzik <jgarzik@pobox.com> [2006-NOV-30] Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: David S. Miller <davem@davemloft.net>
Do some cleanups of TIPC based on make namespacecheck
1. Don't export unused symbols
2. Eliminate dead code
3. Make functions and variables local
4. Rename buf_acquire to tipc_buf_acquire since it is used in several files
Compile tested only.
This make break out of tree kernel modules that depend on TIPC routines.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Acked-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
françois romieu [Wed, 13 Oct 2010 09:26:05 +0000 (09:26 +0000)]
via-velocity: forced 1000 Mbps mode support.
Full duplex only. Half duplex 1000 Mbps is not supported.
Signed-off-by: David Lv <DavidLv@viatech.com.cn> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Tested-by: Seguier Regis <rseguier@e-teleport.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Denis Kirjanov [Wed, 13 Oct 2010 00:56:09 +0000 (00:56 +0000)]
sundance: Add initial ethtool stats support
Add ethtool stats support.
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Dan Carpenter [Tue, 12 Oct 2010 23:36:19 +0000 (23:36 +0000)]
pch_gbe: fix if condition in set_settings()
There were no curly braces in this if condition so it always enabled full
duplex.
And ecmd->speed is an unsigned short so it is never equal to -1. The
effect is that mii_ethtool_sset() fails with -EINVAL and an error is
printed to dmesg.
Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Harvey Harrison [Tue, 12 Oct 2010 22:20:34 +0000 (22:20 +0000)]
dnet: mark methods static and annotate for correct endianness
Their doesn't appear to be bugs with the endianness handling here, just get the
annotations right to keep sparse happy.
Suppresses the following sparse warnings:
drivers/net/dnet.c:30:5: warning: symbol 'dnet_readw_mac' was not declared. Should it be static?
drivers/net/dnet.c:49:6: warning: symbol 'dnet_writew_mac' was not declared. Should it be static?
drivers/net/dnet.c:364:5: warning: symbol 'dnet_phy_marvell_fixup' was not declared. Should it be static?
drivers/net/dnet.c:66:13: warning: incorrect type in assignment (different base types)
drivers/net/dnet.c:66:13: expected unsigned short [unsigned] [usertype] tmp
drivers/net/dnet.c:66:13: got restricted __be16 [usertype] <noident>
drivers/net/dnet.c:68:13: warning: incorrect type in assignment (different base types)
drivers/net/dnet.c:68:13: expected unsigned short [unsigned] [usertype] tmp
drivers/net/dnet.c:68:13: got restricted __be16 [usertype] <noident>
drivers/net/dnet.c:70:13: warning: incorrect type in assignment (different base types)
drivers/net/dnet.c:70:13: expected unsigned short [unsigned] [usertype] tmp
drivers/net/dnet.c:70:13: got restricted __be16 [usertype] <noident>
drivers/net/dnet.c:92:27: warning: cast to restricted __be16
drivers/net/dnet.c:94:33: warning: cast to restricted __be16
drivers/net/dnet.c:96:33: warning: cast to restricted __be16
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Harvey Harrison [Tue, 12 Oct 2010 21:52:26 +0000 (21:52 +0000)]
cxgb4vf: make single bit signed bitfields unsigned
Single bit signed bitfields don't make a lot of sense, noticed by sparse:
drivers/net/cxgb4vf/t4vf_common.h:135:31: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:136:36: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:137:36: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:138:36: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:139:36: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:140:31: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:141:31: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:142:35: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:143:35: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:154:27: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:155:26: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:156:27: error: dubious one-bit signed bitfield
drivers/net/cxgb4vf/t4vf_common.h:157:26: error: dubious one-bit signed bitfield
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Mon, 11 Oct 2010 19:05:25 +0000 (19:05 +0000)]
net: allocate skbs on local node
commit b30973f877 (node-aware skb allocation) spread a wrong habit of
allocating net drivers skbs on a given memory node : The one closest to
the NIC hardware. This is wrong because as soon as we try to scale
network stack, we need to use many cpus to handle traffic and hit
slub/slab management on cross-node allocations/frees when these cpus
have to alloc/free skbs bound to a central node.
skb allocated in RX path are ephemeral, they have a very short
lifetime : Extra cost to maintain NUMA affinity is too expensive. What
appeared as a nice idea four years ago is in fact a bad one.
In 2010, NIC hardwares are multiqueue, or we use RPS to spread the load,
and two 10Gb NIC might deliver more than 28 million packets per second,
needing all the available cpus.
Cost of cross-node handling in network and vm stacks outperforms the
small benefit hardware had when doing its DMA transfert in its 'local'
memory node at RX time. Even trying to differentiate the two allocations
done for one skb (the sk_buff on local node, the data part on NIC
hardware node) is not enough to bring good performance.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Mon, 11 Oct 2010 11:17:47 +0000 (11:17 +0000)]
r8169: use 50% less ram for RX ring
Using standard skb allocations in r8169 leads to order-3 allocations (if
PAGE_SIZE=4096), because NIC needs 16383 bytes, and skb overhead makes
this bigger than 16384 -> 32768 bytes per "skb"
Using kmalloc() permits to reduce memory requirements of one r8169 nic
by 4Mbytes. (256 frames * 16Kbytes). This is fine since a hardware bug
requires us to copy incoming frames, so we build real skb when doing
this copy.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
ret = 0
... when != ret = e1
*x = \(kmalloc\|kcalloc\|kzalloc\)(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk> Cc: <stable@kernel.org> Acked-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
These chipsets will not hit the market, all customers will be
on >= AR9003 2.2. This shaves down the ath9k_hw size by
24161 bytes (24 KB) on my system.
Before:
$ size drivers/net/wireless/ath/ath9k/ath9k_hw.ko
text data bss dec hex filename
292328 616 1824 294768 47f70 drivers/net/wireless/ath/ath9k/ath9k_hw.ko
$ du -b drivers/net/wireless/ath/ath9k/ath9k_hw.ko 5987825 drivers/net/wireless/ath/ath9k/ath9k_hw.ko
After:
$ size drivers/net/wireless/ath/ath9k/ath9k_hw.ko
text data bss dec hex filename
277192 616 1824 279632 44450 drivers/net/wireless/ath/ath9k/ath9k_hw.ko
$ du -b drivers/net/wireless/ath/ath9k/ath9k_hw.ko 5963664 drivers/net/wireless/ath/ath9k/ath9k_hw.ko
Cc: Yixiang Li <yixiang.li@atheros.com> Cc: Don Breslin <don.breslin@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Thu, 14 Oct 2010 11:41:35 +0000 (13:41 +0200)]
radiotap: fix vendor namespace parsing
There's a bug with radiotap vendor namespace
parsing if you don't register for the given
namespace extensions. Fix this by passing
only the unknown vendor namespaces and the
registered data to frontends, but not both.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Paul Fox [Wed, 13 Oct 2010 19:14:56 +0000 (20:14 +0100)]
libertas: Communicate USB transfer errors
The return code was being overwritten with -1.
Useful for debugging.
Signed-off-by: Paul Fox <pgf@laptop.org> Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 12 Oct 2010 14:08:02 +0000 (16:08 +0200)]
ath9k_hw: fix PHY counter overflow handling in ANI v1
PHY counter overflows need to be checked for the old ANI version,
because of its use of interrupt based counter overflow reports when
the counters exceed the configured thresholds.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 12 Oct 2010 14:08:01 +0000 (16:08 +0200)]
ath9k_hw: fix division by zero in the ANI monitor code
The commit "ath9k_hw: remove code duplication in phy error counter handling"
split off some duplicate code into a separate function, but did not have a
return code for aborting ANI processing based on counter values.
This introduced a divide by zero issue.
This patch adds the missing return code check in ath9k_hw_ani_monitor
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 12 Oct 2010 12:02:53 +0000 (14:02 +0200)]
ath9k: do not track cycle counter updates in powersave mode
While the chip is in powersave mode, the cycle counter updates do not
contain useful values. While the chip is in full sleep, the rx_clear
signal stays high, indicating a busy medium.
To ensure sane values, update cycle counters before going into
powersave, and clear them right after switching back to awake.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
John Fastabend [Fri, 15 Oct 2010 16:27:38 +0000 (09:27 -0700)]
ixgbe: DCB: remove DCB check config
Remove a DCB check config from DCB configuration we
continue to configure DCB even if it fails so don't
even bother to check. Plus user space (lldpad) checks
this before programming the hw anyways.
Worse case is we program some values into the hw that
don't make total sense resulting in incorrect bandwidth
allocation.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Carolyn Wyborny [Tue, 12 Oct 2010 22:27:02 +0000 (22:27 +0000)]
igb: add check for fiber/serdes devices to igb_set_spd_dplx;
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Emil Tantilov [Tue, 12 Oct 2010 22:20:59 +0000 (22:20 +0000)]
ixgbe: declare functions as static
Following patch fixes warnings reported by `make namespacecheck`
Reported by Stephen Hemminger
CC: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>