From patchwork Thu Jun 28 18:30:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 10494761 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 433E060230 for ; Thu, 28 Jun 2018 18:31:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AD2A2A782 for ; Thu, 28 Jun 2018 18:31:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E8E72A78F; Thu, 28 Jun 2018 18:31:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1D232A782 for ; Thu, 28 Jun 2018 18:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967929AbeF1Sa0 (ORCPT ); Thu, 28 Jun 2018 14:30:26 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:51265 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967928AbeF1SaW (ORCPT ); Thu, 28 Jun 2018 14:30:22 -0400 Received: by mail-wm0-f67.google.com with SMTP id w137-v6so10796849wmw.1 for ; Thu, 28 Jun 2018 11:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GFR5cLD07vaQghXMShi+oZcEYsGqd1cq9esho7HStrw=; b=sDnI5itoRFu/yV4C49tOrueNHPzBY0v7MjYQAUEjGWIybnBEjza1DoozsEwTPicMR4 vnIyyyXbALwqNAGKisHbRrF5w4I2mcgqGcQ4EZoZKS+sty0a+JVjyAG4yHFXTiJGlMow ahkxgWctO3Was683IZjZaTRRTYJtVDxPlz3o4MD9ORXQopeupPhWv8FplFGRd6uimQKK 1FDm6oSFFJuyVHzt9fYw/BwkHmx0tZl76S1XfuZB/NZ9d3amzy6jvZsTh0fiyxkociC1 3nYnoQL19f5+k3sGfeLQkd/fFxS7ndeCdvHTV53p2qXMxD/VJSWv8shwP7As26EEYZUM bGCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GFR5cLD07vaQghXMShi+oZcEYsGqd1cq9esho7HStrw=; b=BPf910ly/j0BVkh71QXZ65oWtUYDnbDXiiOCQ4ZXU7k37jeMYZtMRSoPFOlIJEwgqG GZW9rO2wNVSc+x3vsmfhK4zxUPo6W0C0RC7h0WITgPgESRVn9+Ivq0iQYqJ2+P065hy1 /bXNQ/suiWWjTO1hTtHoyHlFHxQZVMSOadzH/NDQCgC05U3MmUEASVdtE1nqaqcSfoFC i+sJUh3FTg9bOhL1Y8dgUknwDYxB3YXvOtVUkBpqllHXyulZsPB/s7IBVidHckjLOkoP cqi/jZNz8VEoOhcXV2UDyqnOkORKvUJd0bhTbbP3WdlSeiW+Tb1JVu5LvtXFACQTAA0X qafw== X-Gm-Message-State: APt69E3UMlymMzVPI9x6reo4zv5sXWVTOxAqHKbZtQifmWujDbrmastw 62WqQ5Rrp7vmAuA5KWsCZmqJJg== X-Google-Smtp-Source: AAOMgpf3kYnKjAksShnUWGV7oUn5fXUJRfTgbFfARRVjdcUlcTDcUuxRI+/y6CJKTphzn4ZNZndpPA== X-Received: by 2002:a1c:1e86:: with SMTP id e128-v6mr9312824wme.85.1530210621049; Thu, 28 Jun 2018 11:30:21 -0700 (PDT) Received: from jkicinski-Precision-T1700.netronome.com ([75.53.12.129]) by smtp.gmail.com with ESMTPSA id n10-v6sm8752655wrs.64.2018.06.28.11.30.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 11:30:20 -0700 (PDT) From: Jakub Kicinski To: Bjorn Helgaas Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, Christoph Hellwig , oss-drivers@netronome.com, Don Dutile , Jakub Kicinski Subject: [PATCH] nfp: align setting totalvfs to changes in PCI core Date: Thu, 28 Jun 2018 11:30:09 -0700 Message-Id: <20180628183009.24837-1-jakub.kicinski@netronome.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628180705.GB120578@bhelgaas-glaptop.roam.corp.google.com> References: <20180628180705.GB120578@bhelgaas-glaptop.roam.corp.google.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit 8d85a7a4f2c9 ("PCI/IOV: Allow PF drivers to limit total_VFs to 0") the meaning of pci_sriov_set_totalvfs(pdev, 0) changed from 'no limit set/can use total_VFs' to 'limit set to 0/can't use any VFs'. The driver was resetting the limit in case different FW or driver has set it to an incorrect value. Now the PCI core will take care of resetting so we don't have to do that. Fixes: 8d85a7a4f2c9 ("PCI/IOV: Allow PF drivers to limit total_VFs to 0") Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/netronome/nfp/nfp_main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c index 46b76d5a726c..152283d7e59c 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c @@ -240,7 +240,6 @@ static int nfp_pcie_sriov_read_nfd_limit(struct nfp_pf *pf) return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs); pf->limit_vfs = ~0; - pci_sriov_set_totalvfs(pf->pdev, 0); /* 0 is unset */ /* Allow any setting for backwards compatibility if symbol not found */ if (err == -ENOENT) return 0; @@ -668,7 +667,7 @@ static int nfp_pci_probe(struct pci_dev *pdev, err = nfp_net_pci_probe(pf); if (err) - goto err_sriov_unlimit; + goto err_fw_unload; err = nfp_hwmon_register(pf); if (err) { @@ -680,8 +679,6 @@ static int nfp_pci_probe(struct pci_dev *pdev, err_net_remove: nfp_net_pci_remove(pf); -err_sriov_unlimit: - pci_sriov_set_totalvfs(pf->pdev, 0); err_fw_unload: kfree(pf->rtbl); nfp_mip_close(pf->mip); @@ -715,7 +712,6 @@ static void nfp_pci_remove(struct pci_dev *pdev) nfp_hwmon_unregister(pf); nfp_pcie_sriov_disable(pdev); - pci_sriov_set_totalvfs(pf->pdev, 0); nfp_net_pci_remove(pf);