summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc
AgeCommit message (Collapse)AuthorFilesLines
2014-04-16sfc:On MCDI timeout, issue an FLR (and mark MCDI to fail-fast)Edward Cree10-22/+133
When an MCDI command times out (whether or not we find it completed when we poll), call efx_mcdi_abandon(), which tells all subsequent MCDI calls to fail-fast, and queues up an FLR. Because an FLR doesn't lead to receiving any reboot even from the MC (unlike most other types of reset), we have to call efx_ef10_reset_mc_allocations. In efx_start_all(), if a reset (of any kind) is pending, we bail out. Without this, attempts to reconfigure (e.g. change mtu) can cause driver/mc state inconsistency if the first MCDI call triggers an FLR. For similar reasons, on EF10, in efx_reset_down(method=RESET_TYPE_MCDI_TIMEOUT), set the number of active queues to zero before calling efx_stop_all(). And, on farch, in efx_reset_up(method=RESET_TYPE_MCDI_TIMEOUT), set active_queues and flushes pending & outstanding to zero. efx_mcdi_mode_{poll,event}() should not take us out of fail-fast mode. Instead, this is done by efx_mcdi_reset() after the FLR completes. The new FLR reset_type RESET_TYPE_MCDI_TIMEOUT doesn't really fit into the hierarchy of reset 'scopes' whereby efx_reset() decides some resets subsume others. Thus, it uses separate logic. Also, fixed up some inconsistency around RESET_TYPE_MC_BIST, which was in the wrong place in that hierarchy. Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-04-01Call efx_set_channels() before efx->type->dimension_resources()Daniel Pieczko2-1/+9
When using the "separate_tx_channels=1" module parameter, the TX queues are initially numbered starting from the first TX-only channel number (after all the RX-only channels). efx_set_channels() renumbers the queues so that they are indexed from zero. On EF10, the TX queues need to be relabelled in this way before calling the dimension_resources NIC type operation, otherwise the TX queue PIO buffers can be linked to the wrong VIs when using "separate_tx_channels=1". Added comments to explain UC/WC mappings for PIO buffers Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-21ptp: drivers: set the number of programmable pins.Richard Cochran1-0/+1
This patch updates the many PTP Hardware Clock drivers with the newly introduced field that advertises the number of programmable pins. Some of these devices do have programmable pins, but the implementation will have to wait for follow on patches. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-14sfc: Don't receive packets when the napi budget == 0Eric W. Biederman2-0/+6
Processing any incoming packets with a with a napi budget of 0 is incorrect driver behavior. This matters as netpoll will shortly call drivers with a budget of 0 to avoid receive packet processing happening in hard irq context. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-10sfc: Use ether_addr_copy and eth_broadcast_addrEdward Cree9-39/+37
Faster than memcpy/memset on some architectures. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-05Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-0/+7
Conflicts: drivers/net/wireless/ath/ath9k/recv.c drivers/net/wireless/mwifiex/pcie.c net/ipv6/sit.c The SIT driver conflict consists of a bug fix being done by hand in 'net' (missing u64_stats_init()) whilst in 'net-next' a helper was created (netdev_alloc_pcpu_stats()) which takes care of this. The two wireless conflicts were overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-26sfc: check for NULL efx->ptp_data in efx_ptp_eventEdward Cree1-0/+7
If we receive a PTP event from the NIC when we haven't set up PTP state in the driver, we attempt to read through a NULL pointer efx->ptp_data, triggering a panic. Signed-off-by: Edward Cree <ecree@solarflare.com> Acked-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-18sfc: Use pci_enable_msix_range() instead of pci_enable_msix()Alexander Gordeev1-11/+9
As result of deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() and pci_enable_msix_range() interfaces. Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Cc: Shradha Shah <sshah@solarflare.com> Cc: linux-net-drivers@solarflare.com Cc: netdev@vger.kernel.org Cc: linux-pci@vger.kernel.org Acked-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Add/remove blank lines to tasteBen Hutchings5-7/+2
Remove trailing blank lines in several files. Use only one blank line between functions. Add a blank line as a separator in a few places. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Fail self-test with -EBUSY, not -EIO, if the device is busyBen Hutchings1-1/+1
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Cosmetic changes to self-test from the out-of-tree driverBen Hutchings1-5/+13
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Update product namingBen Hutchings2-2/+2
We don't use 'Solarstorm' or 'Solarflare Communications' in full any more. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Use canonical pointer type for MAC address in efx_set_mac_address()Ben Hutchings1-1/+1
Functions such as is_valid_ether_addr() expect u8 *, so use that instead of char *. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Rename 'use_options' variable in tso_start() to clearer 'use_opt_desc'Ben Hutchings1-2/+2
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Preserve rx_frm_trunc counters when resizing DMA ringsBen Hutchings1-2/+0
We allocate efx_channel structures with kzalloc() so we don't need to zero-initialise individual fields in efx_probe_channel(). Further, this function will be called again during DMA ring resizing and we should not reset any statistics then. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Correct comment about number of TX queues used on EF10Ben Hutchings1-2/+2
EF10 implements option descriptors to switch TX checksum offload on and off between packets. We could therefore use a single hardware TX queue per kernel TX queue, although we don't yet. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Remove unused definitions of EF10 user-mode DMA descriptorsBen Hutchings1-61/+0
These DMA descriptor types will only be used by the userland networking stack. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Replace TSOH_OFFSET with the equivalent NET_IP_ALIGNBen Hutchings1-13/+4
If CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is defined then NET_IP_ALIGN will be defined as 0, so this macro is redundant. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Rewrite adjustment of PPS event in a clearer wayBen Hutchings1-24/+23
There is substantial latency in generation and handling of PPS events from the NIC, which we have to correct for before passing a host timestamp to the PPS subsystem. We compare clocks with the MC, giving us two offsets to subtract from the timestamp generated by pps_get_ts(): (a) Time from the last good sync (where we got host and NIC timestamps for nearly the same instant) to the time we called pps_get_ts() (b) Time from NIC top of second to the last good sync We currently calculate (a) + (b) in a quite confusing way. Instead, calculate (a) completely, then add (b) to it. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Cache skb->data in local variable in efx_ptp_rx()Ben Hutchings1-10/+13
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-12sfc: Removed adhoc scheme to rate limit PTP event queue overflow messageLaurence Evans1-20/+2
Use conventional net_ratelimit() instead. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-02-06drivers/net: fix build warning in ethernet/sfc/tx.cPaul Gortmaker1-0/+2
Commit ee45fd92c739db5b7950163d91dfe5f016af6d24 ("sfc: Use TX PIO for sufficiently small packets") introduced the following warning: drivers/net/ethernet/sfc/tx.c: In function 'efx_enqueue_skb': drivers/net/ethernet/sfc/tx.c:432:1: warning: label 'finish_packet' defined but not used Stick the label inside the same #ifdef that the code which calls it uses. Note that this is only seen for arch that do not set ARCH_HAS_IOREMAP_WC, such as arm, mips, sparc, ..., as the others enable the write combining code and hence use the label. Cc: Jon Cooper <jcooper@solarflare.com> Cc: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-23sfc: Use the correct maximum TX DMA ring size for SFC9100Ben Hutchings2-2/+5
As part of a workaround for a hardware erratum in the SFC9100 family (SF bug 35388), the TX_DESC_UPD_DWORD register address is also used for communicating with the event block, and only descriptor pointer values < 2048 are valid. If the TX DMA ring size is increased to 4096 descriptors (which the firmware still allows) then we may write a descriptor pointer value >= 2048, which has entirely different and undesirable effects! Limit the TX DMA ring size correctly when this workaround is in effect. Fixes: 8127d661e77f ('sfc: Add support for Solarflare SFC9100 family') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-21sfc: Fix transposed ptp_{under, over}size_sync_windows statisticsBen Hutchings1-2/+2
Somehow I transposed these two while bringing the original statistics support upstream. Fixes: 99691c4ac112 ('sfc: Add PTP counters to ethtool stats') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-21sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command.Jon Cooper2-8/+37
PORT_RESET MC command was NOP in the ef10 firmware hence we are using ENTITY_RESET to make sure all resource allocations are reset. Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-19sfc: fix sparse non static symbol warningWei Yongjun1-1/+1
Fixes the following sparse warning: drivers/net/ethernet/sfc/falcon.c:2601:6: warning: symbol 'falcon_pull_nic_stats' was not declared. Should it be static? Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-18net: sfc calls skb_set_hashTom Herbert1-1/+2
Drivers should call skb_set_hash to set the hash and its type in an skbuff. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-17Merge branch 'for-davem' of ↵David S. Miller11-206/+362
git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next Ben Hutchings says: ==================== Miscellaneous changes for 3.14: 1. Add more information to some WARN messages. 2. Refactor pushing of RSS configuration, from Andrew Rybchenko. 3. Refactor handling of automatic (device address list) vs manual (RX NFC) MAC filters. 4. Implement clearing of manual RX filters on EF10 when ntuple offload is disabled. 5. Remove definitions that are unused since the RX buffer allocation changes, from Andrew Rybchenko. 6. Improve naming of some statistics, from Shradha Shah. 7. Add statistics for PTP support code. 8. Fix insertion of RX drop filters on EF10. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-16sfc: Fix RX drop filters for EF10Ben Hutchings1-1/+3
When we insert an filter, the firmware checks that the given RX queue index is in range even if it will not be used. In case we're inserting a drop filter, pass the value 0. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-14Merge branch 'for-davem' of ↵David S. Miller10-217/+797
git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next Ben Hutchings says: ==================== 1. Change PTP clock name to 'sfc'. 2. Complete support for hardware timestamping and PTP clock on the SFC9100 family. 3. Various cleanups for the PTP code. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-14Merge branch 'for-davem' of ↵David S. Miller20-421/+1418
git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next Ben Hutchings says: ==================== An assortment of changes for Linux 3.14: 1. Merge the sfc fixes that you have already merged into net.git. (The branch point for those was such that this does not bring in any other changes.) 2. Reduce log level for a generally useless warning message, from Robert Stonehouse. 3. Include BISTs in ethtool offline self-test for EF10 and recover from BISTs initiated through other functions, from Jon Cooper. 4. Improve a sanity check on RX completions. 5. Avoid incrementing RX dropped count while the interface is down, from Jon Cooper. 6. Improve hardware sensor naming and log messages, from Edward Cree. 7. Log all unexpected errors returned by firmware, from Edward Cree. 8. Expose another NVRAM partition to userland. 9. Some refactoring of the PTP code in preparation for EF10 support. 10. Various minor cleanups. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-12sfc: Add PTP counters to ethtool statsBen Hutchings3-9/+127
These were implemented by Andrew Jackson and Laurence Evans but not previously included in-tree. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Changed the statistic name emerg_{fetch,wait} to hlb_{fetch,wait}Shradha Shah2-6/+6
The original names are unnecessarily alarming. Head-of-line blocking is not an emergency. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: remove unused 'enum efx_rx_alloc_method'Andrew Rybchenko1-6/+0
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: remove unused 'refcnt' from efx_rx_page_stateAndrew Rybchenko1-3/+0
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Implement efx_nic_type::filter_clear_rx operation for EF10Ben Hutchings6-28/+32
The operation can now fail, so change its return type to int. Remove the inline wrapper while we're changing the signature. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Allow filter removal only with exactly matching priorityBen Hutchings2-2/+2
Currently a higher priority client can remove a lower priority client's filter with equal match-expression. This might happen if (a) the higher priority client has a double-free bug, or (b) another client with sufficient priority replaced and then removed an equal filter, allowing the low priority client to insert an equal filter. In neither case does it actually make sense to carry out the removal; we should say the filter doesn't exist, as the filter currently present is not the one that the high-priority client is referring to. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Don't refer to 'stack' in filter implementationBen Hutchings2-56/+56
Change all the 'stack' naming to 'auto' (or other meaningful term); the device address list is based on more than just what the network stack wants, and the no-match filters aren't really what the stack wants at all. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Change priority and flags for automatic MAC filtersBen Hutchings4-54/+67
MAC filters inserted automatically by the driver, based on the device address list (EF10) or no-match filters (Siena), should be overridable at MANUAL or REQUIRED priority. Currently they themselves have REQUIRED priority and this requires some odd special-casing. We also can't reliably tell whether such a MAC filter has or has not been overridden. We just remember that it is wanted by the stack (RX_STACK flag). Add another priority level, AUTO, between HINT and MANUAL, and use this for the automatic filters while they have not been overridden. Remove the RX_STACK flag. Add an RX_OVER_AUTO flag which is set only when an AUTO filter has been overridden (or was requested to be inserted while a higher-priority filter existed). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Change efx_nic_type::rx_push_indir_table to push hash key as wellAndrew Rybchenko7-39/+57
The EF10 implementation already does this, and it makes more logical sense to group the RSS hash key and indirection table together. Rename the operation to rx_push_rss_config. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Add more information to many warnings using WARN() and netdev_WARN()Ben Hutchings1-10/+20
In case of certain hardware and firmware errors it can be useful to have more context than just the file and line number. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Remove unnecessary condition for processing the TX timestamp queueBen Hutchings1-12/+4
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Don't clear timestamps in efx_ptp_rx()Ben Hutchings1-6/+0
A freshly allocated skb starts with timestamps clear. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Enable PTP clock and timestamping for all functions on EF10Ben Hutchings2-17/+30
The SFC9100 family has only one clock per controller, shared by all functions. Therefore only create a clock device under the primary function, and make all other functions refer to the primary's clock device. Since PTP functionality is limited to port 0 and PF 0 on the earlier SFN[56]322F boards, and we also set the primary flag for that function, we can make the creation of a clock device conditional only on this flag. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Associate primary and secondary functions of controllerBen Hutchings4-0/+93
The primary function of an EF10 controller will share its clock device with other functions in the same domain (which we call secondary functions). To this end, we need to associate functions on the same controller. We do not control probe order, so allow primary and secondary functions to appear in any order. Maintain global lists of all primary functions and of unassociated secondary functions, and a list of secondary functions on each primary function. Use the VPD serial number to tell whether functions are part of the same controller. VPD will not be readable by virtual functions, so this may need to be revisited later. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Store VPD serial number at probe timeBen Hutchings2-7/+34
Original version by Stuart Hodgson. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Add RX packet timestamping for EF10Jon Cooper7-15/+277
The EF10 firmware can optionally insert RX timestamps in the packet prefix. These only include the clock minor value. We must also enable periodic time sync events on each event queue which provide the high bits of the clock value. [bwh: Combined and rebased several changes. Added the above description and some sanity checks for inline vs separate timestamps. Changed efx_rx_skb_attach_timestamp() to read the packet prefix from the skb head area.] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Copy RX prefix into skb head area in efx_rx_mk_skb()Ben Hutchings2-12/+7
We can potentially pull the entire packet contents into the head area and then free the page it was in. In order to read an inline timestamp safely, we need to copy the prefix into the head area as well. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: split setup of hardware timestamping into NIC-type operationDaniel Pieczko4-72/+78
I added efx_ptp_get_mode() to avoid moving the definition for efx_ptp_data, since the current PTP mode is needed for siena.c:siena_set_ptp_hwtstamp. [bwh: Also move the rx_filters mask, and add kernel-doc] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Add support for SFC9100 timestamp formatLaurence Evans1-25/+231
The clock minor tick on the SFC9100 family is 2^-27 s, not 1 ns. There are also various pipeline delays which we need to correct for when interpreting timestamps. We query the firmware for the clock format and corrections at run-time. [bwh: Combined and rebased several changes] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>