AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20061114152650.506c3d91@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<warren.gale@onstor.com>,<tim.gardner@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	BB375AF679D4A34E9CA8DFA650E2B04E0161FAB1@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Tue, 14 Nov 2006 15:27:27 -0800
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Warren Gale" <warren.gale@onstor.com>
Cc: "Tim Gardner" <tim.gardner@onstor.com>
Subject: Re: Who do I get to do a code review?
Message-ID: <20061114152727.4cf108cb@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E0161FAB1@onstor-exch02.onstor.net>
References: <20061113144909.601da026@ripper.onstor.net>
	<BB375AF679D4A34E9CA8DFA650E2B04E0161FAB1@onstor-exch02.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.5.6 (GTK+ 2.8.20; i486-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Warren,

Looks good: a large improvement to readability.  I know it's a bit of a
pain when you're reusing other [crazy] people's code.  Do you think the
extra readability was worth the effort?  I think so, but I'm collecting
other opinions.

Cheers,

a

On Mon, 13 Nov 2006 18:20:28 -0800 "Warren Gale"
<warren.gale@onstor.com> wrote:

> Hi Andy,
>    Ok I got a new file.. 
> Please take a look and let me know.
> I saved a copy of the first file you looked at 
>   (cmd_promupgrade.c.Rev1)
>  In the same directory. (If you want to diff)
> 
> Thanks,
> Warren
> 
> -----Original Message-----
> From: Andrew Sharp [mailto:andy.sharp@onstor.com] 
> Sent: Monday, November 13, 2006 2:49 PM
> To: Warren Gale
> Cc: Tim Gardner
> Subject: Re: Who do I get to do a code review?
> 
> Hi Warren,
> 
> Here is the review:
> 
> All the diffs look fine to me.  The new file looks OK as well except
> one thing and some style nits.  I'm a stickler for style nits, oh
> well.  Plus I don't know anything about this code, so style nits it
> is.
> 
> You mention that you've tested it a few times.  I will take your word
> for it ~:^)  I'd rather not upgrade my proms right about now.
> 
> 
> file: nfx-tree/code/ssc-nfxsh/cmd_promupgrade.c
> 
> It looks like the function install_promupgrade, on line 1133, could be
> implemented with a single `if' statement instead of a `switch'
> statement. However, if there are plans for the other priv_t's, then
> maybe you want to leave it as is.
> 
> <style nits>
> 
> (1) please adopt a consistent comment style.  I think I see at least
> one of every style possible in this file.  I prefer the block style
> covered in our code style wiki page:
> 
> /*
>  * comments are important
>  */
> 
> where the asterisks are lined up vertically.  I also think a simple
> double slash in front of debug code is additionally permissible for
> the ease of the programmer.  Your opinion may differ.
> 
> (2) Run on statements.  Try to observe some kind of wrapping
> philosophy at 80 chars. For example, line 96 looks like this:
> 
>         rc = execute_command (STORAGE_CMD, 5, "control", "port",
> "disable", link_name, NULL);
> 
> but would be more readable if continued like this:
> 
>         rc = execute_command (STORAGE_CMD, 5, "control", "port",
> "disable",
>             link_name, NULL);
> 
> (3) Trailing whitespace.  Please try to eliminate trailing whitespace
> on lines, and whitespace on blank lines.  Thank you.
> 
> </style nits>
> 
> 
> Cheers,
> 
> a
> 
> 
> On Thu, 9 Nov 2006 12:26:11 -0800 "Warren Gale"
> <warren.gale@onstor.com> wrote:
> 
> > Hi Andy,
> >  
> > I am sending you all the info I sent to QE on the new PROM upgrade
> > command in nfxsh.
> >  My  client  : P4CLIENT=warreng-r133work-runtime
> >  This is on my local desktop..  (10.1.1.74)
> > Please call/e-mail me if you need further info.
> > Thanks,
> > Warren
> >
> ========================================================================
> > Hi Ken/All,
> > 
> >  I believe I have what you were looking for.
> > 
> > -add a 'system upgrade prom' command to nfxsh that would:
> > 
> >     -install the images into /usr/local/agile/Images on the flash
> > 
> >     -run the prom upgrade procedure on the system
> > 
> > I have run a number of tests, and all seem to work. (numerous times
> > in a row :-))
> > I'd like to get this to the next step.
> > 
> > I need the code to be reviewed , and tested by someone other that
> > me.
> > 
> > I have included a brief write-up on the new command.
> > 
> > Thanks,
> > Warren
> > 
> > 
> > Files opened:
> > warreng:/home/warreng/work/r133work/nfx-tree 38 % p4 opened
> > //depot/R1_3_3_work/nfx-tree/code/ssc-nfxsh/Makefile#2 - edit
> > default change (text)
> > //depot/R1_3_3_work/nfx-tree/code/ssc-nfxsh/cmd_promupgrade.c#1 -
> > add default change (text)
> > //depot/R1_3_3_work/nfx-tree/code/ssc-nfxsh/menu.c#2 - edit default
> > change (text)
> > //depot/R1_3_3_work/nfx-tree/code/ssc-nfxsh/nfxsh.h#3 - edit default
> > change (text)
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > NFXSH   Prom upgrade command
> > (Bobcat Only)
> > 
> > 
> > Prom NFXSH menu:
> > 
> > bobcat2260 diag> prom
> >   upgrade  Upgrade prom images / prom file images
> > bobcat2260 diag> prom upgrade
> >   files     Upgrade Files    prom image files [LOCATION]
> >   recovery  Upgrade Recovery prom images on All cpu's
> >   standard  Upgrade Standard (Normal) prom images on All cpu's
> > bobcat2260 diag>
> > 
> > Description:
> >  
> > A) PROM upgrade File copied to NAS
> > 		The Prom file is ftp'ed from the upgrade server
> > to /tmp. /tmp is checked to see if there is enough space to hold
> > file.
> > 		The file is unzipped and un-tar'ed  in /tmp.
> > 		This creats 5 files in /tmp
> > 		   r9k.bin
> > 		   r9kfimg.bin
> > 		   sibyte_bc.bin
> > 		   sibfimg_bc.bin
> > 		   version
> > 		/usr/local/agile/Images  directory is checked to see
> > if there is a file with the same name.
> > 		   If there is .. rename the file to [filename].BAK
> > 		Use "install" (with safe mode) command to copy the
> > file from /tmp to
> > 		/usr/local/agile/Images
> > 
> > 
> > Example nfxsh command:
> > bobcat2260 diag> 
> >    prom upgrade files
> > ftp://upgrade:password@10.9.1.62/home/upgrade/PROM-2.0.4-BC.tar.gz
> > 
> > B) Program Proms
> > 		Programming proms will shut down the following:
> > 		   all ports (FC and GigE)
> > 		   txrx1 (alt cpu)
> > 		   fp1   (alt cpu)
> > 		   LUC   (holds LUC in RESET)
> > 		If there are any errors, you will return to nfxsh
> > and a system unstable message is displayed. (See below)
> > 		Sends an event message "system going down due to
> > prom upgrade"
> > 		If everything goes as planned , then the system is
> > shutdown, and re-boots.
> > 
> > Example nfxsh command:
> > bobcat2260 diag> prom upgrade standard
> > 		
> > ======  output to nfxsh =============
> >  Large (Normal) Prom selected. Takes about 2 minuets per device (3
> > devices)
> >  Prom Upgrade: disable all ports
> >  Prom Upgrade: halt alt cpus
> >  Prom Upgrade: program proms
> > Upgrading PROM for slot 1 cpu 0 from
> > /usr/local/agile/Images/sibfimg_bc.bin
> > File sent, started programming...done
> > Upgrading PROM for slot 1 cpu 2 from
> > /usr/local/agile/Images/sibfimg_bc.bin
> > File sent, started programming...done
> > Upgrading PROM for slot 2 cpu 0
> > from /usr/local/agile/Images/r9kfimg.bin File sent, started
> > programming...done Prom Upgrade: System sync, System reboot
> > Connection to 10.1.1.109 closed by remote host.
> > Connection to 10.1.1.109 closed.
> > Miscellaneous: 
> > 
> > Log files are located in
> >  "/var/tmp"
> >    promUpgrade.log
> >    prom_file_upgrade.log
> > 
> > 
> > ============ System unstable Error Message
> > =========================== Error Message on prom program..
> > 
> > bobcat2260 diag> prom upgrade standard
> >  Large (Normal) Prom selected. Takes about 2 minutes per device (3
> > devices)
> >  Prom Upgrade: disable all ports
> >  Prom Upgrade: halt alt cpus
> > Init request status indicates failure: rcon session already in use
> > Couldn't initialize remote console session
> >  Connection to SiByte on card, slot 1, cpu 3 failed
> > 
> > 
> >  [[[[[[[[ WARNING! WARNING! ]]]]]]]]
> >   Error! Failure during upgrade.
> >   System is NOT in a usable state!
> >    System Requires a RE-BOOT!
> > 
> > % Command failure.
> > bobcat2260 diag>
> > 
> > 
> > ----  on console -------------------------
> > Nov  6 16:37:37 bobcat2260 : 0:0:nfxsh:ERROR: Error during PROM
> > upgrade
> > 
> > 
> > 
> > How to do it all:
> > 
> > 1) make proms
> > 2) make prom release tar ball
> > 3) copy tar ball to upgrade server(s)  10.9.1.62(P-Town)
> > 10.2.0.2(Main) 4) get nfxsh and libnfxsh.so   (/usr/local/agile/bin,
> > /usr/local/agile/lib)
> > 5) get files to filer 
> >      ( prom upgrade files
> > ftp://USER:PASSWD@SERVER/home/upgrade/FILENAME )
> > 6) upgrade proms      ( prom upgrade statdard   or   prom upgrade
> > recovery )
> > 
> > 
> > ================
> >   1
> > ================
> > SiByte_target = "TGT=prom.sibyte_bc"
> > rXk_target = "TGT=prom.r9000"
> > tgt_host = "HOST=agile"
> > 
> > 
> > make TGT=prom.r9000 HOST=agile clean-tree
> > make TGT=prom.r9000 HOST=agile export-all
> > make TGT=prom.r9000 HOST=agile
> > 
> > make TGT=prom.sibyte_bc HOST=agile clean-tree
> > make TGT=prom.sibyte_bc HOST=agile export-all
> > make TGT=prom.sibyte_bc HOST=agile
> > 
> > sudo sh ./code/prom-decompress/mkproms.sh
> > 
> > ================
> >   2
> > ================
> > Create a "version"  text file that has the following:
> >  "Bobcat  prom-X.X.X"   Where "X" in version number (2.0.4)
> > cd /tftpboot/newproms
> > 
> > Tar up the required files:
> > warreng:/tftpboot/newproms 43 % sudo tar -zcvf PROM-2.0.4-BC.tar.gz
> > r9k.bin sibyte_bc.bin r9kfimg.bin sibfimg_bc.bin version
> > r9k.bin
> > sibyte_bc.bin
> > r9kfimg.bin
> > sibfimg_bc.bin
> > version
> > 
> > warreng:/tftpboot/newproms 29 % ls -lrt
> > total 13324
> > -rw-r--r--  1 root root  448344 Nov  3 13:49 r9kboot.bin
> > -rw-r--r--  1 root root  481436 Nov  3 13:49 luc3.bin
> > -rw-r--r--  1 root root  145376 Nov  3 13:49 lmux.bin
> > -rw-r--r--  1 root root  524288 Nov  3 13:49 sibyte_bc.bin
> > -rw-r--r--  1 root root  493140 Nov  3 13:49 sibboot_bc.bin
> > -rw-r--r--  1 root root 4194304 Nov  3 13:49 r9kfimg.bin
> > -rw-r--r--  1 root root  524288 Nov  3 13:49 r9k.bin
> > -rw-r--r--  1 root root 4194304 Nov  3 13:49 sibfimg_bc.bin
> > -rw-r--r--  1 root root      16 Nov  3 15:35 version
> > -rw-r--r--  1 root root 2586682 Nov  3 15:36 PROM-2.0.4-BC.tar.gz
> > warreng:/tftpboot/newproms 30 %
> > 
> > ================
> >   3
> > ================
> > Copy the newly created tar ball to upgrade servers.
> > 
> > How ever you want to do that.
> > I did
> > scp -p PROM-2.0.4-BC.tar.gz upgrade:password@10.9.1.62:/home/upgrade
> > 
> > ================
> >   4
> > ================
> > Get nfxsh files on filer:
> > Log on to bobcat, and mount directory.
> > From my work space:
> > bobcat-pl# mount -uw /usr/local/agile
> > 
> > cd /usr/local/agile/bin
> > scp -p
> > 10.1.1.74:/home/warreng/work/r133work/nfx-tree/Build/bc/dbg/bin/nfxsh
> .
> > cd /usr/local/agile/lib
> > scp -p
> >
> 10.1.1.74:/home/warreng/work/r133work/nfx-tree/Build/bc/dbg/lib/libnfxsh
> > .so .
> > 
> > Do A sync
> >  maybe a re-boot
> > 
> > ================
> >   5
> > ================
> > Load the files from the upgrade server
> > 
> > nfxsh
> > bobcat2260 diag> prom upgrade files
> > ftp://upgrade:password@10.9.1.62/home/upgrade/PROM-2.0.4-BC.tar.gz
> > 
> > ================
> >   6
> > ================
> > Program the PROMS
> > 
> > bobcat2260 diag> prom upgrade standard
> > 
> > System will reboot once all PROM's (of type selected) are
> > programmed.
> > 
> > 
> >
> ========================================================================
> > =======
> > 
> > _____________________________________________
> > From: Tim Gardner 
> > Sent: Thursday, November 09, 2006 12:05 PM
> > To: Warren Gale
> > Cc: Andy Sharp
> > Subject: RE: Who do I get to do a code review?
> > 
> > Warren,
> > 
> > Please send the email to Andy Sharp. He will do the code review for
> > you. This is a good way to introduce him to some of the prom code.
> > Send him the name of your P4CLIENT along with the output of a p4
> > opened showing what files you have changed.
> > 
> > Tim
> > 
> > 
> > _____________________________________________
> > From: Warren Gale 
> > Sent: Thursday, November 09, 2006 11:41 AM
> > To: Tim Gardner
> > Subject: Who do I get to do a code review?
> > 
> > Tim,
> >    Sorry to bug you, but .. 
> > I was given the task to make prom upgrades happen from nfxsh.
> > Ok, done. (It even works :-)). I sent an e-mail with a write up on
> > what I did and where the code is and all that.
> > OE wants it in the next patch..  I'm guessing that QE doesn't do
> > code reviews.
> > Help please.
> > Thanks,
> > Warren
