AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:
CFG:
PT:0
S:andy.sharp@lsi.com
RQ:
SSV:mhbs.lsil.com
NSV:
SSH:
R:<bill.fisher@lsi.com>,<brian.stark@lsi.com>
MAID:2
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/LSI/INBOX	8210	4AF0D636.2040202@lsi.com
X-Sylpheed-End-Special-Headers: 1
Date: Tue, 3 Nov 2009 20:37:41 -0800
From: Andrew Sharp <andy.sharp@lsi.com>
To: William Fisher <bill.fisher@lsi.com>
Bcc: Brian Stark <brian.stark@lsi.com>
Subject: Re: please review 33334
Message-ID: <20091103203741.54690d66@ripper.onstor.net>
In-Reply-To: <4AF0D636.2040202@lsi.com>
References: <20091022172108.51f46b80@ripper.onstor.net>
 <4AE24B70.5010008@lsi.com>
 <4AF0D636.2040202@lsi.com>
Organization: LSI
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

So, have a look at the comments, I think I fixed them.  If you don't
think so, let me know.

I fixed the mysteriously moved inline function back to where it came
from.

More detailed comments on the rest are below.  I don't want to change
anything else, but as reviewer, you have the power to insist, up to a
point.  Remember, as more and more of these come your way, reviews
become a quid-pro-quo (sp?) kind of thing.  By that I mean you pick
your battles so that you can get what you want in other cases.

Thanks for the good work, it's nice to have you on the team.

a



 On Tue, 3 Nov 2009 18:17:42 -0700 William Fisher
<bill.fisher@lsi.com> wrote:

> William Fisher wrote:
> > Andrew Sharp wrote:
> > 
> >>Hi guys,
> >>
> >>Larry need only look at the makefile changes.
> >>
> >>The tuxstor build doesn't quite work because I need to follow up
> >>this changelist with another one to fix the TUXRX references the
> >>newly created tuxstor files.
> >>
> >>Change 33334 by andys@ripper on 2009/09/14 17:48:04 *pending*
> >>
> >>	Changes for switching to new tuxstor project from old tuxrx
> >>	project.
> >>
> >>	Minor cleanup of linux/Makefile and linux/kernel/Makefile.
> >>
> >>	Add external symbol declarations for small number of symbols
> >>	needed by the acpu module.
> >>
> >>	Clean up comments and some of the macros in mgmtbus driver
> >>	code, plus reorganize some of the code to eliminate large
> >>	ifdef blocks and other infelicities.  Bring the recent
> >>	changes to the code in the dev tree over as well.
> >>
> >>	Move linux/kernel/linux-mips-2.6/arch/mips/onstor/tuxrx
> >>	to ...tuxstor.
> >>
> >>	Micro cleanup of the mgmtbus-aware code in sb1250-mac.c
> >>	(sibyte ethernet driver).
> >>
> >>	reviewed by
> >>
> >>Affected files ...
> >>
> >>... //depot/tuxrx/linux/Makefile#1 edit
> >>... //depot/tuxrx/linux/kernel/Makefile#2 edit
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/.git/logs/HEAD#1 edit
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/.git/logs/refs/heads/onstor-2.6.22#1
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/Kconfig#3
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/Makefile#3
> >>edit
> 
> 	fine.
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/kernel/head.S#2
> >>edit
> 
> 	Fine, convert to CONFIG_LSI_TUXSTOR if you want. All of the
> 	file with those changes are fine.

I would like to keep it ONSTOR_TUXSTOR for sentimental reasons and
because it reflects the product name.

> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/kernel/stacktrace.c#1
> >>edit
> 
> 	Fine, exporting the symbol you need for the stack trace.
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/onstor/Kconfig#3
> >>edit
> 	symbol rename
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/onstor/common/ons_crashdump.c#2
> >>edit
> 
> 	symbol rename.
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/onstor/tuxrx/dbg_io.c#1
> >>delete
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/onstor/tuxrx/setup.c#1
> >>delete ... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/onstor/tuxstor/Makefile#1
> >>branch ... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/onstor/tuxstor/dbg_io.c#1
> >>branch ... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/onstor/tuxstor/prom.c#1
> >>branch ... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/onstor/tuxstor/setup.c#1
> >>branch ... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/onstor/tuxstor/time.c#1
> >>branch
> 
> 	fine.
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/pci/Makefile#2
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/pci/fixup-tuxrx.c#1
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/arch/mips/pci/fixup-tuxstor.c#1
> >>add ... //depot/tuxrx/linux/kernel/linux-mips-2.6/cougar-config#4
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/cougar-debug-config#3
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/drivers/mgmt-bus/Kconfig#1
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/drivers/mgmt-bus/Makefile#1
> >>edit
> 
> 	fine.
> 
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/drivers/mgmt-bus/cougar_mgmt_bus.c#1
> >>edit
> 
> 	The mgmtbus_conver_eee_addr(uint32 port) was moved this file,
> 	but it really isn't cougar specific. It really is the heart of
> 	the indexing scheme for the ring descriptors and probably
> 	should reside in the drivers/mgmt-bus/mgmt-bus.c file
> 	and not in the header file.
> 
> 	The original one is considerably easier to read and understand
> 	and was an inline there. This procedure is critical to
> 	understanding the indexing scheme. The new scheme of
> 	a single defined returns does not explain all the error
> 	cases that can arise. I prefer the original.

fixed

> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/drivers/mgmt-bus/mgmt-bus.c#1
> >>edit
> 
> 	The changes to the net_device mgmtbus_dev for the "features"
>       and tx_queue_len are clearer in the original. The features
> 	flags are critical since you need to know them. They are
> 	now buried under another define somewhere else.

They are most likely critical, I assume they are, but only you need to
know them.  This is actually clearer to the average dog who will
have to maintain this for some finite period, not to mention standard
practice for this kind of multi-platform portable code.

> 	Also the tx_queue_len is also critical to understand the
> 	rings initialization scheme since they can be different
> 	for SSC and TXRX.

Now that it works and is converted, no one needs to, nor wants to
understand it.  It hides the messiness, but not your work that went in
to making it good, working, code.

> 	When I wrote this driver, it took lots of time to
> 	generalize it for both processors, because it was
> 	all SSC specific. The TXRX one was a train-wreck
> 	so I attempted to make it clear the differences
> 	via using specifically named symbols.

I'm definitely aware of all this.  You obviously don't remember, but I
did this minor reorg on your mgmtbus driver back in March and asked
you to look it over then.  Perhaps you didn't, but you told me it was
"fine."

I only have to look at the code to know what you did, and how hard it
was.  If this micro reoganization of the code were to detract from your
hard work or anything you did, then I wouldn't have done it.  Instead,
it amplifies what you did and puts your work to its best use.  It's
just an organizational change, not a functional change.

> 	I understand why you wanted to move the initialization
> 	code, but that code is also critical to understand
> 	the way each side initializes itself. This was very
> 	unclear before and so I moved it front and center
> 	so that people would get the jest of it's importance.

I understand that it might be hard to see someone touch your code, but
don't be a Max*2.  OK, sorry, that was uncalled for.  But relevance and
organizational cleanups should be a constant, you know that.  Try to
remember that you routinely dog the eee code base for never going
through this kind of thing, and it is a mess because of it.   One of
the reasons is those stick-in-the-mudd eee guys couldn't be
professional (and still can't?) about someone touching their precious.
It doesn't mean that your code wasn't good or wasn't right.  It's just
a harmless cleanup. It's building on the good work that you did.

> 	This was the hardest part to debug, not just the array
> 	initialization which is trivial, but the mapping of
> 	the memory and getting the parties to not clobber
> 	each other's slots and seeing the roles.

I dare say it would have been easier if org'd this way, but we old guys
don't always need to make things easier for ourselves.  Re-org'ing it
would have just been makework for you.  You did the heavy lifting.  You
built the building.  Allow the janitor to come along and polish the
windows.

> 	I put lots of debugging here since it was messy
> 	to understand what was broken during the debugging.

No doubt.

> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/drivers/mgmt-bus/mgmt-bus.h#1
> >>edit
> 
> 	The old comment scheme at the end of each line really is
> easier to read IMHO. I prefer the original.

Can you give me slightly more detail?  Line numbers or something?
Wait, I think I see it.  Let me know if this is acceptable.

> 	The movement of the mgmtbus_softc_t structure here is extra.

It should be with the other structure definitions.

> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/drivers/mgmt-bus/rcon.c#1
> >>edit
> 
> 	Comment reformating and printk fixes, ok if you insist.
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/drivers/mgmt-bus/rcon.h#1
> >>edit
> 
> 	The RCON_DEBUG macro movement here is extra. I left it in the
> 	source file just because nobody else cares. Since it is used
> 	in the new tuxrx_mgmbt_bus.c file, I guess that is the
> 	reason you moved it.
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/drivers/mgmt-bus/tuxrx_mgmt_bus.c#1
> >>edit
> 
> 	See above.
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/drivers/net/sb1250-mac.c#2
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/include/asm-mips/bootinfo.h#2
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/include/asm-mips/mach-tuxstor/cpu-feature-overrides.h#1
> >>branch ... //depot/tuxrx/linux/kernel/linux-mips-2.6/include/asm-mips/mach-tuxstor/tuxstor.h#1
> >>branch ... //depot/tuxrx/linux/kernel/linux-mips-2.6/include/linux/onstor/ons_crashdump.h#1
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/include/linux/slab_def.h#1
> >>edit
> 
> 	fine.
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/include/net/sock.h#3
> >>edit
> 
> 	You can revert this back to stock linux. I am doing that in
> 	my changelist. The RPC stuff is now hung off the user_data
> 	pointer in the socket, hence-forth we will be using the
> 	standard linux sock.h header file.

I can't, the build fails.  You'll have to handle it in yours.

> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/kernel/stacktrace.c#1
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/kernel/time.c#1
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/kernel/time/timekeeping.c#1
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/net/Kconfig#3
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/net/Makefile#3
> >>edit ... //depot/tuxrx/linux/kernel/linux-mips-2.6/net/neteee/neteee.c#2
> >>edit
> 
> 	I recommend converting all the  CONFIG_ONSTOR_TUXRX uses to
> 	CONFIG_LSI_TUXSTOR across all of the files. yes, I know this
> 	is busy work but you now have all of the uses open for edit.

It's my job to do the busy work so you don't have to.  That's why I did
this instead of asking you to.  I'd like to keep ONSTOR_TUXSTOR as I
mentioned above.

> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/net/onstor/Kconfig#1
> >>delete ... //depot/tuxrx/linux/kernel/linux-mips-2.6/net/onstor/Makefile#1
> >>edit
> 
> 	Fine.
> 
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/net/onstor/acpu.c#2
> >>edit
> 
> 	Leave in the calls unless it won't link, since they are
> 	not really executed until the global variable is set
> 	via the device driver hack I added. This was the'
> 	work-around for the hang during loading both with
> 	the normal and deferred loading directives in the
> 	code.

This has already been removed from the changelist.

> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/tuxrx-config#2 delete
> >>... //depot/tuxrx/linux/kernel/linux-mips-2.6/tuxrx-debug-config#2
> >>delete ... //depot/tuxrx/linux/kernel/linux-mips-2.6/tuxstor-config#1
> >>branch ... //depot/tuxrx/linux/kernel/linux-mips-2.6/tuxstor-debug-config#1
> >>branch ... //depot/tuxrx/nfx-tree/Makefile.tuxstor#3 edit
> >	
> 	fine.
> 
