Thanks very much!
------------------ ???????? ------------------ ??????: "Ramia, Kannan Babu";<kannan.babu.ra...@intel.com>; ????????: 2018??1??8??(??????) ????9:06 ??????: "????????"<1534057...@qq.com>;"Ananyev, Konstantin"<konstantin.anan...@intel.com>;"dev"<dev@dpdk.org>; ????: RE: [dpdk-dev] ??????RE: Thread safety in rte_acl You can look at the source of anyone of the applications in samplevnf project in OPNFV which uses the active/shadow method for dynamically modifying the rules and applying them. Regards Kannan Babu -----Original Message----- From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of ???? Sent: Monday, January 8, 2018 5:30 PM To: Ananyev, Konstantin <konstantin.anan...@intel.com>; dev <dev@dpdk.org> Subject: [dpdk-dev] ??????RE: Thread safety in rte_acl >> 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.anan...@intel.com>; ????????: 2018??1??8??(??????) ????7:42 ??????: "????????"<1534057...@qq.com>;"dev"<dev@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