From patchwork Tue Dec 2 21:26:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 5424611 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 22F919F30B for ; Tue, 2 Dec 2014 21:26:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 224992021B for ; Tue, 2 Dec 2014 21:26:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60B9C202F2 for ; Tue, 2 Dec 2014 21:26:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933240AbaLBV0Y (ORCPT ); Tue, 2 Dec 2014 16:26:24 -0500 Received: from mail-ie0-f180.google.com ([209.85.223.180]:38687 "EHLO mail-ie0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932800AbaLBV0W (ORCPT ); Tue, 2 Dec 2014 16:26:22 -0500 Received: by mail-ie0-f180.google.com with SMTP id rp18so12047124iec.25 for ; Tue, 02 Dec 2014 13:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=7Cw50ZbM84eeH8H+zzAgPZzpetiwvCX+xva0qp6PCZU=; b=D2rPJ/SkI2+5veGQkUThKPG/zFZVCil1YbtMrOlTK+OIrXemigmk9Fg0iUKE5B7p3l RC99riIseJPudAtjGUPf/4ifSwuoAnwkqPKGH9sG+DqXvVoxDrGMvQ96BCLi0oSgqvGQ 8d2oHnekh6vjGOzN5XkAZOvyZcfG4SUXyJJA/LdkZ78rhsayuLbwSpi6KWmpc3Ae3EDU UuhW4M7RboaHWQPHL2aIE+bkWj5mq8tOqBU74nE41nijmWz1jH+/6+LUbEoogvRyVr2h Gsq5llRBzxKo1yjcwpKoPmi9EEBqJKrP4eHzycbriaz+bjr76nrYzS3YmbZp+71L/XA8 FKTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=7Cw50ZbM84eeH8H+zzAgPZzpetiwvCX+xva0qp6PCZU=; b=JVIeov7ZkoCkQ6cC2C1P5EZm6rh3BWsX7Vm0FXN/JI6d/lAlktU9cLe5MU6aeDPCG5 FvXXynNEngrSwv1QgdijH0ndq19pZ74VAk53PoIBweYSUKv6dvEam1XXzWE+xusi7bJS 4iWFDzIgsV+qSKewmAUZKJpOPy/4cUsF8sVW0YdKHTDqNYvTQ9rL/PdWSDYp0vlhRR0Q LFBIgj+wU9PJg8XNDqGFZTcRBcd8f5BiyaRdabJIPwXQrJnmQGr/90PXFnfNfcY70jum 0hVlQ7xzecoxoAjJsKkIrBka85YPIuE555t7D8OKHsa11hiChctczcx4IybeTx0/ruZi 6V1g== X-Gm-Message-State: ALoCoQnWkaZ48Kr1kyFlV8xjKCdP6ShEeR2haQhYgOdMweluRCHZ6QH+10/xDXLBzqI1bpjctRk8 X-Received: by 10.50.3.67 with SMTP id a3mr53264883iga.42.1417555581322; Tue, 02 Dec 2014 13:26:21 -0800 (PST) Received: from google.com (173-8-252-97-Colorado.hfc.comcastbusiness.net. [173.8.252.97]) by mx.google.com with ESMTPSA id n2sm1536459igp.16.2014.12.02.13.26.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Dec 2014 13:26:20 -0800 (PST) Date: Tue, 2 Dec 2014 14:26:16 -0700 From: Bjorn Helgaas To: "Zytaruk, Kelly" Cc: Yu Zhao , "linux-pci@vger.kernel.org" , Alex Williamson Subject: Re: Architectural question regarding IOV support in Linux 3.13.4 Message-ID: <20141202212616.GA20069@google.com> References: <1393020186.9111.91.camel@ul30vt.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FSL_HELO_FAKE, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Dec 02, 2014 at 09:11:26PM +0000, Zytaruk, Kelly wrote: > > -----Original Message----- > > From: linux-pci-owner@vger.kernel.org [mailto:linux-pci- > > owner@vger.kernel.org] On Behalf Of Bjorn Helgaas > > Sent: Tuesday, December 02, 2014 4:02 PM > > To: Zytaruk, Kelly > > Cc: Yu Zhao; linux-pci@vger.kernel.org; Alex Williamson > > Subject: Re: Architectural question regarding IOV support in Linux 3.13.4 > > > > On Tue, Dec 2, 2014 at 9:42 AM, Zytaruk, Kelly > > wrote: > > > > > > > > >> -----Original Message----- > > >> From: Bjorn Helgaas [mailto:bhelgaas@google.com] ... > > >> Can you try out Yu's patch and see what happens? If you do turn on > > >> SR-IOV on this device, it would be interesting to see the complete dmesg log > > and "lspci -vv" > > >> output to see what we do with it. > > > > > > Bjorn, > > > I am resurrecting this thread as I have been looking through the 3.18 source > > code and don't see any support for PCI_EXP_TYPE_LEG_END for SRIOV. For > > devices that must remain defined as Legacy endpoints we still need to be able to > > enable SRIOV. > > > > Looking back, I see that Yu Zhao did attach a patch earlier in the thread. Are you > > asking me to apply that one? I don't remember why I dropped it from my queue; > > maybe it was because I was waiting for you to test it. > > > > Did you test it? What were the results (complete dmesg log and lspci -vv > > output)? There was also some follow-on discussion that I would need to > > evaluate before applying it. > > > > Bjorn > > I lost the original patch but it was simple enough that I coded it myself (one line change) locally. I have been testing with it for several months now and have no issues with it. In fact my testing requires it to be present in order to succeed, it will fail if it is not present. Huh, I don't see it in the archives, either. Ah, I see, it was a multi-part message, which is rejected by the mailing lists. But since I'm a nice guy, I'll include it again below. See https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches for the usual procedure. Please test the patch below (or post your patch if you prefer), collect the info I requested above (dmesg and lspci info), and attach it to a bugzilla so we can archive the details that motivate this change. Bjorn From e81dfb3e73982ae9d74e3a8c6110a5104e36c3c0 Mon Sep 17 00:00:00 2001 From: Yu Zhao Date: Fri, 21 Feb 2014 14:46:50 -0800 Subject: [PATCH] pci: fix legacy endpoint being excluded from using SR-IOV Neither PCIe 3.0 nor SR-IOV 1.1 spec excludes device of legacy endpoint type from having SR-IOV capability. The legacy endpoint together with root complex integrated and regular endpoints should be supported by sriov_init(). Signed-off-by: Yu Zhao --- drivers/pci/iov.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 9dce7c5..5f98707 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -418,6 +418,7 @@ static int sriov_init(struct pci_dev *dev, int pos) struct pci_dev *pdev; if (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_END && + pci_pcie_type(dev) != PCI_EXP_TYPE_LEG_END && pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT) return -ENODEV;