summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc
AgeCommit message (Collapse)Author
2014-03-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller
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 Cree
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 Gordeev
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 Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Evans
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-07drivers/net: fix build warning in ethernet/sfc/tx.cPaul Gortmaker
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 Hutchings
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 Hutchings
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 Cooper
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 Yongjun
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 Herbert
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. Miller
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 Hutchings
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-15Merge branch 'for-davem' of ↵David S. Miller
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. Miller
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 Hutchings
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 Shah
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 Rybchenko
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: remove unused 'refcnt' from efx_rx_page_stateAndrew Rybchenko
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Implement efx_nic_type::filter_clear_rx operation for EF10Ben Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
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 Rybchenko
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 Hutchings
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 Hutchings
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Don't clear timestamps in efx_ptp_rx()Ben Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
Original version by Stuart Hodgson. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Add RX packet timestamping for EF10Jon Cooper
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 Hutchings
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 Pieczko
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 Evans
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>
2013-12-12sfc: Tidy up PTP synchronization codeLaurence Evans
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: PTP - tidy up unused/useless variablesLaurence Evans
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Remove kernel-doc for efx_ptp_data fields not present in this versionBen Hutchings
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Initialise efx_ptp_data::phc_clock_info from a static templateBen Hutchings
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-12sfc: Do not use MAC address as clock nameBen Hutchings
We'll be sharing clocks between multiple functions with their own MAC addresses. The name field is now documented as 'A short "friendly name" to identify the clock ...' and '... not meant to be a unique id.' So use the name 'sfc'. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>