Received: by 10.192.165.148 with SMTP id m20csp470198imm; Fri, 20 Apr 2018 09:38:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/+8jGA6u+PztcpJI3a43DvUk/r6sZDMOqBe4EkAdLFkxcABwDrtFaHaB3+qz1BOngye/qx X-Received: by 10.101.74.201 with SMTP id c9mr5924960pgu.26.1524242331665; Fri, 20 Apr 2018 09:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524242331; cv=none; d=google.com; s=arc-20160816; b=E/sOWi4kUt02Uoh9EKy16CRYMxHNfzcFOBuF2EdYJzlJz1J/vFpAq4tTZQru1gvZFE FJOurxc0Lc4KGBcMnYIW1r5iDlPHmnAsLHYIXn4sbJtHGRaj+Q8WO+wqKDcMhCZgDxnp 0jkoyfQPWnkkr3M55j1krxYzLdGn10adB0y7UJ57W3UhcARIOssP94/lP9G1tkpEAhwr JDi0PAGmoNARJY1SWJwSiJzNJqQWu9pXdO49QeNK4NgsPxJDZ01RvCBsUdB6On4yAp69 rZIxJBMb9mvF/hTYMFDIIO75owsHaFvsk7JnoxFzkjwMCirwCkfs5eWdvjNyhSn1giIP 1BRw== 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:cc:to:from :subject:arc-authentication-results; bh=pBqTvqPWXFsDJfnxRW5ywjETNg0l1lOzuCn7ktB1nfg=; b=ocHCLWQ0Z+YRR2ceepMN4PdjCyWRf0QmQ9FehexRCvkjrZtyBs9VjMq9/XDq8fep0W X0pUMsLNOA/RGVQU4KmpmFSFLg8P/RcEpa+J6ALvRP6EYV4OzaYyQLI8UfI4ydpd6rDp m5ksBFZk3OYL7a1ecdHrc9tsi33kNAMV+bi7/66c55Uhi795qlRR1YikKPMHqkDNME+4 JTf6qQl8avOR+1iEUHq7ROxmEEMe/Wd8NZf3i7byxxFyOndIoPZTfL9KYmsjFlYXf8qc 9lO4CG2inRFzuwI1spk0EyC2pJ75PZLIKAVvnNBcWOMnHqXtwVDTCCWurJ29Cl5hXl33 MFbA== 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 133si5012474pgc.341.2018.04.20.09.38.36; Fri, 20 Apr 2018 09:38: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; 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 S1752633AbeDTQhP (ORCPT + 99 others); Fri, 20 Apr 2018 12:37:15 -0400 Received: from mga04.intel.com ([192.55.52.120]:5909 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbeDTQhO (ORCPT ); Fri, 20 Apr 2018 12:37:14 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2018 09:37:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,302,1520924400"; d="scan'208";a="222069698" Received: from ahduyck-green-test.jf.intel.com ([10.166.244.179]) by fmsmga006.fm.intel.com with ESMTP; 20 Apr 2018 09:37:12 -0700 Subject: [pci PATCH v8 2/4] ena: Migrate over to unmanaged SR-IOV support From: Alexander Duyck To: bhelgaas@google.com, alexander.h.duyck@intel.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 Date: Fri, 20 Apr 2018 12:30:21 -0400 Message-ID: <20180420162841.46077.17967.stgit@ahduyck-green-test.jf.intel.com> In-Reply-To: <20180420162633.46077.49012.stgit@ahduyck-green-test.jf.intel.com> References: <20180420162633.46077.49012.stgit@ahduyck-green-test.jf.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)