From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id EB70E7DFF for ; Fri, 26 Dec 2014 15:40:07 +0100 (CET) Received: from [2001:470:8:a08:215:ff:fecc:4872] (helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1Y4W3g-0004tu-QH; Fri, 26 Dec 2014 09:40:06 -0500 Date: Fri, 26 Dec 2014 09:40:00 -0500 From: Neil Horman To: Ravi Kerur Message-ID: <20141226144000.GC5567@localhost.localdomain> References: <1419521597-31978-1-git-send-email-rkerur@gmail.com> <1419521597-31978-3-git-send-email-rkerur@gmail.com> <20141225173041.GD3199@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 2/7] Move EAL common functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Dec 2014 14:40:08 -0000 On Thu, Dec 25, 2014 at 11:23:12AM -0800, Ravi Kerur wrote: > Thanks Neil for reviews. Inline > > On Thu, Dec 25, 2014 at 9:30 AM, Neil Horman wrote: > > > On Thu, Dec 25, 2014 at 10:33:12AM -0500, Ravi Kerur wrote: > > > eal_debug.c has no difference between Linux and BSD, move > > > into common directory. > > > Rename eal_debug.c to eal_common_debug.c > > > Makefile changes to reflect file move and name change. > > > Fix checkpatch warnings. > > > > > > Signed-off-by: Ravi Kerur > > > + > > > +/* not implemented in this environment */ > > > +void rte_dump_registers(void) > > > +{ > > > +} > > Clearly this function has no use, instead of keeping it around, can you > > please > > remove it until someone works up the gumption to make it do something. > > We're > > just wasting an extra call instruction here so someone doesn't have to > > write a > > prototype in the future. I don't see the value. > > > > This is existing code, I just removed "return" statement as per > checkpatch. Should I make it "inline" and add a comment indicating to > revisit whether to make it inline/no inline when the function is > implemented? > I understand its existing code, I'm saying that, while you're moving it around, clean it up. Don't make it inline, just remove it, since it does nothing. If you feel its important to keep around, I suppose you can make it inline, but I don't really think its needed at all. Neil > > > > > +/* > > > + * Like rte_panic this terminates the application. However, no > > traceback is > > > + * provided and no core-dump is generated. > > > + */ > > > +void > > > +rte_exit(int exit_code, const char *format, ...) > > > +{ > > > + va_list ap; > > > + > > > + /* disable history */ > > > + rte_log_set_history(0); > > > + > > > + if (exit_code != 0) > > > + RTE_LOG(CRIT, EAL, "Error - exiting with code: %d\n" > > > + " Cause: ", exit_code); > > > + > > > + va_start(ap, format); > > > + rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap); > > > + va_end(ap); > > > + > > > +#ifndef RTE_EAL_ALWAYS_PANIC_ON_ERROR > > > + exit(exit_code); > > > +#else > > > + rte_dump_stack(); > > > + rte_dump_registers(); > > > + abort(); > > > +#endif > > This doesn't match with the commentary above. If rte_exit isn't meant to > > provide a traceback, it shouldn't do so. If an application wants that to > > happen, then they need to use rte_panic. > > > > This is again existing code. I can change the comment which matches > the function, will it work?