[201911] Multiasic cleanup of get_npu_device_id() (#5229)
* [201911] skip_thermalctld for VS platform as it is not supported root@vlab-01:/# supervisorctl status dependent-startup EXITED Aug 18 06:22 AM rsyslogd RUNNING pid 18, uptime 0:12:26 start EXITED Aug 18 06:22 AM supervisor-proc-exit-listener RUNNING pid 13, uptime 0:12:27 Signed-off-by: Abhishek Dosi <abdosi@microsoft.com> * [201911] after PR #https://github.com/Azure/sonic-buildimage/pull/5204 this function is no more needed so cleaning up. Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
This commit is contained in:
parent
9decadfed2
commit
427382b54b
@ -247,31 +247,6 @@ def get_npu_id_from_name(npu_name):
|
||||
return None
|
||||
|
||||
|
||||
def get_npu_device_id(npu_id):
|
||||
platform = get_platform()
|
||||
if not platform:
|
||||
return None
|
||||
|
||||
asic_conf_file_path = os.path.join(SONIC_DEVICE_PATH, platform, ASIC_CONF_FILENAME)
|
||||
if not os.path.isfile(asic_conf_file_path):
|
||||
return None
|
||||
|
||||
# In a multi-npu device we need to have the file "asic.conf" updated with the asic instance
|
||||
# and the corresponding device id which could be pci_id. Below is an eg: for a 2 ASIC platform/sku.
|
||||
# DEV_ID_ASIC_0=03:00.0
|
||||
# DEV_ID_ASIC_1=04:00.0
|
||||
device_str = "DEV_ID_ASIC_{}".format(npu_id)
|
||||
|
||||
with open(asic_conf_file_path) as asic_conf_file:
|
||||
for line in asic_conf_file:
|
||||
tokens = line.split('=')
|
||||
if len(tokens) < 2:
|
||||
continue
|
||||
if tokens[0] == device_str:
|
||||
device_id = tokens[1].strip()
|
||||
return device_id
|
||||
|
||||
|
||||
def get_namespaces():
|
||||
"""
|
||||
In a multi NPU platform, each NPU is in a Linux Namespace.
|
||||
|
Loading…
Reference in New Issue
Block a user