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: <fb037803-0002-4d91-9c9f-bbb233490acb@intel.com>
Date: Tue, 28 May 2024 16:48:00 +0200
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Shay Drory <shayd@...dia.com>, <netdev@...r.kernel.org>,
	<pabeni@...hat.com>, <davem@...emloft.net>, <kuba@...nel.org>,
	<edumazet@...gle.com>, <gregkh@...uxfoundation.org>,
	<david.m.ertman@...el.com>
CC: <rafael@...nel.org>, <ira.weiny@...el.com>, <linux-rdma@...r.kernel.org>,
	<leon@...nel.org>, <tariqt@...dia.com>, Parav Pandit <parav@...dia.com>
Subject: Re: [PATCH net-next v5 2/2] net/mlx5: Expose SFs IRQs

On 5/28/24 11:11, Shay Drory wrote:
> Expose the sysfs files for the IRQs that the mlx5 PCI SFs are using.
> These entries are similar to PCI PFs and VFs in 'msi_irqs' directory.
> 
> Reviewed-by: Parav Pandit <parav@...dia.com>
> Signed-off-by: Shay Drory <shayd@...dia.com>
> 
> ---
> v2->v3:
> - fix mlx5 sfnum SF sysfs
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/eq.c     |  6 +++---
>   .../ethernet/mellanox/mlx5/core/irq_affinity.c   | 15 ++++++++++++++-
>   .../net/ethernet/mellanox/mlx5/core/mlx5_core.h  |  6 ++++++
>   .../net/ethernet/mellanox/mlx5/core/mlx5_irq.h   | 12 ++++++++----
>   .../net/ethernet/mellanox/mlx5/core/pci_irq.c    | 12 +++++++++---
>   .../net/ethernet/mellanox/mlx5/core/sf/dev/dev.c | 16 +++++++---------
>   6 files changed, 47 insertions(+), 20 deletions(-)
> 

[...]

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c b/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c
> index 612e666ec263..5c36aa3c57e0 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c
> @@ -112,15 +112,18 @@ irq_pool_find_least_loaded(struct mlx5_irq_pool *pool, const struct cpumask *req
>   
>   /**
>    * mlx5_irq_affinity_request - request an IRQ according to the given mask.
> + * @dev: mlx5 core device which is requesting the IRQ.
>    * @pool: IRQ pool to request from.
>    * @af_desc: affinity descriptor for this IRQ.
>    *
>    * This function returns a pointer to IRQ, or ERR_PTR in case of error.
>    */
>   struct mlx5_irq *
> -mlx5_irq_affinity_request(struct mlx5_irq_pool *pool, struct irq_affinity_desc *af_desc)
> +mlx5_irq_affinity_request(struct mlx5_core_dev *dev, struct mlx5_irq_pool *pool,
> +			  struct irq_affinity_desc *af_desc)
>   {
>   	struct mlx5_irq *least_loaded_irq, *new_irq;
> +	int ret;
>   
>   	mutex_lock(&pool->lock);
>   	least_loaded_irq = irq_pool_find_least_loaded(pool, &af_desc->mask);
> @@ -152,6 +155,13 @@ mlx5_irq_affinity_request(struct mlx5_irq_pool *pool, struct irq_affinity_desc *
>   					     mlx5_irq_get_index(least_loaded_irq)), pool->name,
>   			      mlx5_irq_read_locked(least_loaded_irq) / MLX5_EQ_REFS_PER_IRQ);
>   unlock:
> +	if (mlx5_irq_pool_is_sf_pool(pool)) {
> +		ret = auxiliary_device_sysfs_irq_add(mlx5_sf_coredev_to_adev(dev),
> +						     mlx5_irq_get_irq(least_loaded_irq));
> +		if (ret)
> +			mlx5_core_err(dev, "Failed to create sysfs entry for irq %d, ret = %d\n",
> +				      mlx5_irq_get_irq(least_loaded_irq), ret);

you are handling the error by logging a message, then ignoring it
this is clearly not an ERROR, just a WARN or INFO.

> +	}
>   	mutex_unlock(&pool->lock);
>   	return least_loaded_irq;
>   }

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ