Received: by 10.213.65.68 with SMTP id h4csp130702imn; Thu, 15 Mar 2018 11:45:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELvC5MXcC0mQv6WREh3WBjdDmh+yj7sfQ/h+yv/l9pwvrPHaYQjwNM9dOnN2wfd3NXXHT0Dw X-Received: by 2002:a17:902:9a91:: with SMTP id w17-v6mr1026124plp.240.1521139546175; Thu, 15 Mar 2018 11:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521139546; cv=none; d=google.com; s=arc-20160816; b=LXAJQh32W2jdi3PH32eJrNPhU+RoZGz13wpQujbYc6OXtGLLLOJOPhLrDS/adUgcmq +XQjWGJtaqawYh9LB0Wvibq2MNUp8lMvPZX9Q1EcmcphW75KXqoNcLni4w6uDM9Gdl05 89NJPV0AxFdYeOqL+s2nJvAIfSEXgprefvNP4zzY0bNcIG0DFaVpgATCI51+lzfFqyEh SAt4O7xTgj+FTnhxH1A6qCjrk0t74A6Il94z58yd7Gcj/P8//9Zu4vrAbCWPYL6be3rS OScKLkoevFapscImjNU6vvoy8t7NXuQflsuxfsr1YURSgy2lymO24evCvTITeuCSzU2o HW7Q== 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:dkim-signature:arc-authentication-results; bh=TEK7dPkTHqB0InxJgaJl6IL0oelo9Pewrxa6mpabK9c=; b=Kp3RTsx6umck+K+orOqc/M8w07YCxw5Pszcu3oLuBJnnMsQxFdLHeYEoPZI0mIZfgB MaOO0tEaQfHjfGMC79QCUq6ZtPgw8ShVVhz1w4DSw+0k1jOzAO1CdfcIE5hKpic1NX93 9n0CllM10f72GC7gPbb0RMb/2CLJy2DWR6lu1bVykbeSfrKyDYzlClZHvnfGkkQcr5/S GVHpfMBTUbneNx6yCzFxofcRpRqkcFdwbJPaW6t8BIRcui+jlM/UGyNwOlABn6vrcI4L 0ms1a2Q5LL/ibMtMXU05rqT5OKyGGxz6aNOsNEU3hocSqbcRqhFF7I2RYOspfKgIvoXs lGlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NK3Mx1B5; 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 e23si4151003pfn.228.2018.03.15.11.45.31; Thu, 15 Mar 2018 11:45: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=NK3Mx1B5; 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 S1752855AbeCOSn1 (ORCPT + 99 others); Thu, 15 Mar 2018 14:43:27 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:42449 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbeCOSnX (ORCPT ); Thu, 15 Mar 2018 14:43:23 -0400 Received: by mail-pl0-f68.google.com with SMTP id w15-v6so4310538plq.9; Thu, 15 Mar 2018 11:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=TEK7dPkTHqB0InxJgaJl6IL0oelo9Pewrxa6mpabK9c=; b=NK3Mx1B50X++EEeY91jd0gMSGtqtkE6Loes6ICvP81GW+VUT4ZVBMfLZfez1kZ0YCI Gvjvdqlu7cSEpJkzv29THHsdVL8tOaA4kBmYsiyQKzrFV3c37hYO5wDkjJBVTseu1OYS 3cZDGxXvs81wLntKbN+QHFhHNuPfKaDXhJITbQi7WJ1QfRpnyi7VrNWr2A2XkeFZDV4o nhxoqyGL1u2tcjmnlqrQ48pm9gCdXlvtjnpuDHG086seHpSzpOIuA6laj5LYGvWEgx2s Yt8p3m+gV/4b1J6oc0pRbUcZ8VIt0uOgj3uGyX+nTp0eA76XUbZmKGMylV6NvukBtmfP Y5gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=TEK7dPkTHqB0InxJgaJl6IL0oelo9Pewrxa6mpabK9c=; b=gmuoGD6FK8JS8STa696e9AbwPHKXyatwHql48FI273CVooyY1AsmmJ3dfmNPXleYKB R90e62DsFLUJ39gLfe+vW33JdEtluK6r1Gtw9rdDZ0Lwm6iZngh1HdZVpRhWG2SmWyDT LzBwch+DuMYcVIgjYvVs6CeTbz4etUNfuiruu7cqpytVcPJyLpyB9LCzjf4OaqZIYxwK WtSc5flx2DAEm1zITHIpRCs/nUqKz31f/9TjckozUYBFbS5UXM10RKV/dxtj3hAVa3LX 9O/uO9VDf5C0X3gxq1yJpOeqq3UwGOZZj9INbEXKqn8wddCnuoqqnPgwxUd/0Fjw8yRz LYIA== X-Gm-Message-State: AElRT7F1fTFSp6uN2bqyxk2BuMhA1MS7XZsXerTYIeC/hT2CKLb202Wq +B+UALbiqwCKpMfXbtQ+mUo= X-Received: by 2002:a17:902:858c:: with SMTP id e12-v6mr9314736plo.39.1521139403045; Thu, 15 Mar 2018 11:43:23 -0700 (PDT) Received: from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0]) by smtp.gmail.com with ESMTPSA id c15sm11616649pfm.114.2018.03.15.11.43.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 11:43:22 -0700 (PDT) Subject: [pci PATCH v7 3/5] 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: Thu, 15 Mar 2018 11:43:21 -0700 Message-ID: <20180315184248.3102.16810.stgit@localhost.localdomain> In-Reply-To: <20180315183449.3102.64791.stgit@localhost.localdomain> References: <20180315183449.3102.64791.stgit@localhost.localdomain> 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 From: Alexander Duyck 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 6975150d144e..6054deb1e6aa 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -3385,32 +3385,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 @@ -3525,7 +3499,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)