Received: by 10.192.165.148 with SMTP id m20csp753860imm; Fri, 20 Apr 2018 15:14:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx495Tvx+/9pMwXxd8oWEGq38Cop2MI3/+VMGoa+Q2VF5YBr1tRz4fyNaOjCiLRPy+NC7m+b2 X-Received: by 2002:a17:902:31a4:: with SMTP id x33-v6mr11735577plb.355.1524262497917; Fri, 20 Apr 2018 15:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524262497; cv=none; d=google.com; s=arc-20160816; b=SWyPCse7fEknKU8xFUGo4VIh+xtevFAzW2xbFjRWn7/kDVWZCyNwder3+dR9UMnjO3 pkBEIirXwmku8/VlZGGylg27eW2rVC4FSN672bGK7iVKzE3+NJG4/+Dkkv4lE1pqmJNN JiDkP4uC+pw5rWP3j66VPGTy9E6jaFrocwIO0hEysueWn8pxbu3OmksCxIpoNLLOqEK0 WBawXzdTAm8VoOlFwnwMbJm17fk39BfDtLP5m6zqg7nYqgjcsy1jeNyPeB2QO+U7iWKr jnz5N/ICILm95EPfbgY/3YPZCiuEN1sswKURz5a9zG9gRKGI78MHUHS4+pBxTTyzkm2U sdGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=FuqWkBiR2iD7+XRjT+NWe2h3p4JtH6Hh2IsheU+DkgQ=; b=FXJmE1laz0mwraoaAhaQetYaiSBHMjkLENyiEm8KhsvnEb/xHUbFLbfQIBBG262+fJ ilvG744ZuIFw0+Zd0uQYBKTVgrBaP2Kucb+e3jcdi+cyfxO03xEddIczQGdXROAabO+u AsQk5KyfzyzFxHZtVzDQDqA80P+ckwQDbxEdG095MVcf2KWrT4drnXUlmZjC4qfPB7ku fo0lw0/HTemVF//m6sfRgpCUeH9oKORJn5HsQdcheUraYZehJPfNsNoCKTFSLO4QJ7mu JXtDTqeuSl/v3hztOFIYm7QR6JlHAxPGXqReGWjmW6gfboT5s50EK6znnSHw3AYpd+mL WWiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VG+/009k; 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 i1si5337679pgv.591.2018.04.20.15.14.20; Fri, 20 Apr 2018 15:14:57 -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=VG+/009k; 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 S1752658AbeDTWKU (ORCPT + 99 others); Fri, 20 Apr 2018 18:10:20 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:43305 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096AbeDTWKR (ORCPT ); Fri, 20 Apr 2018 18:10:17 -0400 Received: by mail-pl0-f65.google.com with SMTP id a39-v6so5942222pla.10; Fri, 20 Apr 2018 15:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=FuqWkBiR2iD7+XRjT+NWe2h3p4JtH6Hh2IsheU+DkgQ=; b=VG+/009ktQnzmn7JUbPxpT3UQTKZG9ktus0uGNcw+0v4NT3w3bg9/2jfhjtYDrwAd7 QakR0YVMHCJASUyMmpXWS4bVqe0T7Ifz9oroaL6ueFhOuvBwfei43DEq9hvbRSqL/fSq dE4pqKkdaKkvvuu5oEB3s0c7eY0lLx38+pccCuSqW8pOnaZljXvYX2sEyotlm+obGAtg QB26KNPBmEswG6h0wTlEJXH1+EsAfPXd4tb0P7RzXlffjc3IXpku9qZkbjuAifBx8VAN mjrK69QAyepz9dFVUPwWlMiPf6WeJZIigm1mI7Uripf2YmJTVE9k2zLfzJOVyMRgGIjd 1bqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=FuqWkBiR2iD7+XRjT+NWe2h3p4JtH6Hh2IsheU+DkgQ=; b=RaSm5VCRlEKAyIgkQuxJjkMBoP20skz6+/TGg95wbm899a66gNBAT2v9XeFMw6Lrj8 tlcvtupnhhe95hiQf/r+ot3XzK0TrRlmd/4BUfZR9pIN5to+RFUesjSsslKxoK8t/fyv JN68E8DdwJANiRDsEcDDygCwkq+WKMgwYetKSFvTfNCSEWtxfgYCJguwpP6JT8Fn9AnI sCWRhbRqnuRi/8W3oEXM93gpZ+dxiwVSv/+5jsaw2sZaMplN9owvijuqx1I9bjQExEWp Jm3m/0fJaZsh/bmbW7XR5Op39Md/SPw4tNZd8O17NHwS6H7hmZB/KwQI3wHL0LBDcLFK FEqg== X-Gm-Message-State: ALQs6tAJfF3/X1rWGMkLJGBOgXd4u/jBsyXzJ/oCXdV04VkWoFmxmbXT nE+TZYmBZ6yVxKJljs4tHWY= X-Received: by 2002:a17:902:1665:: with SMTP id g92-v6mr11818660plg.195.1524262217164; Fri, 20 Apr 2018 15:10:17 -0700 (PDT) Received: from [192.168.0.16] (67-5-146-204.ptld.qwest.net. [67.5.146.204]) by smtp.gmail.com with ESMTPSA id a3sm10487634pgc.2.2018.04.20.15.10.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Apr 2018 15:10:16 -0700 (PDT) Subject: Re: [pci PATCH v8 2/4] ena: Migrate over to unmanaged SR-IOV support To: Alexander Duyck , bhelgaas@google.com, linux-pci@vger.kernel.org Cc: virtio-dev@lists.oasis-open.org, kvm@vger.kernel.org, netdev@vger.kernel.org, dan.daly@intel.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, keith.busch@intel.com, netanel@amazon.com, ddutile@redhat.com, mheyne@amazon.de, liang-min.wang@intel.com, mark.d.rustad@intel.com, dwmw2@infradead.org, hch@lst.de, dwmw@amazon.co.uk References: <20180420162633.46077.49012.stgit@ahduyck-green-test.jf.intel.com> <20180420162841.46077.17967.stgit@ahduyck-green-test.jf.intel.com> From: Gregory Rose Message-ID: <411245b6-fb34-0494-aa5d-1ed5bc69a18c@gmail.com> Date: Fri, 20 Apr 2018 15:10:15 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180420162841.46077.17967.stgit@ahduyck-green-test.jf.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/20/2018 9:30 AM, Alexander Duyck wrote: > Instead of implementing our own version of a SR-IOV configuration stub in > the ena driver we can just reuse the existing > pci_sriov_configure_simple function. > > Signed-off-by: Alexander Duyck > --- > > v5: Replaced call to pci_sriov_configure_unmanaged with > pci_sriov_configure_simple > v6: Dropped "#ifdef" checks for IOV wrapping sriov_configure definition > v7: No change > > drivers/net/ethernet/amazon/ena/ena_netdev.c | 28 +------------------------- > 1 file changed, 1 insertion(+), 27 deletions(-) > > diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c > index a822e70..f2af87d 100644 > --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c > +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c > @@ -3386,32 +3386,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) > } > > /*****************************************************************************/ > -static int ena_sriov_configure(struct pci_dev *dev, int numvfs) > -{ > - int rc; > - > - if (numvfs > 0) { > - rc = pci_enable_sriov(dev, numvfs); > - if (rc != 0) { > - dev_err(&dev->dev, > - "pci_enable_sriov failed to enable: %d vfs with the error: %d\n", > - numvfs, rc); > - return rc; > - } > - > - return numvfs; > - } > - > - if (numvfs == 0) { > - pci_disable_sriov(dev); > - return 0; > - } > - > - return -EINVAL; > -} > - > -/*****************************************************************************/ > -/*****************************************************************************/ > > /* ena_remove - Device Removal Routine > * @pdev: PCI device information struct > @@ -3526,7 +3500,7 @@ static int ena_resume(struct pci_dev *pdev) > .suspend = ena_suspend, > .resume = ena_resume, > #endif > - .sriov_configure = ena_sriov_configure, > + .sriov_configure = pci_sriov_configure_simple, > }; > > static int __init ena_init(void) > Reviewed-by: Greg Rose