aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/selftest.c
Commit message (Collapse)AuthorAgeFilesLines
* sfc: Update copyright bannersBen Hutchings2013-08-291-2/+2
| | | | | | | Update the dates for files that have been added to in 2012-2013. Drop the 'Solarstorm' brand name that's still lingering here. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove efx_process_channel_now()Ben Hutchings2013-08-211-11/+0
| | | | | | | | | | efx_process_channel_now() is unneeded since self-tests can rely on normal NAPI polling. Remove it and all calls to it. efx_channel::work_pending and efx_channel_processed() are also unneeded (the latter being the same as efx_nic_eventq_read_ack()). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: lock TX queues when calling netif_device_detach()Daniel Pieczko2012-12-011-1/+1
| | | | | | | The assertion of netif_device_present() at the top of efx_hard_start_xmit() may fail if we don't do this. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Fix byte order warning in self-testBen Hutchings2012-12-011-1/+1
| | | | | | Add necessary cast when setting a bogus checksum. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Fix loopback self-test with separate_tx_channels=1Ben Hutchings2012-10-021-1/+2
| | | | | | | The loopback self-test iterates over all the TX queues of channel 0, which is not very interesting when that's an RX-only channel. Signed-off-by: Ben Hutchings <bhutchings@solarflre.com>
* sfc: Disable VF queues during register self-testBen Hutchings2012-07-171-47/+15
| | | | | | | | | | | | | | | | | | | Currently VF queues and drivers may remain active during this test. This could cause memory corruption or spurious test failures. Therefore we reset the port/function before running these tests on Siena. On Falcon this doesn't work: we have to do some additional initialisation before some blocks will work again. So refactor the reset/register-test sequence into an efx_nic_type method so efx_selftest() doesn't have to consider such quirks. In the process, fix another minor bug: Siena does not have an 'invisible' reset and the self-test currently fails to push the PHY configuration after resetting. Passing RESET_TYPE_ALL to efx_reset_{down,up}() fixes this. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Use dev_kfree_skb() in efx_end_loopback()Ben Hutchings2012-07-171-1/+1
| | | | | | | | | | | | | Fix CID 102619 in the Coverity report on Linux. efx_end_loopback() iterates over an array of skb pointers of which some may be null (if efx_begin_loopback() failed). It should not use dev_kfree_skb_irq(), which requires non-null pointers. In practice this is safe because it does not run in interrupt context and therefore always ends up calling dev_kfree_skb(), which does allow null pointers. But we should make that explicit. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Run event/IRQ self-test asynchronously when interface is brought upBen Hutchings2012-03-061-0/+35
| | | | | | | | Generate a test event on each event queue whenever the interface is brought up, then after 1 second check that we have either handled a test event or handled another IRQ for each event queue. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Encapsulate access to efx_{channel,nic}::last_irq_cpu in self-testBen Hutchings2012-03-061-10/+4
| | | | | | Cleanup in preparation for doing an event test on ifup. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Test all event queues in parallelBen Hutchings2012-03-061-49/+65
| | | | | | | | In case all event queues are broken for some reason, this means it will only take about a second to check them all, rather than up to 32 seconds. This may also speed up testing in the successful case. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Raise self-test timeoutsBen Hutchings2012-03-061-19/+46
| | | | | | | | | | | | | IRQ latency can be ridiculously high for various reasons, so our current timeouts of 100 ms or 10 ms are too short. Change the IRQ and event tests to use polling loops starting with a delay of 1 tick and doubling that if necessary up to a maximum total delay of approximately 1 second. Raise the loopback packet RX timeout to 1 second. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove remnants of on-load self-testBen Hutchings2012-01-271-8/+4
| | | | | | | | | The out-of-tree version of the sfc driver used to run a self-test on each device before registering it. Although this was never included in-tree, some functions have checks for this special case which is not really possible. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Clean up test interrupt handlingBen Hutchings2012-01-271-5/+7
| | | | | | | | | | | | | | | | | | | Interrupts are normally generated by the event queues, moderated by timers. However, they may also be triggered by detection of a 'fatal' error condition (e.g. memory parity error) or by the host writing to certain CSR fields as part of a self-test. The IRQ level/index used for these on Falcon rev B0 and Siena is set by the KER_INT_LEVE_SEL field and cached by the driver in efx_nic::fatal_irq_level. Since this value is also relevant to self-tests rename the field to just 'irq_level'. Avoid unnecessary cache traffic by using a per-channel 'last_irq_cpu' field and only writing to the per-controller field when the interrupt matches efx_nic::irq_level. Remove the volatile qualifier and use ACCESS_ONCE in the places we read these fields. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove dependence on NAPI polling in efx_test_eventq_irq()Ben Hutchings2012-01-271-39/+40
| | | | | | | | | | | | | | | | | We cannot safely assume that the NAPI handler will complete within the 20 ms that we allow for the event self-test. The handler may be deferred for longer than this, particularly on realtime kernels. Instead, check whether either an event has been handled or (as in the old failure path) whether an interrupt has been received and an event has been delivered but not yet handled. Use napi_disable() to synchronize with the NAPI handler before checking, since it will clear events before updating eventq_read_ptr. Remove the test result chan.N.eventq.poll, since it is not an error if the NAPI handler does not run during the test. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Consistently test DEBUG macro, not EFX_ENABLE_DEBUGBen Hutchings2012-01-271-1/+1
| | | | | | | | | | | | | | | | | | The netif_dbg() macro is defined in <linux/netdevice.h>. If the DEBUG macro is defined, it logs a message at 'debug' level, otherwise it does nothing. In net_driver.h we define DEBUG if EFX_ENABLE_DEBUG is defined, but this is too late for those source files that already got a definition of netif_dbg() by including <linux/netdevice.h> Get rid of EFX_ENABLE_DEBUG, and only define and test DEBUG. In mtd.c, we do not use DEBUG as a condition flag but are forced to use the DEBUG macro-function from <linux/mtd/mtd.h>. Undefine DEBUG before including it. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Merge efx_mac_operations into efx_nic_typeBen Hutchings2012-01-271-1/+1
| | | | | | | | | | | | | | | | | | | No NICs need to switch efx_mac_operations at run-time, and the MAC operations are fairly closely bound to NIC types. Move efx_mac_operations::reconfigure to efx_nic_type::reconfigure_mac and efx_mac_operations::check_fault fo efx_nic_type::check_mac_fault. Change callers to call through efx->type or directly if the NIC type is known. Remove efx_mac_operations::update_stats. The implementations for Falcon used to fetch MAC statistics synchronously and this was used by efx_register_netdev() to clear statistics after running self-tests. However, it now only converts statistics that have already been fetched (and that only for Falcon), and the call from efx_register_netdev() has no effect. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove unnecessary inclusion of <asm/io.h>, prompted by checkpatchBen Hutchings2012-01-091-1/+0
| | | | | | | | | | Fix the warning: WARNING: Use #include <linux/io.h> instead of <asm/io.h> There is no need for selftest.c to include the file at all. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Const-qualify static data as appropriate, partly prompted by checkpatchBen Hutchings2012-01-091-1/+1
| | | | | | | | | | | | Fix the following warnings: WARNING: struct dev_pm_ops should normally be const WARNING: static const char * array should probably be static const char * const Similarly const-qualify struct i2c_board_info, struct i2c_algo_bit_data, struct efx_ethtool_stat, struct efx_mtd_ops and struct siena_nvram_type_info. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Fix some formatting errors reported by checkpatchBen Hutchings2012-01-051-1/+1
| | | | | | | | | | Fix the following errors and warnings: ERROR: trailing whitespace ERROR: spaces required around that '=' (ctx:VxV) WARNING: please, no space before tabs Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Use kcalloc instead of kzalloc to allocate arrayThomas Meyer2011-12-041-2/+2
| | | | | | | | | | | | The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Move the Solarflare driversJeff Kirsher2011-08-111-0/+761
Moves the Solarflare drivers into drivers/net/ethernet/sfc/ and make the necessary Kconfig and Makefile changes. CC: Steve Hodgson <shodgson@solarflare.com> CC: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>