aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc
Commit message (Collapse)AuthorAge
* sfc: initialize dynamic sysfs attributes for lockdepMichal Schmidt2012-07-19
| | | | | | | | | | Dynamically allocated sysfs attributes must be initialized using sysfs_attr_init(), otherwise lockdep complains: BUG: key <address> not in .data! Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'for-davem' of ↵David S. Miller2012-07-18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next Ben Hutchings says: ==================== 1. Fix potential badness when running a self-test with SR-IOV enabled. 2. Fix calculation of some interface statistics that could run backward. 3. Miscellaneous cleanup. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * sfc: Correct some comments on enum reset_typeBen Hutchings2012-07-17
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Fix interface statistics running backwardBen Hutchings2012-07-17
| | | | | | | | | | | | | | | | | | Some interface statistics are computed in such a way that they can sometimes decrease (and even underflow). Since the computed value will never be greater than the true value, we fix this by only storing the computed value when it increases. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Disable VF queues during register self-testBen Hutchings2012-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Explain why efx_mcdi_exit_assertion() ignores result of efx_mcdi_rpc()Ben Hutchings2012-07-17
| | | | | | | | | | | | | | | | | | | | Fix CID 113952 in Coverity report on Linux. This is the one instance where we don't, and shouldn't, check the return code from efx_mcdi_rpc(). It wasn't immediately obvious to me why we didn't, so I think an explanation is in order. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Use dev_kfree_skb() in efx_end_loopback()Ben Hutchings2012-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: Use strlcpy() to copy ethtool stats namesBen Hutchings2012-07-17
| | | | | | | | | | | | | | | | | | | | Fix CID 113703 in the Coverity report on Linux. ethtool stats names are limited to 32 bytes including a null terminator. Use strlcpy() to ensure that we will always include the null terminator even if a source string becomes longer than this. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Stop changing header offsets on TXBen Hutchings2012-07-17
| | | | | | | | | | | | | | There is nothing in the VLAN driver or core VLAN support that invalidates the TCP and IP header offsets. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Remove dead write to tso_state::packet_spaceBen Hutchings2012-07-17
| | | | | | | | | | | | | | tso_state::packet_space is always set in tso_start_packet(); the value set in tso_start() is not used, and is also incorrect. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Use generic DMA API, not PCI-DMA APIBen Hutchings2012-07-17
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Work around bogus 'uninitialised variable' warningBen Hutchings2012-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With some gcc versions & optimisations, the compiler will warn that 'depth' in efx_filter_insert_filter() may be used without being initialised, although this is not the case. This is related to inlining of efx_filter_search(), which only has one caller since commit 8db182f4a8a6e2dcb8b65905ea4af56210e65430 ('sfc: Remove now-unused filter function'). Shut the compiler up by initialising it to 0. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | drivers/net/ethernet: Fix non-kernel-doc comments with kernel-doc start markersBen Hutchings2012-07-11
| | | | | | | | | | | | | | | | | | Convert doxygen (or similar) formatted comments to kernel-doc or unformatted comment. Delete a few that are content-free. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | drivers/net/ethernet: Fix (nearly-)kernel-doc comments for various functionsBen Hutchings2012-07-11
|/ | | | | | | | | | Fix incorrect start markers, wrapped summary lines, missing section breaks, incorrect separators, and some name mismatches. Delete a few that are content-free. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-05-16
|\
| * sfc: Fix division by zero when using one RX channel and no SR-IOVBen Hutchings2012-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If RSS is disabled on the PF (efx->n_rx_channels == 1) we try to set up the indirection table so that VFs can use it, setting efx->rss_spread = efx_vf_size(efx). But if SR-IOV was disabled at compile time, this evaluates to 0 and we end up dividing by zero when initialising the table. I considered changing the fallback definition of efx_vf_size() to return 1, but its value is really meaningless if we are not going to enable VFs. Therefore add a condition of efx_sriov_wanted(efx) in efx_probe_interrupts(). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | drivers/net: Convert compare_ether_addr to ether_addr_equalJoe Perches2012-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new bool function ether_addr_equal to add some clarity and reduce the likelihood for misuse of compare_ether_addr for sorting. Done via cocci script: $ cat compare_ether_addr.cocci @@ expression a,b; @@ - !compare_ether_addr(a, b) + ether_addr_equal(a, b) @@ expression a,b; @@ - compare_ether_addr(a, b) + !ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) == 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) != 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) == 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) != 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !!ether_addr_equal(a, b) + ether_addr_equal(a, b) Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sfc: Implement module EEPROM access for SFE4002 and SFN4112FBen Hutchings2012-05-09
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Added support for new ethtool APIs for obtaining module eepromStuart Hodgson2012-05-09
| | | | | | | | | | | | | | | | | | | | Currently allows for SFP+ eeprom to be returned using the ethtool API. This can be extended in future to handle different eeprom formats and sizes Signed-off-by: Stuart Hodgson <smhodgson@solarflare.com> [bwh: Drop redundant validation, comment, whitespace] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: By default refill RX rings as soon as space for a batchDavid Riddoch2012-05-09
| | | | | | | | | | | | | | Previously we refilled with much larger batches, which caused large latency spikes. We now have many more much much smaller spikes! Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Fill RX rings completely full, rather than to 95% fullDavid Riddoch2012-05-09
| | | | | | | | | | | | | | There was no runtime control of the fast_fill_limit in any case, so purged that field. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Fix missing cleanup in failure path of efx_pci_probe()Ben Hutchings2012-05-09
| | | | | | | | | | | | | | We need to clear the private data pointer in the PCI device. Also reorder cleanup in efx_pci_remove() for symmetry. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Do not attempt to flush queues if DMA is disabledStuart Hodgson2012-05-09
|/ | | | | | | efx_nic_fatal_interrupt() disables DMA before scheduling a reset. After this, we need not and *cannot* flush queues. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* Merge tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6Linus Torvalds2012-03-30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull MTD changes from David Woodhouse: - Artem's cleanup of the MTD API continues apace. - Fixes and improvements for ST FSMC and SuperH FLCTL NAND, amongst others. - More work on DiskOnChip G3, new driver for DiskOnChip G4. - Clean up debug/warning printks in JFFS2 to use pr_<level>. Fix up various trivial conflicts, largely due to changes in calling conventions for things like dmaengine_prep_slave_sg() (new inline wrapper to hide new parameter, clashing with rewrite of previously last parameter that used to be an 'append' flag, and is now a bitmap of 'unsigned long flags'). (Also some header file fallout - like so many merges this merge window - and silly conflicts with sparse fixes) * tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6: (120 commits) mtd: docg3 add protection against concurrency mtd: docg3 refactor cascade floors structure mtd: docg3 increase write/erase timeout mtd: docg3 fix inbound calculations mtd: nand: gpmi: fix function annotations mtd: phram: fix section mismatch for phram_setup mtd: unify initialization of erase_info->fail_addr mtd: support ONFI multi lun NAND mtd: sm_ftl: fix typo in major number. mtd: add device-tree support to spear_smi mtd: spear_smi: Remove default partition information from driver mtd: Add device-tree support to fsmc_nand mtd: fix section mismatch for doc_probe_device mtd: nand/fsmc: Remove sparse warnings and errors mtd: nand/fsmc: Add DMA support mtd: nand/fsmc: Access the NAND device word by word whenever possible mtd: nand/fsmc: Use dev_err to report error scenario mtd: nand/fsmc: Use devm routines mtd: nand/fsmc: Modify fsmc driver to accept nand timing parameters via platform mtd: fsmc_nand: add pm callbacks to support hibernation ...
| * sfc: mtd: Use MTD_FAIL_ADDR_UNKNOWN instead of 0xffffffffShmulik Ladkani2012-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | As of bb0eb217, MTD_FAIL_ADDR_UNKNOWN should be used to indicate mtd erase failure not specific to any particular block. Use MTD_FAIL_ADDR_UNKNOWN instead of 0xffffffff when setting 'erase->fail_addr' in 'efx_mtd_erase()'. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: add leading underscore to all mtd functionsArtem Bityutskiy2012-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch renames all MTD functions by adding a "_" prefix: mtd->erase -> mtd->_erase mtd->read_oob -> mtd->_read_oob ... The reason is that we are re-working the MTD API and from now on it is an error to use MTD function pointers directly - we have a corresponding API call for every pointer. By adding a leading "_" we achieve the following: 1. Make sure we convert every direct pointer users 2. A leading "_" suggests that this interface is internal and it becomes less likely that people will use them directly 3. Make sure all the out-of-tree modules stop compiling and the owners spot the big API change and amend them. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | sfc: Log the part number on probeBen Hutchings2012-03-06
| | | | | | | | | | | | | | | | | | During probe of each port, read and log the part number from VPD. Remove the Falcon-specific board name lookup. Initial version by Stuart Hodgson <smhodgson@solarflare.com>. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Remove efx_channel::last_eventq_read_ptrBen Hutchings2012-03-06
| | | | | | | | | | | | This member has never been used in a production version of the driver. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Run event/IRQ self-test asynchronously when interface is brought upBen Hutchings2012-03-06
| | | | | | | | | | | | | | | | 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-06
| | | | | | | | | | | | 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-06
| | | | | | | | | | | | | | | | 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-06
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 TX completions from adaptive IRQ scoringBen Hutchings2012-03-06
| | | | | | | | | | | | | | | | | | | | RX and TX completions on the same event queue are generally not associated with the same flows. The inclusion of TX completions in the adaptive IRQ score is more of a source of noise rather than useful feedback. Therefore, do not include them in the score, and adjust the default threshold scores down. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Update comments on efx_rx_packet_gro()Ben Hutchings2012-03-06
| | | | | | | | | | | | | | | | The in-tree driver has never supported Driverlink. The rest of the comments are rather redundant, but we can usefully state what the requirements are on the buffer state. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Remove redundant function efx_nic_has_mc()Ben Hutchings2012-03-06
| | | | | | | | | | | | | | This function is now used in only one place, where it always returns true. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Fix calculation of vf_i in map_vi_index()Robert Stonehouse2012-03-06
| | | | | | | | | | | | | | This was broken during refactoring to use efx_vf_size(). [bwh: Keep using efx_vf_size()] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller2012-02-26
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/net/ethernet/sfc/rx.c Overlapping changes in drivers/net/ethernet/sfc/rx.c, one to change the rx_buf->is_page boolean into a set of u16 flags, and another to adjust how ->ip_summed is initialized. Signed-off-by: David S. Miller <davem@davemloft.net>
| * sfc: Fix assignment of ip_summed for pre-allocated skbsBen Hutchings2012-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When pre-allocating skbs for received packets, we set ip_summed = CHECKSUM_UNNCESSARY. We used to change it back to CHECKSUM_NONE when the received packet had an incorrect checksum or unhandled protocol. Commit bc8acf2c8c3e43fcc192762a9f964b3e9a17748b ('drivers/net: avoid some skb->ip_summed initializations') mistakenly replaced the latter assignment with a DEBUG-only assertion that ip_summed == CHECKSUM_NONE. This assertion is always false, but it seems no-one has exercised this code path in a DEBUG build. Fix this by moving our assignment of CHECKSUM_UNNECESSARY into efx_rx_packet_gro(). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | ethernet: unify return value of .ndo_set_mac_address if address is invalidDanny Kukawka2012-02-23
| | | | | | | | | | | | | | | | | | Unify return value of .ndo_set_mac_address if the given address isn't valid. Return -EADDRNOTAVAIL as eth_mac_addr() already does if is_valid_ether_addr() fails. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sfc: Correct efx_for_each_possible_channel_tx_queue() to skip non-TX channelsBen Hutchings2012-02-22
| | | | | | | | | | | | | | | | | | efx_for_each_possible_channel_tx_queue() should do nothing for RX-only or extra channels. The current definition results in allocating additional unused hardware TX queues when using the mqprio qdisc and either separate_tx_channels or SR-IOV. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Minor formatting cleanupBen Hutchings2012-02-22
| | | | | | | | | | | | Fix some indentation and line continuations. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Reverse initial buffer table allocation to allow for later resizingBen Hutchings2012-02-22
| | | | | | | | | | | | | | | | | | | | We have a very simple way of allocating buffer table entries to queues, which is just to take the next one available. The extra channels are the highest numbered channels but they need to be allocated the lowest entries so that the traffic channels can be allocated new entries without any collisions. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Correct validation of peer_page_count in efx_vfdi_set_status_page()Ben Hutchings2012-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | efx_vfdi_set_status_page() validates the peer page count by calculating the size of a request containing that many addresses and comparing that with the maximum valid request size (4KB). The calculation involves a multiplication that may overflow on a 32-bit system. We use kcalloc() to allocate memory to store the addresses; that also does a multiplication and it does check for integer overflow, so any values larger than 0x1fffffff will be rejected. However, values in the range [0x1fffffffc, 0x1fffffff] pass boh tests and result in an attempt to allocate nearly 4GB on the heap. This should be rejected rather quickly as it's obviously impossible on a 32-bit system, and indeed the maximum possible heap allocation is 32MB. Still, let's make absolutely sure by fixing the initial validation. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Specify that the VFDI status page has page alignment and sizeBen Hutchings2012-02-22
| | | | | | | | | | | | | | | | | | | | | | | | This requirement was meant to be implied in the name 'status page'. One out-of-tree VF driver allocates a buffer using the structure size and not a full page - hence the current odd specification - but in practice that allocation will be padded and aligned to at least 4KB. Therefore, we can specify this and have the option to extend the structure up to 4KB without worrying about VF drivers using odd-shaped buffers. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Add SR-IOV back-end support for SFC9000 familyBen Hutchings2012-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the SFC9000 family, each port has 1024 Virtual Interfaces (VIs), each with an RX queue, a TX queue, an event queue and a mailbox register. These may be assigned to up to 127 SR-IOV virtual functions per port, with up to 64 VIs per VF. We allocate an extra channel (IRQ and event queue only) to receive requests from VF drivers. There is a per-port limit of 4 concurrent RX queue flushes, and queue flushes may be initiated by the MC in response to a Function Level Reset (FLR) of a VF. Therefore, when SR-IOV is in use, we submit all flush requests via the MC. The RSS indirection table is shared with VFs, so the number of RX queues used in the PF is limited to the number of VIs per VF. This is almost entirely the work of Steve Hodgson, formerly shodgson@solarflare.com. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Allocate SRAM between buffer table and descriptor caches at init timeBen Hutchings2012-02-15
| | | | | | | | | | | | | | | | | | Each port has a block of 64-bit SRAM that is divided between buffer table and descriptor cache regions at initialisation time. Currently we use a fixed allocation, but it needs to be changed to support larger numbers of queues. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Pass NIC structure into efx_wanted_parallelism()Ben Hutchings2012-02-15
| | | | | | | | | | | | | | This lets us identify the NIC affected in case of failure, and will be necessary to adjust for SR-IOV constraints. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Add support for 'extra' channel typesBen Hutchings2012-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Abstract some of the channel operations to allow for 'extra' channels that do not have RX or TX queues. - Try to assign a channel to each extra channel type that is enabled for the NIC, but gracefully degrade if we can't allocate sufficient MSI-X vectors - Allow each extra channel type to generate its own channel name - Allow channel types to disable reallocation and reinitialisation of their channels Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Make all CPU/IRQ/channel/queue counts unsignedBen Hutchings2012-02-15
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | sfc: Make buffer table indices and counts consistently unsignedBen Hutchings2012-02-15
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>