public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH ncns v1 0/4] chnet ring cleanups
@ 2022-08-16 16:53 Ammar Faizi
  2022-08-16 16:53 ` [PATCH ncns v1 1/4] chnet: ring: Refactor SQE handling Ammar Faizi
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ammar Faizi @ 2022-08-16 16:53 UTC (permalink / raw)
  To: Alviro Iskandar Setiawan; +Cc: Ammar Faizi, GNU/Weeb Mailing List

Hi Al,

This series contains small cleanups and fixes. Summary:

1) Refactor SQE handling.

Make everything about SQE handling simpler and rename them to represent
the function purpose better.

2) Improve `PostCQE()` waiting mechanism.

Don't use sleep(1) in a loop to wait for the CQE slot be free, instead,
use a conditional variable to reduce the loop cycle and also to reduce
the latency because the wake up doesn't need to wait for a full second.
It just waits until it's signaled whenever the CQE slot becomes
available again.

3)  Make sure we are holding the lock when calling `cqe_size()`.

In `CNRingCtx::WaitCQE`, the first call to `cqe_size()` is not protected
by the cqe_lock. Protect it.

4) Only notify CQE free slot when it's available.

In `CNRingCtx::WaitCQE`, we don't actually always need to call
`NotifyWaitCQEFreeSlot()`. To reduce the call overhead, just check
whether the CQE slot is available or not. If it's available, then call
it, otherwise, just don't.

Signed-off-by: Ammar Faizi <[email protected]>
---

Ammar Faizi (4):
  chnet: ring: Refactor SQE handling
  chnet: ring: Improve `PostCQE()` waiting mechanism
  chnet: ring: Make sure we are holding the lock when calling `cqe_size()`
  chnet: ring: Only notify CQE free slot when it's available

 chnet/chnet_ring.cc | 198 +++++++++++++++++++++++++++++---------------
 chnet/chnet_ring.h  |  23 ++---
 2 files changed, 143 insertions(+), 78 deletions(-)


base-commit: 498d5a49cf6e372fa386c832caca4a64987ea78c
-- 
Ammar Faizi


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-08-16 17:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-16 16:53 [PATCH ncns v1 0/4] chnet ring cleanups Ammar Faizi
2022-08-16 16:53 ` [PATCH ncns v1 1/4] chnet: ring: Refactor SQE handling Ammar Faizi
2022-08-16 16:53 ` [PATCH ncns v1 2/4] chnet: ring: Improve `PostCQE()` waiting mechanism Ammar Faizi
2022-08-16 16:53 ` [PATCH ncns v1 3/4] chnet: ring: Make sure we are holding the lock when calling `cqe_size()` Ammar Faizi
2022-08-16 16:53 ` [PATCH ncns v1 4/4] chnet: ring: Only notify CQE free slot when it's available Ammar Faizi
2022-08-16 17:12   ` Alviro Iskandar Setiawan
2022-08-16 17:17     ` Ammar Nofan Faizi
2022-08-16 17:23       ` Alviro Iskandar Setiawan
2022-08-16 17:24 ` [PATCH ncns v1 0/4] chnet ring cleanups Alviro Iskandar Setiawan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox