Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Aug 2012 00:31:06 +0000
From:      John <jwd@FreeBSD.org>
To:        FreeBSD SCSI <freebsd-scsi@freebsd.org>
Subject:   camcontrol devlist device name ordering
Message-ID:  <20120831003106.GA70561@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Hi Folks,

   I've been working on a small utility to map devices and enclosures
and generate a small report. Nothing special really.

   However, I've run into a small parsing issue I thought I'd ask
about here.

   When running "camcontrol devlist", the device names are not always
printed out the same. For instance:

<HP EG0600FBLSH HPD2>              at scbus7 target 165 lun 0 (pass24,da21)
<HP EG0600FBLSH HPD2>              at scbus7 target 166 lun 0 (pass25,da22)
<HP EG0600FBLSH HPD2>              at scbus7 target 167 lun 0 (pass26,da23)
<HP EG0600FBLSH HPD2>              at scbus7 target 168 lun 0 (pass27,da24)
<HP D2700 SAS AJ941A 0131>         at scbus7 target 169 lun 0 (ses0,pass28) <---
<HP EG0600FBLSH HPD2>              at scbus7 target 170 lun 0 (pass29,da25)
<HP EG0600FBLSH HPD2>              at scbus7 target 171 lun 0 (pass30,da26)
<HP EG0600FBLSH HPD2>              at scbus7 target 172 lun 0 (pass31,da27)

   In the last column, the disk devices are pass device / disk device. For
the enclosure, it's enclosure device / pass device.

   First I looked at camcontrol, but it is simply looping over the list
as presented. It is not responsible for the ordering. I then started
poking around in sys/cam/scsi/scsi_ses.c and I can see where the device
is allocated, but I'm not sure how the insertion ordering is controlled
for the pass & ses devices.

   Does someone with a bit more knowledge of this area have an idea
where I should look?

   Running 9.1-PRERELEASE Fri Aug 24. 2012

Thanks,
John




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120831003106.GA70561>