summaryrefslogtreecommitdiffstats
path: root/drivers/net/via-velocity.c
Commit message (Collapse)AuthorAgeFilesLines
* via-velocity: Fix FLOW_CNTL_TX_RX handling in set_mii_flow_control()David S. Miller2010-03-251-1/+1
| | | | | | | | Clear, don't set, ANAR_ASMDIR in this case. Noticed by Roel Kluin. Signed-off-by: David S. Miller <davem@davemloft.net>
* net: convert multiple drivers to use netdev_for_each_mc_addr, part6Jiri Pirko2010-02-261-3/+3
| | | | | Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Enable scatter/gather IO by defaultSimon Kagstrom2010-02-181-1/+1
| | | | | | | Reduces CPU utilization significantly with sendfile for example. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2010-02-151-21/+20Star
|\ | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: net/mac80211/rate.c
| * via-velocity: Fix races on shared interruptsSimon Kagstrom2010-02-101-11/+10Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes two potential races in the velocity driver: * Move the ACK and error handler to the interrupt handler. This fixes a potential race with shared interrupts when the other device interrupts before the NAPI poll handler has finished. As the velocity driver hasn't acked it's own interrupt, it will then steal the interrupt from the other device. * Use spin_lock_irqsave in velocity_poll. In the current code, the interrupt handler will deadlock if e.g., the NAPI poll handler is executing when an interrupt (for another device) comes in since it tries to take the already held lock. Also unlock the spinlock only after enabling the interrupt in velocity_poll. The error path is moved to the interrupt handler since this is where the ISR is checked now. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: Anders Grafstrom <anders.grafstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
| * via-velocity: Take spinlock on set coalesceSimon Kagstrom2010-02-101-0/+3
| | | | | | | | | | | | | | | | velocity_set_coalesce touches ISR and some other sensitive registers not covered by the rtnl lock, so take the velocity spinlock. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
| * via-velocity: Remove unused IRQ status parameter from rx_srv and tx_srvSimon Kagstrom2010-02-101-10/+7Star
| | | | | | | | | | Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: use netdev_mc_count and netdev_mc_empty when appropriateJiri Pirko2010-02-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | This patch replaces dev->mc_count in all drivers (hopefully I didn't miss anything). Used spatch and did small tweaks and conding style changes when it was suitable. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2010-01-111-4/+4
|\| | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/benet/be_cmds.h include/linux/sysctl.h
| * via-velocity: Give RX descriptors to the NIC later on open or MTU changeBen Hutchings2010-01-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | velocity_open() calls velocity_give_many_rx_descs(), which gives RX descriptors to the NIC, before installing an interrupt handler or calling velocity_init_registers(). I think this is very unsafe and it appears to explain the bug report <http://bugs.debian.org/508527>. On MTU change, velocity_give_many_rx_descs() is again called before velocity_init_registers(). I'm not sure whether this is unsafe but it does look wrong. Therefore, move the calls to velocity_give_many_rx_descs() after request_irq() and velocity_init_registers(). Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Tested-by: Jan Ceuleers <jan.ceuleers@computer.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | drivers/net/: use DEFINE_PCI_DEVICE_TABLE()Alexey Dobriyan2010-01-081-1/+1
| | | | | | | | | | | | | | | | Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct section in every case. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | drivers/net/via-velocity.c: use %pM to shown MAC addressH Hartley Sweeten2009-12-301-4/+2Star
|/ | | | | | | Use the %pM kernel extension to display the MAC address. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net: Move && and || to end of previous lineJoe Perches2009-12-031-8/+8
| | | | | | | | | | | | | | Only files where David Miller is the primary git-signer. wireless, wimax, ixgbe, etc are not modified. Compile tested x86 allyesconfig only Not all files compiled (not x86 compatible) Added a few > 80 column lines, which I ignored. Existing checkpatch complaints ignored. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Set tx checksum from ethtool instead of module parameterSimon Kagstrom2009-11-271-14/+4Star
| | | | | | | Defaults to on (as before). Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Re-enable transmit scatter-gather supportSimon Kagstrom2009-11-271-30/+53
| | | | | | | | | | | | The velocity hardware can handle up to 7 memory segments. This can be turned on and off via ethtool. The support was removed in commit 83c98a8cd04dd0f848574370594886ba3bf56750 but is re-enabled and cleaned up here. It's off by default. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Change DMA_LENGTH_DEF (from the VIA driver)Simon Kagstrom2009-11-271-1/+1
| | | | | | | | | The VIA driver has changed the default for the DMA_LENGTH_DEF parameter. Together with adaptive interrupt supression and NAPI support, this improves performance quite a bit Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Implement NAPI supportSimon Kagstrom2009-11-271-35/+46
| | | | | | | | | | This patch adds NAPI support for VIA velocity. The new velocity_poll function also pairs tx/rx handling twice which improves perforamance on some workloads (e.g., netperf UDP_STREAM) significantly (that part is from the VIA driver). Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Add ethtool interrupt coalescing supportSimon Kagstrom2009-11-271-1/+159
| | | | | | | | | (Partially from the upstream VIA driver). Tweaking the number of frames-per-interrupt and timer-until-interrupt can reduce the amount of CPU work quite a lot. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Correct 64-byte alignment for rx buffersSimon Kagstrom2009-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | (From the VIA driver). The current code does not guarantee 64-byte alignment since it simply does int add = skb->data & 63; skb->data += add; (via skb_reserve). So for example, if the skb->data address would be 0x10, this would result in 32-byte alignment (0x10 + 0x10). Correct by adding 64 - (skb->data & 63) instead. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/via-velocity.c: remove exceptional & on function nameJulia Lawall2009-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | In this file, function names are otherwise used as pointers without &. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Remove private device listBen Hutchings2009-10-281-36/+3Star
| | | | | | | | | | | | via-velocity maintains a list of its devices in order to determine whether a netdev notification applies to one of them. That can be determined simply by checking the netdev_ops pointer, so the list can be removed. Compile-tested only. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: Use netdev_alloc_skb_ip_align()Eric Dumazet2009-10-131-2/+1Star
| | | | | Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: Remove redundant checks for CAP_NET_ADMIN in MDIO implementationsBen Hutchings2009-09-041-4/+0Star
| | | | | | | | dev_ioctl() already checks capable(CAP_NET_ADMIN) before calling the driver's implementation of MDIO ioctls. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2009-09-021-1/+1
|\ | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/yellowfin.c
| * via-velocity: Fix test of mii_status bit VELOCITY_DUPLEX_FULLroel kluin2009-08-151-1/+1
| | | | | | | | | | | | | | Test whether VELOCITY_DUPLEX_FULL bit is set in mii_status. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netdev: convert bulk of drivers to netdev_tx_tStephen Hemminger2009-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | In a couple of cases collapse some extra code like: int retval = NETDEV_TX_OK; ... return retval; into return NETDEV_TX_OK; Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Remove unnecessary forward declarations from velocity NIC driver.Dave Jones2009-07-241-1681/+1580Star
| | | | | | | | | | | | | | | | By moving functions to before their first call, we eliminate the need to define forward references. Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Fix up CodingStyle problems in via-velocity.cDave Jones2009-07-241-95/+80Star
| | | | | | | | | | Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Remove unused zero-copy code from velocity NIC driver.Dave Jones2009-07-241-66/+11Star
| | | | | | | | | | | | | | This code hasn't been enabled in forever. Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: use NETDEV_TX_OK instead of 0 in ndo_start_xmit() functionsPatrick McHardy2009-07-061-1/+1
|/ | | | | | | | | | | This patch is the result of an automatic spatch transformation to convert all ndo_start_xmit() return values of 0 to NETDEV_TX_OK. Some occurences are missed by the automatic conversion, those will be handled in a seperate patch. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Fix velocity driver unmapping incorrect size.Dave Jones2009-06-221-1/+1
| | | | | | | | When a packet is greater than ETH_ZLEN, we end up assigning the boolean result of a comparison to the size we unmap. Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity : fix no link detection on bootSéguier Régis2009-06-181-1/+3
| | | | | | | on boot, link is always up. Signed-off-by: Seguier Regis <rseguier@e-teleport.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: use netdev stats in b44, sundance, via-rhine and via-velocityEric Dumazet2009-05-281-11/+11
| | | | | | | | Use struct net_device_stats provided in struct net_device instead of private ones. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity : fix compilation warning.Séguier Régis2009-04-111-2/+2
| | | | | | | | Fix this warning: drivers/net/via-velocity.c:1924: warning: passing argument 2 of 'request_irq' from incompatible pointer type Signed-off-by: Seguier Regis <rseguier@e-teleport.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Fix DMA mapping length errors on transmit.Dave Jones2009-03-131-8/+7Star
| | | | | | | | | | | From: Dave Jones <davej@redhat.com> The dma-debug changes caught that this driver uses the wrong DMA mapping length when skb_padto() does something. With suggestions from Eric Dumazet. Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: fix hot spinroel kluin2009-01-201-1/+1
| | | | | | | while(--j >= 0) keeps spinning when j is unsigned: Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: add missing set_mac_address hookStephen Hemminger2009-01-111-0/+1
| | | | | | | | Many drivers lost the ability to set ethernet address accidently during the net_device_ops conversion. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: add more functions to netdevice opsStephen Hemminger2008-11-211-1/+1
| | | | | | | | | | | | This patch moves neigh_setup and hard_start_xmit into the network device ops structure. For bisection, fix all the previously converted drivers as well. Bonding driver took the biggest hit on this. Added a prefetch of the hard_start_xmit in the fast path to try and reduce any impact this would have. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: convert to net_device_opsStephen Hemminger2008-11-201-10/+14
| | | | | | | Convert this driver to network device ops. Compile tested only. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2008-11-191-1/+1
|\ | | | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/isdn/i4l/isdn_net.c fs/cifs/connect.c
| * via-velocity: enable perfect filtering for multicast packetsJoey Zhuo2008-11-161-1/+1
| | | | | | | | | | | | Signed-off-by: Joey Zhuo <joeyzhuo@via.com.tw> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | drivers/net: Kill now superfluous ->last_rx stores.David S. Miller2008-11-041-2/+0Star
|/ | | | | | | | | | | | | The generic packet receive code takes care of setting netdev->last_rx when necessary, for the sake of the bonding ARP monitor. Drivers need not do it any more. Some cases had to be skipped over because the drivers were making use of the ->last_rx value themselves. Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: use driver string instead of dev->name before register_netdev()Sven Hartge2008-10-271-4/+7
| | | | | | | | | | | | | | | | | | | | | | | This patch corrects a message bug in the via-velocity driver which bothered me for some time. The messages printed during device init look like the following: [ 8.486422] eth%d: set value of parameter Wake On Lan options to 0 ^^! [ 8.487340] eth0: VIA Networking Velocity Family Gigabit Ethernet Adapter Note the unresolved format string. dev->name is unavailable before register_netdev, so use dev_driver_string(&pdev->dev), which is also consistent with other drivers. "char *devname" parameters had to be converted to "const char *devname" to be consistent with dev_driver_string return value. Signed-off-by: Sven Hartge <sven@svenhartge.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* net: Rationalise email address: Network Specific PartsAlan Cox2008-10-141-1/+1
| | | | | | | | | | Clean up the various different email addresses of mine listed in the code to a single current and valid address. As Dave says his network merges for 2.6.28 are now done this seems a good point to send them in where they won't risk disrupting real changes. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: Fix warnings on sparc64.Francois Romieu2008-10-091-2/+2
| | | | | | As reported by Meelis Roos. Signed-off-by: David S. Miller <davem@davemloft.net>
* via-velocity: velocity_init_{rd/tx}_ring use kcalloc(..., GFP_KERNEL).Francois Romieu2008-07-311-46/+86
| | | | | | | | | Allocate and free everyting outside of the locked section. Spotted-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Fixed-by: Seguier Regis <rseguier@e-teleport.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
* via-velocity: separated struct allow wholesale copy during MTU changes.Francois Romieu2008-07-311-86/+87
| | | | | | | It should help people fix the bugs in my code :o) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
* via-velocity: add velocity_set_rxbufsize helperFrancois Romieu2008-07-111-3/+9
| | | | | | | It removes a dependancy from velocity_init_rd_ring to dev->mtu. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* via-velocity: move residual free rx descriptors count register updateFrancois Romieu2008-07-111-14/+14
| | | | | | | | | | | | | | | | | | | | | Updates of the RBRDU have two different meanings depending on their context: 1. the receiving process has not started - the value which is written into the RBRDU register is supposed to be the free rx descriptors count (rounded to a multiple of 4) 2. the receiving process is running - the value increments the count above (sic) The update is currently issued deep inside the rx replenish chain (see velocity_give_many_rx_descs). Let's propagate enough information to the caller so that the rx replenish functions do not depend on hardware any more. It is needed to perform the Rx/Tx buffers housekeeping when MTU changes. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* via-velocity: lean and clean velocity_init_ringsFrancois Romieu2008-07-111-27/+21Star
| | | | | | | | | - PCI consistent areas need no memset - use dev_err instead of plain printk - avoid a few casts Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>