[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3cf565ce-6170-e632-a004-7ef03c40c6ea@gmail.com>
Date: Thu, 14 Nov 2019 13:35:11 -0700
From: David Ahern <dsahern@...il.com>
To: Leon Romanovsky <leon@...nel.org>,
Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...lanox.com>,
"David S . Miller" <davem@...emloft.net>
Cc: Leon Romanovsky <leonro@...lanox.com>,
RDMA mailing list <linux-rdma@...r.kernel.org>,
Danit Goldberg <danitg@...lanox.com>,
linux-netdev <netdev@...r.kernel.org>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH iproute2-next] ip link: Add support to get SR-IOV VF node
GUID and port GUID
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]);
>
Powered by blists - more mailing lists