From owner-freebsd-scsi@freebsd.org Fri Dec 4 16:23:15 2015 Return-Path: Delivered-To: freebsd-scsi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84AEAA41F93 for ; Fri, 4 Dec 2015 16:23:15 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3AF1289 for ; Fri, 4 Dec 2015 16:23:15 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [192.168.1.4] (c-24-6-178-251.hsd1.ca.comcast.net [24.6.178.251]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Mar 31 2015)) with ESMTPSA id <0NYU0026LDIJW420@mr11p00im-asmtp003.me.com> for freebsd-scsi@freebsd.org; Fri, 04 Dec 2015 16:23:09 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-12-04_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510090000 definitions=main-1512040268 User-Agent: Microsoft-MacOutlook/0.0.0.151105 Date: Fri, 04 Dec 2015 08:23:06 -0800 Subject: Re: Accessing static drive info w/o ATA identify and lockup with camcontrol identify From: Ravi Pokala Sender: "Pokala, Ravi" To: "freebsd-scsi@freebsd.org" Message-id: <80BB5907-CC31-4F06-9C70-E6F7834FF28E@panasas.com> Thread-topic: Accessing static drive info w/o ATA identify and lockup with camcontrol identify MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 16:23:15 -0000 >Date: Fri, 4 Dec 2015 02:13:31 -0700 >From: Kevin Bowling >To: freebsd-scsi@freebsd.org >Subject: Accessing static drive info w/o ATA identify and lockup with > camcontrol identify >Message-ID: > >Content-Type: text/plain; charset=UTF-8 > >... > >#2 This all came about because I want to poll device information like disk >model, serial number, speeds, etc. Common use cases would be configuration >management systems and inventory databases. Issuing an ATA identify seems >a bit much and could trigger unwanted HW errata like above. I'm wondering >if it would be better to cache the data on interface change in sysctls or >something. The data is static, read only, but we need to account for disk >swaps. At least some of it is already available via `geom disk list': [daneel:~] rpokala% geom disk list ada5 Geom name: ada5 Providers: 1. Name: ada5 Mediasize: 2000398934016 (1.8T) Sectorsize: 512 Stripesize: 4096 Stripeoffset: 0 Mode: r1w1e1 descr: WDC WD20EFRX-68EUZN0 lunid: 50014ee20b9f7c0f ident: WD-WCC4M1VN0P7L fwsectors: 63 fwheads: 16 GEOM keeps this data in a "struct disk", which is populated during drive attach. You can see that the drive model ("descr") and serial number ("ident") are already listed by GEOM. "struct disk" also already has a rotation-rate field; if that's what you mean by "speeds", it should be trivial for me to add that to the GEOM output as well. If by "speeds", you're talking about the connection's bus speed (i.e. 3/6/12Gbps), then that's probably more complicated. -Ravi (rpokala@) >Regards, >Kevin