From: Leon Romanovsky <leon@kernel.org>
To: Junxian Huang <huangjunxian6@hisilicon.com>
Cc: Selvin Xavier <selvin.xavier@broadcom.com>,
jgg@ziepe.ca, linux-rdma@vger.kernel.org,
andrew.gospodarek@broadcom.com,
kalesh-anakkur.purayil@broadcom.com, kashyap.desai@broadcom.com,
Saravanan Vajravel <saravanan.vajravel@broadcom.com>
Subject: Re: [PATCH for-next 4/4] RDMA/bnxt_re: Add debugfs hook in the driver
Date: Wed, 30 Oct 2024 15:43:06 +0200 [thread overview]
Message-ID: <20241030134306.GA5988@unreal> (raw)
In-Reply-To: <4766a9e3-205a-4979-33c8-703e1148675c@hisilicon.com>
On Wed, Oct 30, 2024 at 06:10:18PM +0800, Junxian Huang wrote:
>
>
> On 2024/10/22 18:11, Selvin Xavier wrote:
> > From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> >
> > Adding support for a per device debugfs folder for exporting
> > some of the device specific debug information.
> > Added support to get QP info for now. The same folder can be
> > used to export other debug features in future.
> >
> > Signed-off-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
> > Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> > Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
> > ---
> > drivers/infiniband/hw/bnxt_re/Makefile | 3 +-
> > drivers/infiniband/hw/bnxt_re/bnxt_re.h | 2 +
> > drivers/infiniband/hw/bnxt_re/debugfs.c | 141 +++++++++++++++++++++++++++++++
> > drivers/infiniband/hw/bnxt_re/debugfs.h | 21 +++++
> > drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 +
> > drivers/infiniband/hw/bnxt_re/ib_verbs.h | 1 +
> > drivers/infiniband/hw/bnxt_re/main.c | 13 ++-
> > 7 files changed, 183 insertions(+), 2 deletions(-)
> > create mode 100644 drivers/infiniband/hw/bnxt_re/debugfs.c
> > create mode 100644 drivers/infiniband/hw/bnxt_re/debugfs.h
<...>
> > +static inline const char *bnxt_re_qp_type_str(u8 type)
> > +{
> > + switch (type) {
> > + case CMDQ_CREATE_QP1_TYPE_GSI: return "QP1";
> > + case CMDQ_CREATE_QP_TYPE_GSI: return "QP1";
> > + case CMDQ_CREATE_QP_TYPE_RC: return "RC";
> > + case CMDQ_CREATE_QP_TYPE_UD: return "UD";
> > + case CMDQ_CREATE_QP_TYPE_RAW_ETHERTYPE: return "RAW_ETHERTYPE";
> > + default: return "Invalid transport type";
> > + }
> > +}
> > +
>
> Would it be better to use table-driven approach for these two functions?
No, proposed variant is better as it can be consumed very easily by tools.
Table are good for humans but bad for tooling.
Thanks
prev parent reply other threads:[~2024-10-30 13:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 10:11 [PATCH for-next 0/4] RDMA/bnxt_re: Debug enhancements for bnxt_re driver Selvin Xavier
2024-10-22 10:11 ` [PATCH for-next 1/4] RDMA/bnxt_re: Support driver specific data collection using rdma tool Selvin Xavier
2024-10-29 14:03 ` Leon Romanovsky
2024-10-30 8:29 ` Selvin Xavier
2024-10-30 13:43 ` Leon Romanovsky
2024-10-22 10:11 ` [PATCH for-next 2/4] RDMA/bnxt_re: Add support for querying HW contexts Selvin Xavier
2024-10-22 10:11 ` [PATCH for-next 3/4] RDMA/bnxt_re: Support raw data query for each resources Selvin Xavier
2024-10-22 10:11 ` [PATCH for-next 4/4] RDMA/bnxt_re: Add debugfs hook in the driver Selvin Xavier
2024-10-30 10:10 ` Junxian Huang
2024-10-30 13:43 ` Leon Romanovsky [this message]
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=20241030134306.GA5988@unreal \
--to=leon@kernel.org \
--cc=andrew.gospodarek@broadcom.com \
--cc=huangjunxian6@hisilicon.com \
--cc=jgg@ziepe.ca \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-rdma@vger.kernel.org \
--cc=saravanan.vajravel@broadcom.com \
--cc=selvin.xavier@broadcom.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