16 Jun, 2010
9 commits
-
Add possibility to register rx_handler data pointer along with a rx_handler.
Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller -
There are multiple problems with the newly added netpoll support:
1) Use-after-free on each netpoll packet.
2) Invoking unsafe code on netpoll/IRQ path.
3) Breaks when netpoll is enabled on the underlying device.This patch fixes all of these problems. In particular, we now
allocate proper netpoll structures for each underlying device.We only allow netpoll to be enabled on the bridge when all the
devices underneath it support netpoll. Once it is enabled, we
do not allow non-netpoll devices to join the bridge (until netpoll
is disabled again).This allows us to do away with the npinfo juggling that caused
problem number 1.Incidentally this patch fixes number 2 by bypassing unsafe code
such as multicast snooping and netfilter.Reported-by: Qianfeng Zhang
Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller -
This patch adds the helper netpoll_tx_running for use within
ndo_start_xmit. It returns non-zero if ndo_start_xmit is being
invoked by netpoll, and zero otherwise.This is currently implemented by simply looking at the hardirq
count. This is because for all non-netpoll uses of ndo_start_xmit,
IRQs must be enabled while netpoll always disables IRQs before
calling ndo_start_xmit.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller -
This patch adds the functions __netpoll_setup/__netpoll_cleanup
which is designed to be called recursively through ndo_netpoll_seutp.They must be called with RTNL held, and the caller must initialise
np->dev and ensure that it has a valid reference count.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller -
This patch adds ndo_netpoll_setup as the initialisation primitive
to complement ndo_netpoll_cleanup.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller -
As it stands, netpoll_setup and netpoll_cleanup have no locking
protection whatsoever. So chaos ensures if two entities try to
perform them on the same device.This patch adds RTNL to the equation. The code has been rearranged so
that bits that do not need RTNL protection are now moved to the top of
netpoll_setup.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller -
The use of RCU in netpoll is incorrect in a number of places:
1) The initial setting is lacking a write barrier.
2) The synchronize_rcu is in the wrong place.
3) Read barriers are missing.
4) Some places are even missing rcu_read_lock.
5) npinfo is zeroed after freeing.This patch fixes those issues. As most users are in BH context,
this also converts the RCU usage to the BH variant.Signed-off-by: Herbert Xu
Acked-by: Paul E. McKenney
Signed-off-by: David S. Miller -
Now that netpoll always zaps npinfo we no longer need to do it
in bridge.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller -
Since we have to NULL npinfo regardless of whether there is a
ndo_netpoll_cleanup, it makes sense to do this unconditionally
in netpoll_cleanup rather than having every driver do it by
themselves.Signed-off-by: Herbert Xu
Signed-off-by: David S. Miller
15 Jun, 2010
7 commits
-
Change 2wire transfer rate of SFP+ module EEPROM from 400Khz to 100Khz
since some DACs(direct attached cables) do not work at 400Khz.Reported-by: Krzysztof Oldzki
Signed-off-by: Yaniv Rosner
Signed-off-by: Eilon Greenstein
Signed-off-by: David S. Miller -
Try to reduce cache line contentions in peer management, to reduce IP
defragmentation overhead.- peer_fake_node is marked 'const' to make sure its not modified.
(tested with CONFIG_DEBUG_RODATA=y)- Group variables in two structures to reduce number of dirtied cache
lines. One named "peers" for avl tree root, its number of entries, and
associated lock. (candidate for RCU conversion)- A second one named "unused_peers" for unused list and its lock
- Add a !list_empty() test in unlink_from_unused() to avoid taking lock
when entry is not unused.- Use atomic_dec_and_lock() in inet_putpeer() to avoid taking lock in
some cases.Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
Uses a seqcount_t to synchronize stat producer and consumer, for packets
and bytes counter, now u64 types.(dropped counter being rarely used, stay a native "unsigned long" type)
No noticeable performance impact on x86, as it only adds two increments
per frame. It might be more expensive on arches where smp_wmb() is not
free.Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
Use RCU to avoid atomic ops on idev refcnt in ipv6_get_mtu()
and ip6_dst_hoplimit()Signed-off-by: Eric Dumazet
Acked-by: YOSHIFUJI Hideaki
Signed-off-by: David S. Miller -
Use __in6_dev_get() instead of in6_dev_get()/in6_dev_put()
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
commit 97f8aefbbfb5aa5c9944e5fa8149f1fdaf71c7b6 "net: fix ethtool
coding style errors and warnings" changed the indentation of several
macro definitions in ethtool.h. These definitions line up in the diff
where there is an extra character at the start of each line, but not
in the resulting file.Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
Conflicts:
drivers/net/ixgbe/ixgbe_ethtool.cWith merge conflict help from Stephen Rothwell.
Signed-off-by: David S. Miller
14 Jun, 2010
5 commits
-
This patch added to 2.6.34:
commit f8d1dcaf88bddc7f282722ec1fdddbcb06a72f18
Author: Jesse Brandeburg
Date: Tue Apr 27 01:37:20 2010 +0000ixgbe: enable extremely low latency
introduced a feature where LRO (called RSC on the hardware) was disabled
automatically when setting rx-usecs to 0 via ethtool. Some might not
like the fact that LRO was disabled automatically, but I'm fine with
that. What I don't like is that LRO/RSC is automatically enabled when
rx-usecs is set >0 via ethtool.This would certainly be a problem if the device was used for forwarding
and it was determined that the low latency wasn't needed after the
device was already forwarding. I played around with saving the state of
LRO in the driver, but it just didn't seem worthwhile and would require
a small change to dev_disable_lro() that I did not like.This patch simply leaves LRO disabled when setting rx-usecs >0 and
requires that the user enable it again. An extra informational message
will also now appear in the log so users can understand why LRO isn't
being enabled as they expect.Inconsistency of LRO setting first noticed by Stanislaw Gruszka.
Signed-off-by: Andy Gospodarek
CC: Stanislaw Gruszka
CC: stable@kernel.org
Tested-by: Stephen Ko
Signed-off-by: Jeff Kirsher
Signed-off-by: David S. Miller -
commit 675ad47375c76a7c3be4ace9554d92cd55518ced
removed the capability to use ethtool.set_msglevel to
control the types of messages emitted by the driver.That commit should probably be reverted.
If not, then this patch fixes a message logging defect
introduced by converting a printk without KERN_
to e_info.This also reduces text by about 200 bytes.
Signed-off-by: Joe Perches
Tested-by: Emil Tantilov
Signed-off-by: Jeff Kirsher
Signed-off-by: David S. Miller -
There is a small window where the watchdog could be running as the
interface is brought down on a NIC with two ports wired back to back.
If ixgbe_update_status is then called can lead to a panic. This patch
allows the update to bail if we are in that condition.This issue was orignally reported and fix proposed by Akihiko Saitou.
CC: Akihiko Saitou
Signed-off-by: Don Skidmore
Signed-off-by: Jeff Kirsher
Signed-off-by: David S. Miller -
No need to copy rxhash again in __skb_clone()
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
deliver_no_wcard is not being set in skb_copy_header.
In the skb_cloned case it is not being cleared and
may cause the skb to be dropped when the loopback device
pushes it back up the stack.Signed-off-by: John Fastabend
Acked-by: Eric Dumazet
Tested-by: Markus Trippelsdorf
Signed-off-by: David S. Miller
13 Jun, 2010
6 commits
-
Device statistics have type unsigned long and several of the
device-specific parameters printed here have type __u32.Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
Use struct rtnl_link_stats64 as the statistics structure.
On 32-bit architectures, insert 32 bits of padding after/before each
field of struct net_device_stats to make its layout compatible with
struct rtnl_link_stats64. Add an anonymous union in net_device; move
stats into the union and add struct rtnl_link_stats64 stats64.Add net_device_ops::ndo_get_stats64, implementations of which will
return a pointer to struct rtnl_link_stats64. Drivers that implement
this operation must not update the structure asynchronously.Change dev_get_stats() to call ndo_get_stats64 if available, and to
return a pointer to struct rtnl_link_stats64. Change callers of
dev_get_stats() accordingly.Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
ioctl operation (ndo_do_ioctl) is added to make mii-tools work
Signed-off-by: Sergey Matyukevich
Signed-off-by: David S. Miller -
Fix build warning on i386 (32-bit) with 32-bit dma_addr_t:
drivers/net/enic/vnic_dev.c: In function 'vnic_dev_init_prov':
drivers/net/enic/vnic_dev.c:716: warning: passing argument 3 of 'pci_alloc_consistent' from incompatible pointer type
include/asm-generic/pci-dma-compat.h:16: note: expected 'dma_addr_t *' but argument is of type 'u64 *'Now builds without warnings on i386 and on x86_64.
Signed-off-by: Randy Dunlap
Cc: Scott Feldman
Cc: Vasanthy Kolluri
Cc: Roopa Prabhu
Acked-by: Scott Feldman
12 Jun, 2010
13 commits
-
This patch increases the granularity of the rate generated by pktgen.
The previous version of pktgen uses micro seconds (udelay) resolution when it
was delayed causing gaps in the rates. It is changed to nanosecond (ndelay).
Now any rate is possible.Also it allows to set, the desired rate in Mb/s or packets per second.
The documentation has been updated.
Signed-off-by: Daniel Turull
Signed-off-by: Robert Olsson
Signed-off-by: David S. Miller -
econet lacks proper locking. It holds econet_lock only when inserting or
deleting an entry in econet_sklist, not during lookups.- convert econet_lock from rwlock to spinlock
- use econet_lock in ec_listening_socket() lookup
- use appropriate sock_hold() / sock_put() to avoid corruptions.
Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
gen_kill_estimator() API is incomplete or not well documented, since
caller should make sure an RCU grace period is respected before
freeing stats_lock.This was partially addressed in commit 5d944c640b4
(gen_estimator: deadlock fix), but same problem exist for all
gen_kill_estimator() users, if lock they use is not already RCU
protected.A code review shows xt_RATEEST.c, act_api.c, act_police.c have this
problem. Other are ok because they use qdisc lock, already RCU
protected.Signed-off-by: Eric Dumazet
Signed-off-by: David S. Miller -
drivers/net/bnx2.c: In function 'bnx2_disable_forced_2g5':
drivers/net/bnx2.c:1489: warning: 'bmcr' may be used uninitialized in this functionWe fix it by checking return values from all bnx2_read_phy() and proceeding
to do read-modify-write only if the read operation is successful.The related bnx2_enable_forced_2g5() is also fixed the same way.
Reported-by: Prarit Bhargava
Signed-off-by: Michael Chan
Signed-off-by: David S. Miller -
If oui were a null variable then vic_provinfo_alloc() would leak memory.
But this function is only called from one place and oui is not null so
I removed the check.I also moved the memory allocation down a line so it was easier to spot.
(No one ever reads variable declarations).Signed-off-by: Dan Carpenter
Signed-off-by: David S. Miller -
The point of using the devres resource management routines is that they
simplify the driver by taking care of releasing resources on failure and
release. A recent commit added a bunch of error handling that is unnecessary
in this context.This patch removes this redundant error handling, as well as using
dmam_alloc_coherent in place of dma_alloc_coherent in order to use this
framework consistenly throughout the driver.Signed-off-by: Jonas Bonn
Signed-off-by: David S. Miller -
This matches what ethoc_mdio_read does and makes the functions
symmetric.Signed-off-by: Jonas Bonn
Signed-off-by: David S. Miller -
Signed-off-by: Jonas Bonn
Signed-off-by: David S. Miller -
- No need to iterate over all possible addresses on bus
- Use helper function phy_find_first
- Use phy_connect_direct as we already have the relevant structureSigned-off-by: Jonas Bonn
Signed-off-by: David S. Miller -
This moves the write of the TX_BD_NUM to init_ring together with the
rest of the code setting up the transmission buffers.Signed-off-by: Jonas Bonn
Signed-off-by: David S. Miller -
The ethoc driver should be writing bus addresses to the ethoc registers, not
virtual addresses. This patch adds an array to store the virtual addresses
in and references that array when manipulating the contents of the buffer
descriptors.Signed-off-by: Jonas Bonn
Signed-off-by: David S. Miller -
This moves the calculation of the number of transmission buffers to
ethoc_probe where it more logically fits with the rest of the memory
allocation code.Signed-off-by: Jonas Bonn
Signed-off-by: David S. Miller