From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) by dpdk.org (Postfix) with ESMTP id 430A81B493 for ; Fri, 5 Apr 2019 13:01:22 +0200 (CEST) Received: by mail-ua1-f43.google.com with SMTP id t15so1918993uao.5 for ; Fri, 05 Apr 2019 04:01:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vETE+RBye2ECyXP1HIopU87ucuWMOd0xnZ8oigQRAH0=; b=QtEHZwbJiv+XSelHb6D5B8AaquQ/KM1raxVqTsrbdjQgkz7cICsNEWyJrwKujIpVig AqkCTd25Xs98Jy8w4nIymx0IsrDJPsp+OiqD7XAZB+jN65w6NlQUIY2mIdRegBtDEu39 TbQwFbJhBuFCjndEzWWu6Hrq8HjmQSg/c0OgKO/DkHMPpEPAss0tmBygn6wa3oZN1Iev saVy2bdTfuXv+Myy4qlfyAKZMNKNmuP1XgJFRIkVFFSTMyrdu5L5BQOxk3VOeCZfaKDm J+3dyYqO6CKAR61nmfRrr0nQM6BXC2/S0Cpd6c9XP68uhhxmPkmY1O/5KSuStuv5jPqr 8J3A== X-Gm-Message-State: APjAAAXOxXFQJuFWYKRbfnEwzBNLTrqvKh6lSYlhg43lTImLurwSWj9k FKtyD2KKhQohkll/15OPh2zuukXScpF+4GpRm9JeAko6 X-Google-Smtp-Source: APXvYqzB3ov1loqt+4eSMMiWx0fmPhxcRRPgQ3ntPxwtLP3yl2SVTc85NosHVxihH8djOKC9iXyeMmwcBRDwzLsiEvc= X-Received: by 2002:ab0:73d3:: with SMTP id m19mr7245284uaq.46.1554462081498; Fri, 05 Apr 2019 04:01:21 -0700 (PDT) MIME-Version: 1.0 References: <20190403171610.23970-1-stephen@networkplumber.org> <20190403171610.23970-2-stephen@networkplumber.org> In-Reply-To: <20190403171610.23970-2-stephen@networkplumber.org> From: David Marchand Date: Fri, 5 Apr 2019 13:01:10 +0200 Message-ID: To: Stephen Hemminger Cc: dev Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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: , X-List-Received-Date: Fri, 05 Apr 2019 11:01:22 -0000 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. + > +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. + > +int > +rte_lcore_return_code(unsigned lcore_id) > unsigned int +{ > + return lcore_config[lcore_id].ret; > +} > + > + > Double blank line. static int > socket_id_cmp(const void *a, const void *b) > { > -- David Marchand 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 2889BA0679 for ; Fri, 5 Apr 2019 13:01:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 681061B4A1; Fri, 5 Apr 2019 13:01:23 +0200 (CEST) Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) by dpdk.org (Postfix) with ESMTP id 430A81B493 for ; Fri, 5 Apr 2019 13:01:22 +0200 (CEST) Received: by mail-ua1-f43.google.com with SMTP id t15so1918993uao.5 for ; Fri, 05 Apr 2019 04:01:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vETE+RBye2ECyXP1HIopU87ucuWMOd0xnZ8oigQRAH0=; b=QtEHZwbJiv+XSelHb6D5B8AaquQ/KM1raxVqTsrbdjQgkz7cICsNEWyJrwKujIpVig AqkCTd25Xs98Jy8w4nIymx0IsrDJPsp+OiqD7XAZB+jN65w6NlQUIY2mIdRegBtDEu39 TbQwFbJhBuFCjndEzWWu6Hrq8HjmQSg/c0OgKO/DkHMPpEPAss0tmBygn6wa3oZN1Iev saVy2bdTfuXv+Myy4qlfyAKZMNKNmuP1XgJFRIkVFFSTMyrdu5L5BQOxk3VOeCZfaKDm J+3dyYqO6CKAR61nmfRrr0nQM6BXC2/S0Cpd6c9XP68uhhxmPkmY1O/5KSuStuv5jPqr 8J3A== X-Gm-Message-State: APjAAAXOxXFQJuFWYKRbfnEwzBNLTrqvKh6lSYlhg43lTImLurwSWj9k FKtyD2KKhQohkll/15OPh2zuukXScpF+4GpRm9JeAko6 X-Google-Smtp-Source: APXvYqzB3ov1loqt+4eSMMiWx0fmPhxcRRPgQ3ntPxwtLP3yl2SVTc85NosHVxihH8djOKC9iXyeMmwcBRDwzLsiEvc= X-Received: by 2002:ab0:73d3:: with SMTP id m19mr7245284uaq.46.1554462081498; Fri, 05 Apr 2019 04:01:21 -0700 (PDT) MIME-Version: 1.0 References: <20190403171610.23970-1-stephen@networkplumber.org> <20190403171610.23970-2-stephen@networkplumber.org> In-Reply-To: <20190403171610.23970-2-stephen@networkplumber.org> From: David Marchand Date: Fri, 5 Apr 2019 13:01:10 +0200 Message-ID: To: Stephen Hemminger Cc: dev Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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: <20190405110110.pSyH-xhRt3p0QIYr4B7pohkBapVCOJ3i6FEVT7hZ9_E@z> 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. + > +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. + > +int > +rte_lcore_return_code(unsigned lcore_id) > unsigned int +{ > + return lcore_config[lcore_id].ret; > +} > + > + > Double blank line. static int > socket_id_cmp(const void *a, const void *b) > { > -- David Marchand