From: "Hore, Soumyadeep" <soumyadeep.hore@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Singh, Aman Deep" <aman.deep.singh@intel.com>,
"Subbarao, Manoj Kumar" <manoj.kumar.subbarao@intel.com>
Subject: RE: [PATCH v3 2/6] net/intel: add read clock feature in ICE
Date: Tue, 10 Jun 2025 11:50:37 +0000 [thread overview]
Message-ID: <CY8PR11MB774772C9CF4FF5DDCDBFA53BF96AA@CY8PR11MB7747.namprd11.prod.outlook.com> (raw)
In-Reply-To: <aEboZmlQum9B21UL@bricha3-mobl1.ger.corp.intel.com>
The similar implementation is done in igc driver. Currently we don't read time from device.
We read the system time and send it out based on the burst calculations. The mechanism is
same in kernel drivers too.
On Sun, Jun 08, 2025 at 11:32:19AM +0000, Soumyadeep Hore wrote:
> Adding eth_ice_read_clock() feature to get current time for scheduling
> Packets based on Tx time.
>
> Signed-off-by: Soumyadeep Hore <soumyadeep.hore@intel.com>
> ---
> drivers/net/intel/ice/ice_ethdev.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/net/intel/ice/ice_ethdev.c
> b/drivers/net/intel/ice/ice_ethdev.c
> index 7cc083ca32..9478ba92df 100644
> --- a/drivers/net/intel/ice/ice_ethdev.c
> +++ b/drivers/net/intel/ice/ice_ethdev.c
> @@ -187,6 +187,7 @@ static int ice_timesync_read_time(struct
> rte_eth_dev *dev, static int ice_timesync_write_time(struct rte_eth_dev *dev,
> const struct timespec *timestamp); static int
> ice_timesync_disable(struct rte_eth_dev *dev);
> +static int eth_ice_read_clock(struct rte_eth_dev *dev, uint64_t
> +*clock);
> static int ice_fec_get_capability(struct rte_eth_dev *dev, struct rte_eth_fec_capa *speed_fec_capa,
> unsigned int num);
> static int ice_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa);
> @@ -317,6 +318,7 @@ static const struct eth_dev_ops ice_eth_dev_ops = {
> .timesync_read_time = ice_timesync_read_time,
> .timesync_write_time = ice_timesync_write_time,
> .timesync_disable = ice_timesync_disable,
> + .read_clock = eth_ice_read_clock,
> .tm_ops_get = ice_tm_ops_get,
> .fec_get_capability = ice_fec_get_capability,
> .fec_get = ice_fec_get,
> @@ -6935,6 +6937,17 @@ ice_timesync_disable(struct rte_eth_dev *dev)
> return 0;
> }
>
> +static int
> +eth_ice_read_clock(__rte_unused struct rte_eth_dev *dev, uint64_t
> +*clock) {
> + struct timespec system_time;
> +
> + clock_gettime(CLOCK_REALTIME, &system_time);
> + *clock = system_time.tv_sec * NSEC_PER_SEC + system_time.tv_nsec;
> +
> + return 0;
> +}
> +
I see a number of problems here:
* The "read_clock" API is for reading the time from an ethernet device.
This is not the same a reading the system time and returning that.
* This uses a potential system call to read the time. (On some linux
implementations I think it will avoid a system call, but even so, we
should not add what may be a system call into these fast-path APIs)
/Bruce
next prev parent reply other threads:[~2025-06-10 11:51 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 21:19 [PATCH v1 0/6] Add TxPP Support for E830 Soumyadeep Hore
2025-06-06 21:19 ` [PATCH v1 1/6] net/intel: update E830 Tx Time Queue Context Structure Soumyadeep Hore
2025-06-07 17:08 ` [PATCH v2 0/6] Add TxPP Support for E830 Soumyadeep Hore
2025-06-07 17:08 ` [PATCH v2 1/6] net/intel: update E830 Tx Time Queue Context Structure Soumyadeep Hore
2025-06-07 17:09 ` [PATCH v2 2/6] net/intel: add read clock feature in ICE Soumyadeep Hore
2025-06-07 17:09 ` [PATCH v2 3/6] net/intel: add TxPP Support for E830 Soumyadeep Hore
2025-06-07 17:09 ` [PATCH v2 4/6] net/intel: add AVX2 Support for TxPP Soumyadeep Hore
2025-06-07 17:09 ` [PATCH v2 5/6] net/intel: add AVX512 " Soumyadeep Hore
2025-06-07 17:09 ` [PATCH v2 6/6] doc: announce TxPP support for E830 adapters Soumyadeep Hore
2025-06-08 11:32 ` [PATCH v3 0/6] Add TxPP Support for E830 Soumyadeep Hore
2025-06-08 11:32 ` [PATCH v3 1/6] net/intel: update E830 Tx Time Queue Context Structure Soumyadeep Hore
2025-06-08 11:32 ` [PATCH v3 2/6] net/intel: add read clock feature in ICE Soumyadeep Hore
2025-06-09 13:57 ` Bruce Richardson
2025-06-10 11:50 ` Hore, Soumyadeep [this message]
2025-06-08 11:32 ` [PATCH v3 3/6] net/intel: add TxPP Support for E830 Soumyadeep Hore
2025-06-09 12:52 ` Bruce Richardson
2025-06-10 11:47 ` Hore, Soumyadeep
2025-06-09 14:39 ` Bruce Richardson
2025-06-10 11:53 ` Hore, Soumyadeep
2025-06-08 11:32 ` [PATCH v3 4/6] net/intel: add AVX2 Support for TxPP Soumyadeep Hore
2025-06-09 15:19 ` Bruce Richardson
2025-06-08 11:32 ` [PATCH v3 5/6] net/intel: add AVX512 " Soumyadeep Hore
2025-06-09 15:21 ` Bruce Richardson
2025-06-08 11:32 ` [PATCH v3 6/6] doc: announce TxPP support for E830 adapters Soumyadeep Hore
2025-06-09 13:38 ` Bruce Richardson
2025-06-10 13:11 ` [PATCH v4 0/6] Add TxPP Support for E830 Soumyadeep Hore
2025-06-10 13:11 ` [PATCH v4 1/6] net/intel: update E830 Tx Time Queue Context Structure Soumyadeep Hore
2025-06-17 0:14 ` [PATCH v5 0/4] Add TxPP Support for E830 Soumyadeep Hore
2025-06-17 0:14 ` [PATCH v5 1/4] net/ice: update E830 Tx Time Queue Context Structure Soumyadeep Hore
2025-06-17 0:14 ` [PATCH v5 2/4] net/ice: add read clock feature Soumyadeep Hore
2025-06-17 9:49 ` Bruce Richardson
2025-06-17 0:14 ` [PATCH v5 3/4] net/intel: add TxPP Support for E830 Soumyadeep Hore
2025-06-17 10:05 ` Bruce Richardson
2025-06-17 0:14 ` [PATCH v5 4/4] doc: announce TxPP support for E830 adapters Soumyadeep Hore
2025-06-17 5:13 ` [PATCH v6 0/4] Add TxPP Support for E830 Soumyadeep Hore
2025-06-17 5:13 ` [PATCH v6 1/4] net/ice: update E830 Tx Time Queue Context Structure Soumyadeep Hore
2025-06-17 5:13 ` [PATCH v6 2/4] net/ice: add read clock feature Soumyadeep Hore
2025-06-17 5:13 ` [PATCH v6 3/4] net/intel: add TxPP Support for E830 Soumyadeep Hore
2025-06-17 5:13 ` [PATCH v6 4/4] doc: announce TxPP support for E830 adapters Soumyadeep Hore
2025-06-17 22:36 ` [PATCH v7 0/4] Add TxPP Support for E830 Soumyadeep Hore
2025-06-17 22:36 ` [PATCH v7 1/4] net/ice: update E830 Tx Time Queue Context Structure Soumyadeep Hore
2025-06-17 22:36 ` [PATCH v7 2/4] net/ice: add read clock feature Soumyadeep Hore
2025-06-17 22:36 ` [PATCH v7 3/4] net/intel: add TxPP Support for E830 Soumyadeep Hore
2025-06-17 22:36 ` [PATCH v7 4/4] doc: announce TxPP support for E830 adapters Soumyadeep Hore
2025-06-19 10:41 ` [PATCH v7 0/4] Add TxPP Support for E830 Bruce Richardson
2025-06-23 12:12 ` Bruce Richardson
2025-06-17 10:10 ` [PATCH v5 4/4] doc: announce TxPP support for E830 adapters Bruce Richardson
2025-06-10 13:11 ` [PATCH v4 2/6] net/intel: add read clock feature in ICE Soumyadeep Hore
2025-06-12 10:14 ` Loftus, Ciara
2025-06-12 15:48 ` Bruce Richardson
2025-06-10 13:11 ` [PATCH v4 3/6] net/intel: add TxPP Support for E830 Soumyadeep Hore
2025-06-12 10:31 ` Loftus, Ciara
2025-06-12 16:44 ` Bruce Richardson
2025-06-10 13:11 ` [PATCH v4 4/6] net/intel: add AVX2 Support for TxPP Soumyadeep Hore
2025-06-10 13:11 ` [PATCH v4 5/6] net/intel: add AVX512 " Soumyadeep Hore
2025-06-10 13:11 ` [PATCH v4 6/6] doc: announce TxPP support for E830 adapters Soumyadeep Hore
2025-06-12 16:46 ` Bruce Richardson
2025-06-06 21:19 ` [PATCH v1 2/6] net/intel: add read clock feature in ICE Soumyadeep Hore
2025-06-06 21:19 ` [PATCH v1 3/6] net/intel: add TxPP Support for E830 Soumyadeep Hore
2025-06-06 21:19 ` [PATCH v1 4/6] net/intel: add AVX2 Support for TxPP Soumyadeep Hore
2025-06-06 21:19 ` [PATCH v1 5/6] net/intel: add AVX512 " Soumyadeep Hore
2025-06-06 21:19 ` [PATCH v1 6/6] doc: announce TxPP support for E830 adapters Soumyadeep Hore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CY8PR11MB774772C9CF4FF5DDCDBFA53BF96AA@CY8PR11MB7747.namprd11.prod.outlook.com \
--to=soumyadeep.hore@intel.com \
--cc=aman.deep.singh@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=manoj.kumar.subbarao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).