netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leonro@nvidia.com>
To: Siva Reddy Kallam <siva.kallam@broadcom.com>
Cc: Simon Horman <horms@kernel.org>, <jgg@nvidia.com>,
	<linux-rdma@vger.kernel.org>, <netdev@vger.kernel.org>,
	<vikas.gupta@broadcom.com>, <selvin.xavier@broadcom.com>,
	<anand.subramanian@broadcom.com>,
	Usman Ansari <usman.ansari@broadcom.com>
Subject: Re: [PATCH 5/8] RDMA/bng_re: Add infrastructure for enabling Firmware channel
Date: Mon, 15 Sep 2025 12:00:30 +0300	[thread overview]
Message-ID: <20250915090030.GB9353@unreal> (raw)
In-Reply-To: <CAMet4B7SJXk1yMsJ61a026U3wNKr-7oNX9_-V+_W1PA0VRaaTQ@mail.gmail.com>

On Mon, Sep 15, 2025 at 02:14:19PM +0530, Siva Reddy Kallam wrote:
> On Fri, Sep 12, 2025 at 2:09 PM Simon Horman <horms@kernel.org> wrote:
> >
> > On Fri, Aug 29, 2025 at 12:30:39PM +0000, Siva Reddy Kallam wrote:
> > > Add infrastructure for enabling Firmware channel.
> > >
> > > Signed-off-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
> > > Reviewed-by: Usman Ansari <usman.ansari@broadcom.com>
> >
> > ...
> >
> > > diff --git a/drivers/infiniband/hw/bng_re/bng_fw.c b/drivers/infiniband/hw/bng_re/bng_fw.c
> >
> > ...
> >
> > > +/* function events */
> > > +static int bng_re_process_func_event(struct bng_re_rcfw *rcfw,
> > > +                                  struct creq_func_event *func_event)
> > > +{
> > > +     int rc;
> > > +
> > > +     switch (func_event->event) {
> > > +     case CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_RX_DATA_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_CQ_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_TQM_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_CFCQ_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_CFCS_ERROR:
> > > +             /* SRQ ctx error, call srq_handler??
> > > +              * But there's no SRQ handle!
> > > +              */
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_CFCC_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_CFCM_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_TIM_ERROR:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_VF_COMM_REQUEST:
> > > +             break;
> > > +     case CREQ_FUNC_EVENT_EVENT_RESOURCE_EXHAUSTED:
> > > +             break;
> > > +     default:
> > > +             return -EINVAL;
> > > +     }
> > > +
> > > +     return rc;
> >
> > rc does not appear to be initialised in this function.
> >
> > Flagged by Clang 20.1.8 with -Wuninitialized
> 
> Thank you for the review. We will fix it in the next version of the patchset.

Once you are fixing it, please squeeze you switch-case to be something
like that:

switch (func_event->event) {
     case CREQ_FUNC_EVENT_EVENT_TX_WQE_ERROR:
     case CREQ_FUNC_EVENT_EVENT_TX_DATA_ERROR:
     case CREQ_FUNC_EVENT_EVENT_RX_WQE_ERROR:
     ....
     	break;
     default:
     	return -EINVAL;
    }

Thanks

> 
> >
> > > +}
> >
> > ...
> >
> > > +int bng_re_enable_fw_channel(struct bng_re_rcfw *rcfw,
> > > +                          int msix_vector,
> > > +                          int cp_bar_reg_off)
> > > +{
> > > +     struct bng_re_cmdq_ctx *cmdq;
> > > +     struct bng_re_creq_ctx *creq;
> > > +     int rc;
> > > +
> > > +     cmdq = &rcfw->cmdq;
> > > +     creq = &rcfw->creq;
> >
> > Conversely, creq is initialised here but otherwise unused in this function.
> >
> > Flagged by GCC 15.1.0 and Clang 20.1.8 with -Wunused-but-set-variable
> 
> Thank you for the review. We will fix it in the next version of the patchset.
> 
> >
> > > +
> > > +     /* Assign defaults */
> > > +     cmdq->seq_num = 0;
> > > +     set_bit(FIRMWARE_FIRST_FLAG, &cmdq->flags);
> > > +     init_waitqueue_head(&cmdq->waitq);
> > > +
> > > +     rc = bng_re_map_cmdq_mbox(rcfw);
> > > +     if (rc)
> > > +             return rc;
> > > +
> > > +     rc = bng_re_map_creq_db(rcfw, cp_bar_reg_off);
> > > +     if (rc)
> > > +             return rc;
> > > +
> > > +     rc = bng_re_rcfw_start_irq(rcfw, msix_vector, true);
> > > +     if (rc) {
> > > +             dev_err(&rcfw->pdev->dev,
> > > +                     "Failed to request IRQ for CREQ rc = 0x%x\n", rc);
> > > +             bng_re_disable_rcfw_channel(rcfw);
> > > +             return rc;
> > > +     }
> > > +
> > > +     return 0;
> > > +}
> >
> > ...
> 

  reply	other threads:[~2025-09-15  9:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29 12:30 [PATCH 0/8] Introducing Broadcom BNG_RE RoCE Driver Siva Reddy Kallam
2025-08-29 12:30 ` [PATCH 1/8] bng_en: Add RoCE aux device support Siva Reddy Kallam
2025-09-01 19:10   ` Jakub Kicinski
2025-08-29 12:30 ` [PATCH 2/8] RDMA/bng_re: Add Auxiliary interface Siva Reddy Kallam
2025-09-16 12:34   ` Simon Horman
2025-09-17  9:17     ` Siva Reddy Kallam
2025-08-29 12:30 ` [PATCH 3/8] RDMA/bng_re: Register and get the resources from bnge driver Siva Reddy Kallam
2025-08-29 12:30 ` [PATCH 4/8] RDMA/bng_re: Allocate required memory resources for Firmware channel Siva Reddy Kallam
2025-08-29 12:30 ` [PATCH 5/8] RDMA/bng_re: Add infrastructure for enabling " Siva Reddy Kallam
2025-09-12  8:39   ` Simon Horman
2025-09-15  8:44     ` Siva Reddy Kallam
2025-09-15  9:00       ` Leon Romanovsky [this message]
2025-09-15 10:09         ` Siva Reddy Kallam
2025-08-29 12:30 ` [PATCH 6/8] RDMA/bng_re: Enable Firmware channel and query device attributes Siva Reddy Kallam
2025-09-12  8:42   ` Simon Horman
2025-09-15  8:46     ` Siva Reddy Kallam
2025-08-29 12:30 ` [PATCH 7/8] RDMA/bng_re: Add basic debugfs infrastructure Siva Reddy Kallam
2025-08-29 12:30 ` [PATCH 8/8] RDMA/bng_re: Initialize the Firmware and Hardware Siva Reddy Kallam

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=20250915090030.GB9353@unreal \
    --to=leonro@nvidia.com \
    --cc=anand.subramanian@broadcom.com \
    --cc=horms@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=selvin.xavier@broadcom.com \
    --cc=siva.kallam@broadcom.com \
    --cc=usman.ansari@broadcom.com \
    --cc=vikas.gupta@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).