[dpdk-dev] 回复:RE: Thread safety in rte_acl
真我风采
1534057243 at qq.com
Mon Jan 8 12:59:46 CET 2018
>> 2. Is it safe that one
>> thread will run "rte_acl_classify" when another thread tries to add new rules to same ctx? thanks,
>Just add new rules is safe, but applying them (calling rte_acl_build()) is not.
In my case, there are two process sharing hugepage memory(struct rte_acl_ctx), one process call 'rte_acl_build' to add and apply rule, another process call frequently 'rte_acl_classify' to match rule, does it need to add lock? if not, is there other method to implement this safely?
------------------ 原始邮件 ------------------
发件人: "Ananyev, Konstantin";<konstantin.ananyev at intel.com>;
发送时间: 2018年1月8日(星期一) 晚上7:42
收件人: "真我风采"<1534057243 at qq.com>;"dev"<dev at dpdk.org>;
主题: RE: [dpdk-dev] Thread safety in rte_acl
>
> Hi, I have two questions : 1. Is it safe that multiple threads will run "rte_acl_classify" in parallel (on the same ctx )?
Yes.
> 2. Is it safe that one
> thread will run "rte_acl_classify" when another thread tries to add new rules to same ctx? thanks,
Just add new rules is safe, but applying them (calling rte_acl_build()) is not.
Konstantin
More information about the dev
mailing list