This directory contains scripts and associated files to show how
SAS-2 zoning might be set up and disabled using the utilities
from this package.

Scripts:
    zoning_ex.sh            - configure zoning
    dis_zoning_ex.sh        - disable zoning
    t10annex_zoning_ex.sh   - configure zoning with permissions as seen
                              in the SAS-2 Annex example (see below)


The zoning_ex.sh script will override any zoning configuration in
place prior to its invocation. The zoning_ex.sh script does not save
any of its new settings to non-volatile storage on the expander. So
when the experimentation is complete, then resetting or power cycling
the expander will restore the previous settings **.

The zoning_ex.sh script is relatively generic with the tailoring to
a set of zone permissions and mapping of expander phys to zone groups
being done by these two files in this directory:
    permf_8i9i.txt  ***
    pconf_2i2t.txt
or, alternatively the permission file and the phy info file can be given
on the script command line (following the expander device node name).
Note that if pconf_2i2t.txt is used then phy ids will most likely need
to be changed depending on what the expanders phys are connected to.
[Suggestion: examine the output of smp_discover closely to determine
which expander phys are connected to what.]

The zone permission table can be read back from the expander with the
REPORT ZONE PERMISSION TABLE function. After zoning was set up on the
author's equipment, the smp_rep_zone_perm_tbl utility was called twice,
the second time with the --nocomma option, and the output placed in
these files:
    rep_permf_8i9i.txt
    rep_nocom_permf_8i9i.txt
Note that the input permission file (i.e. permf_8i9i.txt) was formatted
as if there are only 128 zone groups but the output shows there are
actually 256 zone groups. The expander obviously can cope with this. Also
the smp_rep_zone_perm_tbl utility was called without --multiple so less
than 256 source zone groups are returned. This does not matter since
no zone group above 30 is being used, so all the remaining rows have their
default settings.

The zone phy information settings can also be read back from the expander.
There is no special function for that since the information is available
in a DISCOVER and DISCOVER LIST response. The smp_discover_list utility
has a --zpi=FN option to create a zone phy information file from the
current expander settings. This file is suitable for the
smp_conf_zone_phy_info utility.


The most recent draft of SAS-2 (and later: SPL and SPL-2) at t10.org
contains an annex titled: "Zone permission configuration descriptor
examples". It shows how two descriptors in a CONFIGURE ZONE PERMISSION
TABLE request change the internal zone permission table. One feature
that annex is trying to highlight is that a descriptor not only becomes
a source zone group row in that table, but that its transpose becomes the
corresponding destination zone group column in that table. There is a
reason for highlighting that: not all SAS-2 expanders apply that transpose.

The t10annex_zoning_ex.sh script starts up zoning based on the zone
permission file permf_t10annex.txt. This will send a CONFIGURE ZONE
PERMISSION TABLE request as shown in the annex example. There is an
associated zone phy control file pconf_all10.txt which puts the first 24
expander phys in zone group 10. If the t10annex_zoning_ex.sh script is
successful then the smp_rep_zone_perm_tbl utility can be used to read the
expander zone permission table. The t10annex_zoning_ex.sh script prints
out a copy of the annex table (Table H.4 in my copy) showing the final state
of the zone permission table. A comparison can then be made between this
and what is read back with 'smp_rep_zone_perm_tbl --bits=13 <smp_device>'
command.


**  Just in case the zone permission table or the zone phy information
    is saved, these default files are provided:
      def_permf.txt
      def_pconf.txt

*** The permf_8i9i.txt assumes an expander that does not do the descriptor
    transpose discussed in the t10 annex example above. This should not
    cause a problem on an expander that does perform the descriptor
    transpose.


Doug Gilbert
27th January 2012
