Hi Matt,

Happy new year!
We also noticed this problem and proposed a change in 
https://gerrit.fd.io/r/c/vpp/+/30386.
The change only uses single queue per thread to avoid this problem. We tried 
with 1-4 crypto IDs per core and achieved
Can you have a look?

Regards,
Fan

From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Matthew Smith via 
lists.fd.io
Sent: Tuesday, December 22, 2020 7:31 PM
To: vpp-dev <vpp-dev@lists.fd.io>
Subject: [vpp-dev] question about crypto_sw_scheduler plugin

Hello,

I am looking into enabling VPP's asynchronous crypto for IPsec in Netgate's 
control plane. I was looking at the crypto_sw_scheduler plugin and noticed that 
crypto_sw_scheduler_dequeue_aead() and crypto_sw_scheduler_dequeue_link() each 
have a loop like this:

      vec_foreach_index (i, cm->per_thread_data)
      {
        ptd = cm->per_thread_data + i;
        q = ptd->queues[async_op_id];
        f = crypto_sw_scheduler_get_pending_frame (q);
        if (f)
          break;
      }

It looks like this loop will iterate the per-thread data of each thread 
sequentially starting at thread 0 and try to retrieve a pending frame from that 
thread's queue and break the loop if one is retrieved. Will this end up causing 
the operations which were queued by the threads with lower indices to be 
handled more quickly than operations which were queued by the threads with 
higher indices?

E.g. - assume 4 worker threads. The main thread has ID 0 and the workers have 
IDs 1 - 4. If thread 1 has 5 frames queued for some crypto operation and thread 
4 has 1 frame queued for the same operation, will all 5 frames from thread 1 be 
handled before the 1 frame from thread 4 is? Or am I misunderstanding something?

Thanks!
-Matt

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#18459): https://lists.fd.io/g/vpp-dev/message/18459
Mute This Topic: https://lists.fd.io/mt/79156990/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