From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 54F7FAFCE for ; Fri, 13 Jun 2014 19:51:29 +0200 (CEST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5DHpdgD026868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jun 2014 13:51:40 -0400 Received: from x220.localdomain ([10.3.113.19]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id s5DHpcFI013542; Fri, 13 Jun 2014 13:51:38 -0400 Date: Fri, 13 Jun 2014 10:51:37 -0700 From: Chris Wright To: "Richardson, Bruce" , Stephen Hemminger Message-ID: <20140613175137.GS1384@x220.localdomain> References: <20140606235028.189345212@networkplumber.org> <2240300.rVk2eNDOWK@xps13> <20140613102440.19537123@nehalam.linuxnetplumber.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140613102440.19537123@nehalam.linuxnetplumber.net> User-Agent: Mutt/1.5.21+63 (2f2ebc24920d) (2011-07-01) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH] igb_uio: cap max VFs at 7 to reserve one for PF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 17:51:30 -0000 To keep from confusing users, cap max VFs at 7, despite PCI SR-IOV config space showing a max of 8. This reserves a queue pair for the PF. This issue was cited here: http://dpdk.org/ml/archives/dev/2014-April/001832.html Cc: Bruce Richardson Cc: Stephen Hemminger Signed-off-by: Chris Wright --- This is what Linux kernel driver does. I have only compile tested it. Stephen sending to you and Bruce in case you want to Ack and add to your current queue. lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index 6fa7396..d5db97a 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -139,6 +139,12 @@ store_max_vfs(struct device *dev, struct device_attribute *attr, if (0 != strict_strtoul(buf, 0, &max_vfs)) return -EINVAL; + /* reserve a queue pair for PF */ + if (max_vfs > 7) { + dev_warn(dev, "Maxixum of 7 VFs per PF, using max\n"); + max_vfs = 7; + } + if (0 == max_vfs) pci_disable_sriov(pdev); else if (0 == local_pci_num_vf(pdev))