kern/151564: [ciss] ciss(4) should increase CISS_MAX_LOGICAL to 107

Matthew X. Economou xenophon at irtnog.org
Wed Feb 13 14:11:22 UTC 2013


Sean,

After I applied your patch to FreeBSD 9.1, the server locks up during
boot.  I'm working on attaching a serial console in order to capture the
boot log.

Best wishes,
Matthew

-- 
I FIGHT FOR THE USERS


> -----Original Message-----
> From: owner-freebsd-scsi at freebsd.org [mailto:owner-freebsd-
> scsi at freebsd.org] On Behalf Of Sean Bruno
> Sent: Friday, January 11, 2013 8:20 PM
> To: freebsd-scsi at FreeBSD.org
> Subject: Re: kern/151564: [ciss] ciss(4) should increase
> CISS_MAX_LOGICAL to 107
> 
> The following reply was made to PR kern/151564; it has been noted by
> GNATS.
> 
> From: Sean Bruno <seanbru at yahoo-inc.com>
> To: bug-followup at FreeBSD.org, leon.kos at lecad.fs.uni-lj.si
> Cc: peter <peter at FreeBSD.org>
> Subject: Re: kern/151564: [ciss] ciss(4) should increase
> CISS_MAX_LOGICAL
>  to 107
> Date: Fri, 11 Jan 2013 17:17:51 -0800
> 
>  --=-VU6ICzSz8eqrj1bn7pu+
>  Content-Type: text/plain; charset="UTF-8"
>  Content-Transfer-Encoding: 7bit
> 
>  ok, fixed on the 6i and older with the attached patch.  Try this one
>  instead, basically I had a typo in a variable name and I was making
core
>  logic decisions in boot_verbose code.  :-)
> 
>  this also means, I'm probably going to revert svn r242089 as it might
>  not be the right thing to do, but impossible to hit on older
>  controllers.
> 
>  ciss0: <HP Smart Array 6i> port 0x4000-0x40ff mem
>  0xfdff0000-0xfdff1fff,0xfdf80000-0xfdfbffff irq 51 at device 3.0 on
pci4
>  ciss0: PERFORMANT Transport
>  ciss0: got 0 MSI messages]
>  ioapic2: routing intpin 3 (PCI IRQ 51) to lapic 0 vector 52
>  ciss0: using 1024 of 1024 available commands
>  ciss0:   1 logical drive configured
>  ciss0:   firmware 2.26
>  ciss0:   2 SCSI channels
>  ciss0:   signature 'CISS'
>  ciss0:   valence 1
>  ciss0:   supported I/O methods 0x80000006<simple,performant>
>  ciss0:   active I/O method 0x5<performant>
>  ciss0:   4G page base 0x00000000
>  ciss0:   interrupt coalesce delay 0us
>  ciss0:   interrupt coalesce count 16
>  ciss0:   max outstanding commands 1024
>  ciss0:   bus types 0x2<ultra3>
>  ciss0:   server name ''
>  ciss0:   heartbeat 0x1000008d
>  ciss0:   max logical logical volumes: 63
>  ciss0:   max physical disks supported: 1024
>  ciss0:   max physical disks per logical volume: 0
>  ciss0: 7 physical devices
>  ciss0: 1 logical drive
>  ciss0: logical drive (b0t0): RAID 1(1+0), 103936MB online
> 
> 
>  --=-VU6ICzSz8eqrj1bn7pu+
>  Content-Disposition: attachment;
> filename="ciss_probe_logical_physical.diff"
>  Content-Type: text/x-patch; name="ciss_probe_logical_physical.diff";
> charset="UTF-8"
>  Content-Transfer-Encoding: 7bit
> 
>  --- //depot/yahoo/ybsd_9/src/sys/dev/ciss/ciss.c	2012-03-17
> 00:14:40.000000000 0000
>  +++ /home/seanbru/ybsd_9/sys/dev/ciss/ciss.c	2012-03-17
> 00:14:40.000000000 0000
>  @@ -1202,13 +1202,21 @@
>       /* XXX only really required for old 5300 adapters? */
>       sc->ciss_flags |= CISS_FLAG_BMIC_ABORT;
> 
>  +    /*
>  +     * Earlier controller specs do not contain these config
>  +     * entries, so assume that a 0 means its old and assign
>  +     * these values to the defaults that were established
>  +     * when this driver was developed for them
>  +     */
>  +    if (sc->ciss_cfg->max_logical_supported == 0)
>  +        sc->ciss_cfg->max_logical_supported = CISS_MAX_LOGICAL;
>  +    if (sc->ciss_cfg->max_physical_supported == 0)
>  +	sc->ciss_cfg->max_physical_supported =
> CISS_MAX_PHYSICAL;
>       /* print information */
>       if (bootverbose) {
>  -#if 0	/* XXX proxy volumes??? */
>   	ciss_printf(sc, "  %d logical drive%s configured\n",
>   		    sc->ciss_id->configured_logical_drives,
>   		    (sc->ciss_id->configured_logical_drives == 1) ? "" :
> "s");
>  -#endif
>   	ciss_printf(sc, "  firmware %4.4s\n", sc->ciss_id-
> >running_firmware_revision);
>   	ciss_printf(sc, "  %d SCSI channels\n", sc->ciss_id-
> >scsi_bus_count);
> 
>  @@ -1231,6 +1239,9 @@
>   		    "\20\1ultra2\2ultra3\10fibre1\11fibre2\n");
>   	ciss_printf(sc, "  server name '%.16s'\n", sc->ciss_cfg-
> >server_name);
>   	ciss_printf(sc, "  heartbeat 0x%x\n", sc->ciss_cfg->heartbeat);
>  +    	ciss_printf(sc, "  max logical logical volumes: %d\n",
sc-
> >ciss_cfg->max_logical_supported);
>  +    	ciss_printf(sc, "  max physical disks supported: %d\n",
sc-
> >ciss_cfg->max_physical_supported);
>  +    	ciss_printf(sc, "  max physical disks per logical
volume: %d\n",
> sc->ciss_cfg->max_physical_per_logical);
>       }
> 
>   out:
>  @@ -1318,7 +1329,7 @@
>   	break;
>       case CISS_CMD_STATUS_DATA_OVERRUN:
>   	ciss_printf(sc, "WARNING: more units than driver limit
> (%d)\n",
>  -		    CISS_MAX_LOGICAL);
>  +		    sc->ciss_cfg->max_logical_supported);
>   	break;
>       default:
>   	ciss_printf(sc, "error detecting logical drive configuration
> (%s)\n",
>  @@ -1352,7 +1363,7 @@
>       debug_called(1);
> 
>       cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS,
>  -			   CISS_MAX_LOGICAL);
>  +			   sc->ciss_cfg->max_logical_supported);
>       if (cll == NULL) {
>   	error = ENXIO;
>   	goto out;
>  @@ -1360,9 +1371,9 @@
> 
>       /* sanity-check reply */
>       ndrives = (ntohl(cll->list_size) / sizeof(union
ciss_device_address));
>  -    if ((ndrives < 0) || (ndrives > CISS_MAX_LOGICAL)) {
>  +    if ((ndrives < 0) || (ndrives > sc->ciss_cfg-
> >max_logical_supported)) {
>   	ciss_printf(sc, "adapter claims to report absurd number of
> logical drives (%d > %d)\n",
>  -		    ndrives, CISS_MAX_LOGICAL);
>  +	    	ndrives, sc->ciss_cfg->max_logical_supported);
>   	error = ENXIO;
>   	goto out;
>       }
>  @@ -1385,19 +1396,20 @@
> 
>       for (i = 0; i <= sc->ciss_max_logical_bus; i++) {
>   	sc->ciss_logical[i] =
>  -	    malloc(CISS_MAX_LOGICAL * sizeof(struct ciss_ldrive),
>  +	    malloc(sc->ciss_cfg->max_logical_supported *
>  +		   sizeof(struct ciss_ldrive),
>   		   CISS_MALLOC_CLASS, M_NOWAIT | M_ZERO);
>   	if (sc->ciss_logical[i] == NULL) {
>   	    error = ENXIO;
>   	    goto out;
>   	}
> 
>  -	for (j = 0; j < CISS_MAX_LOGICAL; j++)
>  +	for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++)
>   	    sc->ciss_logical[i][j].cl_status = CISS_LD_NONEXISTENT;
>       }
> 
> 
>  -    for (i = 0; i < CISS_MAX_LOGICAL; i++) {
>  +    for (i = 0; i < sc->ciss_cfg->max_logical_supported; i++) {
>   	if (i < ndrives) {
>   	    struct ciss_ldrive	*ld;
>   	    int			bus, target;
>  @@ -1439,7 +1451,7 @@
>       target = 0;
> 
>       cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_PHYSICAL_LUNS,
>  -			   CISS_MAX_PHYSICAL);
>  +			   sc->ciss_cfg->max_physical_supported);
>       if (cll == NULL) {
>   	error = ENXIO;
>   	goto out;
>  @@ -1982,7 +1994,7 @@
>   	bus_dma_tag_destroy(sc->ciss_parent_dmat);
>       if (sc->ciss_logical) {
>   	for (i = 0; i <= sc->ciss_max_logical_bus; i++) {
>  -	    for (j = 0; j < CISS_MAX_LOGICAL; j++) {
>  +	    for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) {
>   		if (sc->ciss_logical[i][j].cl_ldrive)
>   		    free(sc->ciss_logical[i][j].cl_ldrive,
> CISS_MALLOC_CLASS);
>   		if (sc->ciss_logical[i][j].cl_lstatus)
>  @@ -2965,9 +2977,9 @@
>   	cpi->hba_inquiry = PI_TAG_ABLE;	/* XXX is this correct?
> */
>   	cpi->target_sprt = 0;
>   	cpi->hba_misc = 0;
>  -	cpi->max_target = CISS_MAX_LOGICAL;
>  +	cpi->max_target = sc->ciss_cfg->max_logical_supported;
>   	cpi->max_lun = 0;		/* 'logical drive' channel only
*/
>  -	cpi->initiator_id = CISS_MAX_LOGICAL;
>  +	cpi->initiator_id = sc->ciss_cfg->max_logical_supported;
>   	strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
>           strncpy(cpi->hba_vid, "msmith at freebsd.org", HBA_IDLEN);
>           strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
>  @@ -3878,7 +3890,7 @@
>        * drive address.
>        */
>       cll = ciss_report_luns(sc, CISS_OPCODE_REPORT_LOGICAL_LUNS,
>  -                           CISS_MAX_LOGICAL);
>  +                           sc->ciss_cfg->max_logical_supported);
>       if (cll == NULL)
>           return;
> 
>  @@ -3889,7 +3901,7 @@
>        * firmware.
>        */
>       for (i = 0; i < sc->ciss_max_logical_bus; i++) {
>  -	for (j = 0; j < CISS_MAX_LOGICAL; j++) {
>  +	for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) {
>   	    ld = &sc->ciss_logical[i][j];
> 
>   	    if (ld->cl_update == 0)
>  @@ -4058,7 +4070,7 @@
>   	     * Rescan the physical lun list for new items
>   	     */
>   	    cll = ciss_report_luns(sc,
> CISS_OPCODE_REPORT_PHYSICAL_LUNS,
>  -				   CISS_MAX_PHYSICAL);
>  +				   sc->ciss_cfg-
> >max_physical_supported);
>   	    if (cll == NULL) {
>   		ciss_printf(sc, "Warning, cannot get physical lun
> list\n");
>   		break;
>  @@ -4306,7 +4318,7 @@
> 
> 	"\20\1notify_ok\2control_open\3aborting\4running\21fake_s
> ynch\22bmic_abort\n");
> 
>       for (i = 0; i < sc->ciss_max_logical_bus; i++) {
>  -	for (j = 0; j < CISS_MAX_LOGICAL; j++) {
>  +	for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) {
>   	    ciss_printf(sc, "LOGICAL DRIVE %d:  ", i);
>   	    ciss_print_ldrive(sc, &sc->ciss_logical[i][j]);
>   	}
>  --- //depot/yahoo/ybsd_9/src/sys/dev/ciss/cissreg.h	2011-11-02
> 23:46:55.000000000 0000
>  +++ /home/seanbru/ybsd_9/sys/dev/ciss/cissreg.h	2011-11-02
> 23:46:55.000000000 0000
>  @@ -425,6 +425,15 @@
>   #define CISS_DRIVER_DAUGHTER_ATTACHED		(1<<8)
>   #define CISS_DRIVER_SCSI_PREFETCH		(1<<9)
>       u_int32_t	max_sg_length;		/* 31 in older firmware
> */
>  +/*
>  + * these fields appear in OpenCISS Spec 1.06
>  + * http://cciss.sourceforge.net/#docs
>  + */
>  +    u_int32_t	max_logical_supported;
>  +    u_int32_t	max_physical_supported;
>  +    u_int32_t	max_physical_per_logical;
>  +    u_int32_t	max_perfomant_mode_cmds;
>  +    u_int32_t	max_block_fetch_count;
>   } __packed;
> 
>   /*
> 
>  --=-VU6ICzSz8eqrj1bn7pu+--
> 
> _______________________________________________
> freebsd-scsi at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-scsi
> To unsubscribe, send any mail to "freebsd-scsi-
> unsubscribe at freebsd.org"


More information about the freebsd-scsi mailing list