#1653 closed enhancement (fixed)
Support for 3snic raid cards on Linux
| Reported by: | steven.song | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | Release 7.4 |
| Component: | all | Version: | |
| Keywords: | 3snic linux | Cc: |
Description
Hello,
I work at 3SNIC and want to support our RAID cards descripted as below link in smartmontools, what else needs to provide besides patch files and related log files?
Attachments (14)
Change History (26)
comment:1 by , 3 years ago
| Keywords: | 3snic linux windows added |
|---|---|
| Milestone: | → undecided |
by , 3 years ago
| Attachment: | os_linux.cpp added |
|---|
by , 3 years ago
by , 3 years ago
| Attachment: | smartctl-scan.txt added |
|---|
by , 3 years ago
| Attachment: | smartctl-a.txt added |
|---|
comment:2 by , 3 years ago
The attached source files are modified based on v7.3, please see the log files for --scan and --all parameters.
follow-ups: 4 5 comment:3 by , 3 years ago
Thanks. Unfortunately you didn't follow the hints from the above comment.
- Please provide a patch (e.g. output of
svn diff) file. Do not provide full versions of changed and new files. - Merge your changes of
os_linux.cppto current SVN head. Could easily be done after a svn checkout: runsvn update -r 5338, add your version ofos_linux.cpp, thensvn updateto let SVN do the merge. Resolve conflicts if any. open(),close()and usage ofm_fdlook strange and are possibly not needed at all. Thesscanf(..., &m_hba)could be done in the ctor because the device name does not change later.- Prepend all private member variables
*idwithm_. - Don't use
printf(). It is not compatible withsmartctl --jsonand the syslog output ofsmartd. Usepout()instead. - Remove the
linux_sssraid_device::autodetect_open()function. Useget_sat_device("sat,auto", new linux_sssraid_device(...))instead. Seelinux_cciss_devicefor an example. - Add author and licensing header to
sssraid.h. For licensing info, useSPDX-License-Identifier: GPL-2.0-or-lateror a more relaxed but compatible one, see https://spdx.org/licenses/. - Add this new file to
Makefile.am. - Add an entry to the
ChangeLogfile. - Briefly describe new
-dparameter insmartctl.8.inandsmartd.conf.5.in. - Use
smartctl -xinstead ofsmartctl -afor testing. - Also provide
smartctl -xoutput for a SATA device behind this controller. This also tests whether SCSI sense data is properly returned. This is mandatory when ATA command SMART RETURN STATUS is issued through SAT ATA PASS-THROUGH commands. If this does not work, remove the"sat,auto"detection. - Also test non-DATA commands like
smartctl -t shortfor SAS and SATA. - Also test with
smartdto make sure that repeatedopen()/close()calls work. - Note that comprehensive testing is *very* important. Smartmontools is maintained by few volunteers in unpaid spare time. No developer has access to a test machine with such a controller.
comment:4 by , 3 years ago
Thanks for your advice, will update soon after code modification and testing.
Replying to Christian Franke:
Thanks. Unfortunately you didn't follow the hints from the above comment.
- Please provide a patch (e.g. output of
svn diff) file. Do not provide full versions of changed and new files.- Merge your changes of
os_linux.cppto current SVN head. Could easily be done after a svn checkout: runsvn update -r 5338, add your version ofos_linux.cpp, thensvn updateto let SVN do the merge. Resolve conflicts if any.open(),close()and usage ofm_fdlook strange and are possibly not needed at all. Thesscanf(..., &m_hba)could be done in the ctor because the device name does not change later.- Prepend all private member variables
*idwithm_.- Don't use
printf(). It is not compatible withsmartctl --jsonand the syslog output ofsmartd. Usepout()instead.- Remove the
linux_sssraid_device::autodetect_open()function. Useget_sat_device("sat,auto", new linux_sssraid_device(...))instead. Seelinux_cciss_devicefor an example.- Add author and licensing header to
sssraid.h. For licensing info, useSPDX-License-Identifier: GPL-2.0-or-lateror a more relaxed but compatible one, see https://spdx.org/licenses/.- Add this new file to
Makefile.am.- Add an entry to the
ChangeLogfile.- Briefly describe new
-dparameter insmartctl.8.inandsmartd.conf.5.in.- Use
smartctl -xinstead ofsmartctl -afor testing.- Also provide
smartctl -xoutput for a SATA device behind this controller. This also tests whether SCSI sense data is properly returned. This is mandatory when ATA command SMART RETURN STATUS is issued through SAT ATA PASS-THROUGH commands. If this does not work, remove the"sat,auto"detection.- Also test non-DATA commands like
smartctl -t shortfor SAS and SATA.- Also test with
smartdto make sure that repeatedopen()/close()calls work.- Note that comprehensive testing is *very* important. Smartmontools is maintained by few volunteers in unpaid spare time. No developer has access to a test machine with such a controller.
by , 3 years ago
| Attachment: | os_linux.cpp.diff added |
|---|
by , 3 years ago
| Attachment: | sssraid.h.diff added |
|---|
by , 3 years ago
| Attachment: | smartctl.8.in.diff added |
|---|
by , 3 years ago
| Attachment: | Makefile.am.diff added |
|---|
by , 3 years ago
| Attachment: | ChangeLog.diff added |
|---|
by , 3 years ago
| Attachment: | smartctl-scan.log added |
|---|
by , 3 years ago
| Attachment: | smartctl-x.log added |
|---|
comment:5 by , 3 years ago
Uploaded the source patch and test log, please help review, thanks.
Replying to Christian Franke:
Thanks. Unfortunately you didn't follow the hints from the above comment.
- Please provide a patch (e.g. output of
svn diff) file. Do not provide full versions of changed and new files.- Merge your changes of
os_linux.cppto current SVN head. Could easily be done after a svn checkout: runsvn update -r 5338, add your version ofos_linux.cpp, thensvn updateto let SVN do the merge. Resolve conflicts if any.open(),close()and usage ofm_fdlook strange and are possibly not needed at all. Thesscanf(..., &m_hba)could be done in the ctor because the device name does not change later.- Prepend all private member variables
*idwithm_.- Don't use
printf(). It is not compatible withsmartctl --jsonand the syslog output ofsmartd. Usepout()instead.- Remove the
linux_sssraid_device::autodetect_open()function. Useget_sat_device("sat,auto", new linux_sssraid_device(...))instead. Seelinux_cciss_devicefor an example.- Add author and licensing header to
sssraid.h. For licensing info, useSPDX-License-Identifier: GPL-2.0-or-lateror a more relaxed but compatible one, see https://spdx.org/licenses/.- Add this new file to
Makefile.am.- Add an entry to the
ChangeLogfile.- Briefly describe new
-dparameter insmartctl.8.inandsmartd.conf.5.in.- Use
smartctl -xinstead ofsmartctl -afor testing.- Also provide
smartctl -xoutput for a SATA device behind this controller. This also tests whether SCSI sense data is properly returned. This is mandatory when ATA command SMART RETURN STATUS is issued through SAT ATA PASS-THROUGH commands. If this does not work, remove the"sat,auto"detection.- Also test non-DATA commands like
smartctl -t shortfor SAS and SATA.- Also test with
smartdto make sure that repeatedopen()/close()calls work.- Note that comprehensive testing is *very* important. Smartmontools is maintained by few volunteers in unpaid spare time. No developer has access to a test machine with such a controller.
follow-up: 7 comment:6 by , 3 years ago
Please provide ONE patch file which contains the changes for all files. This is long standing common practice in F(L)OSS community.
comment:7 by , 3 years ago
Please see the attached smartctl.diff for the all changes.
Replying to Christian Franke:
Please provide ONE patch file which contains the changes for all files. This is long standing common practice in F(L)OSS community.
comment:8 by , 3 years ago
| Keywords: | windows removed |
|---|---|
| Milestone: | undecided → Release 7.4 |
| Summary: | Support for 3snic raid cards → Support for 3snic raid cards on Linux |
| Type: | patch → enhancement |
Patch applied with some modifications in r5420.
The following issues were fixed before the commit:
- The new file
sssraid.hwas not included in the patch. You need to usesvn add ...beforesvn diffto get new files included. - The conflicts in
ChangeLogwere not resolved. The conflicting range was marked with<<<<<<< .mine ... ======= ... >>>>>>> .r5419.
Remaining issues fixed afterwards:
- The code did not compile, see CircleCI build "smartmontools 691". Fixed in r5421.
- The documentation syntax in
smartctl.8.inwas incorrect andsmartd.conf.5.indocumentation was missing. Fixed in r5422.
Please test a r5422 or later linux binary from https://builds.smartmontools.org/.
comment:10 by , 3 years ago
Open issue as seen in smartctl-x.log above:
SMART Status not supported: Incomplete response, ATA output registers missing
This means that the ATA PASS-THROUGH(16) SCSI command (cdb[0]=0x85) does not honor the CK_COND bit (cdb[2]|=(1<<5)). If set, ATA output registers must be returned in SCSI sense data. This is not optional and should be fixed.
Smartmontools supports either ATA Status Return sense data descriptor or Fixed format sense data fields for ATA PASS-THROUGH commands.
See SCSI/ATA Translation standards at https://www.t10.org/drafts.htm#SAT for details.
Please report this issue to the authors of controller firmware and Linux driver.
comment:11 by , 3 years ago
This "New patch" is now completely useless as all changes are already committed and fixed in r5420, r5421, r5422. See comment 8 for details.
Run svn revert -R . and then svn up to update your working copy of the code. Compile and test this code. Alternatively test r5422 or any later linux binary from https://builds.smartmontools.org/.
Test both smartctl and smartd with SAS and SATA devices. Report the test result here. Remember that no smartmontools developer could do these tests for you due to lack of access to such a controller.
Smartmontools runs as root and serious bugs may damage stored data or hardware.
Did you report the CK_COND issue described in comment 10 to the authors of controller firmware and Linux driver?
comment:12 by , 3 years ago
Thanks for your comments, this issue was reported to our FW team yesterday, will update test log after fixed.
by , 3 years ago
| Attachment: | smartctl-x-sas.log added |
|---|
by , 3 years ago
| Attachment: | smartctl-x-sata.log added |
|---|

Thanks for offering patches. Please provide patch files in unified diff format which include the changes to os_linux.cpp and/or os_win32.cpp, the ChangeLog and optionally AUTHORS.
Alternatively you could provide the patch as a PR in our read only GH mirror at
https://github.com/smartmontools/smartmontools/
Please note that we allow (and recommend) to use C++11, but not yet C++14.