summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
Commit message (Collapse)AuthorAgeFilesLines
* sfc: Move MTD probe after netdev registration and name allocationBen Hutchings2009-10-241-2/+4
| | | | | | | | | | | | | 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>
* sfc: Remove unnecessary tests of efx->membaseBen Hutchings2009-10-241-8/+0Star
| | | | | | | | 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>
* sfc: Remove incorrect assertion from efx_pci_remove_main()Ben Hutchings2009-10-241-2/+0Star
| | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Remove pointless abstraction of memory BAR numberBen Hutchings2009-10-241-9/+7Star
| | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Maintain interrupt moderation values in ticks, not microsecondsBen Hutchings2009-10-241-18/+23
| | | | | | | This simplifies the implementation a lot. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Change order of device removal to reverse of probe orderBen Hutchings2009-10-241-1/+1
| | | | | | | | 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>
* sfc: Eliminate indirect lookups of queue size constantsBen Hutchings2009-10-241-11/+3Star
| | | | | | | 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>
* cpumask: use zalloc_cpumask_var() where possibleLi Zefan2009-09-241-2/+1Star
| | | | | | | Remove open-coded zalloc_cpumask_var() and zalloc_cpumask_var_node(). Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* sfc: Improve reliability of RX queue flushingBen Hutchings2009-08-271-0/+2
| | | | | | | | | Reconfiguring the port requires us to flush all DMA queues. In repeated testing we have found that RX flushes would sometimes fail because the RX DMA engine was not properly isolated from the MACs. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Fix ordering of device registration and initial netif_carrier_off()Ben Hutchings2009-08-271-9/+17
| | | | | | | | | | | | | We must call netif_carrier_off() after the device is registered, not before, to set the operational state and user-space IFF_RUNNING flag correctly. Since we don't want observers to see an intermediate state, open-code register_netdev() and add efx_update_name() and netif_carrier_off() into the locked region. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Remove lro module parameterBen Hutchings2009-05-201-13/+2Star
| | | | | | | GRO/LRO can be controlled through ethtool so this is unnecessary. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: modify allocation error messageMike Travis2009-05-171-2/+2
| | | | | | | | | | | | | | Change error message when alloc_cpumask_var fails. Repairs "cpumask: convert drivers/net/sfc". Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: David S. Miller <davem@davemloft.net> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Use generic MDIO functions and definitionsBen Hutchings2009-04-301-2/+8
| | | | | | | | | | | Make use of the newly-added generic MDIO clause 45 support and remove redundant definitions. Add an 'efx_' prefix to the remaining driver-specific MDIO functions and remove arguments which are redundant with efx->mdio.prtad. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Match calls to netif_napi_add() and netif_napi_del()Ben Hutchings2009-04-151-3/+4
| | | | | | | | | | | sfc could call netif_napi_add() multiple times for the same napi_struct, corrupting the list of napi_structs for the associated device and leading to a busy-loop on device removal. Move the call to netif_napi_add() and add a call to netif_napi_del() in the obvious places. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Call netif_napi_add() before registering our interrupt handlerBen Hutchings2009-04-011-4/+3Star
| | | | | | | | | | | If we use a shared legacy IRQ then our interrupt handler may be called as soon as it is registered even though IRQs are disabled on the NIC. Now that the legacy interrupt handler also checks for event delivery, it may decide to schedule polling in this case. Ensure that the NAPI context is valid but disabled at this point. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2Ingo Molnar2009-03-271-5/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: arch/parisc/kernel/irq.c arch/x86/include/asm/fixmap_64.h arch/x86/include/asm/setup.h kernel/irq/handle.c Semantic merge: arch/x86/include/asm/fixmap.h Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * Merge commit 'v2.6.29-rc4' into core/percpuIngo Molnar2009-02-091-18/+41
| |\ | | | | | | | | | | | | | | | Conflicts: arch/x86/mach-voyager/voyager_smp.c arch/x86/mm/fault.c
| * | cpumask: convert drivers/net/sfcRusty Russell2009-01-111-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: reduce stack usage, use new cpumask API. Remove a cpumask from the stack. Ben Hutchings indicated that printing a warning and returning 1 was acceptable for the corner case where allocation fails. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Cc: Ben Hutchings <bhutchings@solarflare.com> Cc: linux-net-drivers@solarflare.com
| * | cpumask: Use topology_core_cpumask()/topology_thread_cpumask()Rusty Russell2009-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Impact: reduce stack usage, use new cpumask API. This actually uses topology_core_cpumask() and topology_thread_cpumask(), removing the only users of topology_core_siblings() and topology_thread_siblings() Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Cc: linux-net-drivers@solarflare.com
* | | sfc: Implement adaptive IRQ moderationBen Hutchings2009-03-221-2/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calculate a score for each 1000 IRQs: - TX completions are worth 1 point - RX completions are worth 4 if merged using LRO or 2 otherwise Reduce moderation if the score is less than 10000, down to a minimum of 5 us. Increase moderation if the score is more than 20000, up to the specified maximum. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | sfc: Clean up properly on reset failure pathsBen Hutchings2009-03-051-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | If MAC switching fails, stop the port properly. If PHY reinitialisation fails, clear the port_initialized flag. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | sfc: Clean up LED controlBen Hutchings2009-03-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reinitialise LEDs after overriding them for identification. Rename set_fault_led method to set_id_led since we always use it for NIC identification and not faults. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | Merge branch 'master' of ↵David S. Miller2009-01-301-18/+41
|\ \ \ | | |/ | |/| | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/e1000/e1000_main.c
| * | sfc: Replace stats_enabled flag with a disable countBen Hutchings2009-01-301-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we use a spin-lock to serialise statistics fetches and also to inhibit them for short periods of time, plus a flag to enable/disable statistics fetches for longer periods of time, during online reset. This was apparently insufficient to deal with the several reasons for stats being disabled. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | sfc: Reinitialise the PHY completely in case of a PHY or NIC resetSteve Hodgson2009-01-301-7/+19
| |/ | | | | | | | | | | | | | | | | | | In particular, set pause advertising bits properly. A PHY reset is not necessary to recover from the register self-test, so use a "invisible" reset there instead. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sfc: Replace LRO with GROHerbert Xu2009-01-211-10/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes sfc invoke the GRO hooks instead of LRO. As GRO has a compatible external interface to LRO this is a very straightforward replacement. Everything should appear identical to the user except that the offload is now controlled by the GRO ethtool option instead of LRO. I've kept the lro module parameter as is since that's for compatibility only. I have eliminated efx_rx_mk_skb as the GRO layer can take care of all packets regardless of whether GRO is enabled or not. So the only case where we don't call GRO is if the packet checksum is absent. This is to keep the behaviour changes of the patch to a minimum. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: Remove redundant NAPI functionsBen Hutchings2009-01-211-2/+2
|/ | | | | | | | | | | Following the removal of the unused struct net_device * parameter from the NAPI functions named *netif_rx_* in commit 908a7a1, they are exactly equivalent to the corresponding *napi_* functions and are therefore redundant. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: Fix warning fallout from recent NAPI interface changes.David S. Miller2008-12-271-1/+0Star
| | | | | | | | | | | When we removed the network device argument from several NAPI interfaces in 908a7a16b852ffd618a9127be8d62432182d81b4 ("net: Remove unused netdev arg from some NAPI interfaces.") several drivers now started getting unused variable warnings. This fixes those up. Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: When disabling the NIC, close the device rather than unregistering itBen Hutchings2008-12-261-24/+23Star
| | | | | | | | This should reduce user confusion and may also aid recovery (ioctls will still be available). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Generate unique names for per-NIC workqueuesBen Hutchings2008-12-261-1/+4
| | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: Remove unused netdev arg from some NAPI interfaces.Neil Horman2008-12-231-1/+1
| | | | | | | | | | When the napi api was changed to separate its 1:1 binding to the net_device struct, the netif_rx_[prep|schedule|complete] api failed to remove the now vestigual net_device structure parameter. This patch cleans up that api by properly removing it.. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Fix synchronisation of efx_mtd_{probe,rename,remove}Ben Hutchings2008-12-131-15/+18
| | | | | | | | | | | | | Currently efx_mtd_rename() can race with the probe() and remove() functions. Move probe() before device registration and remove() after unregistration. Move initialisation/update of all names based on the netdev name into a new function and call it under the RTNL immediately after registration. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Treat probe as unsuccessful if it scheduled a resetSteve Hodgson2008-12-131-2/+11
| | | | | | | | | | From: Steve Hodgson <shodgson@solarflare.com> efx_pci_probe_main() can return success despite a reset being scheduled. Catch this and retry or abort probe depending on the reset type. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Rework MAC, PHY and board event handlingBen Hutchings2008-12-131-21/+42
| | | | | | | | | | | From: Steve Hodgson <shodgson@solarflare.com> MAC, PHY and board events may be separately enabled and signalled. Our current arrangement of chaining the polling functions can result in events being missed. Change them to be more independent. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Add support for sub-10G speedsBen Hutchings2008-12-131-19/+43
| | | | | | | | | | | | | The SFC4000 has a separate MAC for use at sub-10G speeds. Introduce an efx_mac_operations structure with implementations for the two MACs. Switch between the MACs as necessary. PHY settings are independent of the MAC, so add get_settings() and set_settings() to efx_phy_operations. Also add macs field to indicate which MACs the PHY is connected to. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Add phy_type device attributeBen Hutchings2008-12-131-0/+19
| | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Remove MII extension cruftBen Hutchings2008-12-131-21/+2Star
| | | | | | | | | | Replace efx_nic::link_options bitfield with link_speed (speed in Mbit/s) and link_fd (full duplex flag). Remove broken auto-negotiation functions. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Provide hints to irqbalance daemonBen Hutchings2008-12-131-0/+24
| | | | | | | | Allocate IRQs with the name format <device>[-<type>]-<number> so that future versions of irqbalanced understand what we're doing. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Add option to use a separate channel for TX completionsNeil Turton2008-12-131-15/+26
| | | | | | | | | | | | In a bidirectional forwarding test, we find that the best performance is achieved by sending the TX completion interrupts from one NIC to a CPU which shares an L2 cache with RX completion interrupts from the other NIC. To facilitate this, add an option (through a module parameter) to create separate channels for RX and TX completion with separate IRQs when MSI-X is available. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Restore phy_flash_cfg module parameterBen Hutchings2008-12-131-0/+7
| | | | | | | This is needed for recovery in case a PHY firmware upgrade is aborted. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Make reset_workqueue driver-global rather than per-NICSteve Hodgson2008-12-131-25/+20Star
| | | | | | | | Each reset is serialised by the rtnl_lock anyway, so there's no win per-NIC. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Board support fixesBen Hutchings2008-12-131-0/+2
| | | | | | | | | | Set dummy monitor method for unrecognised boards. Clean up board resources if efx_pci_probe_main() fails after board has been initialised. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: convert to net_device_opsStephen Hemminger2008-11-221-13/+18
| | | | | | | | Convert driver to new net_device_ops. Compile tested only. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Do not reset when hardware monitor detects a faultBen Hutchings2008-11-061-21/+4Star
| | | | | | | | The TX watchdog should trigger a reset, but a temperature/power alarm should not as this is unlikely to solve the problem. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* sfc: Expose flash region storing boot code as MTDBen Hutchings2008-11-061-0/+7
| | | | | | | | | The boot code that appears as a PCI expansion ROM on the SFC4000 is stored in flash. Expose this as a standard MTD device to allow for in-place upgrades. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* net: convert print_mac to %pMJohannes Berg2008-10-281-9/+6Star
| | | | | | | | | | | | This converts pretty much everything to print_mac. There were a few things that had conflicts which I have just dropped for now, no harm done. I've built an allyesconfig with this and looked at the files that weren't built very carefully, but it's a huge patch. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Make queue flushes more reliableBen Hutchings2008-09-251-8/+7Star
| | | | | | | | | | | | | | Increase the potential retry count for RX flushes from 5 to 100. Stop polling the RX_DESC_PTR_TBL to infer that a flush might have happened. Instead absolutely rely on the flush events, unless bug 7803 applies (Falcon rev A only). To keep things quick, request flushes for every TX and RX queue up front, and match up the events to requests. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* sfc: Remove workaround for old firmware bugBen Hutchings2008-09-251-1/+0Star
| | | | | | | | | There was a bug in XAUI synchronisation in early 10Xpress firmware versions. This is fixed in released firmware and we do not need to work around it. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* sfc: Fix memory BAR release call on error pathBen Hutchings2008-09-251-1/+1
| | | | | | | | | Match pci_request_region() with pci_release_region(), not release_mem_region(). From: Steve Hodgson <shodgson@solarflare.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* sfc: Rework efx_set_multicast_hash()Ben Hutchings2008-09-031-11/+17
| | | | | | | | | | | When !port_enabled, defer the write to reconfigure_mac_wrapper. Whilst here, simplify the logic now that efx_start_port() always calls efx_reconfigure_port(). From: Steve Hodgson <shodgson@solarflare.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>