From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by dpdk.org (Postfix) with ESMTP id 8443F9A8A for ; Thu, 16 Apr 2015 10:40:11 +0200 (CEST) Received: by wiun10 with SMTP id n10so88383851wiu.1 for ; Thu, 16 Apr 2015 01:40:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=BfshAgrmEvzuDzk6Xo6p6DI0dMahmXB6cPtcpMQkVTI=; b=V3whtAQr0MItm/XR+voxxEraf/82gpKsBVkXqwue7Jr2hrYm2xqVSS/rAH3X6LPKWe KMZvO1brwfhvL1l4zqOU7qb8i/qW4GMSuFhy9EPp1XWt7aGqkbZ3t1t01MTYkBIUrHrQ BkiLd6FLm18SRsAX8EAGpfiaoMJ64p3r6cUsAxb5klxLWxVBFSQ59nsl6pWWFGoZqFVt RA2RFumpOoytqVQy0AsKuaXa6XHeYQEF3GA7nn3fKxmOK8Dj7uApdBOcl0dHVJ9UoSjK OszDgBXW9FIGPJk0kqSRw159LGiH7vyC3E/egZ7LrfPOToXDm9T4sF3mBNphKjQSSCwV 4Zmw== X-Gm-Message-State: ALoCoQnJlI+IptPGGEEHPKJ33YnNatsJAOmsi2W+HQrFHe/lleKLnTwTxlyImrqgSuq/xg/Kvfbl X-Received: by 10.195.12.138 with SMTP id eq10mr56174833wjd.65.1429173611218; Thu, 16 Apr 2015 01:40:11 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id b1sm9370081wjs.17.2015.04.16.01.40.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Apr 2015 01:40:10 -0700 (PDT) From: Thomas Monjalon To: Ravi Kerur Date: Thu, 16 Apr 2015 10:39:27 +0200 Message-ID: <1994225.GSe2cYm1g2@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <1428608412-31191-4-git-send-email-rkerur@gmail.com> 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> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 08:40:11 -0000 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? > { > 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); > }