From d40d75d2d787b9d4f949422b88de18ede4ee20b6 Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Thu, 24 Oct 2019 10:16:19 +0200 Subject: executor: move fixed pci devlink handle into network namespace In case there is a fixed pci devlink handle "pci/pci/0000:00:10.0" on the system (initial network namespace), it is moved to a working network namespace. Signed-off-by: Jiri Pirko --- pkg/host/host.go | 2 ++ pkg/host/host_linux.go | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'pkg/host') diff --git a/pkg/host/host.go b/pkg/host/host.go index dbd3b9ec3..f18233085 100644 --- a/pkg/host/host.go +++ b/pkg/host/host.go @@ -76,6 +76,7 @@ const ( FeatureNetworkInjection FeatureNetworkDevices FeatureKCSAN + FeatureDevlinkPCI numFeatures ) @@ -108,6 +109,7 @@ func Check(target *prog.Target) (*Features, error) { FeatureNetworkInjection: {Name: "net packet injection", Reason: unsupported}, FeatureNetworkDevices: {Name: "net device setup", Reason: unsupported}, FeatureKCSAN: {Name: "concurrency sanitizer", Reason: unsupported}, + FeatureDevlinkPCI: {Name: "devlink PCI setup", Reason: unsupported}, } switch target.OS { case "akaros", "fuchsia", "test": diff --git a/pkg/host/host_linux.go b/pkg/host/host_linux.go index a1d5ff1b3..c908ee411 100644 --- a/pkg/host/host_linux.go +++ b/pkg/host/host_linux.go @@ -396,6 +396,7 @@ func init() { checkFeature[FeatureNetworkInjection] = checkNetworkInjection checkFeature[FeatureNetworkDevices] = unconditionallyEnabled checkFeature[FeatureKCSAN] = checkKCSAN + checkFeature[FeatureDevlinkPCI] = checkDevlinkPCI } func checkCoverage() string { @@ -564,3 +565,10 @@ func checkKCSAN() string { } return "" } + +func checkDevlinkPCI() string { + if err := osutil.IsAccessible("/sys/bus/pci/devices/0000:00:10.0/"); err != nil { + return "PCI device 0000:00:10.0 is not available" + } + return "" +} -- cgit mrf-deployment