[PATCH] net/idpf: add clock read support

Anurag Mandal anurag.mandal at intel.com
Mon Jul 27 19:29:46 CEST 2026


Implemented read_clock ethdev operation by adding
idpf_dev_read_clock() feature to get current time
in nanoseconds for scheduling packets based on
transmit time.

Signed-off-by: Anurag Mandal <anurag.mandal at intel.com>
---
 drivers/net/intel/idpf/idpf_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/intel/idpf/idpf_ethdev.c b/drivers/net/intel/idpf/idpf_ethdev.c
index c13505416a..224a649f53 100644
--- a/drivers/net/intel/idpf/idpf_ethdev.c
+++ b/drivers/net/intel/idpf/idpf_ethdev.c
@@ -1124,6 +1124,15 @@ idpf_timesync_disable(struct rte_eth_dev *dev)
 	return 0;
 }
 
+static int
+idpf_dev_read_clock(struct rte_eth_dev *dev, uint64_t *clock)
+{
+	struct idpf_vport *vport = dev->data->dev_private;
+	struct idpf_adapter *adapter = vport->adapter;
+
+	return idpf_ptp_read_src_clk_reg(adapter, clock);
+}
+
 
 static const struct eth_dev_ops idpf_eth_dev_ops = {
 	.dev_configure			= idpf_dev_configure,
@@ -1159,6 +1168,7 @@ static const struct eth_dev_ops idpf_eth_dev_ops = {
 	.timesync_read_time           = idpf_timesync_read_time,
 	.timesync_write_time          = idpf_timesync_write_time,
 	.timesync_disable             = idpf_timesync_disable,
+	.read_clock                   = idpf_dev_read_clock,
 };
 
 static int
-- 
2.34.1



More information about the dev mailing list