Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

arcmsr(4) - tester(s) needed



As a follow-up to my commit yesterday[*], I've made some changes to the arcmsr(4) driver, to avoid (mis)using some fields in the sensors' data structures. Before I commit these changes, I would appreciate it if someone with the requisite hardware could actually test the attached patch!

[*] http://mail-index.netbsd.org/source-changes/2011/06/04/msg022865.html


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------
Index: arcmsr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/arcmsr.c,v
retrieving revision 1.27
diff -u -p -r1.27 arcmsr.c
--- arcmsr.c    4 Jun 2011 13:25:56 -0000       1.27
+++ arcmsr.c    5 Jun 2011 22:38:53 -0000
@@ -1735,8 +1735,8 @@ arc_create_sensors(void *arg)
                kthread_exit(0);
 
        sc->sc_sme = sysmon_envsys_create();
-       slen = sizeof(envsys_data_t) * sc->sc_nsensors;
-       sc->sc_sensors = kmem_zalloc(slen, KM_SLEEP);
+       slen = sizeof(arc_edata_t) * sc->sc_nsensors;
+       sc->sc_arc_sensors = kmem_zalloc(slen, KM_SLEEP);
 
        /* Attach sensors for volumes and disks */
        for (i = 0; i < bi.bi_novol; i++) {
@@ -1745,44 +1745,47 @@ arc_create_sensors(void *arg)
                if (arc_bio_vol(sc, &bv) != 0)
                        goto bad;
 
-               sc->sc_sensors[count].units = ENVSYS_DRIVE;
-               sc->sc_sensors[count].flags = ENVSYS_FMONSTCHANGED;
+               sc->sc_arc_sensors[count].arc_sensor.units = ENVSYS_DRIVE;
+               sc->sc_arc_sensors[count].arc_sensor.flags =
+                   ENVSYS_FMONSTCHANGED;
 
                /* Skip passthrough volumes */          
                if (bv.bv_level == BIOC_SVOL_PASSTHRU)
                        continue;
 
                if (bv.bv_level == BIOC_SVOL_RAID10)
-                       snprintf(sc->sc_sensors[count].desc,
-                           sizeof(sc->sc_sensors[count].desc),
+                       snprintf(sc->sc_arc_sensors[count].arc_sensor.desc,
+                           sizeof(sc->sc_arc_sensors[count].arc_sensor.desc),
                            "RAID 1+0 volume%d (%s)", i, bv.bv_dev);
                else
-                       snprintf(sc->sc_sensors[count].desc,
-                           sizeof(sc->sc_sensors[count].desc),
+                       snprintf(sc->sc_arc_sensors[count].arc_sensor.desc,
+                           sizeof(sc->sc_arc_sensors[count].arc_sensor.desc),
                            "RAID %d volume%d (%s)", bv.bv_level, i,
                            bv.bv_dev);
 
-               sc->sc_sensors[count].value_max = i;
+               sc->sc_arc_sensors[count].arc_sensor.value_max = i;
 
                if (sysmon_envsys_sensor_attach(sc->sc_sme,
-                   &sc->sc_sensors[count]))
+                   &sc->sc_arc_sensors[count].arc_sensor))
                        goto bad;
 
                count++;
 
                /* Attach disk sensors for this volume */
                for (j = 0; j < bv.bv_nodisk; j++) {
-                       sc->sc_sensors[count].units = ENVSYS_DRIVE;
-                       sc->sc_sensors[count].flags = ENVSYS_FMONSTCHANGED;
+                       sc->sc_arc_sensors[count].arc_sensor.units =
+                           ENVSYS_DRIVE;
+                       sc->sc_arc_sensors[count].arc_sensor.flags =
+                           ENVSYS_FMONSTCHANGED;
 
-                       snprintf(sc->sc_sensors[count].desc,
-                           sizeof(sc->sc_sensors[count].desc),
+                       snprintf(sc->sc_arc_sensors[count].arc_sensor.desc,
+                           sizeof(sc->sc_arc_sensors[count].arc_sensor.desc),
                            "disk%d volume%d (%s)", j, i, bv.bv_dev);
-                       sc->sc_sensors[count].value_max = i;
-                       sc->sc_sensors[count].private = j + 10;
+                       sc->sc_arc_sensors[count].arc_volid = i;
+                       sc->sc_arc_sensors[count].arc_diskid = j + 10;
 
                        if (sysmon_envsys_sensor_attach(sc->sc_sme,
-                           &sc->sc_sensors[count]))
+                           &sc->sc_arc_sensors[count].arc_sensor))
                                goto bad;
 
                        count++;
@@ -1806,10 +1809,10 @@ arc_create_sensors(void *arg)
 
 bad:
        sysmon_envsys_destroy(sc->sc_sme);
-       kmem_free(sc->sc_sensors, slen);
+       kmem_free(sc->sc_arc_sensors, slen);
 
        sc->sc_sme = NULL;
-       sc->sc_sensors = NULL;
+       sc->sc_arc_sensors = NULL;
 
        kthread_exit(0);
 }
@@ -1820,6 +1823,7 @@ arc_refresh_sensors(struct sysmon_envsys
        struct arc_softc        *sc = sme->sme_cookie;
        struct bioc_vol         bv;
        struct bioc_disk        bd;
+       arc_edata_t             *arcdata = (arc_edata_t *)edata;
 
        /* sanity check */
        if (edata->units != ENVSYS_DRIVE)
@@ -1835,10 +1839,10 @@ arc_refresh_sensors(struct sysmon_envsys
        }
 
        /* Current sensor is handling a disk volume member */
-       if (edata->private) {
+       if (arcdata->arc_diskid) {
                memset(&bd, 0, sizeof(bd));
-               bd.bd_volid = edata->value_max;
-               bd.bd_diskid = edata->private - 10;
+               bd.bd_volid = arcdata->arc_volid;
+               bd.bd_diskid = arcdata->arc_diskid - 10;
 
                if (arc_bio_disk_volume(sc, &bd)) {
                        edata->value_cur = ENVSYS_DRIVE_OFFLINE;
Index: arcmsrvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/arcmsrvar.h,v
retrieving revision 1.13
diff -u -p -r1.13 arcmsrvar.h
--- arcmsrvar.h 23 Sep 2008 22:22:41 -0000      1.13
+++ arcmsrvar.h 5 Jun 2011 22:38:53 -0000
@@ -407,6 +407,12 @@ struct arc_fw_sysinfo {
 struct arc_ccb;
 TAILQ_HEAD(arc_ccb_list, arc_ccb);
 
+typedef struct arc_edata {
+       envsys_data_t   arc_sensor;
+       int             arc_diskid;
+       int             arc_volid;
+} arc_edata_t;
+
 struct arc_softc {
        struct scsipi_channel   sc_chan;
        struct scsipi_adapter   sc_adapter;
@@ -434,7 +440,7 @@ struct arc_softc {
        krwlock_t               sc_rwlock;
 
        struct sysmon_envsys    *sc_sme;
-       envsys_data_t           *sc_sensors;
+       arc_edata_t             *sc_arc_sensors;
        int                     sc_nsensors;
 
        size_t                  sc_maxraidset;  /* max raid sets */


Home | Main Index | Thread Index | Old Index