From: Markus Elfring <Markus.Elfring@web.de>
To: Yanze Zhang <zhang.yanze@zte.com.cn>,
linux-rdma@vger.kernel.org, Jason Gunthorpe <jgg@ziepe.ca>,
Julian Braha <julianbraha@gmail.com>,
Junxian Huang <huangjunxian6@hisilicon.com>,
Leon Romanovsky <leon@kernel.org>,
Zhu Yanjun <yanjun.zhu@linux.dev>
Cc: lkp@intel.com, LKML <linux-kernel@vger.kernel.org>,
Chengfei Han <han.chengfei@zte.com.cn>,
Junyang Han <han.junyang@zte.com.cn>,
Ming Ran <ran.ming@zte.com.cn>, Quan Wei <wei.quan@zte.com.cn>
Subject: Re: [PATCH rdma v7 3/7] RDMA/zrdma: Add internal headers and hardware register definitions
Date: Tue, 27 Oct 2026 08:10:12 +0100 [thread overview]
Message-ID: <46653715-7efb-40ed-b846-584ed1948eba@web.de> (raw)
In-Reply-To: <20261027021119.2325798-4-zhang.yanze@zte.com.cn>
…
> zxdh_free_rsrc() uses guard(spinlock_irqsave), so the lock is released on
> every exit path. zxdh_alloc_rsrc() keeps the explicit locking, as it has
> several early return paths, and takes a pool name so that the exhaustion
> log identifies the affected pool.
How do you think about to move such hints behind the marker line?
…
> ---
> drivers/infiniband/hw/zrdma/zrdma_hw.h | 21 +++
> drivers/infiniband/hw/zrdma/zrdma_main.h | 216 +++++++++++++++++++++++
…
> +++ b/drivers/infiniband/hw/zrdma/zrdma_main.h
> @@ -0,0 +1,216 @@
…
> +static inline int zxdh_alloc_rsrc(struct zxdh_pci_f *rf,
> + unsigned long *rsrc_array, u32 max_rsrc,
> + u32 *req_rsrc_num, u32 *next,
> + const char *rsrc_name)
> +{
> + unsigned long flags;
> + u32 rsrc_num;
> +
> + spin_lock_irqsave(&rf->rsrc_lock, flags);
> + rsrc_num = find_next_zero_bit(rsrc_array, max_rsrc, *next);
…
> + *req_rsrc_num = rsrc_num;
> + spin_unlock_irqrestore(&rf->rsrc_lock, flags);
> +
> + return 0;
> +}
…
I imagine that a lock guard would be helpful also for this function implementation.
Regards,
Markus
next prev parent reply other threads:[~2026-10-27 7:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 2:11 [PATCH rdma v7 0/7] Add ZTE DingHai Ethernet Protocol Driver for RDMA Yanze Zhang
2026-10-27 2:11 ` [PATCH rdma v7 1/7] RDMA/zrdma: Add build infrastructure and module skeleton Yanze Zhang
2026-10-27 2:11 ` [PATCH rdma v7 2/7] RDMA/zrdma: Add core data structures and ABI definitions Yanze Zhang
2026-10-27 2:11 ` [PATCH rdma v7 3/7] RDMA/zrdma: Add internal headers and hardware register definitions Yanze Zhang
2026-10-27 7:10 ` Markus Elfring [this message]
2026-10-27 2:11 ` [PATCH rdma v7 4/7] RDMA/zrdma: Add hardware resource initialization and verbs skeleton Yanze Zhang
2026-10-27 2:11 ` [PATCH rdma v7 5/7] RDMA/zrdma: Add device probe and remove logic Yanze Zhang
2026-10-27 2:11 ` [PATCH rdma v7 6/7] RDMA/zrdma: Implement context, PD, and mmap operations Yanze Zhang
2026-10-27 2:11 ` [PATCH rdma v7 7/7] RDMA/zrdma: Implement device and port query operations Yanze Zhang
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=46653715-7efb-40ed-b846-584ed1948eba@web.de \
--to=markus.elfring@web.de \
--cc=han.chengfei@zte.com.cn \
--cc=han.junyang@zte.com.cn \
--cc=huangjunxian6@hisilicon.com \
--cc=jgg@ziepe.ca \
--cc=julianbraha@gmail.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=lkp@intel.com \
--cc=ran.ming@zte.com.cn \
--cc=wei.quan@zte.com.cn \
--cc=yanjun.zhu@linux.dev \
--cc=zhang.yanze@zte.com.cn \
/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
all inboxes | Powered by JetHome®