[dpdk-dev] 答复: [PATCH] cycles: add isb before read cntvct_el0

Linhaifeng haifeng.lin at huawei.com
Tue Mar 10 03:39:28 CET 2020



-----邮件原件-----
发件人: Jerin Jacob [mailto:jerinjacobk at gmail.com] 
发送时间: 2020年3月9日 23:43
收件人: Linhaifeng <haifeng.lin at huawei.com>
抄送: dev at dpdk.org; thomas at monjalon.net; Lilijun (Jerry) <jerry.lilijun at huawei.com>; chenchanghu <chenchanghu at huawei.com>; xudingke <xudingke at huawei.com>
主题: Re: [dpdk-dev] [PATCH] cycles: add isb before read cntvct_el0

On Mon, Mar 9, 2020 at 2:43 PM Linhaifeng <haifeng.lin at huawei.com> wrote:
>
> We nead isb rather than dsb to sync system counter to cntvct_el0.

# Currently rte_rdtsc() does not have dsb. Right? or any barriers.
# Why do you need it? If it regarding, getting accurate value then use rte_rdtsc_precise().

We use rte_get_tsc_cycles get start_value in pmd1 and end_value in pmd2 in our qos module, it works ok in x86 but not ok in arm64.

Then we use rte_mb() to sync instruction but it not work.Because rte_mb is dsb I think it only have affect on memory. cntvct_el0 and system counter is register so I think we should use isb.

It works well after we use isb in multi core scenes.

Use rte_rdtsc_precise is good idea. Maybe use isb replace of rte_mb(dsb) ?

>
> Signed-off-by: Haifeng Lin <haifeng.lin at huawei.com>


More information about the dev mailing list