summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-12-13sfc: 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-13sfc: 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-13sfc: remove unused 'enum efx_rx_alloc_method'Andrew Rybchenko1-6/+0
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: remove unused 'refcnt' from efx_rx_page_stateAndrew Rybchenko1-3/+0
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: 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-13sfc: 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-13sfc: 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-13sfc: 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-13sfc: 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-13sfc: 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-13sfc: Remove unnecessary condition for processing the TX timestamp queueBen Hutchings1-12/+4
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: 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-13sfc: 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-13sfc: 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-13sfc: 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-13sfc: 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-13sfc: 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-13sfc: 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-13sfc: 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>
2013-12-13sfc: Tidy up PTP synchronization codeLaurence Evans1-20/+24
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: PTP - tidy up unused/useless variablesLaurence Evans1-15/+1
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Remove kernel-doc for efx_ptp_data fields not present in this versionBen Hutchings1-15/+0
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Initialise efx_ptp_data::phc_clock_info from a static templateBen Hutchings1-14/+16
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Do not use MAC address as clock nameBen Hutchings1-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>
2013-12-13sfc: Store flags from MC_CMD_DRV_ATTACH for later useBen Hutchings2-2/+18
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Remove dependency of PTP on having a dedicated channelBen Hutchings3-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>
2013-12-13sfc: Split PTP multicast filter insertion/removal out of efx_ptp_{start,stop}()Ben Hutchings1-17/+39
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Return EBUSY for filter insertion on EF10, matching Falcon/SienaBen Hutchings1-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>
2013-12-13sfc: Expose NVRAM_PARTITION_TYPE_LICENSE on EF10Ben Hutchings1-0/+1
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Fold efx_flush_all() into efx_stop_port() and update commentsBen Hutchings1-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>
2013-12-13sfc: Map MCDI error MC_CMD_ERR_ENOTSUP to Linux EOPNOTSUPPBen Hutchings1-0/+2
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Log all unexpected MCDI errorsEdward Cree5-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>
2013-12-13sfc: Add new sensor namesBen Hutchings1-0/+3
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Revise sensor names to be more understandable and consistentEdward Cree1-23/+26
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Report units in sensor warningsEdward Cree1-4/+20
Add units to the "Sensor reports condition X for raw value Y" messages. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Correct RX dropped count for drops while interface is downJon Cooper9-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>
2013-12-13sfc: Make initial fill of RX descriptors synchronousJon Cooper5-9/+12
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-13sfc: Tighten the check for RX merged completion eventsBen Hutchings1-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>
2013-12-13sfc: Add MC BISTs to ethtool offline self test on EF10Jon Cooper8-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>
2013-12-07sfc: Update MCDI protocol definitionsBen Hutchings1-70/+663
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-07sfc: Demote "MC Scheduler error" messagesRobert Stonehouse1-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>
2013-12-07Merge branch 'sfc-3.13' into masterBen Hutchings6-23/+101
Merge sfc fixes destined for 3.13, as development for 3.14+ depends on some of them.
2013-12-07sfc: Poll for MCDI completion once before timeout occursRobert Stonehouse1-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>
2013-12-07sfc: Refactor efx_mcdi_poll() by introducing efx_mcdi_poll_once()Robert Stonehouse1-6/+17
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-07sfc: RX buffer allocation takes prefix size into account in IP header alignmentAndrew Rybchenko3-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>
2013-12-07sfc: Maintain current frequency adjustment when applying a time offsetBen Hutchings1-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>
2013-12-07sfc: Stop/re-start PTP when stopping/starting the datapath.Alexandre Rames3-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>
2013-12-07sfc: Rate-limit log message for PTP packets without a matching timestamp eventBen Hutchings1-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>
2013-12-07sfc: PTP: Moderate log message on event queue overflowLaurence Evans1-2/+21
Limit syslog flood if a PTP packet storm occurs. Fixes: 7c236c43b838 ('sfc: Add support for IEEE-1588 PTP') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-12-07sfc: Add length checks to efx_xmit_with_hwtstamp() and efx_ptp_is_ptp_tx()Ben Hutchings1-0/+4
efx_ptp_is_ptp_tx() must be robust against skbs from raw sockets that have invalid IPv4 and UDP headers. Add checks that: - the transport header has been found - there is enough space between network and transport header offset for an IPv4 header - there is enough space after the transport header offset for a UDP header Fixes: 7c236c43b838 ('sfc: Add support for IEEE-1588 PTP') Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>