* [PATCH net] net/core: Do not clear VF index for node/port GUIDs query
@ 2020-01-30 12:59 Leon Romanovsky
2020-01-30 14:21 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2020-01-30 12:59 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski
Cc: Leon Romanovsky, Adrian Chiris, Danit Goldberg, linux-netdev
From: Leon Romanovsky <leonro@mellanox.com>
VF numbers were assigned to node_guid and port_guid, but cleared
right before such query calls were issued. It caused to return
node/port GUIDs of VF index 0 for all VFs.
Fixes: 30aad41721e0 ("net/core: Add support for getting VF GUIDs")
Reported-by: Adrian Chiris <adrianc@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
net/core/rtnetlink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index cdad6ed532c4..09c44bf2e1d2 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1242,6 +1242,8 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
return 0;
memset(&vf_vlan_info, 0, sizeof(vf_vlan_info));
+ memset(&node_guid, 0, sizeof(node_guid));
+ memset(&port_guid, 0, sizeof(port_guid));
vf_mac.vf =
vf_vlan.vf =
@@ -1290,8 +1292,6 @@ static noinline_for_stack int rtnl_fill_vfinfo(struct sk_buff *skb,
sizeof(vf_trust), &vf_trust))
goto nla_put_vf_failure;
- memset(&node_guid, 0, sizeof(node_guid));
- memset(&port_guid, 0, sizeof(port_guid));
if (dev->netdev_ops->ndo_get_vf_guid &&
!dev->netdev_ops->ndo_get_vf_guid(dev, vfs_num, &node_guid,
&port_guid)) {
--
2.24.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net/core: Do not clear VF index for node/port GUIDs query
2020-01-30 12:59 [PATCH net] net/core: Do not clear VF index for node/port GUIDs query Leon Romanovsky
@ 2020-01-30 14:21 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-01-30 14:21 UTC (permalink / raw)
To: leon; +Cc: kuba, leonro, adrianc, danitg, netdev
From: Leon Romanovsky <leon@kernel.org>
Date: Thu, 30 Jan 2020 14:59:49 +0200
> From: Leon Romanovsky <leonro@mellanox.com>
>
> VF numbers were assigned to node_guid and port_guid, but cleared
> right before such query calls were issued. It caused to return
> node/port GUIDs of VF index 0 for all VFs.
>
> Fixes: 30aad41721e0 ("net/core: Add support for getting VF GUIDs")
> Reported-by: Adrian Chiris <adrianc@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Looks good, applied and queued up for -stable.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-30 14:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-30 12:59 [PATCH net] net/core: Do not clear VF index for node/port GUIDs query Leon Romanovsky
2020-01-30 14:21 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).