Skip to content

Commit

Permalink
Change Virtium SSD which doesn't support SmartCMD, to use only smartc…
Browse files Browse the repository at this point in the history
…tl (#522)

- Description
Add support for Virtium SSD which can't use SmartCMD - to use only smartctl (using generic ssd info parser).

- Motivation and Context
There are Virtium SSDs which can't receive SSD info from 'SmartCMD', and must use 'smartctl' command.
For those SSDs, after calling the generic ssd parser, the function is finished and the specific vendor parser won't be called.

- How Has This Been Tested?
I tested it manually with a special Virtium SSD which doesn't support SmartCMD

- Additional Information (Optional)
output after the change:
root@sonic:/home/admin# show platform ssdhealth
Disk Type : NVME
Device Model : Virtium VTPM24CEXI080-BM110006
Health : 100.0%
Temperature : 52.0C

output before the change:
root@sonic:/home/admin# show platform ssdhealth
[Error] Cannot read SMART information on device /dev/nvme0n1
Disk Type : NVME
Device Model : Virtium VTPM24CEXI080-BM110006
Health : N/A
Temperature : 51.0C
  • Loading branch information
noaOrMlnx authored Jan 16, 2025
1 parent 9ca0f69 commit 75c320d
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions sonic_platform_base/sonic_storage/ssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ def __init__(self, diskdev):
self.log = syslogger.SysLogger(self.log_identifier)

self.vendor_ssd_utility = {
"Generic" : { "utility" : SMARTCTL, "parser" : self.parse_generic_ssd_info },
"InnoDisk" : { "utility" : INNODISK, "parser" : self.parse_innodisk_info },
"M.2" : { "utility" : INNODISK, "parser" : self.parse_innodisk_info },
"StorFly" : { "utility" : VIRTIUM, "parser" : self.parse_virtium_info },
"Virtium" : { "utility" : VIRTIUM, "parser" : self.parse_virtium_info },
"Swissbit" : { "utility" : SMARTCTL, "parser" : self.parse_swissbit_info },
"Micron" : { "utility" : SMARTCTL, "parser" : self.parse_micron_info },
"Intel" : { "utility" : SMARTCTL, "parser" : self.parse_intel_info },
"Transcend" : { "utility" : TRANSCEND, "parser" : self.parse_transcend_info },
"Generic" : { "utility" : SMARTCTL, "parser" : self.parse_generic_ssd_info },
"InnoDisk" : { "utility" : INNODISK, "parser" : self.parse_innodisk_info },
"M.2" : { "utility" : INNODISK, "parser" : self.parse_innodisk_info },
"StorFly" : { "utility" : VIRTIUM, "parser" : self.parse_virtium_info },
"Virtium" : { "utility" : VIRTIUM, "parser" : self.parse_virtium_info },
"Swissbit" : { "utility" : SMARTCTL, "parser" : self.parse_swissbit_info },
"Micron" : { "utility" : SMARTCTL, "parser" : self.parse_micron_info },
"Intel" : { "utility" : SMARTCTL, "parser" : self.parse_intel_info },
"Transcend" : { "utility" : TRANSCEND, "parser" : self.parse_transcend_info },
}

self.dev = diskdev
Expand All @@ -103,6 +103,11 @@ def fetch_parse_info(self, diskdev):

# Known vendor part
if self.model:
# For some Virtium SSDs, parse_generic_ssd_info should be called.
# Since it was called above, no need to parse a specific vendor SSD info.
if self.model in ['Virtium VTPM24CEXI080-BM110006']:
return

vendor = self._parse_vendor()
if vendor:
try:
Expand Down

0 comments on commit 75c320d

Please sign in to comment.