All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: sharmaajay@linuxonhyperv.com
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
	Dexuan Cui <decui@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ajay Sharma <sharmaajay@microsoft.com>
Subject: Re: [Patch v2 3/5] RDMA/mana_ib : Add error eq and notification from SoC
Date: Wed, 26 Jul 2023 14:25:43 +0200	[thread overview]
Message-ID: <ZMEQxzqhdbNRxAfE@corigine.com> (raw)
In-Reply-To: <1690343820-20188-4-git-send-email-sharmaajay@linuxonhyperv.com>

On Tue, Jul 25, 2023 at 08:56:58PM -0700, sharmaajay@linuxonhyperv.com wrote:

...

> diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c
> index 2c4e3c496644..2ea24ba3065f 100644
> --- a/drivers/infiniband/hw/mana/main.c
> +++ b/drivers/infiniband/hw/mana/main.c
> @@ -504,3 +504,47 @@ int mana_ib_query_gid(struct ib_device *ibdev, u32 port, int index,
>  void mana_ib_disassociate_ucontext(struct ib_ucontext *ibcontext)
>  {
>  }
> +
> +void mana_ib_soc_event_handler(void *ctx, struct gdma_queue *queue,
> +				struct gdma_event *event)

Hi Ajay,

I wonder if this function should be static.
It seems to only be used in this file.

> diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c

...

> @@ -435,44 +434,47 @@ static int mana_gd_register_irq(struct gdma_queue *queue,
>  	gc = gd->gdma_context;
>  	r = &gc->msix_resource;
>  	dev = gc->dev;
> +	msi_index = spec->eq.msix_index;
>  
>  	spin_lock_irqsave(&r->lock, flags);
>  
> -	msi_index = find_first_zero_bit(r->map, r->size);
> -	if (msi_index >= r->size || msi_index >= gc->num_msix_usable) {
> -		err = -ENOSPC;
> -	} else {
> -		bitmap_set(r->map, msi_index, 1);
> -		queue->eq.msix_index = msi_index;
> -	}
> -
> -	spin_unlock_irqrestore(&r->lock, flags);
> +	if (!spec->eq.msix_allocated) {
> +		msi_index = find_first_zero_bit(r->map, r->size);
>  
> -	if (err) {
> -		dev_err(dev, "Register IRQ err:%d, msi:%u rsize:%u, nMSI:%u",
> -			err, msi_index, r->size, gc->num_msix_usable);
> +			if (msi_index >= r->size ||
> +			    msi_index >= gc->num_msix_usable)
> +				err = -ENOSPC;
> +			else
> +				bitmap_set(r->map, msi_index, 1);

It looks like the indention of the lines above is off.
There seems to be one tab too many.

>  
> -		return err;
> +		if (err) {
> +			dev_err(dev, "Register IRQ err:%d, msi:%u rsize:%u, nMSI:%u",
> +				err, msi_index, r->size, gc->num_msix_usable);
> +				goto out;
> +		}
>  	}

...

  reply	other threads:[~2023-07-26 12:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26  3:56 [Patch v2 0/5] RDMA/mana_ib Read Capabilities sharmaajay
2023-07-26  3:56 ` [Patch v2 1/5] RDMA/mana-ib : Rename all mana_ib_dev type variables to mib_dev sharmaajay
2023-07-26  3:56 ` [Patch v2 2/5] RDMA/mana_ib : Register Mana IB device with Management SW sharmaajay
2023-07-26  3:56 ` [Patch v2 3/5] RDMA/mana_ib : Add error eq and notification from SoC sharmaajay
2023-07-26 12:25   ` Simon Horman [this message]
2023-07-26 15:11   ` kernel test robot
2023-07-26  3:56 ` [Patch v2 4/5] RDMA/mana_ib : Create Adapter - each vf bound to adapter object sharmaajay
2023-07-26 12:26   ` Simon Horman
2023-07-26  3:57 ` [Patch v2 5/5] RDMA/mana_ib : Query adapter capabilities sharmaajay
2023-07-26 12:31   ` Simon Horman

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=ZMEQxzqhdbNRxAfE@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=jgg@ziepe.ca \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sharmaajay@linuxonhyperv.com \
    --cc=sharmaajay@microsoft.com \
    --cc=wei.liu@kernel.org \
    /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.