From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0040.outbound.protection.outlook.com [104.47.32.40]) by dpdk.org (Postfix) with ESMTP id 4FBC12BBE for ; Mon, 3 Apr 2017 16:56:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cfOl09qJgihzalRbX4oJSTc+S4HFUptc9tKRgeVxqN4=; b=S8lI6l4tL+bUKKJiAIqZEXowPnsWIGRcNXpw9oyVNdPa0mwaux+TeSWupF2cHSICvTlDIzL1ArrTP99X+vIHWvoMbjQnagWoFdcAPVrEx9vXBE2cU7cISZPewHubFWlPQm8HCkL3SLIwuqyBZkDmGa4xE+QdhyW8b3QuxhOE+bo= Authentication-Results: caviumnetworks.com; dkim=none (message not signed) header.d=none;caviumnetworks.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (14.140.2.178) by CY1PR0701MB1728.namprd07.prod.outlook.com (10.163.21.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Mon, 3 Apr 2017 14:56:18 +0000 Date: Mon, 3 Apr 2017 20:25:59 +0530 From: Jerin Jacob To: Andriy Berestovskyy Cc: Maciej Czekaj , dev@dpdk.org Message-ID: <20170403145518.ahzma7cjalosxomx@localhost.localdomain> References: <1490968669-9161-1-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> <1490968669-9161-2-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1490968669-9161-2-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0070.INDPRD01.PROD.OUTLOOK.COM (10.163.199.42) To CY1PR0701MB1728.namprd07.prod.outlook.com (10.163.21.142) X-MS-Office365-Filtering-Correlation-Id: d9b70156-bafd-4a2d-7a5e-08d47aa19768 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1728; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 3:K7i5s+teImGKJjSNNvbwm5dtOA6cilNnJJikIBoN59or0GRYPANSK46cTy2Dx15kKNsxDUbW34auaoe8GZ4g8LtY7JxPgy0e16FCETw6CWH9TJlGuYfucTMF5owvXhawut6Hu2n8AehmJ5urfPa/AcmdPZof4mnmfCwpBhoK9Gfx3J9Mu+jk3jrvX4Emnmt5oDH6N9KabTp4zyBRDEF2bnFQvNkdx2rCXpAbL39zmDHTzlr2aSRQ09bfGcyv++LE09wOqEO5YijwKK1bwY+7zigTpAHs3UO11QqgXVkoFPbEfF8giwQ6NaNXtQD2wfAPAl+Au4Wz+UVnM7iOt9uscw==; 25:ZfyGYirnmbQ76R4C/3ZvudxFQ82qbNW7+RepnwitrmJuwb4xJpMhx/I/l6OGinySClNWnkA4B8Z7vp5MAzL5rTWQLvcK3cTI+K3hZieQiffXDmDs0CjATQNM1Edt40zxdOkwOTcElhGNpWuzHsITB23uSwLP7IzcHcS6eobQ3cx+GDbp3OXk8E5mTDUEsHgBDHIEtcq6pJvzRtkPwywgDb/lkTf+hx8Wkv4CpPFOYZGbBGelxu2cVaIPlS+/VL7/lQb866BvkAE+8aIh4ID89Gj4Yq8RcPtWaXLmU82Vdr9U9swA3GcBwWF34ePQpFNN2C6UQ+3lXOMurE4ldUxt5LzIjj97QdQJAKDG/onCHHTtD4Dl+u8WLAg8uHGa089WjlhnRKUYLxgZwrV2el6EII9H2+S7aIObXIgrG/jYllGiWFrybIvWPKmLmyxIrIQoXHyqVG6i00vVWrFUYFuQFQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 31:JbStfbfySVBYtmmx5VZ2w9Ud0cMLUCkwkLi/7cnbMvxs/OjON85imWKMS0UtV5oP2owgX0mQRUvyojkpXrfVytRyqD2GVOu2Y0Tnj94A4YWm/fp5Vfr0WzgbVp9DfYLLTW+GoHqICdwTOmsEMb5YMvU62c4MJ4awBOv/mrxpqfH+XSIoxbdbX8/DBeqcVMI/VC3m7rCofe5LE+d9ZU1yjn0aOKl99vAaMSjeecsKjpM=; 20:ew16MOnmuUkal3rm4c00NM/sgdcnK7X/NXz5jo9egLPmeHVE3sHYoN7rb15hMH6ppQJqZSnkjYOYEVvS/9n3G7RZj0J/MCfXvBEZ068R7VDiRT12wcfgfh9xP5xiJyfgQ2xTmEetyj3sh0yU8Jm63iEnndyCceEi1FwvnY/qKInYJsr2VnLEK4uyNte+udViKRiUDcEF+IUpJCbdOfeYAJRA+aanziEkZk8DbBFK0gqWKge+hwM+nNLQcj0Cb4xw+ywMfOOPRVykInCYFhyNMQlxjlY4EmvCPFggUV+yoPFbnsLjo/xtM4JIRHWyvDQr3j5gEyj81euIUllO+LxlS1ml3m5m0KSwUyYQK5nBNvQs/KgP750o2J3Uungtbg+KX3i2CRnboJ6Ra7noV+KTSSgpWZ4vTKWHbq9c4LCS1+dnmfqdTejBNHL/MT1wfSf0c4W4MxIR+Imbshhz9HaZ0zUN3oMgiFGGyUyQDL4qRPh22ZSjNHAW00ZdIEndYMQC2G+xndWkPCIyE4eeopldja2eJe5cWlxFdaNLlC1b7bmdS1Jx3IwS+IUZPiIDQgUHDARJDhTaT0ajPbeiEHQqTzNw+L8Lk+dCEJ671YrdvmE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR0701MB1728; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1728; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 4:ZLrJuGFjADPSkGXvIVwNLcI7m16NoRDaM9OoTuhO39h7vBzVWi9KJB2DcHMwUi9X1VRti2l3wzN+de/IgupeAFTu/YQYa398qk3IqZIMlnSzpN6tTTSKV0uZHcMJz3gEU+Yh1i8fWy2VRLxmXXv4ENdMCRTQ/E7dBXNwsSTRnydbC/d9fTIpoMGqJo+nfmpJxUz6ghT1cPTHhl8vXBcm9Azd8ga0o6Wm1ofdIgO7sLOxzxbYeBckQUwX/b1SNPwpJHhMHkQWqclpRotmFvINd33HN6wIsjTcBwAGmLY32VSOe5YxooKJqMQcZLAx0asKR2sVQEg33K28yD09ZKR507n0YhPIUQN64+tMDhJhP6A8dK5+yLUx+s1xiSlOW36U9caLlIY+BzWeYaKGZ8Sug4Q3cowAPDRW4P/ThWCKcXaSMMEhxzyPMD2+1RBACRjg7+Exrhdrjv9Ehia/nwSJ3AOa3x8s0NvDECAhHxlZpB2F6m+XCx6ZW1KIVUiXncvWPGCAJIFcWl4ouLghLSXr2x0aX4IjVKOr0t7d6H9hqoY9fZe8pI/mM3AFM0J7j26T8UvbW0qzuS6AwICCAfW3YuJt3ASnVYpGSKNS6qRiU5B7KqfcAp7/caBhdGT2JO+u3E74IccMxUk2pxAEHaijNOTPNSH7pV4GXIkR9pTRPYz7FJPHqlo3KEHX2M0lj2TVwFQ5bpIhgkpCr8oBTC/WhQQWpxJ89GCK5TGGlv33SolfWgj8FmfOQjBXrTJ9+n5y X-Forefront-PRVS: 0266491E90 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(24454002)(6636002)(5009440100003)(6506006)(81166006)(8676002)(42882006)(6666003)(5660300001)(61506002)(2950100002)(50466002)(50986999)(66066001)(54356999)(189998001)(6116002)(23726003)(3846002)(33646002)(9686003)(55016002)(2906002)(1076002)(76176999)(229853002)(42186005)(305945005)(6246003)(106356001)(4001350100001)(6862004)(38730400002)(53936002)(110136004)(83506001)(25786009)(47776003)(7736002)(4326008)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1728; H:localhost.localdomain; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1728; 23:KHiqoloAxySDnlwb4emXHw0EkxSNKB8/auWVvPR?= =?us-ascii?Q?F12p7mFLibF3NxENL/VbdNwAqMufBhveBP0gJBL6JKZBYHQIIOZPMyyhdhKC?= =?us-ascii?Q?2ioto78duNj7X/pTeLt3LzudBXITwXrU+UxaAiOQwV8zzNkUKN+VSJmP4GJe?= =?us-ascii?Q?Rje3EcXZbBByIRM5W/JlSGZoLcfQONFxANTWyfrFWSskvfKRC3nlU4Dsyc99?= =?us-ascii?Q?nlplnG+Rm8978C6R7JILLxClRz6qgVl2pedsAHXubEZhb8UIY8IGA7KYt+Oe?= =?us-ascii?Q?mJ7Ka49df6hikpGpIxSVAxDPRvntZTGnS2+mS06+csqYIJ0X8e5mRedGnnIB?= =?us-ascii?Q?06TuTX7vI9cJr/8v6QmYRfGqiUB66CiToAucjMVPF70Wt/+96fc95FcCEoO8?= =?us-ascii?Q?LPv/lOxmpruT/dPzFjw/b+n3IrMpj8pj5qll0rD5EzGwfCFjb5rDHycqcY0x?= =?us-ascii?Q?Xy8td/LoAJY8WoJxnNkDL6XhZqQzLVyaVPCOjjDRUZweKBLyXDyXbYKqLoVK?= =?us-ascii?Q?rtIGC5NfgPGXEDGBk7dpNuUVsJQCAbcfKh4ImrQrLE6l9jRjbGbnOvvk4Zln?= =?us-ascii?Q?D70qZ1YOURYy3Sx28nKdY9gS8ACkrggaMm7GP582Vzy4XXK8lMM0iQK3Cbdr?= =?us-ascii?Q?4NyYPVCBf3VJPdJ503CLu6Dqb0KSMa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+RyKbc+43boOljX/Iga42eW63eRuAse5DJab/1A8W9Uw==; 5:QgVjO/+lxNgrWQLNySdUTFCeojxURVh9ouNmNIu2tXKyGrG3oAM+0wbdN295GnIuTkEBkEHyim8gXVs+zYN2aZEw3rw7f+EDCl+jRZzBP7QYUpyWey/tgNtaoh2fWlFsW/Bnjhs2pAVRji7jPDYXSw==; 24:4vyjeHosEhSe02afOnM4zS7cxcpafMj5PMvMuWlGhZeMt7q4xTzQya2vGrRDYplEWq+TBPAPczRocBZpEcuTGxqA+KVXr/HIq8+we0BdqS8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 7:6oj8/HBWT0EtvDtdrvZuAMu0AtVcbQHcFD2Vey26RP3nCKuA7TsvLwipD1i+UYzR8ozQDNhCgpuMwn5HZL6P8MGIxSXjAZ3ezDfixErRc3slnNxMWgFKl/46Ll7EOFrrV0fg9ZIQjLqL5BdfD55dftPsqz1ptW+y7//C5zCk4jy9zdjer1N7/NEZ2+A3+umfZzfrK6yq7z5bvpk5ZohlqQ/BDNkCsu8v9A8be+llD2bXB9s/Te1MPpmxJF9cAiZxp//zj9oejRmNPuL576KJGiHA1ld5XLVPhZUBDT8HiiELlybNsj5RXzBp5NXsXOEvvxdWiW/8t9fW3D87rhJYeQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2017 14:56:18.7580 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1728 Subject: Re: [dpdk-dev] [PATCH 2/2] net/thunderx: wait to complete during link update 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: Mon, 03 Apr 2017 14:56:23 -0000 On Fri, Mar 31, 2017 at 03:57:49PM +0200, Andriy Berestovskyy wrote: > Some DPDK applications/examples check link status on their > start. NICVF does not wait for the link, so those apps fail. > > Wait up to 9 seconds for the link as other PMDs do in order > to fix those apps/examples. > > Signed-off-by: Andriy Berestovskyy Acked-by: Jerin Jacob > --- > drivers/net/thunderx/nicvf_ethdev.c | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c > index 984c218..2fe653a 100644 > --- a/drivers/net/thunderx/nicvf_ethdev.c > +++ b/drivers/net/thunderx/nicvf_ethdev.c > @@ -145,16 +145,29 @@ nicvf_periodic_alarm_stop(void (fn)(void *), void *arg) > * Return 0 means link status changed, -1 means not changed > */ > static int > -nicvf_dev_link_update(struct rte_eth_dev *dev, > - int wait_to_complete __rte_unused) > +nicvf_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete) > { > +#define CHECK_INTERVAL 100 /* 100ms */ > +#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */ > struct rte_eth_link link; > struct nicvf *nic = nicvf_pmd_priv(dev); > + int i; > > PMD_INIT_FUNC_TRACE(); > > - memset(&link, 0, sizeof(link)); > - nicvf_set_eth_link_status(nic, &link); > + if (wait_to_complete) { > + /* rte_eth_link_get() might need to wait up to 9 seconds */ > + for (i = 0; i < MAX_CHECK_TIME; i++) { > + memset(&link, 0, sizeof(link)); > + nicvf_set_eth_link_status(nic, &link); > + if (link.link_status) > + break; > + rte_delay_ms(CHECK_INTERVAL); > + } > + } else { > + memset(&link, 0, sizeof(link)); > + nicvf_set_eth_link_status(nic, &link); > + } > return nicvf_atomic_write_link_status(dev, &link); > } > > -- > 2.7.4 >