summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorŁukasz Zemczak <sil2100@vexillium.org>2020-04-16 00:33:27 +0200
committerGitHub <noreply@github.com>2020-04-16 00:33:27 +0200
commit1ccf7e0e3a7a91edbbe3f9f0669c8bbab8248cd1 (patch)
treeef45bae76de375d3f16bd098d5618aa5f621c7d9 /src
parentb7f1d9b0421296a3d872d613ed9a3463ce68eace (diff)
SR-IOV support for explicitly defining the VF count (#130)
This is a possible feature request to the just-landed SR-IOV support in netplan. This PR introduces an optional 'virtual-function-count:' parameter that can be defined for physical functions to force the allocation of a given number of VFs, regardless of how many are actually used in the netplan config. There are of course safety checks to ensure that we can't request less VFs than actually needed in netplan. This feature request came from the OpenStack team. We did consider such a thing originally, but then decided that it's better if we let netplan handle it. This PR adds this as an option (not recommended for everyday usage tho). Co-authored-by: Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>
Diffstat (limited to 'src')
-rw-r--r--src/parse.c1
-rw-r--r--src/parse.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/parse.c b/src/parse.c
index b9c4692..c1dc175 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -1726,6 +1726,7 @@ static const mapping_entry_handler ethernet_def_handlers[] = {
PHYSICAL_LINK_HANDLERS,
{"auth", YAML_MAPPING_NODE, handle_auth},
{"link", YAML_SCALAR_NODE, handle_netdef_id_ref, NULL, netdef_offset(sriov_link)},
+ {"virtual-function-count", YAML_SCALAR_NODE, handle_netdef_guint, NULL, netdef_offset(sriov_explicit_vf_count)},
{NULL}
};
diff --git a/src/parse.h b/src/parse.h
index e11f57d..b84ff4c 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -336,6 +336,7 @@ struct net_definition {
/* these properties are only valid for SR-IOV NICs */
struct net_definition* sriov_link;
gboolean sriov_vlan_filter;
+ guint sriov_explicit_vf_count;
union {
struct NetplanNMSettings {