Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp714501imm; Thu, 13 Sep 2018 06:43:19 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb7r3qjeP3EJZvMtrR71Ok4LfgcI5YSmKBnS967SxT+qV08SbtvflhVnpS62VOSm1C9KEpo X-Received: by 2002:a63:e0e:: with SMTP id d14-v6mr5559932pgl.38.1536846199321; Thu, 13 Sep 2018 06:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536846199; cv=none; d=google.com; s=arc-20160816; b=kxBjSHrMqXGRG02cJnl84cxP5dHJfB0LcKEqkIPt6rQIZyCBbTUgrUiv5DdLucV5q/ Dj3uvklTD7ce4KQIETHzIzYwThdTBnlUe4KE+fH8Pzk0SD34TI32dpoEj1V6hjF5Xdi4 0cIVXGjbAC2+ziX7KZnC7cQtl8OwRNM5m1AR4t5TkEL26eKZ8be9dsyMrpTFR4tEDtuz 9HM3ypv2cMJQwt7iHb74X+SX2m64qz0r1bReA9KVABXsP4bMqqjcrhh0Z+JceSRGBfvd O6ATStglo64T1SeNTGvXv89irTpk5ZKcsnZmZ1qV4xwxp24+bcJVAfCEgYyvRdBA68WT zNuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=ntfaWgG25csl5cixfojUYBNL5OrcCvEkCIvsDWo+0sA=; b=nyk8Dxj0zrj+wZB+WYoQG214jhw/z0oFA5bP9f4+cTkc/AZUXrTO7DjrAoFXDxC7t7 wZ3bxhixZ3srXX7yoJy2a7anr49hH+ix1U58lIiGBh1XGB0jyagKhZSmp8KVmySnCs2q 41qLF222g10R8xl4W9mLdq0dE8GceDM1Y37fjAqu0smYTX8WxAUoui1E2ah3BLsamK2+ eFhbXrnumDRBR3MRDFqXluUgaPkwL9vGyghE49hPvYQa6EaQRRrdujil2tM+6X8sBBQp LhIi3dvxxpulNPmWZC6PJdfDVTuRNZl7DyPV1mMAYRaEV8RkOlJ/hHOMbtH9ujx/Jfb6 pUKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q132-v6si4293234pfc.159.2018.09.13.06.43.04; Thu, 13 Sep 2018 06:43:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729765AbeIMSwG (ORCPT + 99 others); Thu, 13 Sep 2018 14:52:06 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60194 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728637AbeIMSwG (ORCPT ); Thu, 13 Sep 2018 14:52:06 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CFFB2D19; Thu, 13 Sep 2018 13:42:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Hemminger , "David S. Miller" Subject: [PATCH 4.14 016/115] hv_netvsc: ignore devices that are not PCI Date: Thu, 13 Sep 2018 15:30:36 +0200 Message-Id: <20180913131824.514116209@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131823.327472833@linuxfoundation.org> References: <20180913131823.327472833@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stephen Hemminger [ Upstream commit b93c1b5ac8643cc08bb74fa8ae21d6c63dfcb23d ] Registering another device with same MAC address (such as TAP, VPN or DPDK KNI) will confuse the VF autobinding logic. Restrict the search to only run if the device is known to be a PCI attached VF. Fixes: e8ff40d4bff1 ("hv_netvsc: improve VF device matching") Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/hyperv/netvsc_drv.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -1895,11 +1896,15 @@ static int netvsc_register_vf(struct net { struct net_device *ndev; struct net_device_context *net_device_ctx; + struct device *pdev = vf_netdev->dev.parent; struct netvsc_device *netvsc_dev; if (vf_netdev->addr_len != ETH_ALEN) return NOTIFY_DONE; + if (!pdev || !dev_is_pci(pdev) || dev_is_pf(pdev)) + return NOTIFY_DONE; + /* * We will use the MAC address to locate the synthetic interface to * associate with the VF interface. If we don't find a matching