Skip to content

Commit

Permalink
[201911] Multiasic cleanup of get_npu_device_id() (#5229)
Browse files Browse the repository at this point in the history
* [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 ##5204
this function is no more needed so cleaning up.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
  • Loading branch information
abdosi authored Aug 21, 2020
1 parent 9decadf commit 427382b
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions src/sonic-py-common/sonic_py_common/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 427382b

Please sign in to comment.