aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc
Commit message (Collapse)AuthorAge
...
* | sfc: Rename 'use_options' variable in tso_start() to clearer 'use_opt_desc'Ben Hutchings2014-02-12
| | | | | | | | | | | | 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>
* | sfc: Preserve rx_frm_trunc counters when resizing DMA ringsBen Hutchings2014-02-12
| | | | | | | | | | | | | | | | | | | | | | 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>
* | sfc: Correct comment about number of TX queues used on EF10Ben Hutchings2014-02-12
| | | | | | | | | | | | | | | | | | | | 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>
* | sfc: Remove unused definitions of EF10 user-mode DMA descriptorsBen Hutchings2014-02-12
| | | | | | | | | | | | | | | | | | 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>
* | sfc: Replace TSOH_OFFSET with the equivalent NET_IP_ALIGNBen Hutchings2014-02-12
| | | | | | | | | | | | | | | | | | 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>
* | sfc: Rewrite adjustment of PPS event in a clearer wayBen Hutchings2014-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | sfc: Cache skb->data in local variable in efx_ptp_rx()Ben Hutchings2014-02-12
| | | | | | | | | | | | 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>
* | sfc: Removed adhoc scheme to rate limit PTP event queue overflow messageLaurence Evans2014-02-12
|/ | | | | | | | 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>
* drivers/net: fix build warning in ethernet/sfc/tx.cPaul Gortmaker2014-02-07
| | | | | | | | | | | | | | | | | | | 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>
* sfc: Use the correct maximum TX DMA ring size for SFC9100Ben Hutchings2014-01-23
| | | | | | | | | | | | | | | | | | | 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>
* sfc: Fix transposed ptp_{under, over}size_sync_windows statisticsBen Hutchings2014-01-21
| | | | | | | | | | 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>
* sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command.Jon Cooper2014-01-21
| | | | | | | | 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>
* sfc: fix sparse non static symbol warningWei Yongjun2013-12-19
| | | | | | | | | | 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>
* net: sfc calls skb_set_hashTom Herbert2013-12-18
| | | | | | | | 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>
* Merge branch 'for-davem' of ↵David S. Miller2013-12-17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Fix RX drop filters for EF10Ben Hutchings2013-12-16
| | | | | | | | | | | | | | | | 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>
| * sfc: Add PTP counters to ethtool statsBen Hutchings2013-12-12
| | | | | | | | | | | | | | These were implemented by Andrew Jackson and Laurence Evans but not previously included in-tree. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Changed the statistic name emerg_{fetch,wait} to hlb_{fetch,wait}Shradha Shah2013-12-12
| | | | | | | | | | | | | | The original names are unnecessarily alarming. Head-of-line blocking is not an emergency. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: remove unused 'enum efx_rx_alloc_method'Andrew Rybchenko2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: remove unused 'refcnt' from efx_rx_page_stateAndrew Rybchenko2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Implement efx_nic_type::filter_clear_rx operation for EF10Ben Hutchings2013-12-12
| | | | | | | | | | | | | | | | 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>
| * sfc: Allow filter removal only with exactly matching priorityBen Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Don't refer to 'stack' in filter implementationBen Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | 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>
| * sfc: Change priority and flags for automatic MAC filtersBen Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Change efx_nic_type::rx_push_indir_table to push hash key as wellAndrew Rybchenko2013-12-12
| | | | | | | | | | | | | | | | 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>
| * sfc: Add more information to many warnings using WARN() and netdev_WARN()Ben Hutchings2013-12-12
| | | | | | | | | | | | | | 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>
* | Merge branch 'for-davem' of ↵David S. Miller2013-12-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Remove unnecessary condition for processing the TX timestamp queueBen Hutchings2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Don't clear timestamps in efx_ptp_rx()Ben Hutchings2013-12-12
| | | | | | | | | | | | A freshly allocated skb starts with timestamps clear. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Enable PTP clock and timestamping for all functions on EF10Ben Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Associate primary and secondary functions of controllerBen Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Store VPD serial number at probe timeBen Hutchings2013-12-12
| | | | | | | | | | | | Original version by Stuart Hodgson. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Add RX packet timestamping for EF10Jon Cooper2013-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Copy RX prefix into skb head area in efx_rx_mk_skb()Ben Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | 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>
| * sfc: split setup of hardware timestamping into NIC-type operationDaniel Pieczko2013-12-12
| | | | | | | | | | | | | | | | | | 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>
| * sfc: Add support for SFC9100 timestamp formatLaurence Evans2013-12-12
| | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Tidy up PTP synchronization codeLaurence Evans2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: PTP - tidy up unused/useless variablesLaurence Evans2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Remove kernel-doc for efx_ptp_data fields not present in this versionBen Hutchings2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Initialise efx_ptp_data::phc_clock_info from a static templateBen Hutchings2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Do not use MAC address as clock nameBen Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | 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>
| * sfc: Store flags from MC_CMD_DRV_ATTACH for later useBen Hutchings2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | Merge branch 'for-davem' of ↵David S. Miller2013-12-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Remove dependency of PTP on having a dedicated channelBen Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | | | | | We need a dedicated channel on Siena to ensure we can match up the separate RX and timestamp events for each PTP packet. We won't do this for EF10 as timestamps are delivered inline. Pass a channel index of 0 to MC_CMD_PTP_OP_ENABLE when there is no dedicated channel. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Split PTP multicast filter insertion/removal out of efx_ptp_{start,stop}()Ben Hutchings2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Return EBUSY for filter insertion on EF10, matching Falcon/SienaBen Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | The MC firmware will return error MC_CMD_ERR_ENOSPC if filter insertion fails due to lack of resources. The net driver's filter implementation for Falcon-architecture returns EBUSY. They should behave consistently, so for EF10 change ENOSPC to EBUSY. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Expose NVRAM_PARTITION_TYPE_LICENSE on EF10Ben Hutchings2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Fold efx_flush_all() into efx_stop_port() and update commentsBen Hutchings2013-12-12
| | | | | | | | | | | | | | | | | | | | | | | | efx_flush_all() is a really misleading name - it has nothing to do with e.g. flushing DMA queues. Since it's called immediately after efx_stop_port() and is highly dependent on what that does, combine the two functions. Update comments to explain what this is doing a little better. Also update an related and erroneous comment in efx_start_port(). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Map MCDI error MC_CMD_ERR_ENOTSUP to Linux EOPNOTSUPPBen Hutchings2013-12-12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Log all unexpected MCDI errorsEdward Cree2013-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split each of efx_mcdi_rpc, efx_mcdi_rpc_finish, and efx_mcdi_rpc_async into a normal and a _quiet version; made the former log MCDI errors with netif_err (and include the raw MCDI error code), and the latter never log them at all. Changed various callers; any where some errors are expected (but others are not) call the _quiet version and then if necessary log the MCDI error themselves. Said logging is done by new efx_mcdi_display_error. Callers of efx_mcdi_rpc*_quiet functions which may want to log the error need to ensure that their outbuf is big enough to hold an MCDI error; to this end, they now use MCDI_DECLARE_BUF_OUT_OR_ERR, which always allocates at least 8 bytes. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>