From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by dpdk.org (Postfix) with ESMTP id 827869A81 for ; Fri, 17 Apr 2015 00:10:15 +0200 (CEST) Received: by obbeb7 with SMTP id eb7so54262204obb.3 for ; Thu, 16 Apr 2015 15:10:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=t25dK7JjhzIbYu/DsA+I4vbFLkSjovsgsVygh0QJmfE=; b=yIvsz8Ael3gou41BAkHZ1nbvneSWFJGKFoWfiP9nb8ZrUUZnzQfh70aQ8My/GZXr9V JfIAAeyf4P8id1gkkysYjK4xtTZb9NrYcMcIP6hyRkf2KXO1ooyU1Y6KfLvYvygtLeLE bC1dZaJhbrXwCOUa4x9fpPip+uXLtgb6YIoE5ha60sjhBYiAmG+4Wz/w+MCxn4p2o2iA sELYSYyNsK8L07Pp9rg47Tmk9AQEAIIKSPekkXpcPrtyYZVF3vMvDPzegasb6wL7K6Qv KO/8oeQJ73fK7LXE2tm0Wuis9BMTZahOqgQ3H08oQ+Sr9nMdB8EUmDDpay2gBeNzcam/ Bi7A== MIME-Version: 1.0 X-Received: by 10.202.220.135 with SMTP id t129mr22366258oig.115.1429222215075; Thu, 16 Apr 2015 15:10:15 -0700 (PDT) Received: by 10.202.179.6 with HTTP; Thu, 16 Apr 2015 15:10:15 -0700 (PDT) In-Reply-To: <1994225.GSe2cYm1g2@xps13> References: <1428608301-31033-1-git-send-email-rkerur@gmail.com> <1428608412-31191-1-git-send-email-rkerur@gmail.com> <1428608412-31191-4-git-send-email-rkerur@gmail.com> <1994225.GSe2cYm1g2@xps13> Date: Thu, 16 Apr 2015 15:10:15 -0700 Message-ID: From: Ravi Kerur To: Thomas Monjalon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v5 3/8] Move common functions in eal_lcore.c 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: Thu, 16 Apr 2015 22:10:16 -0000 On Thu, Apr 16, 2015 at 1:39 AM, Thomas Monjalon wrote: > 2015-04-09 12:40, Ravi Kerur: > > Changes in v5 > > Rebase to latest code. > > > > Changes in v4 > > Implement cpu_detected() for BSD. > > Have common RTE_LOG for Linux and BSD in rte_eal_cpu_init(). > > Remove RTE_EXEC_ENV_BSDAPP in common file. > > > > Changes in v3 > > Changed subject to be more explicit on file name inclusion. > > > > Changes in v2 > > None > > > > Changes in v1 > > Move common function in eal_lcore.c to librte_eal/common/ > > eal_common_lcore.c file. > > > > Following function is moved to eal_common_lcore.c file > > > > int rte_eal_cpu_init(void); > > > > Use RTE_EXEC_ENV_BSDAPP to differentiate minor differences in > > common function. > > Makefile changes to reflect new file added. > > Fix checkpatch warnings and errors. > > > > Signed-off-by: Ravi Kerur > [...] > > --- a/lib/librte_eal/bsdapp/eal/eal_lcore.c > > +++ b/lib/librte_eal/bsdapp/eal/eal_lcore.c > [...] > > static int > > -get_ncpus(void) > > +eal_get_ncpus(void) > > Why not keep it static as it seems to be specific to BSD handling? > It is static with the changes, "name" is changed from "get_ncpus" to "eal_get_ncpus". > > > { > > int mib[2] = {CTL_HW, HW_NCPU}; > > int ncpu; > > @@ -59,63 +62,18 @@ get_ncpus(void) > > return ncpu; > > } > [...] > > -unsigned > > -eal_cpu_socket_id(__rte_unused unsigned cpu_id) > > +/* Check if a cpu is present by the presence of the > > + * cpu information for it. > > + */ > > +int > > +eal_cpu_detected(unsigned lcore_id) > > { > > - return cpu_socket_id(cpu_id); > > + const unsigned ncpus = eal_get_ncpus(); > > + return (lcore_id < ncpus); > > } > > > >