Bug 243530 - sysutils/cciss_vol_status: Does not display (some) physical drives
Summary: sysutils/cciss_vol_status: Does not display (some) physical drives
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-22 22:43 UTC by Peter Eriksson
Modified: 2024-01-24 12:28 UTC (History)
2 users (show)

See Also:
freebsd: maintainer-feedback+


Attachments
Patch to solve numerous issues in cciss_vol_status (7.97 KB, patch)
2024-01-24 12:25 UTC, Peter Eriksson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Eriksson 2020-01-22 22:43:57 UTC
On a HP server with a "Smart HBA H241" SAS controller with an external D6020 disk enclosure it doesn't seem to display the 35 disks installed (and in use as a big ZFS zpool):

# cciss_vol_status -V /dev/ciss1
Controller: Smart HBA H241
  Board ID: 0x21c8103c
  Logical drives: 0
  Running firmware: 6.60
  ROM firmware: 6.60
  Physical drives: 0
/dev/ciss1: (Smart HBA H241) Enclosure D6020 (S/N: 7CE823P1HE) on Bus 2, Physical Port 1E status: OK.
/dev/ciss1(Smart HBA H241:0): Non-Volatile Cache status:
                   Cache configured: No

# camcontrol devlist|egrep scbus4|wc -l
      35

Excerpt from dmesg:

da6 at ciss1 bus 32 scbus4 target 16 lun 0
da6: <HP MB010000JWAYK HPD5> Fixed Direct Access SPC-4 SCSI device
da6: Serial Number JEJ3UBPN
da6: 135.168MB/s transfers
da6: Command Queueing enabled
da6: 9537536MB (2441609216 4096 byte sectors)
da7 at ciss1 bus 32 scbus4 target 17 lun 0
da7: <HP MB010000JWAYK HPD5> Fixed Direct Access SPC-4 SCSI device
da7: Serial Number JEJ414TN
da7: 135.168MB/s transfers
da7: Command Queueing enabled
da7: 9537536MB (2441609216 4096 byte sectors)



Whereas on FreeBSD 11.3-RELEASE-p5, it correctly displays the connected drives
(different server, but similar hardware):

# cciss_vol_status -V /dev/ciss1
Controller: Smart HBA H241
  Board ID: 0x21c8103c
  Logical drives: 0
  Running firmware: 6.60
  ROM firmware: 6.60
  Physical drives: 21
         connector 1E box 1 bay 22                 HP      MB010000JWAYK                                    JEHJY9WN     HPD5 OK
         connector 1E box 1 bay 23                 HP      MB010000JWAYK                                    JEHJS9RN     HPD5 OK
         connector 1E box 1 bay 24                 HP      MB010000JWAYK                                    JEHHWKUN     HPD5 OK
         connector 1E box 1 bay 25                 HP      MB010000JWAYK                                    JEHJR20N     HPD5 OK
         connector 1E box 1 bay 26                 HP      MB010000JWAYK                                    JEHJ7DSN     HPD5 OK
         connector 1E box 1 bay 27                 HP      MB010000JWAYK                                    JEHHK0BN     HPD5 OK
         connector 1E box 1 bay 28                 HP      MB010000JWAYK                                    JEHJUD1N     HPD5 OK
         connector 1E box 1 bay 29                 HP      MB010000JWAYK                                    JEHJ0NLN     HPD5 OK
         connector 1E box 1 bay 30                 HP      MB010000JWAYK                                    JEHJ7VEN     HPD5 OK
         connector 1E box 1 bay 31                 HP      MB010000JWAYK                                    JEHHZ0VN     HPD5 OK
         connector 1E box 1 bay 32                 HP      MB010000JWAYK                                    JEHJ95KN     HPD5 OK
         connector 1E box 1 bay 33                 HP      MB010000JWAYK                                    JEHJ85EN     HPD5 OK
         connector 1E box 1 bay 34                 HP      MB010000JWAYK                                    JEHJ94YN     HPD5 OK
         connector 1E box 1 bay 35                 HP      MB010000JWAYK                                    JEHJ7DNN     HPD5 OK
         connector 2E box 1 bay 29                 HP      MB010000JWAYK                                    JEHG8E8N     HPD5 OK
         connector 2E box 1 bay 30                 HP      MB010000JWAYK                                    JEJ3A58N     HPD5 OK
         connector 2E box 1 bay 31                 HP      MB010000JWAYK                                    JEJ3NLAN     HPD5 OK
         connector 2E box 1 bay 32                 HP      MB010000JWAYK                                    JEJ4347N     HPD5 OK
         connector 2E box 1 bay 33                 HP      MB010000JWAYK                                    JEJ433NN     HPD5 OK
         connector 2E box 1 bay 34                 HP      MB010000JWAYK                                    JEHK031N     HPD5 OK
         connector 2E box 1 bay 35                 HP      MB010000JWAYK                                    JEHJEBEN     HPD5 OK
/dev/ciss1: (Smart HBA H241) Enclosure D6020 (S/N: 7CE814P34L) on Bus 2, Physical Port 1E status: OK.
/dev/ciss1: (Smart HBA H241) Enclosure D6020 (S/N: 7CE814P34L) on Bus 3, Physical Port 2E status: OK.
/dev/ciss1(Smart HBA H241:0): Non-Volatile Cache status:
                   Cache configured: No
Comment 1 Frank Wall 2020-06-16 11:53:11 UTC
I have approved the patch provided in the other report:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246357
Comment 2 Peter Eriksson 2020-06-16 13:00:58 UTC
Actually I don't think the other patch fixes this particular issue (that not all drives are printed). This is probably due to another issue where it doesn't correctly enumerate all drives if there are "gaps" in the list (like a drive gone bad). It stops at the first "missing" drive.

I'll have a look at patching cciss_vol_status for this problem too. It shouldn't be impossible since the kernel driver does detect them correctly.

(Atleast after some other bugs in the ciss driver has been fixed - it fails to detect more all drives if you have more than 48 drives per controller. But I have a patch and diff that solves that too - https://reviews.freebsd.org/D25155).
Comment 3 Peter Eriksson 2024-01-24 12:25:49 UTC
Created attachment 247922 [details]
Patch to solve numerous issues in cciss_vol_status

This patch solves a number of issues, and cleans up formatting of the output a little bit.

1. Fixes a number of bitwise comparisions that uses "&&" but really should be using "&".

2. Fixes a buffer overrun where the code writes to byte[41] (ie 42) in a 41 byte buffer...

3. Solves the "missing disks" problem - it seems the CISS HBA puts any disks with 4K native sector sizes in the "non-disk" list, even though they work perfectly fine with FreeBSD (when the controller is used as an HBA - they won't work when used as a RAID controller). 

4. Adds a "-D" option which prints a little bit more info than "-V".
Comment 4 Peter Eriksson 2024-01-24 12:27:01 UTC
(The attachment is intended to replace the files/patch-cciss_vol_status.c file in the port)