From 0154175097b25352ed7ff5055d9725e0f2cf3f67 Mon Sep 17 00:00:00 2001 From: Xinran Wang Date: Thu, 27 Aug 2020 06:11:49 -0400 Subject: [PATCH] keep FPGA driver's deployable_name unique The deployable_name should be unique because deployable_name will be reported to placement as the resource_provider_name, which is required by placement to be unique. The current naming method for deployable_name in cyborg cannot ensure the uniqueness, so we should enhance this. This patch enhances the FPGA driver naming method. Change-Id: If8afa4718c0c90ac938ec691eff699aaf0e5125e Story: 2008074 Task: 40763 --- cyborg/accelerator/drivers/fpga/intel/sysinfo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cyborg/accelerator/drivers/fpga/intel/sysinfo.py b/cyborg/accelerator/drivers/fpga/intel/sysinfo.py index 36b03d06..2d5727b6 100644 --- a/cyborg/accelerator/drivers/fpga/intel/sysinfo.py +++ b/cyborg/accelerator/drivers/fpga/intel/sysinfo.py @@ -21,6 +21,7 @@ Cyborg Intel FPGA driver implementation. import glob import os import re +import socket from oslo_serialization import jsonutils @@ -38,7 +39,6 @@ PCI_DEVICES_PATH_PATTERN = "/sys/bus/pci/devices/*" # TODO(shaohe) The KNOWN_FPGAS can be configurable. KNOWN_FPGAS = [("0x8086", "0x09c4")] -INTEL_FPGA_DEV_PREFIX = "intel-fpga-dev" SYS_FPGA = "/sys/class/fpga" DEVICE = "device" PF = "physfn" @@ -231,7 +231,7 @@ def fpga_tree(): # name = os.path.basename(path) fpga = {"type": constants.DEVICE_FPGA, "devices": bdf, "stub": True, - "name": "_".join((INTEL_FPGA_DEV_PREFIX, bdf))} + "name": "_".join((socket.gethostname(), bdf))} d_info = fpga_device(path) fpga.update(d_info) if names: