stx-config: add extra command to bring sriov pf device up 45/3745/1
authorLitao Gao <litao.gao@windriver.com>
Tue, 19 May 2020 09:19:38 +0000 (09:19 +0000)
committerLitao Gao <litao.gao@windriver.com>
Tue, 19 May 2020 09:34:30 +0000 (05:34 -0400)
Extra command is needed to bring up the interface whose
inet configuration type is 'manual'.

Issue-ID: INF-119
Signed-off-by: Litao Gao <litao.gao@windriver.com>
Change-Id: I65d0f2faae14426f5ecafa21a21c7dfbc2f6f905

meta-stx/recipes-core/stx-config/files/sriovpf-bring-up.patch [new file with mode: 0644]
meta-stx/recipes-core/stx-config/stx-config.bb

diff --git a/meta-stx/recipes-core/stx-config/files/sriovpf-bring-up.patch b/meta-stx/recipes-core/stx-config/files/sriovpf-bring-up.patch
new file mode 100644 (file)
index 0000000..8e9e91e
--- /dev/null
@@ -0,0 +1,16 @@
+diff -ruN a/sysinv/sysinv/sysinv/sysinv/puppet/interface.py b/sysinv/sysinv/sysinv/sysinv/puppet/interface.py
+--- a/sysinv/sysinv/sysinv/sysinv/puppet/interface.py  2020-05-19 09:09:32.685727476 +0000
++++ b/sysinv/sysinv/sysinv/sysinv/puppet/interface.py  2020-05-19 09:10:34.225727195 +0000
+@@ -938,8 +938,10 @@
+             # others share the same pci-sriov sysfs enabling mechanism
+             sriovfs_path = ("/sys/class/net/%s/device/sriov_numvfs" %
+                             get_interface_port_name(context, iface))
+-            options['pre_up'] = "echo 0 > %s; echo %s > %s" % (
+-                sriovfs_path, iface['sriov_numvfs'], sriovfs_path)
++            sriovpf_up_cmd = ("ifconfig %s up" %
++                            get_interface_port_name(context, iface))
++            options['pre_up'] = "echo 0 > %s; echo %s > %s; %s" % (
++                sriovfs_path, iface['sriov_numvfs'], sriovfs_path, sriovpf_up_cmd)
+     elif interface_class == constants.INTERFACE_CLASS_PCI_PASSTHROUGH:
+         sriovfs_path = ("/sys/class/net/%s/device/sriov_numvfs" %
+                         get_interface_port_name(context, iface))
index 89e7ff0..0f56b06 100644 (file)
@@ -29,6 +29,7 @@ SRC_URI = " \
        git://opendev.org/starlingx/config.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH} \
        file://0001-stx-config-remove-argparse-requirement-from-sysinv.patch \
        file://0002-cgts-client-handle-exceptions-other-than-CalledProcessErr.patch \
+       file://sriovpf-bring-up.patch \
        "
 
 DEPENDS = "\