Simply because most CLI commands and API handlers are marked as not is_mp_safe, 
hence they are actually protected by vlib_worker_thread_barrier_sync.

So to speak, node functions are temporally stopped and waiting when CLI/API is 
being executed.

You should take a look at: vlib_worker_thread_barrier_sync/ 
vlib_worker_thread_barrier_release

Regards,
Kingwel

From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of blankspot
Sent: Tuesday, January 15, 2019 3:00 PM
To: vpp-dev <vpp-dev@lists.fd.io>
Subject: [vpp-dev] About lock-free operation in policer

hi all,

I have a question about policer classify.
The code of bind/unbind a policer with interface is:

      if (is_add)
            pcm->classify_table_index_by_sw_if_index[ti][sw_if_index] = pct[ti];
      else
            pcm->classify_table_index_by_sw_if_index[ti][sw_if_index] = ~0;

and the code checking the value in "ip4-policer-classify" node is:

table_index0 =
            pcm->classify_table_index_by_sw_if_index[tid][sw_if_index0];

There is no lock protecting the table index.

The function of policer is ok in multi-thread vpp, but I don't know why it is 
lock-free.
Can any one help?

Thanks.

yonggong
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11919): https://lists.fd.io/g/vpp-dev/message/11919
Mute This Topic: https://lists.fd.io/mt/29122225/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to