Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SM: Need to have support for SROIV provisioning Testing: launching a SRIOV VM and seeing the vland id for the VF interface. Change-Id: If3ace43d11181eb158ef037e63a5e2dcf5f7b1c4
- Loading branch information
1 parent
7432c6b
commit 688262c
Showing
7 changed files
with
139 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
contrail/environment/modules/contrail/manifests/lib/setup_passthrough_white_list.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
define contrail::lib::setup_passthrough_white_list( | ||
$dev_name, | ||
) { | ||
$physnet = $title | ||
|
||
notify { "phys_nets_${title} = ${physnet}":; } | ||
notify { "dev_name_${title} = ${dev_name}":; } | ||
$wl = "{ \"devname\": \"${dev_name}\", \"physical_network\": \"${physnet}\"}" | ||
$pci_passthrough_whitelist_line = "pci_passthrough_whitelist = ${wl}" | ||
notify { "wl_${title}=${wl}":; } | ||
notify { "pci_passthrough_whitellist_line_${title}=${pci_passthrough_whitelist_line}":; } | ||
exec { "config_pci_whitelist_${title}": | ||
command => "sed -i '/\[DEFAULT\]/a ${pci_passthrough_whitelist_line} ' /etc/nova/nova.conf", | ||
provider => shell, | ||
logoutput => true | ||
} | ||
|
||
|
||
/* | ||
file_line { "config_pci_whitelist_${title}": | ||
path => '/etc/nova/nova.conf', | ||
line => "pci_passthrough_whitelist = ${wl}" | ||
} | ||
#cannot use openstack-config as multi-valued option is not supported | ||
#Also cannot use nova_config resourse as it is seen as a re-declaration by puppet | ||
exec { "config_pci_whitelist_${title}": | ||
command => "openstack-config --set /etc/nova/nova.conf DEFAULT pci_passthrough_whitelist ${wl}", | ||
provider => shell, | ||
logoutput => true | ||
} | ||
$nova_pci_passthrough_whitelist_params = { | ||
'pci_passthrough_whitelist' => { value => '{ "devname": $dev_name, "physical_network": $physnet}'} | ||
} | ||
create_resources(nova_config, $nova_pci_passthrough_whitelist_params, {}) | ||
*/ | ||
} |
19 changes: 19 additions & 0 deletions
19
contrail/environment/modules/contrail/manifests/lib/setup_sriov.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
define contrail::lib::setup_sriov( | ||
$intf_name, | ||
$num_of_vfs, | ||
$physnet_list, | ||
) { | ||
$line = "echo ${num_of_vfs} > /sys/class/net/${intf_name}/device/sriov_numvfs" | ||
exec { "setup_rc_local_${title}": | ||
command => "sed -i '/exit 0/i ${line}' /etc/rc.local", | ||
provider => shell, | ||
logoutput => true, | ||
} | ||
|
||
|
||
|
||
contrail::lib::setup_passthrough_white_list{ $physnet_list: | ||
dev_name => $intf_name } | ||
|
||
|
||
} |
42 changes: 42 additions & 0 deletions
42
contrail/environment/modules/contrail/manifests/lib/setup_sriov_wrapper.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
define contrail::lib::setup_sriov_wrapper( | ||
$intf_hash, | ||
$enable_dpdk, | ||
) { | ||
|
||
if ($enablle_dpdk){ | ||
$linux_default_val = "nomdmonddf nomdmonisw intel_iommu=pt" | ||
} else { | ||
$linux_default_val = "nomdmonddf nomdmonisw intel_iommu=on" | ||
} | ||
|
||
|
||
if (!empty($intf_hash)) { | ||
$intf_details = $intf_hash[$title] | ||
if ($intf_hash) { | ||
file_line { "set_grub_iommu_${title}": | ||
path => '/etc/default/grub', | ||
line => "GRUB_CMDLINE_LINUX_DEFAULT=\"${linux_default_val}\"", | ||
match => '^GRUB_CMDLINE_LINUX_DEFAULT.*', | ||
} | ||
/* | ||
-> | ||
exec { "setup_default": | ||
command => "echo '[DEFAULT]' >> /etc/nova/nova.conf", | ||
provider => shell, | ||
logoutput => true, | ||
} | ||
*/ | ||
|
||
} | ||
|
||
notify { "intf_hash_${title} = ${intf_hash}":; } | ||
notify { "title_${title} = ${title}":; } | ||
notify { "intf_details_${title} = ${intf_details}":; } | ||
contrail::lib::setup_sriov{$title : | ||
intf_name => $title, | ||
num_of_vfs => $intf_details['VF'], | ||
physnet_list => $intf_details['physnets'] | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters