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] [day] [month] [year] [list]
Message-ID: <ab47dc52-3bb3-4b69-b202-b59fe4cb0727@lunn.ch>
Date: Tue, 11 Feb 2025 17:31:22 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Erni Sri Satya Vennela <ernis@...ux.microsoft.com>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
	decui@...rosoft.com, andrew+netdev@...n.ch, davem@...emloft.net,
	edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
	michal.swiatkowski@...ux.intel.com, mlevitsk@...hat.com,
	yury.norov@...il.com, shradhagupta@...ux.microsoft.com,
	kotaranov@...rosoft.com, peterz@...radead.org,
	brett.creeley@....com, mhklinux@...look.com,
	schakrabarti@...ux.microsoft.com, kent.overstreet@...ux.dev,
	longli@...rosoft.com, leon@...nel.org, erick.archer@...look.com,
	linux-hyperv@...r.kernel.org, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: mana: Add debug logs in MANA network driver

On Tue, Feb 11, 2025 at 01:51:55AM -0800, Erni Sri Satya Vennela wrote:
> Add debug statements to assist in debugging and monitoring
> driver behaviour, making it easier to identify potential
> issues  during development and testing.
> 
> Signed-off-by: Erni Sri Satya Vennela <ernis@...ux.microsoft.com>
> ---
>  .../net/ethernet/microsoft/mana/gdma_main.c   | 52 +++++++++++++----
>  .../net/ethernet/microsoft/mana/hw_channel.c  |  6 +-
>  drivers/net/ethernet/microsoft/mana/mana_en.c | 58 +++++++++++++++----
>  3 files changed, 94 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> index be95336ce089..f9839938f0ab 100644
> --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c
> +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c
> @@ -666,8 +666,11 @@ int mana_gd_create_hwc_queue(struct gdma_dev *gd,
>  
>  	gmi = &queue->mem_info;
>  	err = mana_gd_alloc_memory(gc, spec->queue_size, gmi);
> -	if (err)
> +	if (err) {
> +		dev_err(gc->dev, "GDMA queue type: %d, size: %u, gdma memory allocation err: %d\n",
> +			spec->type, spec->queue_size, err);

I would expect a debug statement to use dev_dbg(). Please update your
commit message.

>  		goto free_q;
> +	}
>  
>  	queue->head = 0;
>  	queue->tail = 0;
> @@ -688,6 +691,8 @@ int mana_gd_create_hwc_queue(struct gdma_dev *gd,
>  	*queue_ptr = queue;
>  	return 0;
>  out:
> +	dev_err(gc->dev, "Failed to create queue type %d of size %u, err: %d\n",
> +		spec->type, spec->queue_size, err);
>  	mana_gd_free_memory(gmi);
>  free_q:
>  	kfree(queue);
> @@ -763,14 +768,18 @@ static int mana_gd_create_dma_region(struct gdma_dev *gd,
>  
>  	if (resp.hdr.status ||
>  	    resp.dma_region_handle == GDMA_INVALID_DMA_REGION) {
> -		dev_err(gc->dev, "Failed to create DMA region: 0x%x\n",
> -			resp.hdr.status);
>  		err = -EPROTO;
>  		goto out;
>  	}
>  
>  	gmi->dma_region_handle = resp.dma_region_handle;
> +	dev_dbg(gc->dev, "Created DMA region handle 0x%llx\n",
> +		gmi->dma_region_handle);

Given all the dev_err() you have added, do this add any value? Is
there a way out of this function which is not a success and does not
print an error?

    Andrew

---
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ