X-MimeOLE: Produced By Microsoft Exchange V6.5
Received: by onstor-exch02.onstor.net 
	id <01C70849.7D43469D@onstor-exch02.onstor.net>; Tue, 14 Nov 2006 16:03:33 -0800
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-class: urn:content-classes:message
Subject: RE: Who do I get to do a code review?
Date: Tue, 14 Nov 2006 16:03:33 -0800
Message-ID: <BB375AF679D4A34E9CA8DFA650E2B04E01620028@onstor-exch02.onstor.net>
In-Reply-To: <20061114152727.4cf108cb@ripper.onstor.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Who do I get to do a code review?
thread-index: AccIRI1vd5nO7/l5SXOPdZwxSQMF3wABIzsw
From: "Warren Gale" <warren.gale@onstor.com>
To: "Andy Sharp" <andy.sharp@onstor.com>
Cc: "Tim Gardner" <tim.gardner@onstor.com>

Yea, I think so too. It may be a pain, but worth it.=20
Thanks again.
Warren

-----Original Message-----
From: Andrew Sharp [mailto:andy.sharp@onstor.com]=20
Sent: Tuesday, November 14, 2006 3:27 PM
To: Warren Gale
Cc: Tim Gardner
Subject: Re: Who do I get to do a code review?

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..=20
> Please take a look and let me know.
> I saved a copy of the first file you looked at=20
>   (cmd_promupgrade.c.Rev1)
>  In the same directory. (If you want to diff)
>=20
> Thanks,
> Warren
>=20
> -----Original Message-----
> From: Andrew Sharp [mailto:andy.sharp@onstor.com]=20
> 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?
>=20
> Hi Warren,
>=20
> Here is the review:
>=20
> 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.
>=20
> 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.
>=20
>=20
> file: nfx-tree/code/ssc-nfxsh/cmd_promupgrade.c
>=20
> 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.
>=20
> <style nits>
>=20
> (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:
>=20
> /*
>  * comments are important
>  */
>=20
> 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.
>=20
> (2) Run on statements.  Try to observe some kind of wrapping
> philosophy at 80 chars. For example, line 96 looks like this:
>=20
>         rc =3D execute_command (STORAGE_CMD, 5, "control", "port",
> "disable", link_name, NULL);
>=20
> but would be more readable if continued like this:
>=20
>         rc =3D execute_command (STORAGE_CMD, 5, "control", "port",
> "disable",
>             link_name, NULL);
>=20
> (3) Trailing whitespace.  Please try to eliminate trailing whitespace
> on lines, and whitespace on blank lines.  Thank you.
>=20
> </style nits>
>=20
>=20
> Cheers,
>=20
> a
>=20
>=20
> On Thu, 9 Nov 2006 12:26:11 -0800 "Warren Gale"
> <warren.gale@onstor.com> wrote:
>=20
> > Hi Andy,
> > =20
> > I am sending you all the info I sent to QE on the new PROM upgrade
> > command in nfxsh.
> >  My  client  : P4CLIENT=3Dwarreng-r133work-runtime
> >  This is on my local desktop..  (10.1.1.74)
> > Please call/e-mail me if you need further info.
> > Thanks,
> > Warren
> >
>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > Hi Ken/All,
> >=20
> >  I believe I have what you were looking for.
> >=20
> > -add a 'system upgrade prom' command to nfxsh that would:
> >=20
> >     -install the images into /usr/local/agile/Images on the flash
> >=20
> >     -run the prom upgrade procedure on the system
> >=20
> > 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.
> >=20
> > I need the code to be reviewed , and tested by someone other that
> > me.
> >=20
> > I have included a brief write-up on the new command.
> >=20
> > Thanks,
> > Warren
> >=20
> >=20
> > 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)
> >=20
> >=20
> >=20
> >=20
> >=20
> >=20
> >=20
> >=20
> >=20
> >=20
> > NFXSH   Prom upgrade command
> > (Bobcat Only)
> >=20
> >=20
> > Prom NFXSH menu:
> >=20
> > 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>
> >=20
> > Description:
> > =20
> > 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
> >=20
> >=20
> > Example nfxsh command:
> > bobcat2260 diag>=20
> >    prom upgrade files
> > ftp://upgrade:password@10.9.1.62/home/upgrade/PROM-2.0.4-BC.tar.gz
> >=20
> > 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.
> >=20
> > Example nfxsh command:
> > bobcat2260 diag> prom upgrade standard
> > 	=09
> > =3D=3D=3D=3D=3D=3D  output to nfxsh =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >  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:=20
> >=20
> > Log files are located in
> >  "/var/tmp"
> >    promUpgrade.log
> >    prom_file_upgrade.log
> >=20
> >=20
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D System unstable Error Message
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D Error Message on prom program..
> >=20
> > 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
> >=20
> >=20
> >  [[[[[[[[ WARNING! WARNING! ]]]]]]]]
> >   Error! Failure during upgrade.
> >   System is NOT in a usable state!
> >    System Requires a RE-BOOT!
> >=20
> > % Command failure.
> > bobcat2260 diag>
> >=20
> >=20
> > ----  on console -------------------------
> > Nov  6 16:37:37 bobcat2260 : 0:0:nfxsh:ERROR: Error during PROM
> > upgrade
> >=20
> >=20
> >=20
> > How to do it all:
> >=20
> > 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=20
> >      ( prom upgrade files
> > ftp://USER:PASSWD@SERVER/home/upgrade/FILENAME )
> > 6) upgrade proms      ( prom upgrade statdard   or   prom upgrade
> > recovery )
> >=20
> >=20
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >   1
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > SiByte_target =3D "TGT=3Dprom.sibyte_bc"
> > rXk_target =3D "TGT=3Dprom.r9000"
> > tgt_host =3D "HOST=3Dagile"
> >=20
> >=20
> > make TGT=3Dprom.r9000 HOST=3Dagile clean-tree
> > make TGT=3Dprom.r9000 HOST=3Dagile export-all
> > make TGT=3Dprom.r9000 HOST=3Dagile
> >=20
> > make TGT=3Dprom.sibyte_bc HOST=3Dagile clean-tree
> > make TGT=3Dprom.sibyte_bc HOST=3Dagile export-all
> > make TGT=3Dprom.sibyte_bc HOST=3Dagile
> >=20
> > sudo sh ./code/prom-decompress/mkproms.sh
> >=20
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >   2
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > 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
> >=20
> > 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
> >=20
> > 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 %
> >=20
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >   3
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > Copy the newly created tar ball to upgrade servers.
> >=20
> > 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
> >=20
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >   4
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > Get nfxsh files on filer:
> > Log on to bobcat, and mount directory.
> > From my work space:
> > bobcat-pl# mount -uw /usr/local/agile
> >=20
> > 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 .
> >=20
> > Do A sync
> >  maybe a re-boot
> >=20
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >   5
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > Load the files from the upgrade server
> >=20
> > nfxsh
> > bobcat2260 diag> prom upgrade files
> > ftp://upgrade:password@10.9.1.62/home/upgrade/PROM-2.0.4-BC.tar.gz
> >=20
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >   6
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > Program the PROMS
> >=20
> > bobcat2260 diag> prom upgrade standard
> >=20
> > System will reboot once all PROM's (of type selected) are
> > programmed.
> >=20
> >=20
> >
>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > =3D=3D=3D=3D=3D=3D=3D
> >=20
> > _____________________________________________
> > From: Tim Gardner=20
> > 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?
> >=20
> > Warren,
> >=20
> > 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.
> >=20
> > Tim
> >=20
> >=20
> > _____________________________________________
> > From: Warren Gale=20
> > Sent: Thursday, November 09, 2006 11:41 AM
> > To: Tim Gardner
> > Subject: Who do I get to do a code review?
> >=20
> > Tim,
> >    Sorry to bug you, but ..=20
> > 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
