[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250213073109.GA10334@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Date: Wed, 12 Feb 2025 23:31:09 -0800
From: Erni Sri Satya Vennela <ernis@...ux.microsoft.com>
To: Andrew Lunn <andrew@...n.ch>
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 05:31:22PM +0100, Andrew Lunn wrote:
> 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.
I'll make sure to make this change in the next version of the patch.
>
> > 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?
>
I wanted to provide more detailed information using dev_err and dev_dbg.
In the next version, I will retain the dev_err in the if condition as it
is, and change the dev_err to dev_dbg in the "out:" label to ensure that
most of the information gets logged.
> Andrew
>
> ---
> pw-bot: cr
Powered by blists - more mailing lists