summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc
Commit message (Collapse)AuthorAgeFilesLines
...
| * sfc: Add PTP counters to ethtool statsBen Hutchings2013-12-123-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>
| * sfc: Changed the statistic name emerg_{fetch,wait} to hlb_{fetch,wait}Shradha Shah2013-12-122-6/+6
| | | | | | | | | | | | | | 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-121-6/+0
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: remove unused 'refcnt' from efx_rx_page_stateAndrew Rybchenko2013-12-121-3/+0
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Implement efx_nic_type::filter_clear_rx operation for EF10Ben Hutchings2013-12-126-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>
| * sfc: Allow filter removal only with exactly matching priorityBen Hutchings2013-12-122-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>
| * sfc: Don't refer to 'stack' in filter implementationBen Hutchings2013-12-122-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>
| * sfc: Change priority and flags for automatic MAC filtersBen Hutchings2013-12-124-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>
| * sfc: Change efx_nic_type::rx_push_indir_table to push hash key as wellAndrew Rybchenko2013-12-127-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>
| * sfc: Add more information to many warnings using WARN() and netdev_WARN()Ben Hutchings2013-12-121-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>
* | Merge branch 'for-davem' of ↵David S. Miller2013-12-1410-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>
| * sfc: Remove unnecessary condition for processing the TX timestamp queueBen Hutchings2013-12-121-12/+4
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Don't clear timestamps in efx_ptp_rx()Ben Hutchings2013-12-121-6/+0
| | | | | | | | | | | | 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-122-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>
| * sfc: Associate primary and secondary functions of controllerBen Hutchings2013-12-124-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>
| * sfc: Store VPD serial number at probe timeBen Hutchings2013-12-122-7/+34
| | | | | | | | | | | | Original version by Stuart Hodgson. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Add RX packet timestamping for EF10Jon Cooper2013-12-127-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>
| * sfc: Copy RX prefix into skb head area in efx_rx_mk_skb()Ben Hutchings2013-12-122-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>
| * sfc: split setup of hardware timestamping into NIC-type operationDaniel Pieczko2013-12-124-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>
| * sfc: Add support for SFC9100 timestamp formatLaurence Evans2013-12-121-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>
| * sfc: Tidy up PTP synchronization codeLaurence Evans2013-12-121-20/+24
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: PTP - tidy up unused/useless variablesLaurence Evans2013-12-121-15/+1
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Remove kernel-doc for efx_ptp_data fields not present in this versionBen Hutchings2013-12-121-15/+0
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Initialise efx_ptp_data::phc_clock_info from a static templateBen Hutchings2013-12-121-14/+16
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Do not use MAC address as clock nameBen Hutchings2013-12-121-3/+2
| | | | | | | | | | | | | | | | | | 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-122-2/+18
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* | Merge branch 'for-davem' of ↵David S. Miller2013-12-1420-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>
| * sfc: Remove dependency of PTP on having a dedicated channelBen Hutchings2013-12-123-24/+41
| | | | | | | | | | | | | | | | | | | | | | 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-121-17/+39
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Return EBUSY for filter insertion on EF10, matching Falcon/SienaBen Hutchings2013-12-121-0/+2
| | | | | | | | | | | | | | | | | | 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-121-0/+1
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Fold efx_flush_all() into efx_stop_port() and update commentsBen Hutchings2013-12-121-18/+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-121-0/+2
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Log all unexpected MCDI errorsEdward Cree2013-12-125-229/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * sfc: Add new sensor namesBen Hutchings2013-12-121-0/+3
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Revise sensor names to be more understandable and consistentEdward Cree2013-12-121-23/+26
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Report units in sensor warningsEdward Cree2013-12-121-4/+20
| | | | | | | | | | | | Add units to the "Sensor reports condition X for raw value Y" messages. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Correct RX dropped count for drops while interface is downJon Cooper2013-12-129-11/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't directly control RX ingress on Siena or any later controllers, and so we cannot prevent packets from entering the RX datapath while the RX queues are not set up. This results in the hardware incrementing RX_NODESC_DROP_CNT, but it's not an error and we should not include it in error stats. When bringing an interface up or down, pull (or wait for) stats and count the number of packets that were dropped while the interface was down. Subtract this from the reported RX dropped count. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Make initial fill of RX descriptors synchronousJon Cooper2013-12-125-9/+12
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Tighten the check for RX merged completion eventsBen Hutchings2013-12-121-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The addition of RX event merging support means we don't reliably detect dropped RX events now. Currently we will only detect them if the previous event for the RX queue had the CONT bit set. Only accept RX completion events as merged if the GET_CAPABILITIES_OUT_RX_BATCHING bit is set in datapath_caps (which it won't be for the low-latency datapath) and the CONT bit is not set on the event. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Add MC BISTs to ethtool offline self test on EF10Jon Cooper2013-12-128-2/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To run BISTs the MC goes down in to a special mode where it will only respond to MCDI from the testing PF, and TX, RX and event queues are torn down. Other PFs get a message as it goes down to tell them it's going down. When the other PFs get this message, they check the soft status register to tell when the MC has rebooted after BIST mode and they can start recovery. [bwh: Convert the test result to 1 or -1 as for earlier NICs] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Update MCDI protocol definitionsBen Hutchings2013-12-061-70/+663
| | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * sfc: Demote "MC Scheduler error" messagesRobert Stonehouse2013-12-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | The MC firmware is cooperatively multitasking and its scheduler will send an event when a task yields after running for more than the expected maximum time. This can be useful for firmware development but does not usually indicate a serious error and does not help to detect a lockup (there is a hardware watchdog that does that). Change the message and reduce log level accordingly. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| * Merge branch 'sfc-3.13' into masterBen Hutchings2013-12-066-23/+101
| |\ | | | | | | | | | | | | Merge sfc fixes destined for 3.13, as development for 3.14+ depends on some of them.
| | * sfc: Poll for MCDI completion once before timeout occursRobert Stonehouse2013-12-061-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an as-yet unexplained bug that sometimes prevents (or delays) the driver seeing the completion event for a completed MCDI request on the SFC9120. The requested configuration change will have happened but the driver assumes it to have failed, and this can result in further failures. We can mitigate this by polling for completion after unsuccessfully waiting for an event. Fixes: 8127d661e77f ('sfc: Add support for Solarflare SFC9100 family') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| | * sfc: Refactor efx_mcdi_poll() by introducing efx_mcdi_poll_once()Robert Stonehouse2013-12-061-6/+17
| | | | | | | | | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| | * sfc: RX buffer allocation takes prefix size into account in IP header alignmentAndrew Rybchenko2013-12-063-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | rx_prefix_size is 4-bytes aligned on Falcon/Siena (16 bytes), but it is equal to 14 on EF10. So, it should be taken into account if arch requires IP header to be 4-bytes aligned (via NET_IP_ALIGN). Fixes: 8127d661e77f ('sfc: Add support for Solarflare SFC9100 family') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| | * sfc: Maintain current frequency adjustment when applying a time offsetBen Hutchings2013-12-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a single MCDI PTP operation for setting the frequency adjustment and applying a time offset to the hardware clock. When applying a time offset we should not change the frequency adjustment. These two operations can now be requested separately but this requires a flash firmware update. Keep using the single operation, but remember and repeat the previous frequency adjustment. Fixes: 7c236c43b838 ('sfc: Add support for IEEE-1588 PTP') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| | * sfc: Stop/re-start PTP when stopping/starting the datapath.Alexandre Rames2013-12-063-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This disables PTP when we bring the interface down to avoid getting unmatched RX timestamp events, and tries to re-enable it when bringing the interface up. [bwh: Make efx_ptp_stop() safe on Falcon. Introduce efx_ptp_{start,stop}_datapath() functions; we'll expand them later.] Fixes: 7c236c43b838 ('sfc: Add support for IEEE-1588 PTP') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
| | * sfc: Rate-limit log message for PTP packets without a matching timestamp eventBen Hutchings2013-12-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | In case of a flood of PTP packets, the timestamp peripheral and MC firmware on the SFN[56]322F boards may not be able to provide timestamp events for all packets. Don't complain too much about this. Fixes: 7c236c43b838 ('sfc: Add support for IEEE-1588 PTP') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
OpenPOWER on IntegriCloud