Re: [PATCH rdma-next v2 1/4] RDMA/bnxt_re: Move the UAPI methods to a dedicated file

Sriharsha Basavapatna
2025-11-10T14:44:14Z

[-- Attachment #1: Type: text/plain, Size: 3805 bytes --]

On Sun, Nov 9, 2025 at 2:42 PM Leon Romanovsky <leon@kernel.org> wrote:
>
> On Tue, Nov 04, 2025 at 12:53:17PM +0530, Sriharsha Basavapatna wrote:
> > From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> >
> > This is in preparation for upcoming patches in the series.
> > Driver has to support additional UAPIs for Direct verbs.
> > Moving current UAPI implementation to a new file, dv.c.
> >
> > Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> > Reviewed-by: Selvin Thyparampil Xavier <selvin.xavier@broadcom.com>
> > Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
> > ---
> > drivers/infiniband/hw/bnxt_re/Makefile | 2 +-
> > drivers/infiniband/hw/bnxt_re/dv.c | 356 +++++++++++++++++++++++
> > drivers/infiniband/hw/bnxt_re/ib_verbs.c | 305 +------------------
> > drivers/infiniband/hw/bnxt_re/ib_verbs.h | 3 +
> > 4 files changed, 361 insertions(+), 305 deletions(-)
> > create mode 100644 drivers/infiniband/hw/bnxt_re/dv.c
>
> <...>
>
> > +++ b/drivers/infiniband/hw/bnxt_re/dv.c
> > @@ -0,0 +1,356 @@
> > +/*
> > + * Broadcom NetXtreme-E RoCE driver.
> > + *
> > + * Copyright (c) 2025, Broadcom. All rights reserved. The term
> > + * Broadcom refers to Broadcom Inc. and/or its subsidiaries.
> > + *
> > + * This software is available to you under a choice of one of two
> > + * licenses. You may choose to be licensed under the terms of the GNU
> > + * General Public License (GPL) Version 2, available from the file
> > + * COPYING in the main directory of this source tree, or the
> > + * BSD license below:
> > + *
> > + * Redistribution and use in source and binary forms, with or without
> > + * modification, are permitted provided that the following conditions
> > + * are met:
> > + *
> > + * 1. Redistributions of source code must retain the above copyright
> > + * notice, this list of conditions and the following disclaimer.
> > + * 2. Redistributions in binary form must reproduce the above copyright
> > + * notice, this list of conditions and the following disclaimer in
> > + * the documentation and/or other materials provided with the
> > + * distribution.
> > + *
> > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
> > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
> > + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> > + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
> > + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
> > + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> > + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
> > + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
> > + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > + *
> > + * Description: Direct Verbs interpreter
> > + */
>
> Please remove all this boilerplate and use SPDX tag instead,
ack.
>
> > +
> > +#include <rdma/ib_addr.h>
> > +#include <rdma/uverbs_types.h>
> > +#include <rdma/uverbs_std_types.h>
> > +#include <rdma/ib_user_ioctl_cmds.h>
> > +#define UVERBS_MODULE_NAME bnxt_re
> > +#include <rdma/uverbs_named_ioctl.h>
> > +#include <rdma/bnxt_re-abi.h>
>
> <...>
>
> > + uctx = container_of(ib_uverbs_get_ucontext(attrs), struct bnxt_re_ucontext, ib_uctx);
> > + if (IS_ERR(uctx))
>
> This is can't be right, you should check ib_uverbs_get_ucontext() for
> error first, before doing container_of().
>
> > + return PTR_ERR(uctx);
ack.
>
> Thanks

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5505 bytes --]