linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: longli@linuxonhyperv.com
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
	Ajay Sharma <sharmaajay@microsoft.com>,
	Dexuan Cui <decui@microsoft.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@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,
	Long Li <longli@microsoft.com>
Subject: Re: [Patch v1 2/4] RDMA/mana_ib: create and process EQ events
Date: Sun, 26 Nov 2023 17:15:04 +0000	[thread overview]
Message-ID: <20231126171504.GC84723@kernel.org> (raw)
In-Reply-To: <1700709010-22042-3-git-send-email-longli@linuxonhyperv.com>

On Wed, Nov 22, 2023 at 07:10:08PM -0800, longli@linuxonhyperv.com wrote:
> From: Long Li <longli@microsoft.com>
> 
> Before the software can create an RDMA adapter handle with SoC, it needs to
> create EQs for processing SoC events from RDMA device. Because MSI-X
> vectors are shared between MANA Ethernet device and RDMA device, this
> patch adds support to share EQs on MSI-X vectors and creates management
> EQ for RDMA device.
> 
> Signed-off-by: Long Li <longli@microsoft.com>

...

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

...

> -static void mana_gd_deregiser_irq(struct gdma_queue *queue)
> +static void mana_gd_deregister_irq(struct gdma_queue *queue)
>  {
>  	struct gdma_dev *gd = queue->gdma_dev;
>  	struct gdma_irq_context *gic;
>  	struct gdma_context *gc;
>  	struct gdma_resource *r;
>  	unsigned int msix_index;
> +	struct gdma_queue *eq;
>  	unsigned long flags;
> +	struct list_head *p;
>  
>  	gc = gd->gdma_context;
>  	r = &gc->msix_resource;
> @@ -505,14 +507,24 @@ static void mana_gd_deregiser_irq(struct gdma_queue *queue)
>  	if (WARN_ON(msix_index >= gc->num_msix_usable))
>  		return;
>  
> +	spin_lock_irqsave(&r->lock, flags);
> +
>  	gic = &gc->irq_contexts[msix_index];
> -	gic->handler = NULL;
> -	gic->arg = NULL;
> +	list_for_each_rcu(p, &gic->eq_list) {
> +		eq = list_entry(p, struct gdma_queue, entry);

Hi Long Li,

Sparse complains a bit about this construction:

 .../gdma_main.c:513:9: error: incompatible types in comparison expression (different address spaces):
 .../gdma_main.c:513:9:    struct list_head [noderef] __rcu *
 .../gdma_main.c:513:9:    struct list_head *
 .../gdma_main.c:513:9: error: incompatible types in comparison expression (different address spaces):
 .../gdma_main.c:513:9:    struct list_head [noderef] __rcu *
 .../gdma_main.c:513:9:    struct list_head *

Perhaps using list_for_each_entry_rcu() is appropriate here.


> +		if (queue == eq) {
> +			list_del(&eq->entry);
> +			synchronize_rcu();
> +			break;
> +		}
> +	}
>  
> -	spin_lock_irqsave(&r->lock, flags);
> -	bitmap_clear(r->map, msix_index, 1);
> -	spin_unlock_irqrestore(&r->lock, flags);
> +	if (list_empty(&gic->eq_list)) {
> +		gic->handler = NULL;
> +		bitmap_clear(r->map, msix_index, 1);
> +	}
>  
> +	spin_unlock_irqrestore(&r->lock, flags);
>  	queue->eq.msix_index = INVALID_PCI_MSIX_INDEX;
>  }
>  

...

  reply	other threads:[~2023-11-26 17:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23  3:10 [Patch v1 0/4] longli
2023-11-23  3:10 ` [Patch v1 1/4] RDMA/mana_ib: register RDMA device with GDMA longli
2023-11-23  3:10 ` [Patch v1 2/4] RDMA/mana_ib: create and process EQ events longli
2023-11-26 17:15   ` Simon Horman [this message]
2023-11-27 19:00     ` Long Li
2023-11-23  3:10 ` [Patch v1 3/4] RDMA/mana_ib: create RDMA adapter handle longli
2023-11-23  3:10 ` [Patch v1 4/4] RDMA/mana_ib: query device capabilities longli

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=20231126171504.GC84723@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=haiyangz@microsoft.com \
    --cc=jgg@ziepe.ca \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@linuxonhyperv.com \
    --cc=longli@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 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).