From: "Dimon" <dimon.zhao@nebula-matrix.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>
Cc: "dev" <dev@dpdk.org>, "Leon" <leon.yu@nebula-matrix.com>,
"Sam" <sam.chen@nebula-matrix.com>
Subject: 回复:[PATCH v5 04/17] net/nbl: add Channel layer definitions and implementation
Date: Thu, 21 Aug 2025 11:19:18 +0800 [thread overview]
Message-ID: <e61b8ddf-98cc-4520-902a-4a478aa68dda.dimon.zhao@nebula-matrix.com> (raw)
In-Reply-To: <20250820091637.3388306d@hermes.local>
[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]
Hi Stephen,
> + while (true) {
> + if (rte_bitmap_get(chan_info->mailbox.state_bmp, NBL_CHAN_INTERRUPT_READY)) {
> + nr = read(chan_info->mailbox.fd[0], &unused, sizeof(unused));
> + if (nr < 0)
> + break;
> + }
> + nbl_chan_clean_queue(chan_mgt);
> + nanosleep(&time, 0);
> + }
The chan_info->mailbox.fd[0] is the read fd of eventfd. We are using the eventfd block waiting to read mailbox message.
Thank you.
------------------------------------------------------------------
发件人:Stephen Hemminger <stephen@networkplumber.org>
发送时间:2025年8月21日(周四) 00:16
收件人:Dimon<dimon.zhao@nebula-matrix.com>
抄 送:dev<dev@dpdk.org>; Kyo Liu<kyo.liu@nebula-matrix.com>; Leon<leon.yu@nebula-matrix.com>; Sam<sam.chen@nebula-matrix.com>
主 题:Re: [PATCH v5 04/17] net/nbl: add Channel layer definitions and implementation
On Tue, 19 Aug 2025 03:22:24 -0700
Dimon Zhao <dimon.zhao@nebula-matrix.com> wrote:
> +
> +static uint32_t nbl_chan_thread_polling_task(void *param)
> +{
> + struct nbl_channel_mgt *chan_mgt = (struct nbl_channel_mgt *)param;
> + union nbl_chan_info *chan_info = NBL_CHAN_MGT_TO_CHAN_INFO(chan_mgt);
> + struct timespec time;
> + char unused[16];
> + ssize_t nr = 0;
> +
> + time.tv_sec = 0;
> + time.tv_nsec = 100000;
> +
> + while (true) {
> + if (rte_bitmap_get(chan_info->mailbox.state_bmp, NBL_CHAN_INTERRUPT_READY)) {
> + nr = read(chan_info->mailbox.fd[0], &unused, sizeof(unused));
> + if (nr < 0)
> + break;
> + }
> + nbl_chan_clean_queue(chan_mgt);
> + nanosleep(&time, 0);
> + }
> +
> + return 0;
> +}
This is going to make embedded application developers upset because it uses
a significant part of a CPU polling.
Since you are reading from mailbox, why not implement select/poll/epoll and
have the thread block waiting to read mailbox instead.
[-- Attachment #2: Type: text/html, Size: 14565 bytes --]
next prev parent reply other threads:[~2025-08-21 3:19 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 1:40 [PATCH v3 00/16] NBL PMD for Nebulamatrix NICs dimon.zhao
2025-06-27 1:40 ` [PATCH v3 01/16] net/nbl: add doc and minimum nbl build framework dimon.zhao
2025-06-27 1:40 ` [PATCH v3 02/16] net/nbl: add simple probe/remove and log module dimon.zhao
2025-08-20 19:51 ` Stephen Hemminger
2025-06-27 1:40 ` [PATCH v3 03/16] net/nbl: add PHY layer definitions and implementation dimon.zhao
2025-06-27 1:40 ` [PATCH v3 04/16] net/nbl: add Channel " dimon.zhao
2025-06-27 1:40 ` [PATCH v3 05/16] net/nbl: add Resource " dimon.zhao
2025-06-27 1:40 ` [PATCH v3 06/16] net/nbl: add Dispatch " dimon.zhao
2025-06-27 1:40 ` [PATCH v3 07/16] net/nbl: add Dev " dimon.zhao
2025-06-27 1:40 ` [PATCH v3 08/16] net/nbl: add complete device init and uninit functionality dimon.zhao
2025-06-27 1:40 ` [PATCH v3 09/16] net/nbl: add UIO and VFIO mode for nbl dimon.zhao
2025-06-27 1:40 ` [PATCH v3 10/16] net/nbl: add nbl coexistence " dimon.zhao
2025-06-27 1:40 ` [PATCH v3 11/16] net/nbl: add nbl ethdev configuration dimon.zhao
2025-06-27 1:40 ` [PATCH v3 12/16] net/nbl: add nbl device rxtx queue setup and release ops dimon.zhao
2025-06-27 1:40 ` [PATCH v3 13/16] net/nbl: add nbl device start and stop ops dimon.zhao
2025-06-27 1:40 ` [PATCH v3 14/16] net/nbl: add nbl device Tx and Rx burst dimon.zhao
2025-06-27 1:40 ` [PATCH v3 15/16] net/nbl: add nbl device xstats and stats dimon.zhao
2025-06-27 1:40 ` [PATCH v3 16/16] net/nbl: nbl device support set MTU and promisc dimon.zhao
2025-06-27 21:07 ` [PATCH v3 00/16] NBL PMD for Nebulamatrix NICs Stephen Hemminger
2025-06-27 21:40 ` Thomas Monjalon
2025-08-13 6:43 ` [PATCH v4 " Dimon Zhao
2025-08-13 6:43 ` [PATCH v4 01/16] net/nbl: add doc and minimum nbl build framework Dimon Zhao
2025-08-13 14:43 ` Stephen Hemminger
2025-08-19 22:32 ` Stephen Hemminger
2025-08-13 6:43 ` [PATCH v4 02/16] net/nbl: add simple probe/remove and log module Dimon Zhao
2025-08-13 6:43 ` [PATCH v4 03/16] net/nbl: add PHY layer definitions and implementation Dimon Zhao
2025-08-13 9:30 ` Ivan Malov
2025-08-13 14:19 ` Stephen Hemminger
2025-08-13 6:43 ` [PATCH v4 04/16] net/nbl: add Channel " Dimon Zhao
2025-08-13 9:54 ` Ivan Malov
2025-08-13 14:21 ` Stephen Hemminger
2025-08-13 14:22 ` Stephen Hemminger
2025-08-13 14:25 ` Stephen Hemminger
2025-08-13 14:28 ` Stephen Hemminger
2025-08-13 6:43 ` [PATCH v4 05/16] net/nbl: add Resource " Dimon Zhao
2025-08-13 6:44 ` [PATCH v4 06/16] net/nbl: add Dispatch " Dimon Zhao
2025-08-13 6:44 ` [PATCH v4 07/16] net/nbl: add Dev " Dimon Zhao
2025-08-13 10:12 ` Ivan Malov
2025-08-13 6:44 ` [PATCH v4 08/16] net/nbl: add complete device init and uninit functionality Dimon Zhao
2025-08-13 6:44 ` [PATCH v4 09/16] net/nbl: add UIO and VFIO mode for nbl Dimon Zhao
2025-08-13 6:44 ` [PATCH v4 10/16] net/nbl: add nbl coexistence " Dimon Zhao
2025-08-13 10:35 ` Ivan Malov
2025-08-13 6:44 ` [PATCH v4 11/16] net/nbl: add nbl ethdev configuration Dimon Zhao
2025-08-13 10:40 ` Ivan Malov
2025-08-13 6:44 ` [PATCH v4 12/16] net/nbl: add nbl device rxtx queue setup and release ops Dimon Zhao
2025-08-13 12:00 ` Ivan Malov
2025-08-15 3:47 ` 回复:[PATCH " Dimon
2025-08-15 8:00 ` Ivan Malov
2025-08-18 2:59 ` 回复:回复:[PATCH " Dimon
2025-08-13 6:44 ` [PATCH v4 13/16] net/nbl: add nbl device start and stop ops Dimon Zhao
2025-08-13 6:44 ` [PATCH v4 14/16] net/nbl: add nbl device Tx and Rx burst Dimon Zhao
2025-08-13 11:31 ` Ivan Malov
2025-08-13 6:44 ` [PATCH v4 15/16] net/nbl: add nbl device xstats and stats Dimon Zhao
2025-08-13 11:48 ` Ivan Malov
2025-08-13 14:27 ` Stephen Hemminger
2025-08-18 10:11 ` 回复:[PATCH " Dimon
2025-08-13 6:44 ` [PATCH v4 16/16] net/nbl: nbl device support set MTU and promisc Dimon Zhao
2025-08-13 12:06 ` Ivan Malov
2025-08-19 10:22 ` [PATCH v5 00/17] NBL PMD for Nebulamatrix NICs Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 01/17] net/nbl: add doc and minimum nbl build framework Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 02/17] net/nbl: add simple probe/remove and log module Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 03/17] net/nbl: add HW layer definitions and implementation Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 04/17] net/nbl: add Channel " Dimon Zhao
2025-08-19 22:05 ` Stephen Hemminger
2025-08-20 16:16 ` Stephen Hemminger
2025-08-21 3:19 ` Dimon [this message]
2025-08-19 10:22 ` [PATCH v5 05/17] net/nbl: add Resource " Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 06/17] net/nbl: add Dispatch " Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 07/17] net/nbl: add Dev " Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 08/17] net/nbl: add complete device init and uninit functionality Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 09/17] net/nbl: add UIO and VFIO mode for nbl Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 10/17] net/nbl: add nbl coexistence " Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 11/17] net/nbl: add nbl ethdev configuration Dimon Zhao
2025-08-19 15:30 ` Stephen Hemminger
2025-08-19 10:22 ` [PATCH v5 12/17] net/nbl: add nbl device rxtx queue setup and release ops Dimon Zhao
2025-08-19 22:35 ` Stephen Hemminger
2025-08-19 10:22 ` [PATCH v5 13/17] net/nbl: add nbl device start and stop ops Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 14/17] net/nbl: add nbl device Tx and Rx burst Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 15/17] net/nbl: add nbl ethdev infos get Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 16/17] net/nbl: add nbl device xstats and stats Dimon Zhao
2025-08-19 10:22 ` [PATCH v5 17/17] net/nbl: nbl device support set MTU and promisc Dimon Zhao
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 \
--in-reply-to=e61b8ddf-98cc-4520-902a-4a478aa68dda.dimon.zhao@nebula-matrix.com \
--to=dimon.zhao@nebula-matrix.com \
--cc=dev@dpdk.org \
--cc=leon.yu@nebula-matrix.com \
--cc=sam.chen@nebula-matrix.com \
--cc=stephen@networkplumber.org \
/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;
as well as URLs for NNTP newsgroup(s).