From owner-freebsd-hackers@FreeBSD.ORG Tue May 27 02:14:19 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3744CD91 for ; Tue, 27 May 2014 02:14:19 +0000 (UTC) Received: from mail-ob0-x234.google.com (mail-ob0-x234.google.com [IPv6:2607:f8b0:4003:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0552E215C for ; Tue, 27 May 2014 02:14:18 +0000 (UTC) Received: by mail-ob0-f180.google.com with SMTP id va2so8682761obc.11 for ; Mon, 26 May 2014 19:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=mSP3fGY3YNt5XBwniosMwh2iH70Zc2JKgOrn+nGiGqg=; b=y4pWdduW7v+wccQgQFfLLAWSm9NCQCap5kLvWkbBeUFWdgFDr4J71wXkngcn9OxV0B GqSDMMYV/h1E9Yjv0cZr+bPNIOmiZ6ilVpvWam0OPXhH2a6M6R4A3ZbjzIYQNIyHEYG8 hu2g2B2NhIMwQLnmlja9+0EfNzRcLrbpLhOdec6Hz89foS77mT2y96hCjwG3oqU+tXTE rL4g16aoD2gA2Llh4UQEcUrO7YLEZzH7cq1KyOiPqjp4EmpnZt946V9DiMhFkay3LrNi Mr8SF44Zml/sWqemEpI+jeiWwEpRKhVCFqm1Esi9s4o4FUZ0Yg5Z4bRP4kBq0ITM2Z0u PpHA== MIME-Version: 1.0 X-Received: by 10.182.227.197 with SMTP id sc5mr29404928obc.18.1401156858290; Mon, 26 May 2014 19:14:18 -0700 (PDT) Received: by 10.76.23.130 with HTTP; Mon, 26 May 2014 19:14:18 -0700 (PDT) Date: Mon, 26 May 2014 22:14:18 -0400 Message-ID: Subject: SR-IOV Patch Series 5/7: SR-IOV Configuration Interface From: Ryan Stone To: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 02:14:19 -0000 This patch series deals with the configuration schema, which specifies the format of valid configuration for a given PF device, and the details of accepting configuration from iovctl, validating it against the schema and then passing it to the driver. http://people.freebsd.org/~rstone/patches/iov/0011-Add-infrastructure-for-exporting-config-schema-from-.patch [PATCH 11/21] Add infrastructure for exporting config schema from PF drivers --- sys/conf/files | 1 + sys/dev/pci/pci_if.m | 6 ++ sys/dev/pci/pci_iov.c | 186 ++++++++++++++++++++++++++++++++++++- sys/dev/pci/pci_iov_private.h | 1 + sys/dev/pci/pci_iov_schema.c | 208 ++++++++++++++++++++++++++++++++++++++++++ sys/dev/pci/pci_private.h | 3 +- sys/dev/pci/pcivar.h | 7 +- sys/dev/pci/schema_private.h | 35 +++++++ sys/sys/iov.h | 127 ++++++++++++++++++++++++++ sys/sys/iov_schema.h | 52 +++++++++++ 10 files changed, 622 insertions(+), 4 deletions(-) http://people.freebsd.org/~rstone/patches/iov/0012-Add-function-to-validate-the-consistency-of-SR-IOV-c.patch [PATCH 12/21] Add function to validate the consistency of SR-IOV config Add a function that validates that the user-provided SR-IOV configuration is valid. This includes basic checks that the structure of the configuration is correct (e.g. all required configuration nodes are present) as well as validating against a configuration schema. The schema validation consists of: - Ensuring that all required config parameters are present. - If the schema defines a default value for a parameter, adding the default value if the parameter is not set. - Ensuring that no parameters are specified in the config that are not defined in the schema. - Ensuring that have the correct type defined in the schema. - Ensuring that no configuration nodes are present for devices that do not exist. For example, if 2 VFs are configured, then we validate that a node called VF-5 does not exist. --- sys/dev/pci/pci_iov_schema.c | 428 ++++++++++++++++++++++++++++++++++++++++--- sys/sys/iov.h | 5 + 2 files changed, 412 insertions(+), 21 deletions(-) http://people.freebsd.org/~rstone/patches/iov/0013-Pass-SR-IOV-configuration-to-kernel-using-an-nvlist.patch [PATCH 13/21] Pass SR-IOV configuration to kernel using an nvlist Pass all SR-IOV configuration to the kernel using an nvlist. The main benefit that this offers is flexibility. It allows a driver to accept any number of parameters of any type supported by the SR-IOV configuration infrastructure with having to make any changes outside of the driver. It also offers the user very fine-grained control over the configuration of the VFs -- if they want, they can have different configuration applied to every VF. --- sys/dev/pci/pci_if.m | 2 + sys/dev/pci/pci_iov.c | 129 +++++++++++++++++++++++++++++++++++++++++--------- sys/sys/iov.h | 93 +++++++++++++++++++++++++++++++++--- 3 files changed, 195 insertions(+), 29 deletions(-) http://people.freebsd.org/~rstone/patches/iov/0021-Validate-the-schema-that-the-PF-driver-passed-to-us.patch [PATCH 21/21] Validate the schema that the PF driver passed to us --- sys/dev/pci/pci_iov.c | 4 + sys/dev/pci/pci_iov_schema.c | 275 +++++++++++++++++++++++++++++++++++++++++-- sys/dev/pci/schema_private.h | 2 + 3 files changed, 274 insertions(+), 7 deletions(-)