Date: Mon, 26 May 2014 22:18:20 -0400 From: Ryan Stone <rysto32@gmail.com> To: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: SR-IOV Patch Series 6/7: iovctl Configuration Tool Message-ID: <CAFMmRNyGfv7Fx0txZuUvON7W1OWVeHU40YoidD9LeD==ST9u8w@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
This patch series has the complete implementation of iovctl(8). This tool parses configuration files (in libucl format, the same format used by pkg(8)), converts the configuration to the nvlist-based format used in the kernel, validates the configuration, and then passes the configuration to the kernel. Validating the configuration in iovctl is technically redundant however iovctl is much more able to give meaningful error messages to the administrator. http://people.freebsd.org/~rstone/patches/iov/0016-Add-iovctl-functions-for-validating-config.patch [PATCH 16/21] Add iovctl functions for validating config Add an function to iovctl that validates the configuration against a schema. This function is able to assume that the parser has done most of the validation already and it's only responsible for applying default VF values specified in the config file, confirming that all required parameters have been set and that no invalid VF numbers have been specified. --- usr.sbin/iovctl/validate.c | 274 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 274 insertions(+) http://people.freebsd.org/~rstone/patches/iov/0017-Add-functions-for-parsing-the-iovctl-config-file.patch [PATCH 17/21] Add functions for parsing the iovctl config file Add two functions for parsing the iovctl config file. The config file is parsed using libucl[1], which accepts most YAML files and a superset of JSON. The first function is an ad-hoc parser that searches the file for the PF.DEVICE configuration value. We need to know that value in order to fetch the schema from the kernel, and we need the schema in order to be able to fully parse the file. The second function parses the config file and validates it against a schema. This function will exit with an error message if any validation error occurs. If it succeeds, the configuration is returned as an nvlist suitable for passing to the kernel. [1] https://github.com/vstakhov/libucl --- usr.sbin/iovctl/parse.c | 398 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 398 insertions(+) http://people.freebsd.org/~rstone/patches/iov/0018-Add-main-for-iovctl-and-hook-iovctl-into-build.patch [PATCH 18/21] Add main() for iovctl and hook iovctl into build --- usr.sbin/Makefile | 1 + usr.sbin/iovctl/Makefile | 19 +++ usr.sbin/iovctl/iovctl.c | 402 +++++++++++++++++++++++++++++++++++++++++++++++ usr.sbin/iovctl/iovctl.h | 37 +++++ 4 files changed, 459 insertions(+)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNyGfv7Fx0txZuUvON7W1OWVeHU40YoidD9LeD==ST9u8w>