> -----Original Message-----
> From: Qiao, Wenjing <wenjing.q...@intel.com>
> Sent: Friday, May 19, 2023 4:31 PM
> To: Wu, Jingjing <jingjing...@intel.com>; Xing, Beilei 
> <beilei.x...@intel.com>;
> Zhang, Qi Z <qi.z.zh...@intel.com>
> Cc: dev@dpdk.org; Liu, Mingxia <mingxia....@intel.com>; Qiao, Wenjing
> <wenjing.q...@intel.com>; sta...@dpdk.org
> Subject: [PATCH v4 1/7] common/idpf: fix 64b timestamp roll over issue
> 
> Reading MTS register at first packet will cause timestamp roll over issue. To
> support calculating 64b timestamp, need an alarm to save main time from
> registers every 1 second.
> 
> Fixes: 8c6098afa075 ("common/idpf: add Rx/Tx data path")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Wenjing Qiao <wenjing.q...@intel.com>
> ---
>  drivers/common/idpf/idpf_common_rxtx.c | 126 ++++++++++++++-----------
>  drivers/common/idpf/idpf_common_rxtx.h |   6 +-
>  drivers/common/idpf/version.map        |   2 +
>  3 files changed, 77 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/common/idpf/idpf_common_rxtx.c
> b/drivers/common/idpf/idpf_common_rxtx.c
> index fc87e3e243..b487c2a8a6 100644
> --- a/drivers/common/idpf/idpf_common_rxtx.c
> +++ b/drivers/common/idpf/idpf_common_rxtx.c
> @@ -4,6 +4,7 @@
/* re-alarm watchdog */
> +     rc = rte_eal_alarm_set(1000 * 1000, &idpf_dev_read_time_hw, cb_arg);
...
> +int
> +idpf_rx_timestamp_start(struct idpf_adapter *base) {
> +     rte_eal_alarm_set(1000 * 1000,
> +                       &idpf_dev_read_time_hw,
> +                       (void *)base);
> +     return 0;
> +}
> +
[Liu, Mingxia] 1000*1000us means 1s, better to use macro variables, such as 
"US_PER_S", will be more readable.

Reply via email to