David,

I believe you are right, it is possible to get into a dead lock between worker 
A and B in the case where A is waiting for B and B is waiting for A.
We solved that by tail drop. Another way of doing that is by using a separate 
handover worker from NAT worker.

We are exploring some new ideas for NAT session handling now, can’t say if that 
will pan out or not yet. Stay tuned. ;-)

Cheers,
Ole

> On 30 Dec 2018, at 15:51, david.leitch....@gmail.com wrote:
> 
> Hi Damjan
> Thnaks for your answer,
> 
> I think it is possible (I encountered this problem) to have deadlock even 
> when I use separate CPU for handoff and NAT processing, Or same CPU with 
> congestion drop mechanism.
> 
> I studied the code and separate the CPUs of handoff and NAT processing, in 
> this situation I think just in one case deadlock for handoff may be happen
> suppose if worker A wants to dequeue but elt->valid value is zero so 
> vlib_frame_queue_dequeue function return and do not dequeue, as result 
> fq->head will never increase:
>  
> int vlib_frame_queue_dequeue (vlib_main_t *vm, vlib_frame_queue_main_t *fqm)
> {
>  ....
>  while (1)
>     {
>        if (fq->head == fq->tail)
>               return processed;
>       
>       elt = fq->elts + ((fq->head + 1) & (fq->nelts - 1));
>  
>       if (!elt->valid)
>         {
>             fq->head_hint = fq->head;
>             return processed;
>         }
>  ....
> }
> 
> and on the other side , worker B ( on handoff node) wants to enqueue but ring 
> is full so wait :
> 
> static inline vlib_frame_queue_elt_t *
> vlib_get_frame_queue_elt (u32 frame_queue_index, u32 index)
> {
>    ...
>    new_tail = __sync_add_and_fetch (&fq->tail, 1);
>  
>   /* Wait until a ring slot is available */
>   while (new_tail >= fq->head_hint + fq->nelts)
>       vlib_worker_thread_barrier_check ();
>      ....
> }
> 
> therefore worker B never exit from while loop , do you think it is possible ?
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#11803): https://lists.fd.io/g/vpp-dev/message/11803
> Mute This Topic: https://lists.fd.io/mt/28878687/675193
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [otr...@employees.org]
> -=-=-=-=-=-=-=-=-=-=-=-

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

View/Reply Online (#11804): https://lists.fd.io/g/vpp-dev/message/11804
Mute This Topic: https://lists.fd.io/mt/28878687/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