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 676DFA0AC5 for ; Fri, 3 May 2019 19:25:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 94EE01B131; Fri, 3 May 2019 19:25:26 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 9C1011B11F for ; Fri, 3 May 2019 19:25:22 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id a59so3000885pla.5 for ; Fri, 03 May 2019 10:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zNltVzlxvH9rabMCydlhPZChw/XgxYYGtV0k1rmfLOw=; b=Oz98T+v3l2X4wqtNc1Ek13o1MWY41BGHYNvxZm6Z56TWiA4Rt1dDYqZpgwPqc+9yu5 HwMQSjVxuvkUcc8CDDmWsPovRUcXca8yMRXt7xHJTOSquFt37r7DUrA431YXoLh6iEVQ aFmRDxduwxozU6Bah4bm/xW4tYX95k2z7ACLf5VKo323mo9Ru/kQg5YdNS7qj8/rxSF8 dhl6sjQqHLqBedx0T5cWp87iCBBtMAhwq/JtpD1DLkDDEwK6h57NEx0ndXYMSbDmN/vk uf5Xucns1uk/nnWZeaW96wyg0GnqVsoS4PempqwVmfIjgYmmmhJZNdzsffD4XuahJ+UZ Oa/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zNltVzlxvH9rabMCydlhPZChw/XgxYYGtV0k1rmfLOw=; b=Z0kjM0nR8Zu1NWUOeh24YwshnBmH2bnSuMDl7N41u8gE2IEnhvI4y5SgibCv0S09U7 Ilh1ErAImfFSt7W4Wj33doZLoOUIRtwfl/yvmqPzTAp1L0Yu23vldUYOYBtEpzUWmzZ/ fVB0bwelpxDRh+qAQEjFYVgeSCwdeHInxRCk2aPyhaZ15V4eXB6uKeDnySYZKLdtCiCm arUqhxIAmFTrGZTmBhX0NBNy+hpicgaqYjcjBwFG5kfnhF07/cPixacQK7IMQ9LwvNrZ EGEJVPHYOsfWALGus99MY/uN0TYtyzBY8L61mPRk+8/zSwRGzKY8VqV8uVYHwPJdlJGv HLCg== X-Gm-Message-State: APjAAAVzZdeHX+2YrPCKsjy9m9GJVoZ14ex3XrcGdRv3Si4xZ9FEPFlL COS8Zk6lZyFAdlqnWWJPFVTSNEoW4tA= X-Google-Smtp-Source: APXvYqxhyJWEbZuN228cOUgzYlwHbZGbpaTYJR0atTWqh8a9AqAXr7MnTiqAVrTHPJxkJ0AQ2zTBbQ== X-Received: by 2002:a17:902:4681:: with SMTP id p1mr12006964pld.139.1556904321584; Fri, 03 May 2019 10:25:21 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id t13sm3109578pgj.49.2019.05.03.10.25.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 10:25:20 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 3 May 2019 10:25:06 -0700 Message-Id: <20190503172507.5272-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190503172507.5272-1-stephen@networkplumber.org> References: <20190410171603.8979-1-stephen@networkplumber.org> <20190503172507.5272-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 4/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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190503172506.douktoUxCdLrxLYiZnFfRVw_Bzl61fRJ2k2QgLqG6zU@z> Referring to lcore_config directly is no longer recommended. Also remove unnecessary assignment of slave_core_id. Signed-off-by: Stephen Hemminger --- examples/bond/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/bond/main.c b/examples/bond/main.c index ef86194fff4a..1b35d53c8efa 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -526,8 +526,9 @@ 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_eal_get_lcore_state(global_flag_stru_p->LcoreMainCore) + != WAIT) { rte_spinlock_unlock(&global_flag_stru_p->lock); return; } @@ -760,7 +761,7 @@ static void prompt(__attribute__((unused)) void *arg1) int main(int argc, char *argv[]) { - int ret; + int ret, slave_core_id; uint16_t nb_ports, i; /* init EAL */ @@ -792,13 +793,13 @@ main(int argc, char *argv[]) bond_port_init(mbuf_pool); rte_spinlock_init(&global_flag_stru_p->lock); - int slave_core_id = rte_lcore_id(); /* check state of lcores */ RTE_LCORE_FOREACH_SLAVE(slave_core_id) { - if (lcore_config[slave_core_id].state != WAIT) - return -EBUSY; + if (rte_eal_get_lcore_state(slave_core_id) != WAIT) + return -EBUSY; } + /* start lcore main on core != master_core - ARP response thread */ slave_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0); if ((slave_core_id >= RTE_MAX_LCORE) || (slave_core_id == 0)) -- 2.20.1