Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Gal Pressman <galpress@amazon.com>
To: Devesh Sharma <devesh.sharma@broadcom.com>
Cc: <linux-rdma@vger.kernel.org>, <jgg@mellanox.com>, <leon@kernel.org>
Subject: Re: [PATCH v3] rdma-core/libibverbs: display gid type in ibv_devinfo
Date: Mon, 3 Feb 2020 11:13:24 +0200	[thread overview]
Message-ID: <65ab8a55-2155-cf1e-fcd8-b87fc7360a36@amazon.com> (raw)
In-Reply-To: <1580708846-10851-1-git-send-email-devesh.sharma@broadcom.com>

On 03/02/2020 7:47, Devesh Sharma wrote:
> It becomes difficult to make out from the output of ibv_devinfo
> if a particular gid index is RoCE v2 or not.
> 
> Adding a string to the output of ibv_devinfo -v to display the
> gid type at the end of gid.
> 
> Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
> ---
>  libibverbs/examples/devinfo.c | 22 ++++++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/libibverbs/examples/devinfo.c b/libibverbs/examples/devinfo.c
> index bf53eac..bbaed8c 100644
> --- a/libibverbs/examples/devinfo.c
> +++ b/libibverbs/examples/devinfo.c
> @@ -162,8 +162,18 @@ static const char *vl_str(uint8_t vl_num)
>  	}
>  }
>  
> +static const char *gid_type_str(enum ibv_gid_type type)
> +{
> +	switch (type) {
> +	case 0: return "IB/RoCE v1";
> +	case 1: return "RoCE v2";
> +	default: return "invalid value";
> +	}
> +}

Why hard code the enum values? Use IBV_GID_TYPE_IB_ROCE_V1 and IBV_GID_TYPE_ROCE_V2.

  parent reply	other threads:[~2020-02-03  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03  5:47 [PATCH v3] rdma-core/libibverbs: display gid type in ibv_devinfo Devesh Sharma
2020-02-03  8:49 ` Leon Romanovsky
2020-02-03 14:59   ` Devesh Sharma
2020-02-03  9:13 ` Gal Pressman [this message]
2020-02-03 15:00   ` Devesh Sharma

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=65ab8a55-2155-cf1e-fcd8-b87fc7360a36@amazon.com \
    --to=galpress@amazon.com \
    --cc=devesh.sharma@broadcom.com \
    --cc=jgg@mellanox.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /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