Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Oct 1999 17:42:17 -0400
From:      Simon Shapiro as Himself <shimon@simon-shapiro.org>
To:        arch@freebsd.org
Subject:   Minor Device numbers
Message-ID:  <37FA70B9.B5DBA345@simon-shapiro.org>

next in thread | raw e-mail | index | archive | help
Hope this is the correct forum.  If not let me know.

Am struggling with mapping device numbers to IOPs in i2o;

* There can be any number of I/O Processors (IOPs) in a 
  system.  Think of an IOP as a device driver, NOT as a
  controller, nor as a device.  IOPs have device drivers
  running on them which control devices.

* Each IOP can have any number of devices attached to it.

*  Each IOP can have any type of device attached to it.
   It is a bit like SCSI in this sense.

*  Part of the boot process is to inquire each IOP of 
   their devices and then tell each IOP which devices 
   all the IOPs have (IOPs talk to each other,
   without O/S intervention).

This leads me to a structure where I have a list of IOPs, 
in which each IOP has an array of devices.  I cannot have
a list of devices, as the i2o standard specifies an array
with a header.  The array can be redefined at any time so
that dvices can come and go (as far as IOPs are concerned),
How the O/S deals with an vaporized or materialized
device is outside the spec.

Now is my problem.  When I get (in open, close, strategy,
etc.) a dev_t argument, I want to quickly extract the
IOP number from it.  In other words, the device number
must be unique across IOPs and somehow contain the IOP
identity.

Problem is that according to disklabel.h (which presumably
covers ``only disks'', there are only 9 bits for unit''
(512 unique unit numbers).  ANy which way I slice it, 
this is not enough.  Assume a system with 4 DPT PM2755F
IOPs, each with 2 fiber channels.  This is a total of 
8 channels, or over a thousand devices. 
In reality there would not be as many devices on most
systems, but assume 4 IOPs for disks, 2 for Networking,
and 2 more for something else (video, whatever.).  This
gives me 8 IOPS, which means 3 bits for IOP number, and
6 bits for device or no more than 64 devices per IOP.
Not enough.  4xPIII-600 can do lots of useful stuff on
100 drives.  They may NEED hundreds of drives to max the
CPUs.

I am open to any polite suggestion, but my inclination
is to recommend 32bit major devices where the lower
8 bits do exactly what they do today, and the upper 
24 are as per driver.  The problem with that is that
the major number is stuck in the middle of the minor.
Actually was the upper byte on the PDP-11 :-).
To solve that one would need either separate arguments,
or turn dev_t to a 64bit integer.

-- 


Sincerely Yours,                 Shimon@Simon-Shapiro.ORG
                                             404.644.6401
Simon Shapiro

Unwritten code has no bugs and executes at twice the speed of mouth




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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