From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4831EA0679 for ; Fri, 5 Apr 2019 18:33:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B7A924C96; Fri, 5 Apr 2019 18:33:40 +0200 (CEST) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 6B40034F3 for ; Fri, 5 Apr 2019 18:33:39 +0200 (CEST) Received: by mail-pl1-f194.google.com with SMTP id w23so3307266ply.4 for ; Fri, 05 Apr 2019 09:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/YCUzKZ7FelFQtV+utakNW4GhZ9kyzTmalfD23abW14=; b=tSNkjHRlzerdyU6EQmpD9ffJuWzUrGqRE3x/EX3INl3zuWR0A+ptL+FkbOw8iDIEkC KbqJaaOX5f1f3Jz5nwbVHxN+BPq59CUX7fKCjEGNAkKWtSw0PVljw4R4gsuPRiXM+OHm wDgkAbtso6k7faMQcVBKBW7adNrVFyEx38DjsiGhwK1xWtsbYQkhIzuRzadsaLuDNbcM MLtW+MRes9ahDOP0QtefGesfwCRamuZztMiV+GIIBJx+QN+nLSHhVyS91K+I1CniLGjd qi18u/eUsqzZ7ir/xTpv/YID54pAAPGiN73tZdy4Kp4XjRauFPgogVyhrEM/r2zsAi5q 0j2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/YCUzKZ7FelFQtV+utakNW4GhZ9kyzTmalfD23abW14=; b=DrW3W2wP3Hamr0BDY2H9HTEziVNfbeCACJ57bkA+tNYJx8n6RKzBZBxK3bs4oyyDQV WudduN6I5x7O2Kc0SpZh8+siseBDaw4kexzvn332sXJosPVC9u2Yj1dziLsLfpwfJOuM OpZUBVQJOXhSihjR7n7cKSsXGXK78I3w9350QScaDcMoF35UUedMsZsJ+b7hGvJWJIqc AjzbS3F7z+SKJvkFFkeam02Mpj0pt86J8EZPHZ8/xpKjolht/gKpHFVGYrY77H/ajU3Y 84i5DZHdb/1RW6hw1Kkye0ekPdMX4CEdg8IaWkQbLg2jyBO52ju5kjU0b4VieBroEiLJ 3m3Q== X-Gm-Message-State: APjAAAVFzwVSdKyu/tlRyVsQr7/K2a8ar4vpcLy3r6GMR4Xkn0bZ3N0O SfZsyLL0v5hk51okUoYVgZ7Uzw== X-Google-Smtp-Source: APXvYqyQpV6JXpBGIuujtMagvNVzFKczCFGSB4woH4cqNjtMgU7H6UTgMyMrBnao7RAifdeSsAdVfQ== X-Received: by 2002:a17:902:9a43:: with SMTP id x3mr14201071plv.173.1554482018407; Fri, 05 Apr 2019 09:33:38 -0700 (PDT) Received: from shemminger-XPS-13-9360 ([167.220.104.255]) by smtp.gmail.com with ESMTPSA id b3sm29713078pfi.82.2019.04.05.09.33.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Apr 2019 09:33:38 -0700 (PDT) Date: Fri, 5 Apr 2019 09:33:35 -0700 From: Stephen Hemminger To: David Marchand Cc: dev Message-ID: <20190405093335.72df8ac0@shemminger-XPS-13-9360> In-Reply-To: References: <20190403171610.23970-1-stephen@networkplumber.org> <20190403171610.23970-2-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC 1/5] eal: add accessor functions for lcore_config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190405163335.2vG9rZXNVtd5C2txIUPW7q901tJUrvXziHaIBcJxTWE@z> On Fri, 5 Apr 2019 13:01:10 +0200 David Marchand wrote: > On Wed, Apr 3, 2019 at 7:16 PM Stephen Hemminger > wrote: > > > diff --git a/lib/librte_eal/common/eal_common_lcore.c > > b/lib/librte_eal/common/eal_common_lcore.c > > index 1cbac42286ba..806204d9f73d 100644 > > --- a/lib/librte_eal/common/eal_common_lcore.c > > +++ b/lib/librte_eal/common/eal_common_lcore.c > > @@ -16,6 +16,52 @@ > > #include "eal_private.h" > > #include "eal_thread.h" > > > > +int rte_lcore_index(int lcore_id) > > +{ > > + if (unlikely(lcore_id >= RTE_MAX_LCORE)) > > + return -1; > > + > > + if (lcore_id < 0) > > + lcore_id = (int)rte_lcore_id(); > > + > > + return lcore_config[lcore_id].core_index; > > +} > > > + > > +int rte_lcore_to_cpu_id(int lcore_id) > > +{ > > + if (unlikely(lcore_id >= RTE_MAX_LCORE)) > > + return -1; > > + > > + if (lcore_id < 0) > > + lcore_id = (int)rte_lcore_id(); > > + > > + return lcore_config[lcore_id].core_id; > > +} > > + > > +rte_cpuset_t rte_lcore_cpuset(unsigned lcore_id) > > > > unsigned int > > +{ > > + return lcore_config[lcore_id].cpuset; > > +} > > > > I am a bit skeptical at what dpaa wants to do with this. > Anyway, it can be used when we want to check the current cpuset. Since cpuset is defined already, don't want to override it with unsigned. > + > > +unsigned > > > > unsigned int > > +rte_lcore_to_socket_id(unsigned int lcore_id) > > +{ > > + return lcore_config[lcore_id].socket_id; > > +} > > + > > +enum rte_lcore_state_t > > +rte_lcore_state(unsigned lcore_id) > > > > unsigned int > > +{ > > + return lcore_config[lcore_id].state; > > +} > > > > This is a duplicate for existing rte_eal_get_lcore_state() in > lib/librte_eal/common/eal_common_launch.c. > So either we keep rte_eal_get_lcore_state() or we replace it with this new > one. Good point.