]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add function to validate the consistency of SR-IOV config
authorrstone <rstone@FreeBSD.org>
Sun, 1 Mar 2015 00:40:51 +0000 (00:40 +0000)
committerrstone <rstone@FreeBSD.org>
Sun, 1 Mar 2015 00:40:51 +0000 (00:40 +0000)
commitf0a0142dd0f7d8bd0ae394686c21c67b3e9f0ae7
tree804f78ae0c4d00ff1c6e0186ff0be90801d451a6
parent15b49f363938ba88303620a98857d0e4cd15bd29
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.

Differential Revision: https://reviews.freebsd.org/D81
Reviewed by: jhb
MFC after:  1 month
Sponsored by: Sandvine Inc.
sys/dev/pci/pci_iov_schema.c
sys/sys/iov.h