diff options
author | rstone <rstone@FreeBSD.org> | 2015-03-01 00:40:51 +0000 |
---|---|---|
committer | rstone <rstone@FreeBSD.org> | 2015-03-01 00:40:51 +0000 |
commit | f0a0142dd0f7d8bd0ae394686c21c67b3e9f0ae7 (patch) | |
tree | 804f78ae0c4d00ff1c6e0186ff0be90801d451a6 /sys/sys/iov.h | |
parent | 15b49f363938ba88303620a98857d0e4cd15bd29 (diff) | |
download | FreeBSD-src-f0a0142dd0f7d8bd0ae394686c21c67b3e9f0ae7.zip FreeBSD-src-f0a0142dd0f7d8bd0ae394686c21c67b3e9f0ae7.tar.gz |
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.
Diffstat (limited to 'sys/sys/iov.h')
-rw-r--r-- | sys/sys/iov.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/sys/iov.h b/sys/sys/iov.h index 976f6e0..db5648d 100644 --- a/sys/sys/iov.h +++ b/sys/sys/iov.h @@ -34,6 +34,11 @@ #define PF_CONFIG_NAME "PF" #define VF_SCHEMA_NAME "VF" +#define VF_PREFIX "VF-" +#define VF_PREFIX_LEN 3 +#define VF_NUM_LEN 5 /* The maximum VF num is 65535. */ +#define VF_MAX_NAME (VF_PREFIX_LEN + VF_NUM_LEN + 1) + #define DRIVER_CONFIG_NAME "DRIVER" #define IOV_CONFIG_NAME "IOV" |