linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org,
	andrew.gospodarek@broadcom.com, selvin.xavier@broadcom.com,
	kalesh-anakkur.purayil@broadcom.com
Subject: Re: [PATCH rdma-next v2 1/4] RDMA/bnxt_re: Move the UAPI methods to a dedicated file
Date: Sun, 9 Nov 2025 11:12:02 +0200	[thread overview]
Message-ID: <20251109091202.GF15456@unreal> (raw)
In-Reply-To: <20251104072320.210596-2-sriharsha.basavapatna@broadcom.com>

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,

> +
> +#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);

Thanks

  reply	other threads:[~2025-11-09  9:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04  7:23 [PATCH rdma-next v2 0/4] RDMA/bnxt_re: Support direct verbs Sriharsha Basavapatna
2025-11-04  7:23 ` [PATCH rdma-next v2 1/4] RDMA/bnxt_re: Move the UAPI methods to a dedicated file Sriharsha Basavapatna
2025-11-09  9:12   ` Leon Romanovsky [this message]
2025-11-10 14:43     ` Sriharsha Basavapatna
2025-11-04  7:23 ` [PATCH rdma-next v2 2/4] RDMA/bnxt_re: Refactor bnxt_qplib_create_qp() function Sriharsha Basavapatna
2025-11-09  9:21   ` Leon Romanovsky
2025-11-10 14:49     ` Sriharsha Basavapatna
2025-11-11 10:14       ` Leon Romanovsky
2025-11-04  7:23 ` [PATCH rdma-next v2 3/4] RDMA/bnxt_re: Direct Verbs: Support DBR and UMEM verbs Sriharsha Basavapatna
2025-11-04  7:23 ` [PATCH rdma-next v2 4/4] RDMA/bnxt_re: Direct Verbs: Support CQ and QP verbs Sriharsha Basavapatna
2025-11-09  9:49   ` Leon Romanovsky
2025-11-10 14:58     ` Sriharsha Basavapatna

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=20251109091202.GF15456@unreal \
    --to=leon@kernel.org \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=jgg@ziepe.ca \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=selvin.xavier@broadcom.com \
    --cc=sriharsha.basavapatna@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 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).