From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 608BEC33C9E for ; Thu, 30 Jan 2020 12:59:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 202332083E for ; Thu, 30 Jan 2020 12:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580389199; bh=JNIF4xcLS3EAgcYhSNk8/FL+grLMS1nHKvBUas/mkUg=; h=From:To:Cc:Subject:Date:List-ID:From; b=YcWy/c1S1WCzTLJcvy5Zd1bEMXhplvxFtNBzEhXPL49YWdivNAaOscIbVhFBiCtR5 XFkHGag8EMbnwGXPtZ3wgJdjWxXl5IwIwDfuTJlMbQdmyHbstL/XvaDun9RHM1MLmm /D8/IvBQcD3U/YHYRATzZdJQ/+eQKdMnbz7Y/e1k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727321AbgA3M76 (ORCPT ); Thu, 30 Jan 2020 07:59:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:40532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbgA3M76 (ORCPT ); Thu, 30 Jan 2020 07:59:58 -0500 Received: from localhost (unknown [193.47.165.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E3A4320702; Thu, 30 Jan 2020 12:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580389197; bh=JNIF4xcLS3EAgcYhSNk8/FL+grLMS1nHKvBUas/mkUg=; h=From:To:Cc:Subject:Date:From; b=puhLDowyJtgsIqAaqATZn1NpW4QsZ7JLcN28ekoCeyYQhw97oUMwKAdDLTt4gmcIP jLlxh4qIiySpPwxLQBjZr53K6JaVfwczd3DMGsDSHvqSBi//O7/3DG0Ju5RSDUT3YH R+AprRJ9JJrfFOn6jt6uX32vwiF6z49EEdWHdP1o= From: Leon Romanovsky To: "David S . Miller" , Jakub Kicinski Cc: Leon Romanovsky , Adrian Chiris , Danit Goldberg , linux-netdev Subject: [PATCH net] net/core: Do not clear VF index for node/port GUIDs query Date: Thu, 30 Jan 2020 14:59:49 +0200 Message-Id: <20200130125949.409354-1-leon@kernel.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Leon Romanovsky 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 Signed-off-by: Leon Romanovsky --- 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