From: Andrew Lunn <andrew@lunn.ch>
To: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
decui@microsoft.com, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
michal.swiatkowski@linux.intel.com, mlevitsk@redhat.com,
yury.norov@gmail.com, shradhagupta@linux.microsoft.com,
kotaranov@microsoft.com, peterz@infradead.org,
brett.creeley@amd.com, mhklinux@outlook.com,
schakrabarti@linux.microsoft.com, kent.overstreet@linux.dev,
longli@microsoft.com, leon@kernel.org, erick.archer@outlook.com,
linux-hyperv@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: mana: Add debug logs in MANA network driver
Date: Tue, 11 Feb 2025 17:31:22 +0100 [thread overview]
Message-ID: <ab47dc52-3bb3-4b69-b202-b59fe4cb0727@lunn.ch> (raw)
In-Reply-To: <1739267515-31187-1-git-send-email-ernis@linux.microsoft.com>
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@linux.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
next prev parent reply other threads:[~2025-02-11 16:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-11 9:51 Erni Sri Satya Vennela
2025-02-11 15:40 ` Haiyang Zhang
2025-02-11 16:31 ` Andrew Lunn [this message]
2025-02-13 7:31 ` Erni Sri Satya Vennela
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=ab47dc52-3bb3-4b69-b202-b59fe4cb0727@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=erick.archer@outlook.com \
--cc=ernis@linux.microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kent.overstreet@linux.dev \
--cc=kotaranov@microsoft.com \
--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=longli@microsoft.com \
--cc=mhklinux@outlook.com \
--cc=michal.swiatkowski@linux.intel.com \
--cc=mlevitsk@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peterz@infradead.org \
--cc=schakrabarti@linux.microsoft.com \
--cc=shradhagupta@linux.microsoft.com \
--cc=wei.liu@kernel.org \
--cc=yury.norov@gmail.com \
/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
all inboxes | Powered by JetHome®