From 4001a48cf6d6f72b49acd5de7d1c1f35769c9612 Mon Sep 17 00:00:00 2001 From: Litao Gao Date: Tue, 19 May 2020 09:19:38 +0000 Subject: [PATCH] stx-config: add extra command to bring sriov pf device up Extra command is needed to bring up the interface whose inet configuration type is 'manual'. Issue-ID: INF-119 Signed-off-by: Litao Gao Change-Id: I65d0f2faae14426f5ecafa21a21c7dfbc2f6f905 --- .../recipes-core/stx-config/files/sriovpf-bring-up.patch | 16 ++++++++++++++++ meta-stx/recipes-core/stx-config/stx-config.bb | 1 + 2 files changed, 17 insertions(+) create mode 100644 meta-stx/recipes-core/stx-config/files/sriovpf-bring-up.patch 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 index 0000000..8e9e91e --- /dev/null +++ b/meta-stx/recipes-core/stx-config/files/sriovpf-bring-up.patch @@ -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)) diff --git a/meta-stx/recipes-core/stx-config/stx-config.bb b/meta-stx/recipes-core/stx-config/stx-config.bb index 89e7ff0..0f56b06 100644 --- a/meta-stx/recipes-core/stx-config/stx-config.bb +++ b/meta-stx/recipes-core/stx-config/stx-config.bb @@ -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 = "\ -- 2.16.6