Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp727585imm; Thu, 13 Sep 2018 06:55:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYB3TtG2WE9wcFDpCHMUjgKaKUCx/GxRNuX8+v/o8zbOuIP/I3kzegYuhAa6wz1Ynb2Itrq X-Received: by 2002:a17:902:25ab:: with SMTP id y40-v6mr7311979pla.120.1536846918688; Thu, 13 Sep 2018 06:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536846918; cv=none; d=google.com; s=arc-20160816; b=CwsdPx1cqL0BVRR1E/xbAeO8x88jQVruPmdspU6k2lYrG6B080hYjR4BOSSA0Ckv4Q oVYyQF3vsL3t8THywfULfLpE9tkmKLi0DT+X1c5feW11KpopOuBkrZ0sOMCxwTA2ldFs 9urTBlhcQGJbsw1BJ/aB8fLPEFwEUx4MUvLOhXbdTnLlJm4b1T5LXtIeuxxbHkXYIN2u 9qUvRXHcyglUTmviWgz1Hucu7dBYy9L7hGtTtFCITQs26mY52X0gGvdLMR4xJnrnQIIF CvwD+dGIG5Ajkc1V1PNZilJz1sImpIPN7Z6Q22YCxfHzbslMFlu8qpbxYPFLn5+2703Q fQkw== 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=idvSgU+05yQE7CGowHKg1++mJtoLRBiVlZQyzHMHs54=; b=KKoXHBAsVusMgWWX0U3iUf0uNUGPx4B90cVqz9LTO7Hmg30GfWkEvs7mrI2wrS2ki0 7wfDCL0NF44XYktEVQg8VH7cYVmpPljYfNKkoxys/Qli7pLsgIu0QVcLXDOFGOk1uGw1 fAiWJbiuthrz8iqwzSGtK+IWTZ8uGaeXmdyhzNSQw0M45IuKQoWjY93uUseNS5LrWuWb xk/Mg6Zm68D9z570+Bu1Dw8i9WbEbNE5RfnfYrwlS5FA7zeRBTr8MpUGFcjltIJxwoOl YrbUj8QN8ssgT4/Ld7oKROQJ26/3PqvCMQPiu8xhUHgYvoHxB/vUhJ/49WQGKrUtMH9s BlRw== 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 o20-v6si4159077pgd.58.2018.09.13.06.55.02; Thu, 13 Sep 2018 06:55:18 -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 S1730928AbeIMTDO (ORCPT + 99 others); Thu, 13 Sep 2018 15:03:14 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33700 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728810AbeIMTDO (ORCPT ); Thu, 13 Sep 2018 15:03:14 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 51257CE7; Thu, 13 Sep 2018 13:53:38 +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.18 036/197] hv_netvsc: ignore devices that are not PCI Date: Thu, 13 Sep 2018 15:29:45 +0200 Message-Id: <20180913131842.997840806@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@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.18-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 @@ -1939,12 +1940,16 @@ 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; int ret; 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