[PATCH v4 1/7] common/idpf: fix 64b timestamp roll over issue
Liu, Mingxia
mingxia.liu at intel.com
Wed May 24 10:36:49 CEST 2023
> -----Original Message-----
> From: Qiao, Wenjing <wenjing.qiao at intel.com>
> Sent: Friday, May 19, 2023 4:31 PM
> To: Wu, Jingjing <jingjing.wu at intel.com>; Xing, Beilei <beilei.xing at intel.com>;
> Zhang, Qi Z <qi.z.zhang at intel.com>
> Cc: dev at dpdk.org; Liu, Mingxia <mingxia.liu at intel.com>; Qiao, Wenjing
> <wenjing.qiao at intel.com>; stable at 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: stable at dpdk.org
>
> Signed-off-by: Wenjing Qiao <wenjing.qiao at 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.
More information about the dev
mailing list