From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 0B7D954AE for ; Tue, 9 Apr 2019 09:43:45 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id w13so9237709vsc.4 for ; Tue, 09 Apr 2019 00:43:44 -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=zsO16tAZngnq13yc/aBXLNRv/PzPuZUK3Hz8uyGPavs=; b=qowhqIIBm8YFuloaOM4vXWpC+e8G7Ak9TOJVGGxeoC4Oy4pkZYiLO3wW9icXE6EYQf B1kaagZUnfpGB42a8YzjT0ZlVqoUyJT91gbSSeq0CFOquiA68PMcWrGG4J8XFmjdMee3 rzoOdvg5axRiHJGxbDl1Mn25TlA9t/7/B9wMohLqA2vHp2a4EEnTLOQvcv2h+dCQIyRt /Q3PIj3W2GSf9jApTqAHt/rDz/PWJq17vSnXOPPtMN4bYuK7B34qLbNUCnDBWTmDVqmR bq51UuDrZGKvmlHwPHtWRiB/Zlb8wM+CeEh915h6Aukhrv1WJW8LvI5p4OIJnxyLT1NF CZSA== X-Gm-Message-State: APjAAAW2J7ayr8tLSWxsDkGw8QuPzKXlxtE6squZLvvgaaWKupZpBoZh 7glg7AnHY+2lHTJjXxclzLqJ885o2KrmdGnAmEM2Ag== X-Google-Smtp-Source: APXvYqxOPtcJieTOK/atdEY5PJLQ98Hs6Jmau5y8qJfFr15hE/+I9uq4C4dqSJ3/6I4jclEO2LCUwQI8XyAR6ryV0Zc= X-Received: by 2002:a67:c812:: with SMTP id u18mr20171425vsk.87.1554795824481; Tue, 09 Apr 2019 00:43:44 -0700 (PDT) MIME-Version: 1.0 References: <20190408182510.16078-1-stephen@networkplumber.org> <20190408182510.16078-4-stephen@networkplumber.org> In-Reply-To: <20190408182510.16078-4-stephen@networkplumber.org> From: David Marchand Date: Tue, 9 Apr 2019 09:43:33 +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] [PATCH v1 3/5] examples/bond: use lcore accessor 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: Tue, 09 Apr 2019 07:43:45 -0000 On Mon, Apr 8, 2019 at 8:25 PM Stephen Hemminger wrote: > Use the accessor function to look at lcore state. > > Signed-off-by: Stephen Hemminger > --- > examples/bond/main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/examples/bond/main.c b/examples/bond/main.c > index ef86194fff4a..48e6755ea294 100644 > --- a/examples/bond/main.c > +++ b/examples/bond/main.c > @@ -526,8 +526,8 @@ static void cmd_start_parsed(__attribute__((unused)) > void *parsed_result, > int slave_core_id = rte_lcore_id(); > > rte_spinlock_trylock(&global_flag_stru_p->lock); > - if (global_flag_stru_p->LcoreMainIsRunning == 0) { > - if (lcore_config[global_flag_stru_p->LcoreMainCore].state > != WAIT) { > + if (global_flag_stru_p->LcoreMainIsRunning == 0) { > + if (rte_lcore_state(global_flag_stru_p->LcoreMainCore) != > WAIT) { > s/rte_lcore_state/rte_eal_get_lcore_state/ rte_spinlock_unlock(&global_flag_stru_p->lock); > return; > } > -- > 2.17.1 > > And you missed another reference in this file: diff --git a/examples/bond/main.c b/examples/bond/main.c index 48e6755..982b7ea 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -527,7 +527,7 @@ static void cmd_start_parsed(__attribute__((unused)) void *parsed_result, rte_spinlock_trylock(&global_flag_stru_p->lock); if (global_flag_stru_p->LcoreMainIsRunning == 0) { - if (rte_lcore_state(global_flag_stru_p->LcoreMainCore) != WAIT) { + if (rte_eal_get_lcore_state(global_flag_stru_p->LcoreMainCore) != WAIT) { rte_spinlock_unlock(&global_flag_stru_p->lock); return; } @@ -796,7 +796,7 @@ static void prompt(__attribute__((unused)) void *arg1) /* check state of lcores */ RTE_LCORE_FOREACH_SLAVE(slave_core_id) { - if (lcore_config[slave_core_id].state != WAIT) + if (rte_eal_get_lcore_state(slave_core_id) != WAIT) return -EBUSY; } /* start lcore main on core != master_core - ARP response thread */ -- 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 6A7E0A0096 for ; Tue, 9 Apr 2019 09:43:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3712F559A; Tue, 9 Apr 2019 09:43:46 +0200 (CEST) Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 0B7D954AE for ; Tue, 9 Apr 2019 09:43:45 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id w13so9237709vsc.4 for ; Tue, 09 Apr 2019 00:43:44 -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=zsO16tAZngnq13yc/aBXLNRv/PzPuZUK3Hz8uyGPavs=; b=qowhqIIBm8YFuloaOM4vXWpC+e8G7Ak9TOJVGGxeoC4Oy4pkZYiLO3wW9icXE6EYQf B1kaagZUnfpGB42a8YzjT0ZlVqoUyJT91gbSSeq0CFOquiA68PMcWrGG4J8XFmjdMee3 rzoOdvg5axRiHJGxbDl1Mn25TlA9t/7/B9wMohLqA2vHp2a4EEnTLOQvcv2h+dCQIyRt /Q3PIj3W2GSf9jApTqAHt/rDz/PWJq17vSnXOPPtMN4bYuK7B34qLbNUCnDBWTmDVqmR bq51UuDrZGKvmlHwPHtWRiB/Zlb8wM+CeEh915h6Aukhrv1WJW8LvI5p4OIJnxyLT1NF CZSA== X-Gm-Message-State: APjAAAW2J7ayr8tLSWxsDkGw8QuPzKXlxtE6squZLvvgaaWKupZpBoZh 7glg7AnHY+2lHTJjXxclzLqJ885o2KrmdGnAmEM2Ag== X-Google-Smtp-Source: APXvYqxOPtcJieTOK/atdEY5PJLQ98Hs6Jmau5y8qJfFr15hE/+I9uq4C4dqSJ3/6I4jclEO2LCUwQI8XyAR6ryV0Zc= X-Received: by 2002:a67:c812:: with SMTP id u18mr20171425vsk.87.1554795824481; Tue, 09 Apr 2019 00:43:44 -0700 (PDT) MIME-Version: 1.0 References: <20190408182510.16078-1-stephen@networkplumber.org> <20190408182510.16078-4-stephen@networkplumber.org> In-Reply-To: <20190408182510.16078-4-stephen@networkplumber.org> From: David Marchand Date: Tue, 9 Apr 2019 09:43:33 +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] [PATCH v1 3/5] examples/bond: use lcore accessor 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: <20190409074333.LjZN1zKTER30d1b9Hwick5_d3wgCSaO-jlll6d2t6QY@z> On Mon, Apr 8, 2019 at 8:25 PM Stephen Hemminger wrote: > Use the accessor function to look at lcore state. > > Signed-off-by: Stephen Hemminger > --- > examples/bond/main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/examples/bond/main.c b/examples/bond/main.c > index ef86194fff4a..48e6755ea294 100644 > --- a/examples/bond/main.c > +++ b/examples/bond/main.c > @@ -526,8 +526,8 @@ static void cmd_start_parsed(__attribute__((unused)) > void *parsed_result, > int slave_core_id = rte_lcore_id(); > > rte_spinlock_trylock(&global_flag_stru_p->lock); > - if (global_flag_stru_p->LcoreMainIsRunning == 0) { > - if (lcore_config[global_flag_stru_p->LcoreMainCore].state > != WAIT) { > + if (global_flag_stru_p->LcoreMainIsRunning == 0) { > + if (rte_lcore_state(global_flag_stru_p->LcoreMainCore) != > WAIT) { > s/rte_lcore_state/rte_eal_get_lcore_state/ rte_spinlock_unlock(&global_flag_stru_p->lock); > return; > } > -- > 2.17.1 > > And you missed another reference in this file: diff --git a/examples/bond/main.c b/examples/bond/main.c index 48e6755..982b7ea 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -527,7 +527,7 @@ static void cmd_start_parsed(__attribute__((unused)) void *parsed_result, rte_spinlock_trylock(&global_flag_stru_p->lock); if (global_flag_stru_p->LcoreMainIsRunning == 0) { - if (rte_lcore_state(global_flag_stru_p->LcoreMainCore) != WAIT) { + if (rte_eal_get_lcore_state(global_flag_stru_p->LcoreMainCore) != WAIT) { rte_spinlock_unlock(&global_flag_stru_p->lock); return; } @@ -796,7 +796,7 @@ static void prompt(__attribute__((unused)) void *arg1) /* check state of lcores */ RTE_LCORE_FOREACH_SLAVE(slave_core_id) { - if (lcore_config[slave_core_id].state != WAIT) + if (rte_eal_get_lcore_state(slave_core_id) != WAIT) return -EBUSY; } /* start lcore main on core != master_core - ARP response thread */ -- David Marchand