From patchwork Fri Aug 25 10:49:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 111002 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp813488qge; Fri, 25 Aug 2017 03:54:36 -0700 (PDT) X-Received: by 10.223.176.72 with SMTP id g8mr5193460wra.117.1503658476011; Fri, 25 Aug 2017 03:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658476; cv=none; d=google.com; s=arc-20160816; b=q2teisoiUXHc0D5xSX8q9/S67QhM6CYS4Hrns0ayoFY9PSyUbh1Ny0EbqYjLlGcBvt yNHlpdNAbJzBOqEV+zWckZxhXLE0q6I9OpaSfWSnZzaoBCZssxyI7AKbPPjmWKyKIBzK fkek7HclACVFvZn2SgNPaQ2oeU7JeT5ZGLpRaTmOISAfQBb1T20WSXlQPmlQGyEplPEA SNLYDWYm6r+KyFgOee9+DakOIU5Sj/Krwly+6uLzQ9RbfG4dMnfCmOiKyOkcI7jW8F55 ekfpRWbXBoJjjzN0dsKo1h8Sf4VSkjEJ1RG5Myc2+4B2pE3J1ipDAfdHmEfN2n6r1fu0 ukNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=sKibeukb36x6IJzp7xONLd4P3HsX/ZMaudrGdyqI/vU=; b=jw5Fv3C9ZEDQ2kbNJd6J+pLSLBlqBF4gGwhGPU/Q1HnG1yPCeImC4GFaw1UNpNtgw1 Aha//gZj16hmBXilxLk/gKLJJOdpOfhNaRMy05dt3nWE4ahPH5iPNOgendfteAdVs6Tf J/t8zHGEgqkwKd7vRLRP/NCv22S95Z3ojlZi9aWfd9huNVmShKFBLYu7zNNX+fIJfauv 88jZ42xWNWutVl77O8tG/lz8JwZywTojtxP11Vox5ZeKrEDUxDm7KAlRaRN/zc1GTZhx 8nZ2QUQjR6eTXIZpTnj68lt2Y7iDLR4mJOMOzAkdANi7WqoNOVZ27/G48QJxKVUEL+yB pejw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id v193si1033159wme.133.2017.08.25.03.54.35; Fri, 25 Aug 2017 03:54:35 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 36BE1999E; Fri, 25 Aug 2017 12:50:45 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0073.outbound.protection.outlook.com [104.47.38.73]) by dpdk.org (Postfix) with ESMTP id CE6279989 for ; Fri, 25 Aug 2017 12:50:38 +0200 (CEST) Received: from BN3PR03CA0113.namprd03.prod.outlook.com (10.174.66.31) by DM5PR03MB3322.namprd03.prod.outlook.com (10.174.241.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:37 +0000 Received: from BN1BFFO11FD034.protection.gbl (2a01:111:f400:7c10::1:153) by BN3PR03CA0113.outlook.office365.com (2603:10b6:400:4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50:36 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD034.mail.protection.outlook.com (10.58.144.97) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:36 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7PAnw6N032070; Fri, 25 Aug 2017 03:50:34 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:35 +0530 Message-ID: <1503658183-4078-20-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318367136880; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(86362001)(77096006)(47776003)(189998001)(97736004)(85426001)(50226002)(305945005)(2906002)(6916009)(104016004)(54906002)(2950100002)(626005)(81166006)(8656003)(50986999)(5660300001)(498600001)(76176999)(33646002)(356003)(8936002)(106466001)(81156014)(2351001)(68736007)(8676002)(36756003)(53936002)(105606002)(50466002)(110136004)(48376002)(5003940100001)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB3322; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD034; 1:atPXOdDcIhuFKlAkFkLe4LqnYXdUnY78degpqoCsEqQ04mOmEkT/LYwVqsVljQLmsWJAWQOOUS0iOVa8hW0T+T6udNnH6YYrJqAsqlBDenIH7a5B+8633/TAAEaLxyUC MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0abc14ac-aeb0-460b-8c70-08d4eba71e56 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR03MB3322; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 3:j5JXlbHTVnfQMZmY9zAcfUPz3qEmDxwdI+WcZNgfjWMKbx7avao5qjhp4Zn9YrcOwIxPIfur3JkYpHIxwH35v8PIvkFTjHa0NDL6cRlQC9484j9evlUi7Zbwp0NSbOIXEd/lF/Ns0eHfRfr1cdA6uMLByl4C/QldSPmC/IkP7hENdo7e2Lz/MAFxNpzdfsZoFMoAB0pdbo018DrTc/U6YffjXmxDH0cfWygEZBJaw5bU3rJbYGBXrTGJEhEVfVkNzQRB2jLzGAr1wOqqSoXWyBQRl0mLK4piWrslQzvEQJ+jXroVHSHLJenecpsBwEiki3dnB9VZ63V532yiCpL6CY+v0SRFydomKyW1WScH5Ps=; 25:MtDMNcjkZ1qexO/+3KCb7KokXG+7XOcjDt7gferOfLHPiLq3C8H8uESCxbdGTJBLBrscJNrJS6gNlTcO+DUVdGQb64+QFWznIf7tZ4aUWZ3joeEwMOY37wOxkGdZJx/30DXu1sNS/4qKWMvCxvlTUveilazXuk6XTNEVM409iwcZFUHGiAnImL62rF4Z8kyC93NK3aZfqbgnf9WN/WD9ZUAwjAelm/L5Z2rw2J5HEZXMdjecTN9uDVbyELhsMBqgJSCvRTyCEJH6scU7RuJhx0nOgQ8OVyhWxeJtfNb6kS3qGDuf3071Ls2h7AzO8oiKljEmB3adJAOMKUusyrZbJg== X-MS-TrafficTypeDiagnostic: DM5PR03MB3322: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3322; 31:/dFd1CDQMdjX8OpTbgNKOD8ltVsdF2CxtzaKepGC/8HithtMzu+8TTBBZlSdtukvS7PISYlroEIOKTJrUx8muLS/9wS2QF9metxE3GUtFAi0XFkHxQNNsXpn+kqpBAlXuLq6xoQG383urswqcICzA2CPBreLbADvjgEwCNiO/Yv9JuqGfMhbzkwevP/6lM8l3ogaA8CK84XjiBoAPVFtWHfsFnG0rDBlzGS6qOG6nZc=; 4:4xcmvYfFpIcZelR8qLUffR92mOiTucGY+Ki8wqwkfZ6AdVjs3wZKHe54tfPTEP662e/HKPzSVx0KHf/9cwW9+3aD1CP8LV6zpl0eg+Ii2n4Jh7o04nUFwlPsxLIAPGdQN7yMiBe1kleNRalvSktIkfePaNsyzha+GYBdUHUrWFYd6Q0npweSwjD9tq4xcvK61Bu2Fe1T09+OwRGDGn1zvh7ZfGuzbwshgHxhWFrZ+lPlhPFBx3d8zRmj2veJK7T/lzBGcZ3P5cJqtegPdY2DwlAO8D842UsKH/X7p+7th8Y= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB3322; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB3322; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3322; 23:UkS5/WvYC5f5OYBBucC3OE8BtfWTLtCp46vOYLZL1?= G8MJPaZryy2NzjJz8CjJ8JU/ygbwRw9OHm/kUIaQ74Y8rbYG0ze+Y3rucyqfgc6EqUHKdX1zJ0KOWR1FHWTHq3eUdAXuxQ95aTq5M/xxEYq/1rO8mv6eMd1QVKvsk5DZ1ACUs04n6tsRaEnCt4MP8Cmo5f15ENq7ysJFrH42oMoVSTJ8QPGU6hHODD3rR90quFtG7cnnn5Seq0ZaZ/T9Jm/X/jDx2sWV6TUxour2gXRogM68Amc2qyI6Rhs2lLNxkjaBKHAFPLBGLBRORhxCsyfWbVbO4CTcu9YJqDoVRioonmsn6o3Aow0q+CL9b5o2mw3s2jXHOU/bxqKL1qJDSKBkuG1mWLRkIUUvC8aw/QeUYngpYpwAEWGKjbWkBaCz3JSDshaUztuGQ/1Oe4vJzb5QIEqUN1z5NAMoHFuLxYiDtJWSb0jKS8q7xEM2sDikNEz2/3gEJ6Aj8w/4oHGhLAA9gekYz11+al7YS2bmeZnFI8iwiXB9kDImczdjqnG5YxEpe+2/wIWxwU6JkYAapEcH0UZWZ+4jMGmKv6xy/CyPpVYG7TbyX77mZdV44Wyjw0Fk0jQ0qYLXy6MQ8Zulv85s/HlGnVCJfPA3em0aFS6XOWxpoJB6JF6LgacShVf8Nza2oF8sSOVB673ErPDy+UkWUKX7WNCBrd2zx6U5a6Aa2hup8p0Sn4vWPud8XxntaCMjS8c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3cBpsFbibV/Ri53FukCF5hF+64RfMexet2RGrVFLMCoTTBW3W6B/AYK2LAN6i3qHyrJNuL+QivwBUNqu65bxMl5ycbtJ/XOzXQGZ6hpgfukosiY2fh382T8IJ+hJPdv6JhkGac3Xw0TiB/kVJFdgguekJ/5rppsNSjibHFs+UGmfh2wnahy58PJQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:36.5420 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB3322 Subject: [dpdk-dev] [PATCH 19/27] net/dpaa2: check physical link state on up cmd 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" Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 49dc42b..5e5a71f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1186,6 +1186,7 @@ dpaa2_dev_set_link_up(struct rte_eth_dev *dev) struct dpaa2_dev_priv *priv; struct fsl_mc_io *dpni; int en = 0; + struct dpni_link_state state = {0}; PMD_INIT_FUNC_TRACE(); @@ -1213,11 +1214,21 @@ dpaa2_dev_set_link_up(struct rte_eth_dev *dev) return -EINVAL; } } + ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state); + if (ret < 0) { + RTE_LOG(ERR, PMD, "error: dpni_get_link_state %d\n", ret); + return -1; + } + /* changing tx burst function to start enqueues */ dev->tx_pkt_burst = dpaa2_dev_tx; - dev->data->dev_link.link_status = 1; + dev->data->dev_link.link_status = state.up; - PMD_DRV_LOG(INFO, "Port %d Link UP successful", dev->data->port_id); + if (state.up) + PMD_DRV_LOG(INFO, "Port %d Link is set as UP", + dev->data->port_id); + else + PMD_DRV_LOG(INFO, "Port %d Link is DOWN", dev->data->port_id); return ret; }