DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Patrick Keroulas <patrick.keroulas@radio-canada.ca>,
	dev@dpdk.org, Vivien Didelot <vivien.didelot@gmail.com>
Cc: "Stephen Hemminger" <stephen@networkplumber.org>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Viacheslav Ovsiienko" <viacheslavo@nvidia.com>,
	"Tom Barbette" <barbette@kth.se>,
	"Reshma Pattan" <reshma.pattan@intel.com>,
	"Olivier Matz" <olivier.matz@6wind.com>,
	"Thomas Monjalon" <thomas@monjalon.net>,
	"Andrew Rybchenko" <arybchenko@solarflare.com>
Subject: Re: [dpdk-dev] [[PATCH v3 0/4] pdump HW Rx timestamps for mlx5
Date: Tue, 6 Oct 2020 17:25:42 +0100	[thread overview]
Message-ID: <4e38acac-fd2c-8172-269e-a45dbfcf0f37@intel.com> (raw)
In-Reply-To: <20200724202315.19533-1-patrick.keroulas@radio-canada.ca>

On 7/24/2020 9:23 PM, Patrick Keroulas wrote:
> The intention is to produce a pcap with nanosecond precision when
> Rx timestamp offloading is activated on mlx5 NIC.
> 
> The packets forwarded by testpmd hold the raw counter but a pcap
> requires a time unit. Assuming that the NIC clock is already synced
> with external master clock, this patchset simply integrates the
> nanosecond converter that derives from device frequency and start time.
> 
> v2 -> v3:
>      - replace ib_verbs nanosecond converter with more generic method
>        based on device frequency and start time.
> 
> Patrick Keroulas (3):
>    net/mlx5: query device frequency
>    ethdev: add API to query device frequency
>    pdump: convert timestamp to nanoseconds on Rx path
> 
> Vivien Didelot (1):
>    net/pcap: support hardware Tx timestamps
> 

We have three patch/patchset for same issue,

1) Current one, https://patches.dpdk.org/user/todo/dpdk/?series=11294
2) Vivien's series: https://patches.dpdk.org/user/todo/dpdk/?series=10678
3) Vivien's pcap patch: https://patches.dpdk.org/user/todo/dpdk/?series=10403

And one related one from Slava,
4) https://patchwork.dpdk.org/project/dpdk/list/?series=10948&state=%2A&archive=both

I am replying to this one since this is the latest, but first can we clarify if 
all are still valid and can we combine the effort?


Second, the problems to solve,
1) Device provided timestamp value has no unit, it needs to be converted to 
nanosecond.
There are different approaches in above patches,
- One adds '.convert_ts_to_ns' dev_ops to make PMD convert the timestamp
- Other adds '.eth_get_clock_freq' dev_ops, to get frequency from device clock
   so that conversion can be done within the app.
- I wonder why existing 'rte_eth_read_clock()' can't be enough for conversion,
   as described in its documentation:
   https://doc.dpdk.org/api/rte__ethdev_8h.html#a4346bf07a0d302c9ba4fe06baffd3196
     rte_eth_read_clock(port, start);
     rte_delay_ms(100);
     rte_eth_read_clock(port, end);
     double freq = (end - start) * 10;

2) Where to put the timestamps data, is it to the 'mbuf->timestamp' or dynamic
    filed 'RTE_MBUF_DYNFIELD_TIMESTAMP_NAME'? Using dynamic field of requires
    more work on registering and looking up the fields.

3) Calculation in the datapath should be done in a performance optimized way, 
instead of using division.

4) Should the timestamp value provided by the Rx device used, or should the time 
when the packet transmitted used. I can see current use case seems first one, 
but can there be cases we would like to record when packet exactly sent.

5) Should we create a 'PKT_TX_TIMESTAMP' flag, instead of re-using the Rx one, 
to let the application explicitly define which packets to record timestamp.

Please add if I missing more.

  parent reply	other threads:[~2020-10-06 16:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 20:23 Patrick Keroulas
2020-07-24 20:23 ` [dpdk-dev] [[PATCH v3 1/4] net/mlx5: query device frequency Patrick Keroulas
2020-07-24 20:23 ` [dpdk-dev] [[PATCH v3 2/4] ethdev: add API to " Patrick Keroulas
2020-07-24 20:23 ` [dpdk-dev] [[PATCH v3 3/4] pdump: convert timestamp to nanoseconds on Rx path Patrick Keroulas
2020-09-02 15:41   ` Pattan, Reshma
2020-07-24 20:23 ` [dpdk-dev] [[PATCH v3 4/4] net/pcap: support hardware Tx timestamps Patrick Keroulas
2020-07-25  8:35   ` Tom Barbette
2020-07-25 11:51     ` Stephen Hemminger
2020-07-26 22:17   ` Stephen Hemminger
2020-10-06 16:25 ` Ferruh Yigit [this message]
2020-10-07  6:59   ` [dpdk-dev] [[PATCH v3 0/4] pdump HW Rx timestamps for mlx5 Morten Brørup

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=4e38acac-fd2c-8172-269e-a45dbfcf0f37@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=barbette@kth.se \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=olivier.matz@6wind.com \
    --cc=patrick.keroulas@radio-canada.ca \
    --cc=reshma.pattan@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    --cc=vivien.didelot@gmail.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).