public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: Alviro Iskandar Setiawan <[email protected]>
Cc: Ammar Faizi <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH ncns v1 0/4] chnet ring cleanups
Date: Tue, 16 Aug 2022 23:53:10 +0700	[thread overview]
Message-ID: <[email protected]> (raw)

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


             reply	other threads:[~2022-08-16 16:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 16:53 Ammar Faizi [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox