From patchwork Wed Mar 1 07:47:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunt, David" X-Patchwork-Id: 21010 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C45D0F977; Wed, 1 Mar 2017 15:47:58 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9DA00C304 for ; Wed, 1 Mar 2017 15:47:25 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2017 06:47:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.35,226,1484035200"; d="scan'208"; a="1117076588" Received: from silpixa00397515.ir.intel.com (HELO silpixa00397515.ger.corp.intel.com) ([10.237.223.14]) by fmsmga001.fm.intel.com with ESMTP; 01 Mar 2017 06:47:24 -0800 From: David Hunt To: dev@dpdk.org Cc: bruce.richardson@intel.com, David Hunt Date: Wed, 1 Mar 2017 07:47:30 +0000 Message-Id: <1488354455-142764-14-git-send-email-david.hunt@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488354455-142764-1-git-send-email-david.hunt@intel.com> References: <1487647073-129064-2-git-send-email-david.hunt@intel.com> <1488354455-142764-1-git-send-email-david.hunt@intel.com> Subject: [dpdk-dev] [PATCH v8 13/18] sample: distributor: wait for ports to come up 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" On some machines, ports take several seconds to come up. This patch causes the app to wait. Signed-off-by: David Hunt --- examples/distributor/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 3657e5d..aeb75a8 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -1,8 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. - * All rights reserved. + * Copyright(c) 2010-2017 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -62,6 +61,7 @@ static uint32_t enabled_port_mask; volatile uint8_t quit_signal; volatile uint8_t quit_signal_rx; volatile uint8_t quit_signal_dist; +volatile uint8_t quit_signal_work; static volatile struct app_stats { struct { @@ -165,7 +165,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) struct rte_eth_link link; rte_eth_link_get_nowait(port, &link); - if (!link.link_status) { + while (!link.link_status) { + printf("Waiting for Link up on port %"PRIu8"\n", port); sleep(1); rte_eth_link_get_nowait(port, &link); }