1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet
Jacob Keller ea9b847cda ice: enable transmit timestamps for E810 devices
Add support for enabling Tx timestamp requests for outgoing packets on
E810 devices.

The ice hardware can support multiple outstanding Tx timestamp requests.
When sending a descriptor to hardware, a Tx timestamp request is made by
setting a request bit, and assigning an index that represents which Tx
timestamp index to store the timestamp in.

Hardware makes no effort to synchronize the index use, so it is up to
software to ensure that Tx timestamp indexes are not re-used before the
timestamp is reported back.

To do this, introduce a Tx timestamp tracker which will keep track of
currently in-use indexes.

In the hot path, if a packet has a timestamp request, an index will be
requested from the tracker. Unfortunately, this does require a lock as
the indexes are shared across all queues on a PHY. There are not enough
indexes to reliably assign only 1 to each queue.

For the E810 devices, the timestamp indexes are not shared across PHYs,
so each port can have its own tracking.

Once hardware captures a timestamp, an interrupt is fired. In this
interrupt, trigger a new work item that will figure out which timestamp
was completed, and report the timestamp back to the stack.

This function loops through the Tx timestamp indexes and checks whether
there is now a valid timestamp. If so, it clears the PHY timestamp
indication in the PHY memory, locks and removes the SKB and bit in the
tracker, then reports the timestamp to the stack.

It is possible in some cases that a timestamp request will be initiated
but never completed. This might occur if the packet is dropped by
software or hardware before it reaches the PHY.

Add a task to the periodic work function that will check whether
a timestamp request is more than a few seconds old. If so, the timestamp
index is cleared in the PHY, and the SKB is released.

Just as with Rx timestamps, the Tx timestamps are only 40 bits wide, and
use the same overall logic for extending to 64 bits of nanoseconds.

With this change, E810 devices should be able to perform basic PTP
functionality.

Future changes will extend the support to cover the E822-based devices.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-06-11 08:47:41 -07:00
..
3com net: 3com: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
8390 net: 8390: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
actions net: ethernet: actions: Add Actions Semi Owl Ethernet MAC driver 2021-03-22 12:56:21 -07:00
adaptec treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
aeroflex of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
agere ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
alacritech
allwinner of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
alteon net: alteon: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
altera of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
amazon net: ena: make symbol 'ena_alloc_map_page' static 2021-06-09 15:35:48 -07:00
amd net: amd: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
apm
apple net: apple: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
aquantia net: ethernet: aquantia: Handle error cleanup of start on open 2021-02-11 14:38:06 -08:00
arc net: arc: Demote non-compliant kernel-doc headers 2021-05-17 14:12:38 -07:00
atheros atl1c: add 4 RX/TX queue support for Mikrotik 10/25G NIC 2021-05-27 16:06:46 -07:00
broadcom net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname 2021-06-07 14:07:22 -07:00
brocade net: brocade: bna: Fix wrong function name in comments 2021-05-17 14:12:38 -07:00
cadence net: macb: Use devm_platform_get_and_ioremap_resource() 2021-06-07 14:07:22 -07:00
calxeda net: calxeda: Fix wrong function name in comments 2021-05-17 14:12:38 -07:00
cavium Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
chelsio Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net 2021-06-07 13:01:52 -07:00
cirrus
cisco ethernet:enic: Fix a use after free bug in enic_hard_start_xmit 2021-05-03 13:23:00 -07:00
cortina net: gemini: Use devm_platform_get_and_ioremap_resource() 2021-06-07 13:20:00 -07:00
davicom net: davicom: Remove redundant assignment to ret 2021-04-26 12:48:30 -07:00
dec net: tulip: Remove the repeated declaration 2021-06-07 14:03:11 -07:00
dlink net: dlink: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
emulex net: remove ndo_udp_tunnel_* callbacks 2021-01-07 12:53:29 -08:00
ezchip of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
faraday net: ftgmac100: add missing error return code in ftgmac100_probe() 2021-05-23 16:16:24 -07:00
freescale net: enetc: Use devm_platform_get_and_ioremap_resource() 2021-06-07 14:07:22 -07:00
fujitsu Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
google gve: Correct SKB queue index validation. 2021-05-17 15:38:40 -07:00
hisilicon net: hns3: use list_move_tail instead of list_del/list_add_tail in hclge_main.c 2021-06-09 13:55:38 -07:00
huawei net: huawei: hinic: Fix wrong function name in comments 2021-05-17 14:12:38 -07:00
i825xx drivers: net: ethernet: i825xx: Fix couple of spellings in the file ether1.c 2021-02-04 19:07:55 -08:00
ibm ibmvnic: Allow device probe if the device is not ready at boot 2021-06-10 14:35:07 -07:00
intel ice: enable transmit timestamps for E810 devices 2021-06-11 08:47:41 -07:00
marvell net: marvell: prestera: add LAG support 2021-06-10 14:20:44 -07:00
mediatek net: ethernet: mtk_eth_soc: Fix packet statistics support for MT7628/88 2021-05-23 16:13:11 -07:00
mellanox net/mlx5: Bridge, add tracepoints 2021-06-09 18:36:12 -07:00
micrel net: micrel: check return value after calling platform_get_resource() 2021-06-07 14:07:22 -07:00
microchip net: encx24j600: fix kernel-doc syntax in file headers 2021-05-20 15:25:38 -07:00
microsoft net: mana: Use struct_size() in kzalloc() 2021-05-13 15:58:46 -07:00
moxa net: moxa: Use devm_platform_get_and_ioremap_resource() 2021-06-07 14:08:30 -07:00
mscc net: mscc: ocelot: support PTP Sync one-step timestamping 2021-04-27 14:10:15 -07:00
myricom ethernet: myri10ge: Fix missing error code in myri10ge_probe() 2021-06-01 15:54:38 -07:00
natsemi net: natsemi: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
neterion net: vxge: Declare the function vxge_reset_all_vpaths as void 2021-06-01 15:29:43 -07:00
netronome nfp: use list_move instead of list_del/list_add in nfp_cppcore.c 2021-06-09 13:55:37 -07:00
ni net: nixge: simplify code with devm platform functions 2021-06-08 16:36:57 -07:00
nvidia forcedeth: fix excluded_middle.cocci warnings 2020-11-03 17:47:04 -08:00
nxp of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
oki-semi net: pch_gbe: remove unneeded MODULE_VERSION() call 2021-05-10 14:58:20 -07:00
packetengines drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
pasemi net: pasemi: fix error return code in pasemi_mac_open() 2020-12-02 18:03:58 -08:00
pensando ionic: fix ptp support config breakage 2021-05-11 16:20:27 -07:00
qlogic ethernet/qlogic: Use list_for_each_entry() to simplify code in qlcnic_hw.c 2021-06-08 16:31:25 -07:00
qualcomm net: ethernet: rmnet: Always subtract MAP header 2021-06-09 15:37:07 -07:00
rdc net: r6040: Allow restarting auto-negotiation 2021-05-23 17:23:59 -07:00
realtek r8169: Fix fall-through warning for Clang 2021-05-28 15:25:48 -07:00
renesas net: ethernet: ravb: Use devm_platform_get_and_ioremap_resource() 2021-06-09 13:51:11 -07:00
rocker net: bridge: switchdev: include local flag in FDB notifications 2021-04-16 15:15:45 -07:00
samsung net: samsung: sxgbe: Fix wrong function name in comments 2021-05-17 14:12:39 -07:00
seeq net: seeq: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
sfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
sgi net: sgi: ioc3-eth: check return value after calling platform_get_resource() 2021-06-09 15:24:43 -07:00
silan net: silan: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:38 -07:00
sis net: sis: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
smsc net: smsc: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
socionext net: socionext: Demote non-compliant kernel-doc headers 2021-05-17 14:12:39 -07:00
stmicro net: stmmac: Fix mixed enum type warning 2021-06-10 13:56:48 -07:00
sun Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
synopsys net: dwc-xlgmac: Fix spelling mistake in function name 2021-02-06 11:37:01 -08:00
tehuti net: tehuti: fix error return code in bdx_probe() 2021-03-05 12:59:32 -08:00
ti net: davinci_emac: Use devm_platform_get_and_ioremap_resource() 2021-06-10 13:02:01 -07:00
toshiba net: toshiba: fix the trailing format of some block comments 2021-03-31 14:34:09 -07:00
tundra
via net: via: Fix wrong function name in comments 2021-05-17 14:12:39 -07:00
wiznet net: w5100: Use devm_platform_get_and_ioremap_resource() 2021-06-10 13:53:13 -07:00
xilinx net: axienet: Use devm_platform_get_and_ioremap_resource() 2021-06-10 13:53:13 -07:00
xircom net: xircom: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
xscale net: ethernet: ixp4xx_eth: Use devm_platform_get_and_ioremap_resource() 2021-06-07 13:05:37 -07:00
dnet.c drivers/net/ethernet: clean up unused assignments 2020-09-25 16:29:00 -07:00
dnet.h
ec_bhf.c
ethoc.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
fealnx.c net: fealnx: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
jme.c net: jme: Replace link-change tasklet with work 2021-03-17 16:33:58 +01:00
jme.h net: jme: Replace link-change tasklet with work 2021-03-17 16:33:58 +01:00
Kconfig net: korina: Make driver COMPILE_TESTable 2021-04-19 15:58:14 -07:00
korina.c net: korina: Fix return value check in korina_probe() 2021-05-13 15:54:08 -07:00
lantiq_etop.c
lantiq_xrx200.c net: lantiq: Use devm_platform_get_and_ioremap_resource() 2021-06-07 13:05:37 -07:00
Makefile net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) 2021-04-19 15:24:25 -07:00