From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 10/10] eal: add option --master-lcore Date: Tue, 25 Nov 2014 13:45:22 +0100 Message-ID: <4906267.1tRnJm3qQV@xps13> References: <1416692622-28886-1-git-send-email-thomas.monjalon@6wind.com> <1416692622-28886-11-git-send-email-thomas.monjalon@6wind.com> <54744756.4010207@neclab.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Simon Kuenzer Return-path: In-Reply-To: <54744756.4010207-kcmmt4fgdiuHXe+LvDLADg@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi Simon, 2014-11-25 10:09, Simon Kuenzer: > thanks for your work. I have one (minor) comment for this patch that > should be fixed in a later version. > > + /* default master lcore is the first one */ > > + if (cfg->master_lcore == 0) > > + cfg->master_lcore = rte_get_next_lcore(-1, 0, 0); > > + > > Might be confusing if a user specifies --master-lcore 0 and uses a > coremask/corelist where core id 0 is not specified. Yes, in this corner case, master-lcore will be adjusted instead of having an error. > What about setting cfg->master_lcore to (RTE_MAX_LCORE + 1) on > initialization in order to distinguish if a master_lcore got specified > by the user or not? Even simpler, I can fix it by introducing a flag master_lcore_parsed and do the adjustment only if the option is not parsed. -- Thomas