All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Leon Romanovsky <leon@kernel.org>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@mellanox.com>,
	"David S . Miller" <davem@davemloft.net>
Cc: Leon Romanovsky <leonro@mellanox.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Danit Goldberg <danitg@mellanox.com>,
	linux-netdev <netdev@vger.kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH iproute2-next] ip link: Add support to get SR-IOV VF node GUID and port GUID
Date: Thu, 14 Nov 2019 13:35:11 -0700	[thread overview]
Message-ID: <3cf565ce-6170-e632-a004-7ef03c40c6ea@gmail.com> (raw)
In-Reply-To: <20191114133126.238128-2-leon@kernel.org>

On 11/14/19 6:31 AM, Leon Romanovsky wrote:
> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index b72eb7a1..ed72d0bd 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -484,6 +484,29 @@ static void print_vfinfo(FILE *fp, struct ifinfomsg *ifi, struct rtattr *vfinfo)
>  				   vf_spoofchk->setting);
>  	}
>  
> +#define GUID_STR_LEN 24
> +	if (vf[IFLA_VF_IB_NODE_GUID]) {
> +		char buf[GUID_STR_LEN];

buf should be declared with SPRINT_BUF; see other users of ll_addr_n2a.
And, print_vfinfo already has b1 declared so you do not need a new one;
just change buf to b1.


> +		struct ifla_vf_guid *guid = RTA_DATA(vf[IFLA_VF_IB_NODE_GUID]);
> +		uint64_t node_guid = ntohll(guid->guid);
> +
> +		print_string(PRINT_ANY, "node guid", ", NODE_GUID %s",
> +				ll_addr_n2a((const unsigned char *)&node_guid,
> +					 RTA_PAYLOAD(vf[IFLA_VF_IB_NODE_GUID]),
> +					 ARPHRD_INFINIBAND,
> +					 buf, sizeof(buf)));
> +	}
> +	if (vf[IFLA_VF_IB_PORT_GUID]) {
> +		char buf[GUID_STR_LEN];
> +		struct ifla_vf_guid *guid = RTA_DATA(vf[IFLA_VF_IB_PORT_GUID]);
> +		uint64_t port_guid = ntohll(guid->guid);
> +
> +		print_string(PRINT_ANY, "port guid", ", PORT_GUID %s",
> +				ll_addr_n2a((const unsigned char *)&port_guid,
> +					 RTA_PAYLOAD(vf[IFLA_VF_IB_PORT_GUID]),
> +					 ARPHRD_INFINIBAND,
> +					 buf, sizeof(buf)));
> +	}
>  	if (vf[IFLA_VF_LINK_STATE]) {
>  		struct ifla_vf_link_state *vf_linkstate =
>  			RTA_DATA(vf[IFLA_VF_LINK_STATE]);
> 


  reply	other threads:[~2019-11-14 20:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 13:31 [PATCH rdma-next 0/4] Get IB port and node GUIDs through rtnetlink Leon Romanovsky
2019-11-14 13:31 ` [PATCH iproute2-next] ip link: Add support to get SR-IOV VF node GUID and port GUID Leon Romanovsky
2019-11-14 20:35   ` David Ahern [this message]
2019-11-15 15:24     ` Leon Romanovsky
2019-11-14 13:31 ` [PATCH rdma-next 1/4] net/core: Add support for getting VF GUIDs Leon Romanovsky
2019-11-22  0:54   ` David Ahern
2019-11-22 16:16     ` Leon Romanovsky
2019-11-14 13:31 ` [PATCH rdma-next 2/4] IB/core: Add interfaces to get VF node and port GUIDs Leon Romanovsky
2019-11-14 13:31 ` [PATCH rdma-next 3/4] IB/ipoib: Add ndo operation for getting VFs GUID attributes Leon Romanovsky
2019-11-14 13:31 ` [PATCH rdma-next 4/4] IB/mlx5: Implement callbacks " Leon Romanovsky
2019-11-18  7:25 ` [PATCH rdma-next 0/4] Get IB port and node GUIDs through rtnetlink Leon Romanovsky
2019-11-21 17:36   ` Leon Romanovsky
2019-11-22 16:21 ` Leon Romanovsky
2019-11-22 20:15   ` Jason Gunthorpe

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=3cf565ce-6170-e632-a004-7ef03c40c6ea@gmail.com \
    --to=dsahern@gmail.com \
    --cc=danitg@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=leon@kernel.org \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.