lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231126171504.GC84723@kernel.org>
Date: Sun, 26 Nov 2023 17:15:04 +0000
From: Simon Horman <horms@...nel.org>
To: longli@...uxonhyperv.com
Cc: Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>,
	Ajay Sharma <sharmaajay@...rosoft.com>,
	Dexuan Cui <decui@...rosoft.com>,
	"K. Y. Srinivasan" <kys@...rosoft.com>,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	Wei Liu <wei.liu@...nel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	linux-rdma@...r.kernel.org, linux-hyperv@...r.kernel.org,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	Long Li <longli@...rosoft.com>
Subject: Re: [Patch v1 2/4] RDMA/mana_ib: create and process EQ events

On Wed, Nov 22, 2023 at 07:10:08PM -0800, longli@...uxonhyperv.com wrote:
> From: Long Li <longli@...rosoft.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@...rosoft.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;
>  }
>  

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ