From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 06EAB1B19 for ; Wed, 24 Jan 2018 09:19:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2018 00:19:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,406,1511856000"; d="scan'208";a="198215899" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 24 Jan 2018 00:19:34 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 24 Jan 2018 00:19:34 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Wed, 24 Jan 2018 16:19:32 +0800 From: "Xing, Beilei" To: Ori Kam CC: "dev@dpdk.org" Thread-Topic: [PATCH] examples/flow_filtering: add delay during updating link status Thread-Index: AQHTlOu0wy7z3wkQxUeIWqDQazGKVaOCrgvw Date: Wed, 24 Jan 2018 08:19:31 +0000 Message-ID: <94479800C636CB44BD422CB454846E0132092163@SHSMSX101.ccr.corp.intel.com> References: <1516780359-57421-1-git-send-email-beilei.xing@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] examples/flow_filtering: add delay during updating link status 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: Wed, 24 Jan 2018 08:19:36 -0000 > -----Original Message----- > From: Ori Kam [mailto:orika@mellanox.com] > Sent: Wednesday, January 24, 2018 4:17 PM > To: Xing, Beilei > Cc: dev@dpdk.org > Subject: RE: [PATCH] examples/flow_filtering: add delay during updating l= ink > status >=20 > Hi Beilei, >=20 > PSB >=20 > > -----Original Message----- > > From: Beilei Xing [mailto:beilei.xing@intel.com] > > Sent: Wednesday, January 24, 2018 9:53 AM > > To: Ori Kam > > Cc: dev@dpdk.org > > Subject: [PATCH] examples/flow_filtering: add delay during updating > > link status > > > > Add up to 9s delay for getting link status to make sure NIC updates > > link status successfully, just like other applications such as testpmd = and > l2fwd. > > > > Signed-off-by: Beilei Xing > > --- > > examples/flow_filtering/main.c | 12 +++++++++++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/examples/flow_filtering/main.c > > b/examples/flow_filtering/main.c index 4a07b63..1788f24 100644 > > --- a/examples/flow_filtering/main.c > > +++ b/examples/flow_filtering/main.c > > @@ -55,6 +55,7 @@ > > #include > > #include > > #include > > +#include > > > > static volatile bool force_quit; > > > > @@ -119,13 +120,22 @@ main_loop(void) > > rte_eth_dev_close(port_id); > > } > > > > +#define CHECK_INTERVAL 1000 /* 100ms */ >=20 > This define is not used. >=20 > > +#define MAX_REPEAT_TIME 90 /* 9s (90 * 100ms) in total */ > > + > > static void > > assert_link_status(void) > > { > > struct rte_eth_link link; > > + uint8_t rep_cnt =3D MAX_REPEAT_TIME; > > > > memset(&link, 0, sizeof(link)); > > - rte_eth_link_get(port_id, &link); > > + do { > > + rte_eth_link_get(port_id, &link); > > + if (link.link_status =3D=3D ETH_LINK_UP) > > + break; > > + } while (--rep_cnt); >=20 > I think you are missing the rte_delay_ms(CHECK_INTERVAL); Currently the > code will work for 90 iterations but we can't grantee the duration. Sorry for missing rte_delay_ms in this patch, will send v2 later, thanks. >=20 > > + > > if (link.link_status =3D=3D ETH_LINK_DOWN) > > rte_exit(EXIT_FAILURE, ":: error: link is still down\n"); } > > -- > > 2.5.5 >=20 > Regards, > Ori