Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yanze Zhang" <zhang.yanze@zte.com.cn>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma v8 4/7] RDMA/zrdma: Add hardware resource initialization and verbs skeleton
Date: Mon, 02 Nov 2026 09:14:33 +0000	[thread overview]
Message-ID: <sashiko-outbox-193163@kernel.org> (raw)
In-Reply-To: <20261102082026.2645777-5-zhang.yanze@zte.com.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] RDMA/zrdma: duplicate ib_mtu_int_to_enum() logic in zxdh_mtu_int_to_enum()
--

commit 6c940106ffd314fb52ef54d2c5282f1990d4be08
Author: Yanze Zhang <zhang.yanze@zte.com.cn>

RDMA/zrdma: Add hardware resource initialization and verbs skeleton

This commit adds hardware resource initialization logic and a minimal verbs
layer skeleton for the zrdma driver. It allocates resource bitmaps and tables
in a single allocation and registers the RDMA device with basic device
operations.

> diff --git a/drivers/infiniband/hw/zrdma/zrdma_verbs.h b/drivers/infiniband/hw/zrdma/zrdma_verbs.h
> new file mode 100644
> index 0000000000000..a4b628651bf02
> --- /dev/null
> +++ b/drivers/infiniband/hw/zrdma/zrdma_verbs.h
> @@ -0,0 +1,134 @@

[ ... ]

> +static inline enum ib_mtu zxdh_mtu_int_to_enum(int mtu)
> +{
> +	mtu = mtu - ZXDH_MTU_HEADER_RSV;
> +	if (mtu >= 4096)
> +		return IB_MTU_4096;
> +	else if (mtu >= 2048)
> +		return IB_MTU_2048;
> +	else if (mtu >= 1024)
> +		return IB_MTU_1024;
> +	else if (mtu >= 512)
> +		return IB_MTU_512;
> +	else
> +		return IB_MTU_256;
> +}

[Severity: Low]
This isn't a bug, but in zxdh_mtu_int_to_enum() in
drivers/infiniband/hw/zrdma/zrdma_verbs.h, after subtracting
ZXDH_MTU_HEADER_RSV from mtu, the threshold comparison ladder duplicates
ib_mtu_int_to_enum() from include/rdma/ib_verbs.h, which this header already
includes. Could zxdh_mtu_int_to_enum() simply return
ib_mtu_int_to_enum(mtu - ZXDH_MTU_HEADER_RSV) instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102082026.2645777-1-zhang.yanze@zte.com.cn?part=4

  reply	other threads:[~2026-11-02  9:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02  8:20 [PATCH rdma v8 0/7] Add ZTE DingHai Ethernet Protocol Driver for RDMA Yanze Zhang
2026-11-02  8:20 ` [PATCH rdma v8 1/7] RDMA/zrdma: Add build infrastructure and module skeleton Yanze Zhang
2026-11-02  8:45   ` sashiko-bot
2026-11-02  8:20 ` [PATCH rdma v8 2/7] RDMA/zrdma: Add core data structures and ABI definitions Yanze Zhang
2026-11-02  8:55   ` sashiko-bot
2026-11-02  8:20 ` [PATCH rdma v8 3/7] RDMA/zrdma: Add internal headers and hardware register definitions Yanze Zhang
2026-11-02  9:00   ` sashiko-bot
2026-11-02  8:20 ` [PATCH rdma v8 4/7] RDMA/zrdma: Add hardware resource initialization and verbs skeleton Yanze Zhang
2026-11-02  9:14   ` sashiko-bot [this message]
2026-11-02  8:20 ` [PATCH rdma v8 5/7] RDMA/zrdma: Implement device and port query operations Yanze Zhang
2026-11-02  9:31   ` sashiko-bot
2026-11-02  8:20 ` [PATCH rdma v8 6/7] RDMA/zrdma: Add device probe and remove logic Yanze Zhang
2026-11-02  9:36   ` sashiko-bot
2026-11-02  8:20 ` [PATCH rdma v8 7/7] RDMA/zrdma: Implement context, PD, and mmap operations Yanze Zhang
2026-11-02  9:47   ` sashiko-bot

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=sashiko-outbox-193163@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.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