aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/igb/igb_ptp.c
AgeCommit message (Collapse)AuthorFilesLines
2013-08-22igb: Read register for latch_on without return valueAkeem G Abodunrin1-4/+4
This patch changes register read to "just-read" without returning a value for hardware to accurately latch the register value. Signed-off-by: Akeem G Abodunrin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-18igb: Add support for i354 devicesCarolyn Wyborny1-0/+4
This patch adds base support for new i354 devices. Loopback test is unsupported for this release. Signed-off-by: Carolyn Wyborny <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-18igb: Fix code comments and whitespaceJeff Kirsher1-39/+18
Aligns the multi-line code comments with the desired style for the networking tree. Also cleaned up whitespace issues found during the cleanup of code comments (i.e. remove unnecessary blank lines, use tabs where possible, properly wrap lines and keep strings on a single line) Signed-off-by: Jeff Kirsher <[email protected]> Tested-by: Aaron Brown <[email protected]>
2013-03-26igb: fix PHC stopping on max freqJiri Benc1-1/+1
For 82576 MAC type, max_adj is reported as 1000000000 ppb. However, if this value is passed to igb_ptp_adjfreq_82576, incvalue overflows out of INCVALUE_82576_MASK, resulting in setting of zero TIMINCA.incvalue, stopping the PHC (instead of going at twice the nominal speed). Fix the advertised max_adj value to the largest value hardware can handle. As there is no min_adj value available (-max_adj is used instead), this will also prevent stopping the clock intentionally. It's probably not a big deal, other igb MAC types don't support stopping the clock, either. Signed-off-by: Jiri Benc <[email protected]> Acked-by: Matthew Vick <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-18igb: Use in-kernel PTP_EV_PORT #defineMatthew Vick1-3/+3
Rather than use an extra #define for something that already exists, use the kernel #define for the PTP port. Cc: Richard Cochran <[email protected]> Signed-off-by: Matthew Vick <[email protected]> Acked-by: Jacob Keller <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-18igb: Free any held skb that should have been timestamped on removeMatthew Vick1-0/+4
To prevent a race condition where an skb has been saved to return the Tx timestamp later and the driver is removed, add a check to determine if we have an skb stored and, if so, free it. Cc: Richard Cochran <[email protected]> Signed-off-by: Matthew Vick <[email protected]> Acked-by: Jacob Keller <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-18igb: Add mechanism for detecting latched hardware Rx timestampMatthew Vick1-0/+45
Add a check against possible Rx timestamp freezing in the hardware via watchdog mechanism. This situation can occur when an Rx timestamp has been latched, but the packet has been dropped because the Rx ring is full. Whenever a packet comes in that should be timestamped, the Rx timestamp gets latched into the hardware registers and we will store the jiffy value in the rx_ring. The watchdog will keep track of his own jiffy timer whenever there is no valid timestamp in the registers. If the watchdog detects a valid timestamp in the registers, meaning that no Rx packet has consumed it yet, it will check which time is most recent: the last time in the watchdog or any time in the rx_rings. If the most recent "event" was more than 5 seconds ago, it will flush the Rx timestamp and print a warning message to the syslog. Cc: Richard Cochran <[email protected]> Signed-off-by: Matthew Vick <[email protected]> Acked-by: Richard Cochran <[email protected]> Acked-by: Jacob Keller <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-18igb: Add timeout for PTP Tx work itemMatthew Vick1-0/+10
When transmitting a packet that must return a Tx timestamp, a work item gets scheduled to poll for the Tx timestamp being completed in hardware. Add a timeout on this work item of 15 seconds from when the driver gets the skb, after which it will stop polling. Report via stats and system log if this occurs. Cc: Richard Cochran <[email protected]> Signed-off-by: Matthew Vick <[email protected]> Acked-by: Jacob Keller <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-11-22igb: Update PTP Rx filtersMatthew Vick1-27/+20
Update the filters to be more consistent with what the driver wants to do. For example, for devices that timestamp all packets, report that the filter is set for timestamping all packets. Signed-off-by: Matthew Vick <[email protected]> Acked-by: Richard Cochran <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-10-29igb: Fix sparse warning in igb_ptp_rx_pktstampAlexander Duyck1-1/+1
This change fixes a sparse warning triggered by us casting the timestamp in the packet as a u64 instead of as a __le64. This change corrects that in order to resolve the sparse warning. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-10-19igb: Split Rx timestamping into two separate functionsAlexander Duyck1-17/+38
In order to support page based receive we will need to split up the two different types of timestamping into two separate functions. The first one will handle legacy timestamps with the value in the register, and the new one will handle timestamps in the Rx buffer itself. Signed-off-by: Alexander Duyck <[email protected]> Acked-by: Matthew Vick <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-09-22ptp: link the phc device to its parent deviceRichard Cochran1-1/+2
PTP Hardware Clock devices appear as class devices in sysfs. This patch changes the registration API to use the parent device, clarifying the clock's relationship to the underlying device. Signed-off-by: Richard Cochran <[email protected]> Acked-by: Ben Hutchings <[email protected]> Acked-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-09-17igb: Add 1588 support to I210/I211.Matthew Vick1-45/+171
Previously I210/I211 followed the same code flow as 82580/I350 for 1588. However, since the register sets have changed, we must update the implementation to accommodate the register changes. Cc: Richard Cochran <[email protected]> Signed-off-by: Matthew Vick <[email protected]> Acked-by: Jacob Keller <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-09-17igb: Prevent dropped Tx timestamps via work items and interrupts.Matthew Vick1-16/+86
In rare circumstances, it's possible a descriptor writeback will occur before a timestamped Tx packet will go out on the wire, leading to the driver believing the hardware failed to timestamp the packet. Schedule a work item for 82576 and use the available time sync interrupt registers on 82580 and above to account for this. Cc: Richard Cochran <[email protected]> Signed-off-by: Matthew Vick <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-09-17igb: Store the MAC address in the name in the PTP struct.Matthew Vick1-4/+3
Change the name of the adapter in the PTP struct to enable easier correlation between interface and PTP device. Cc: Richard Cochran <[email protected]> Signed-off-by: Matthew Vick <[email protected]> Acked-by: Jacob Keller <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-09-17igb: Update PTP function names/variables and locations.Matthew Vick1-118/+367
Where possible, move PTP-related functions into igb_ptp.c and update the names of functions and variables to match the established coding style in the files and specify that they are PTP-specific. Cc: Richard Cochran <[email protected]> Signed-off-by: Matthew Vick <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-06-20igb: Add switch case for supported hardware to igb_ptp_remove.Carolyn Wyborny1-1/+11
PTP initialization is only done on supported parts, so remove needs same checks or it will cause crashes on systems with igb devices that don't support PTP. This patch adds those checks to the exit function. Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-05-12igb: Add Support for new i210/i211 devices.Carolyn Wyborny1-0/+4
This patch adds new initialization functions and device support for i210 and i211 devices. Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-04-04igb: offer a PTP Hardware Clock instead of the timecompare methodRichard Cochran1-0/+59
This commit removes the legacy timecompare code from the igb driver and offers a tunable PHC instead. Signed-off-by: Richard Cochran <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-04-04igb: add PTP Hardware Clock codeRichard Cochran1-0/+322
This patch adds a source file implementing a PHC. Only the basic clock operations have been implemented, although the hardware would offer some ancillary functions. The code is fairly self contained and is not yet used in the main igb driver. Every timestamp and clock read operation must consult the overflow counter to form a correct time value. Access to the counter is protected by a spin lock, and the counter is implemented using the standard cyclecounter/timecounter code. Signed-off-by: Richard Cochran <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>