From: Stephen Hemminger <stephen@networkplumber.org>
To: Simei Su <simei.su@intel.com>
Cc: qi.z.zhang@intel.com, junfeng.guo@intel.com, dev@dpdk.org,
wenjun1.wu@intel.com
Subject: Re: [PATCH v3 2/2] net/igc: enable launch time offloading
Date: Thu, 2 Feb 2023 16:30:32 -0800 [thread overview]
Message-ID: <20230202163032.5e83a648@hermes.local> (raw)
In-Reply-To: <20230202071801.30576-3-simei.su@intel.com>
On Thu, 2 Feb 2023 15:18:01 +0800
Simei Su <simei.su@intel.com> wrote:
>
> +static uint32_t igc_tx_launchtime(uint64_t txtime, uint16_t port_id)
> +{
> + struct rte_eth_dev *dev = &rte_eth_devices[port_id];
> + struct igc_adapter *adapter = IGC_DEV_PRIVATE(dev);
> + uint64_t base_time = adapter->base_time;
> + uint64_t cycle_time = adapter->cycle_time;
> + uint32_t launchtime;
> +
> + launchtime = (txtime - base_time) % cycle_time;
> +
> + return rte_cpu_to_le_32(launchtime);
> +}
Divide in transmit path will slow things down.
Better to use something like rte_reciprocal_divide_64() to avoid slow 64 bit divide.
next prev parent reply other threads:[~2023-02-03 0:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-20 3:47 [PATCH 0/2] net/igc: support Tx timestamp offload Simei Su
2022-12-20 3:47 ` [PATCH 1/2] net/igc/base: " Simei Su
2022-12-20 3:47 ` [PATCH 2/2] net/igc: enable " Simei Su
2023-02-01 7:30 ` [PATCH v2 0/2] net/igc: support launch time offloading Simei Su
2023-02-01 7:30 ` [PATCH v2 1/2] net/igc/base: expose packet pacing registers Simei Su
2023-02-01 7:30 ` [PATCH v2 2/2] net/igc: enable launch time offloading Simei Su
2023-02-01 8:34 ` Zhang, Qi Z
2023-02-01 8:46 ` [PATCH v2 0/2] net/igc: support " Morten Brørup
2023-02-02 7:17 ` [PATCH v3 " Simei Su
2023-02-02 7:18 ` [PATCH v3 1/2] net/igc/base: expose packet pacing registers Simei Su
2023-02-02 7:18 ` [PATCH v3 2/2] net/igc: enable launch time offloading Simei Su
2023-02-03 0:30 ` Stephen Hemminger [this message]
2023-02-03 3:22 ` Su, Simei
2023-02-02 8:46 ` [PATCH v3 0/2] net/igc: support " Zhang, Qi Z
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=20230202163032.5e83a648@hermes.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=junfeng.guo@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=simei.su@intel.com \
--cc=wenjun1.wu@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).