Received: by 10.213.65.68 with SMTP id h4csp204422imn; Mon, 12 Mar 2018 11:10:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELsvqjJvbv7ZmunZjoy1E81euy1YjneVMRKTFviCPkB6RN9qrsqO7lxSLMt4p7IBM1gM7Eiv X-Received: by 2002:a17:902:f81:: with SMTP id 1-v6mr9011729plz.265.1520878246058; Mon, 12 Mar 2018 11:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520878246; cv=none; d=google.com; s=arc-20160816; b=Hla0OdQ3nPQnMOs9La4gCfZzimHc5ZtWH14mqv6SSviojnKeaj7HfAu+LOxa2H2KWn YhnJ8Nu+c1JLYnFaKa6Oz2lT8bvIX3k+d4LLcP4i0IkIQwOCXfH1Gkw9a+HlmICj4FB7 Va3EfogwDQiuk8Uow3ns0n2HDAavU87Rz/NQq4vvcXs+GdHqLFlPO9xnni7uR1E0SwCS e0Z1RhI9eE7NgzyG/6ixhI4Y2RJqcY2i49P26hXrJoNy8K5IabEEFd7jrn3WKyxnWaBs NmlG4+srhn4x5TmlACNcqP0YIUQsVouwbXbxQDVDTp9ARhAaX09MbmSZDQmIL3GrJo04 1/OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=16f+aolTLwDNbTYl+pMS0zXXbJoYIO9oKuJscsvZbbI=; b=dPp9uHaiRk4XRFzydflP5yl3WmX42ZfnRleS/fMj2cbTlQtYPagKZXmOjI5wreTS9W 1zlgjDZhtTjImSM/Isjtauf0J2zBGyKTOkCy/gCBcD4CGPc7s6KO9l6SsRZSht8JXxx/ 78hZbkk9PZOW8UpAH1TIZf1/dtQ/jrOhYJ33RPSSR0G5vQldEOq1+jQXxMCvSixOl7/i 6NcTNDK7yQs2AVQLVbsmwrgVQBLtSUy1o+9piaKxVbrIaC2m5HFkX6MS6qUOb2RJLndQ fgfaKbn44rEyPNc5p+jnnQWzkXB/CUmU8wqSY9TECZpHWkwsWdXNtof0D4bDnSC/s+kq jtZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RPqOr9/S; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5-v6si3261315ply.427.2018.03.12.11.10.31; Mon, 12 Mar 2018 11:10:46 -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=pass header.i=@gmail.com header.s=20161025 header.b=RPqOr9/S; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932751AbeCLSJi (ORCPT + 99 others); Mon, 12 Mar 2018 14:09:38 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33750 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932560AbeCLSJg (ORCPT ); Mon, 12 Mar 2018 14:09:36 -0400 Received: by mail-qk0-f193.google.com with SMTP id f25so12489293qkm.0; Mon, 12 Mar 2018 11:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=16f+aolTLwDNbTYl+pMS0zXXbJoYIO9oKuJscsvZbbI=; b=RPqOr9/SPBuuphxMTDwN6aN1kUeaemDdJFVqkbxZKbRxAH7bo9dcklkFB9iLmlkJsi wSZ1cXKj8QZ/uzinBtSq7Bcm2xKuSuUhk5QtJypcV9RPgYLChenBdXnRx2PZfXvui7Cy q475lWIoax7s/E26a7GhZ0QhDoCwWFe5dsWY3CofR5ByTpAZLDNE8JdBjpEemIEQHX3A g+J7uZ6Rfah61LCfbu3kN4M6AHEZLfN5ti9aFd+EIG6ro7HL+Br9ra3+c4xpDS+p94mw l3BuLi82svf5Ci++N00w/EIOV2q5mJPLBQtkm0J/V82tJcSJIHX4A4OPAWmooTTmSnIo JA9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=16f+aolTLwDNbTYl+pMS0zXXbJoYIO9oKuJscsvZbbI=; b=L9wHNE374dX62X6rtfzCO0imGPN+ayI5sxKMknhZF6ahDAwWa0/Pxt4KTmguXkOAhv 0Cle2y/n7D7gE2AuYdoJNK9zWV+V70iLOOYsg5QH4/keGu+T52GNNxAk+YOmcGJjKSom vgTj0gZ7TnweMcoSxDdw4jBmGvaLLEJLMYxyJAMSaG7qphcXMbEjWHyMkNPO5SgcdfQF 5VE0yUQCn/vEkPs21jaF0IBHwPcHLhZciWGe/JFV7yyf9ljM4+MVJwcxVaNEIpa+2eXj prITjl/WJbCUOHmP5IBv8pcCHJLV/lmiZVMIgsMxskOdeKVsRFqx0q3JGa1lIpuWYcWd oqwQ== X-Gm-Message-State: AElRT7FIMlrkA5N3g0WfI2zdHX5L/HEn5Zkcq8HUsHaIghbIyOU1RcyI TCy31JAXnaXrlyMPGtSCBnAhcd1X3ou6bodyl4o= X-Received: by 10.55.246.26 with SMTP id y26mr1525104qkj.127.1520878175413; Mon, 12 Mar 2018 11:09:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.89.138 with HTTP; Mon, 12 Mar 2018 11:09:34 -0700 (PDT) In-Reply-To: <20180312174012.GE18494@localhost.localdomain> References: <20180312171813.3487.94803.stgit@localhost.localdomain> <20180312172031.3487.20651.stgit@localhost.localdomain> <20180312174012.GE18494@localhost.localdomain> From: Alexander Duyck Date: Mon, 12 Mar 2018 11:09:34 -0700 Message-ID: Subject: Re: [pci PATCH v5 1/4] pci: Add pci_sriov_configure_simple for PFs that don't manage VF resources To: Keith Busch Cc: Bjorn Helgaas , "Duyck, Alexander H" , linux-pci@vger.kernel.org, virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, Netdev , "Daly, Dan" , LKML , linux-nvme@lists.infradead.org, netanel@amazon.com, Maximilian Heyne , "Wang, Liang-min" , "Rustad, Mark D" , David Woodhouse , Christoph Hellwig , dwmw@amazon.co.uk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 12, 2018 at 10:40 AM, Keith Busch wrote: > On Mon, Mar 12, 2018 at 10:21:29AM -0700, Alexander Duyck wrote: >> diff --git a/include/linux/pci.h b/include/linux/pci.h >> index 024a1beda008..9cab9d0d51dc 100644 >> --- a/include/linux/pci.h >> +++ b/include/linux/pci.h >> @@ -1953,6 +1953,7 @@ static inline void pci_mmcfg_late_init(void) { } >> int pci_vfs_assigned(struct pci_dev *dev); >> int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); >> int pci_sriov_get_totalvfs(struct pci_dev *dev); >> +int pci_sriov_configure_simple(struct pci_dev *dev, int nr_virtfn); >> resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno); >> void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool probe); >> #else > > I recommend stubbing 'pci_sriov_configure_simple' or defining it to > NULL in the '#else' section here so you don't need to repeat the "#ifdef > CONFIG_PCI_IOV" in each driver wishing to use this function. Otherwise > looks fine to me. My concern with defining it as NULL is that somebody may end up calling it in the future directly and that may end up causing issues. One thought I have been debating is moving it to a different file. I am just not sure where the best place to put something like this would be. I could move this function to drivers/pci/pci.c if everyone is okay with it and then I could just strip the contents out by wrapping them in a #ifdef instead.