Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5720937ybi; Sun, 7 Jul 2019 11:03:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw02K/I1Mbsbs9wY+wXZ0E9GB1Oa3U6mfTWD28d9nM4zIJidfzCuU1N0d3exf87syOC3PGN X-Received: by 2002:a17:90a:206a:: with SMTP id n97mr19892779pjc.10.1562522631109; Sun, 07 Jul 2019 11:03:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562522631; cv=none; d=google.com; s=arc-20160816; b=yFeiEsn4wBGSMlRfLotw8u9M5Xb9ajIumX10yE7cxJlhvIiPiZacY/5hkr1rj7AI27 SmpBkYzU8K0z6C19jNQJjgh9cwrtAWUQ+K+DKEKwONDvO1pj8CNpNdqiA9NVeDQPRHjI Dv4w6t0C+rhtsPMOCV5+jmm27soLcL9Yr/mYVLvtktZs9tFNoCHvPLBO0FVUxjGWVOkI IwXcn/RfFCEKPtUcUZc25EkY428or/IL8ZFcvav0jTrOacIF6F1Aug9CB1H7cQsFOjeN 8vfvFuXLi+/UnTtGQE9k42VNdtCbBPsV9RONxVoM225P7jvg7h/3sjW8cn5h8jBzGufs 6n0Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=tsh1M3+YIkp/+slPl4drTdVgeXhFHnK+iRmBroB6M24=; b=MYErsaaOeL3ExV+FK/t1KnbuM0vQGp2PiKGmenQ0Pi6ssAXa9zErnclKixRwLMAjVs caK6K3HlP5RBZwrAnaLBlktZB1XaIKpua4k0FtI3BeWjOzS+hu26iwhJY+hF3T+nr/5J SERlz/Bgqqk1HHeaZD3752y/aVQDRYCueuDDSw9HzwbeeJk7gsDQXv1NjZY3/nNmoPls NrC7PfXH8/68fZKDGVeRfIkaJ5c0yU/LEPmaKM6uv7soNCWx7EgWx3+m+cw4Tj6LAC5n uORfe0QeucyyLb/aW2nB0irpSGT+oiKJ59jxo3Ezn4M+YSa9ZFwyXb7teS33jhqxPSFX n8Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=JKG9FSVx; 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 m99si15133600pjb.107.2019.07.07.11.03.24; Sun, 07 Jul 2019 11:03:51 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=JKG9FSVx; 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 S1727261AbfGGRq3 (ORCPT + 99 others); Sun, 7 Jul 2019 13:46:29 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45028 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbfGGRq3 (ORCPT ); Sun, 7 Jul 2019 13:46:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tsh1M3+YIkp/+slPl4drTdVgeXhFHnK+iRmBroB6M24=; b=JKG9FSVxwMXPED30sVVWKeoZN 3T3+i/GVWvNpb6NrfWRfYiLy12PElmUZochO7zJlc9zxNE5ZsYdq29SARsHPCSb6Gdbd5+3jHev1M wUSQuBk/pPlNycIMehkFBKaRpwRc7zF8lJjJFfj/3aofrUDKStZnKWB4wEudVxfJu3y8qOjFNqwOg b6P4gbRUMp+DHYo9xbB+1Kh7UEDMZXCiy2OQjrKnp4nEvkORjhUqh6g0oHH0SSCDgswY3vJwmMifU IZe5fBUhG77ddg7ZWfOnET9G85hFI4ShWmRn1M4ToEVXD96TjzLw9a8FN1EGv6btJVn918LjbUQKV 3EPTU6L+A==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hkBF1-0003m8-SC; Sun, 07 Jul 2019 17:46:23 +0000 Subject: Re: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled To: Haiyang Zhang , LKML , linux-pci , Stephen Hemminger Cc: Matthew Wilcox , Jake Oshins , KY Srinivasan , Sasha Levin , Bjorn Helgaas , "linux-hyperv@vger.kernel.org" , Dexuan Cui , Yuehaibing , Stephen Hemminger References: <535f212f-e111-399d-4ad0-82d2ae505e48@infradead.org> From: Randy Dunlap Message-ID: Date: Sun, 7 Jul 2019 10:46:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/3/19 11:06 AM, Haiyang Zhang wrote: > > >> -----Original Message----- >> From: Randy Dunlap >> Sent: Wednesday, July 3, 2019 12:59 PM >> To: LKML ; linux-pci > pci@vger.kernel.org> >> Cc: Matthew Wilcox ; Jake Oshins >> ; KY Srinivasan ; Haiyang >> Zhang ; Stephen Hemminger >> ; Sasha Levin ; Bjorn >> Helgaas ; linux-hyperv@vger.kernel.org; Dexuan >> Cui ; Yuehaibing >> Subject: [PATCH v2] PCI: hv: fix pci-hyperv build when SYSFS not enabled >> >> From: Randy Dunlap >> >> Fix build of drivers/pci/controller/pci-hyperv.o when >> CONFIG_SYSFS is not set/enabled by adding stubs for >> pci_create_slot() and pci_destroy_slot(). >> >> Fixes these build errors: >> >> ERROR: "pci_destroy_slot" [drivers/pci/controller/pci-hyperv.ko] undefined! >> ERROR: "pci_create_slot" [drivers/pci/controller/pci-hyperv.ko] undefined! >> >> Fixes: a15f2c08c708 ("PCI: hv: support reporting serial number as slot >> information") >> >> Signed-off-by: Randy Dunlap >> Cc: Matthew Wilcox >> Cc: Jake Oshins >> Cc: "K. Y. Srinivasan" >> Cc: Haiyang Zhang >> Cc: Stephen Hemminger >> Cc: Sasha Levin >> Cc: Bjorn Helgaas >> Cc: linux-pci@vger.kernel.org >> Cc: linux-hyperv@vger.kernel.org >> Cc: Dexuan Cui >> Cc: Yuehaibing >> --- >> v2: >> - provide non-CONFIG_SYSFS stubs for pci_create_slot() and >> pci_destroy_slot() [suggested by Matthew Wilcox ] >> - use the correct Fixes: tag [Dexuan Cui ] >> >> include/linux/pci.h | 12 ++++++++++-- >> 1 file changed, 10 insertions(+), 2 deletions(-) >> >> --- lnx-52-rc7.orig/include/linux/pci.h >> +++ lnx-52-rc7/include/linux/pci.h >> @@ -25,6 +25,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -947,14 +948,21 @@ int pci_scan_root_bus_bridge(struct pci_ >> struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev >> *dev, >> int busnr); >> void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); >> +#ifdef CONFIG_SYSFS >> +void pci_dev_assign_slot(struct pci_dev *dev); >> struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, >> const char *name, >> struct hotplug_slot *hotplug); >> void pci_destroy_slot(struct pci_slot *slot); >> -#ifdef CONFIG_SYSFS >> -void pci_dev_assign_slot(struct pci_dev *dev); >> #else >> static inline void pci_dev_assign_slot(struct pci_dev *dev) { } >> +static inline struct pci_slot *pci_create_slot(struct pci_bus *parent, >> + int slot_nr, >> + const char *name, >> + struct hotplug_slot *hotplug) { >> + return ERR_PTR(-EINVAL); >> +} >> +static inline void pci_destroy_slot(struct pci_slot *slot) { } >> #endif >> int pci_scan_slot(struct pci_bus *bus, int devfn); >> struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); >> > > The serial number in slot info is used to match VF NIC with Synthetic NIC. > Without selecting SYSFS, the SRIOV feature will fail on VM on Hyper-V and > Azure. The first version of this patch should be used. > > @Stephen Hemminger how do you think? > > Thanks, > - Haiyang Hi Stephen, Please comment on this patch or v1. v1: https://lore.kernel.org/lkml/69c25bc3-da00-2758-92ee-13c82b51fc45@infradead.org/ thanks. -- ~Randy