All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Siva Reddy Kallam" <siva.kallam@broadcom.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [RDMA v2 03/13] RDMA/bng_re: Add support verbs
Date: Sat, 05 Dec 2026 16:10:07 +0000	[thread overview]
Message-ID: <sashiko-outbox-251727@kernel.org> (raw)
In-Reply-To: <20261204155249.1002019-4-siva.kallam@broadcom.com>

Thank you for your contribution! Sashiko AI review found 5 potential
issues to consider:
- [Medium] RDMA/bng_re: bng_re_query_device() ignores udata instead of
  ib_no_udata_io()
- [Low] RDMA/bng_re: missing MAINTAINERS entry for
  include/uapi/rdma/bng_re-abi.h
- [Low] RDMA/bng_re: commit message lists absent bng_re_process_mad()
- [Low] RDMA/bng_re: unlocked plain read of netdev->mtu in
  bng_re_query_port()
- [Low] RDMA/bng_re: unused static const bng_re_dev_ops breaks W=1
  builds
--

commit 0d67aa9f4a9f7c944ce5b1c43677b8883c5379ce
Author: Usman Ansari <usman.ansari@broadcom.com>

> RDMA/bng_re: Add support verbs
>
> This patch adds below verbs.
> - bng_re_query_device
> - bng_re_modify_device
> - bng_re_query_fw_str
> - bng_re_query_port
> - bng_re_get_link_layer
> - bng_re_get_port_immutable
> - bng_re_process_mad
> - bng_re_query_pkey
>
> Signed-off-by: Usman Ansari <usman.ansari@broadcom.com>
> Signed-off-by: Siva Reddy Kallam <siva.kallam@broadcom.com>

[Severity: Low]
Does the commit message match what this patch actually changes?

The list includes bng_re_process_mad, which is neither implemented nor
wired into bng_re_dev_ops.  The message also omits the new UAPI header
include/uapi/rdma/bng_re-abi.h, the RDMA_DRIVER_BNG_RE addition in
include/uapi/rdma/ib_user_ioctl_verbs.h, and the rename of max_qp_wqes
to max_sq_wqes in bng_sp.c and bng_sp.h.

[ ... ]

> diff --git a/drivers/infiniband/hw/bng_re/bng_dev.c b/drivers/infiniband/hw/bng_re/bng_dev.c
> index f5b80b1129ad6..bb29c0f0b2bac 100644
> --- a/drivers/infiniband/hw/bng_re/bng_dev.c
> +++ b/drivers/infiniband/hw/bng_re/bng_dev.c

[ ... ]

> @@ -17,11 +18,25 @@
>  #include "bng_debugfs.h"
>  #include "bng_re_mpc_roce.h"
>  #include "bng_xid.h"
> +#include "bng_verbs.h"
>  
>  MODULE_AUTHOR("Siva Reddy Kallam <siva.kallam@broadcom.com>");
>  MODULE_DESCRIPTION(BNG_RE_DESC);
>  MODULE_LICENSE("Dual BSD/GPL");
>  
> +static const struct ib_device_ops bng_re_dev_ops = {
> +	.owner			= THIS_MODULE,
> +	.driver_id              = RDMA_DRIVER_BNG_RE,
> +	.uverbs_abi_ver         = BNG_RE_ABI_VERSION,
> +	.query_device		= bng_re_query_device,
> +	.modify_device		= bng_re_modify_device,
> +	.get_dev_fw_str		= bng_re_query_fw_str,
> +	.query_port		= bng_re_query_port,
> +	.get_link_layer		= bng_re_get_link_layer,
> +	.get_port_immutable	= bng_re_get_port_immutable,
> +	.query_pkey		= bng_re_query_pkey,
> +};

[Severity: Low]
Will this unused static const bng_re_dev_ops break W=1 builds with
CONFIG_WERROR=y?

Nothing in bng_dev.c references bng_re_dev_ops until commit "RDMA/bng_re:
Register with ib-core" passes it to ib_set_device_ops(), so W=1 builds
emit -Wunused-const-variable across intermediate patches in the series.
Deferring the definition to that commit, or marking it __maybe_unused
until then, keeps every patch bisect-clean.

[ ... ]

> diff --git a/drivers/infiniband/hw/bng_re/bng_verbs.c b/drivers/infiniband/hw/bng_re/bng_verbs.c
> new file mode 100644
> index 0000000000000..6750dfa4a1680
> --- /dev/null
> +++ b/drivers/infiniband/hw/bng_re/bng_verbs.c

[ ... ]

> +int bng_re_query_device(struct ib_device *ibdev,
> +			struct ib_device_attr *ib_attr,
> +			struct ib_udata *udata)
> +{
> +	struct bng_re_dev *rdev = to_bng_re_dev(ibdev, ibdev);
> +	struct bng_re_dev_attr *dev_attr = rdev->dev_attr;

[Severity: Medium]
Should bng_re_query_device() call ib_no_udata_io(udata) instead of ignoring
udata?

ib_uverbs_ex_query_device() passes user-supplied driver_udata directly to
query_device().  Without ib_no_udata_io(udata), non-zero provider input is
silently accepted instead of returning -EOPNOTSUPP, and any provider output
buffer is left unzeroed, locking broken udata semantics into ABI version 1.

Once all udata-taking ops follow the udata helpers, bng_re_dev_ops should
also set .uverbs_robust_udata = true per commit 613713f251c8 ("RDMA: Add
IB_UVERBS_CORE_SUPPORT_ROBUST_UDATA").

[ ... ]

> +int bng_re_query_port(struct ib_device *ibdev, u32 port_num,
> +		      struct ib_port_attr *port_attr)
> +{
> +	struct bng_re_dev *rdev = to_bng_re_dev(ibdev, ibdev);
> +	struct bng_re_dev_attr *dev_attr = rdev->dev_attr;
> +	int rc;

[ ... ]

> +	port_attr->max_mtu = IB_MTU_4096;
> +	port_attr->active_mtu = iboe_get_mtu(rdev->netdev->mtu);

[Severity: Low]
Can this plain read of rdev->netdev->mtu race with concurrent MTU updates?

bng_re_query_port() runs without rtnl_lock(), while __netif_set_mtu()
updates dev->mtu via WRITE_ONCE() and expects lockless readers to pair
with READ_ONCE().  Using READ_ONCE(rdev->netdev->mtu) avoids a KCSAN data
race and potential load tearing.

[ ... ]

> diff --git a/include/uapi/rdma/bng_re-abi.h b/include/uapi/rdma/bng_re-abi.h
> new file mode 100644
> index 0000000000000..cea056dc8610d
> --- /dev/null
> +++ b/include/uapi/rdma/bng_re-abi.h
> @@ -0,0 +1,12 @@
> +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
> +/* Copyright (c) 2025 Broadcom */
> +
> +#ifndef __BNG_RE_UVERBS_ABI_H__
> +#define __BNG_RE_UVERBS_ABI_H__
> +
> +#include <linux/types.h>
> +#include <rdma/ib_user_ioctl_cmds.h>
> +
> +#define BNG_RE_ABI_VERSION	1
> +
> +#endif /* __BNG_RE_UVERBS_ABI_H__*/

[Severity: Low]
Should this new UAPI header also be added to MAINTAINERS?

The BROADCOM 800 GIGABIT ROCE DRIVER section in MAINTAINERS only lists
drivers/infiniband/hw/bng_re/, so scripts/get_maintainer.pl will not map
patches touching include/uapi/rdma/bng_re-abi.h to the driver maintainer.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204155249.1002019-1-siva.kallam@broadcom.com?part=3

  reply	other threads:[~2026-12-05 16:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 15:47 [RDMA v2 00/13] Add BNG_RE control path verbs Siva Reddy Kallam
2026-12-04 15:47 ` [RDMA v2 01/13] bnge: Keep the RoCE MSI-X minimum for the MPC vector Siva Reddy Kallam
2026-12-04 15:47 ` [RDMA v2 02/13] RDMA/bng_re: Add MPC, XID management, doorbell infrastructure Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:47 ` [RDMA v2 03/13] RDMA/bng_re: Add support verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot [this message]
2026-12-04 15:47 ` [RDMA v2 04/13] RDMA/bng_re: Add ucontext/mmap verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:47 ` [RDMA v2 05/13] RDMA/bng_re: Add GID verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:47 ` [RDMA v2 06/13] RDMA/bng_re: Add PD verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:47 ` [RDMA v2 07/13] RDMA/bng_re: Add MR verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:48 ` [RDMA v2 08/13] RDMA/bng_re: Add CQ verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:48 ` [RDMA v2 09/13] RDMA/bng_re: Add SRQ verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:48 ` [RDMA v2 10/13] RDMA/bng_re: Add Stats verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:48 ` [RDMA v2 11/13] RDMA/bng_re: Add AH verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:48 ` [RDMA v2 12/13] RDMA/bng_re: Add QP verbs Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-04 15:48 ` [RDMA v2 13/13] RDMA/bng_re: Register with ib-core Siva Reddy Kallam
2026-12-05 16:10   ` sashiko-bot
2026-12-05 16:10 ` [RDMA v2 00/13] Add BNG_RE control path verbs 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-251727@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=siva.kallam@broadcom.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.