Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 1997 22:56:57 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        FreeBSD-SCSI@FreeBSD.ORG, Shimon@i-Connect.Net
Subject:   Re: Phoenix... SCSI Devices Minor Mapping
Message-ID:  <199708031256.WAA16206@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I am dealing with systems with very large databases, some systems will
>have up to 8 DPT controllers, 4 busses per controller, 15 SCSI hubs per 
>bus, 7 devices per hub.  This gives us well over 3,000 drives.  We need
>...
>Proposal A:
>
>Divide the minor number as follows:
>
>  f   e   d   c   b   a   9   8   7   6   5   4   3   2   1   0
>+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
>| c | c | c | c | b | b | b | b | l | l | l | l | t | t | t | t |
>+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
>
>Where t = Target ID
>      l = Logigal Unit number
>      b = Bus number
>      c = Controller number
>...
>Similar to Proposal A but with complete renaming and the following bitmap:
>
>  f   e   d   c   b   a   9   8   7   6   5   4   3   2   1   0
>+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
>| b | b | b | b | t | t | t | t | t | t | t | t | l | l | l | l |
>+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
>
>  1f  1e  1d  1c  1b  1a  19  18  17  16  15  14  13  12  11  10
>+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
>| - | - | - | - | - | - | - | - | - | - | - | - | c | c | c | c |
>+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
>
>Where t = Target ID
>      l = Logigal Unit number
>      b = Bus number
>      c = Controller number
>      - = Reserved

Minor numbers are 24 bits (discontiguous), and we already have too
many not-quite-right numbering schemes.  The two uniform && used
ones are:

Boot-style device number (see <sys/reboot.h>):

  f   e   d   c   b   a   9   8   7   6   5   4   3   2   1   0
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| p | p | p | p | p | p | p | p | M | M | M | M | M | M | M | M |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

  1f  1e  1d  1c  1b  1a  19  18  17  16  15  14  13  12  11  10
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| g | g | g | g | a | a | a | a | c | c | c | c | u | u | u | u |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

Where M = Major number
      p = Partition number (should also contain Slice number)
      u = Unit number (map this to `t'?)
      c = Controller number
      a = Adaptor number ("uba, mba, etc") (map this to to `b'?)
      g = Magic number (4 bits - very wasteful; map this to 'l'?)

There are not enough minor bits, since another bit or two is required
to select the encoding scheme.

Normal disk device number (see <sys/disklabel.h>):

  f   e   d   c   b   a   9   8   7   6   5   4   3   2   1   0
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| M | M | M | M | M | M | M | M | u | u | u | u | u | p | p | p |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

  1f  1e  1d  1c  1b  1a  19  18  17  16  15  14  13  12  11  10
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| t | t | t | t | t | t | t | u | u | u | u | s | s | s | s | s |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

Where p = Partition number
      u = Unit number
      M = Major number
      s = Slice number
      t = Type (driver-specific, but not suitable for drive/controller
          select.  Used mainly by SCSI driver to select encoding of
          other bits.  Used by my version of the floppy driver for the
          floppy type).

There are not nearly enough unit bits for you.  This is easy enough to
handle inside the kernel by making the encoding depend on the driver,
but not so easy to handle in config(8) or MAKEDEV.

Bruce



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