From patchwork Fri Sep 8 08:45:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112040 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1246967ybm; Fri, 8 Sep 2017 01:50:10 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAR1UKHn2Mi4PgYqKAgxF3nl6l8dJdAFeKUD05tXI4BrIBrM9CXtkO+oZaJoYAGWrNi15Nf X-Received: by 10.28.236.67 with SMTP id k64mr1241662wmh.146.1504860609991; Fri, 08 Sep 2017 01:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504860609; cv=none; d=google.com; s=arc-20160816; b=xQqsLxbmXeaJVuZxPMYYgQ7zFnDNeNOk7kiGcxKgSTW/7aFQwVaJ7j+nAqpVK5bw1Z YFzVviSTWsDN0Mg1N+BfK2n8HtSkm4eKqqTLU4CwLQ6IdtWMAlM6C35gIRI5+sT7uE0j v2vq8eLWRnXpj4+Znh7Hb9SjbCKPhm9L3IuhByoHYXJJ1EsMemY/ozAGLt6OBEzRfOQL Zj8PkJ2IBsIte9hmunWmVoRzL9hvpdliz0NR68+mib1Z1NdQIPXJnNMv0kWsy8Su3bZ0 jMFHo+mPVdhEdwq2kvmSjSaHtsw/luV0j3+c4DzjYdis7FM/nn/oelUK1GX1c574qgWb oPTA== 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=BWaiFazhqzpQJPRIBukmB7YYHeZSUdxWqHUVLNomlMo=; b=uqEw4snXl9QdUc2MMXpFwrRXo+bfz57Al95HgcLqT6wLbKeViPSHGZTPGtGYSKgCBU aXk2QApQzpIwhgKbVKH6FMZxX/DyWxBgH6hK/2vQMC2KD14BZczWSOcbdfXotJWkJew8 /jFkj88ifHgumITTPHGSRFkdycz6hTN6sRsZR8sVYI1S8mQuM2E3+S6YENDOBLmyUBCH gZFUyQkHjKvXO29TVKL6hH1wqf/Kc9BLvqzFVZ/IeZey9pLbeZKemEFP/Z4NO9uI3vrm lQYw63ZUCNsQDyWnbhVIyqe8FoG23C1ZaE22Zamu7ycepp/09JBEX0j4aS6TSEA/egAG CSOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id f90si994810wmh.141.2017.09.08.01.50.09; Fri, 08 Sep 2017 01:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 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 985E619A33; Fri, 8 Sep 2017 10:46:30 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0071.outbound.protection.outlook.com [104.47.34.71]) by dpdk.org (Postfix) with ESMTP id F1D3119A2B for ; Fri, 8 Sep 2017 10:46:28 +0200 (CEST) Received: from CY4PR03CA0002.namprd03.prod.outlook.com (10.168.162.12) by CY1PR03MB2265.namprd03.prod.outlook.com (10.166.207.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Fri, 8 Sep 2017 08:46:27 +0000 Received: from BY2FFO11FD029.protection.gbl (2a01:111:f400:7c0c::176) by CY4PR03CA0002.outlook.office365.com (2603:10b6:903:33::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12 via Frontend Transport; Fri, 8 Sep 2017 08:46:27 +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 BY2FFO11FD029.mail.protection.outlook.com (10.1.14.212) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Fri, 8 Sep 2017 08:46:27 +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 v888jmop023063; Fri, 8 Sep 2017 01:46:25 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Sep 2017 14:15:16 +0530 Message-ID: <1504860327-18451-20-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131493339874461379; (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)(8936002)(498600001)(85426001)(81166006)(81156014)(50226002)(8656003)(68736007)(86362001)(50466002)(48376002)(4326008)(110136004)(8676002)(2906002)(189998001)(104016004)(356003)(305945005)(77096006)(53936002)(50986999)(5003940100001)(54906002)(5660300001)(36756003)(2351001)(106466001)(97736004)(47776003)(76176999)(6666003)(2950100002)(105606002)(6916009)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2265; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD029; 1:cG15ohLwfco1ae+BOp+3GQKxcY9Ya6llvNqNKLJMIM4h95IMg5mjfh+B+felTbdeJqL6A32LEm1+r6CjxaThZpEmAY6iD5ALTGvRuaU6vY1hmg0mDKIvmSCSWHU8zsdr MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3b063dd-ebab-438d-fbc3-08d4f69617ef 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:CY1PR03MB2265; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2265; 3:wKCa64VMkPCybj4xqGwnSYRrM+wPk41z4MeF8IFUo/2EEHdXkISo50BP1fi1tfItd2WF/SmLnDz09pQYiEOt/WK+yXtqXpUDCNLhV+fMiof2fFcMagc/0CaJwM+l6+M4XmoNPXnHLjqFbJrOxkUjV83opHTgu15auRH2/9CxURGXIORLcG1kwslF9lXGlQzFhLGEE2ZPOE1Rq5S4IBH8cqLFT2rrCwEwMn53PK3uU+LiKHVn467C8fv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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)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2265; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2265; X-Forefront-PRVS: 04244E0DC5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2265; 23:mPPD4bJUJlHGi/LQyKJ3R1w1UxAWO/6TfYE1EpeQN?= vWdsz8RXnD8rrjQ/bkupVZmJcbRS2/brsqDhFLzyLZ8t9E7uuY5YGvK0vn7PSTq5LTxK3G7BEkZOxsWj0LpO6taB59FzP7FV94tbhrw2YvxD+TZDgGEcT6HrAtqFYlklxMWw9DOAhDEe1HGQrmsrJw63jjuF+SJUBB+o8ZPQRBYFdYWRS3P4j1nJDoWuUWzxLAwoEagRY+VEYQohV+9qrRuFKhlqn3Zx+r671Kty18hfuPWe0Htzz7LE1ZOMWh8VgVSMEL++oRJ5neFKl1ZbeSMJ8OeJhU4v3jaD3xlai8l2l2Vch2/UN6pawOGV4rNyGAjI9hTxBChmdWpgPPuKgeZzeKJs8PkND18XrhuMoWtaoKhcKDd2Tv4DCiiO9/ETKmxJYU+4u1nrLaH9yTktmK14A0AR+NQKgADlcHv8SvYe40ymHH1w0VyiGtJ25HdwCoZEgrU31K5qPLZmZtSqsqBphX0hJh04YVAVqk+mpVm59olPhBK8S03e0XFsHR/sfasu1+LuLfs1ZIYKvyV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dXnM2wt2n4YsQi1RHPTHzfMVg==; 24:ElXtdPvncWRcfK9D8HuClLkhtX09QX0K/Fl19951YUZa7DvS5VBQSrLIchbxmx04y9jMicaMCCOxGc9OblZke+DWgWlqkTChyZkr+eYxwFk=; 7:FJr8J5/eh14aG3sLY9PlYBmdTdbkLE3fhzsoV0q47Djvz75yLEZygWNwd7XomHAcCNRZYgPbfDFcbCPe9t/AxAOUdri/5jrGb9oF0E5CZ7DMfkjR+4lQiSB3e7kA5AANgUSsHeiENnHX/1rqzZELCUiwsMWx5H8QGw6OJwmkfP+g7+M5FSozUpgmbuzSEa20iqqAxQLDUNkWjk1IwdGdR5+3f5hMdt9DAv8Bw8lZitM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2017 08:46:27.1341 (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: CY1PR03MB2265 Subject: [dpdk-dev] [PATCH v2 19/30] 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 | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 49dc42b..74a61b5 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -666,7 +666,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) return ret; } - /* Power up the phy. Needed to make the link go Up */ + /* Power up the phy. Needed to make the link go UP */ dpaa2_dev_set_link_up(dev); ret = dpni_get_qdid(dpni, CMD_PRI_LOW, priv->token, @@ -1137,8 +1137,6 @@ dpaa2_dev_link_update(struct rte_eth_dev *dev, struct rte_eth_link link, old; struct dpni_link_state state = {0}; - PMD_INIT_FUNC_TRACE(); - if (dpni == NULL) { RTE_LOG(ERR, PMD, "dpni is NULL\n"); return 0; @@ -1171,7 +1169,7 @@ dpaa2_dev_link_update(struct rte_eth_dev *dev, if (link.link_status) PMD_DRV_LOG(INFO, "Port %d Link is Up\n", dev->data->port_id); else - PMD_DRV_LOG(INFO, "Port %d Link is Down\n", dev->data->port_id); + PMD_DRV_LOG(INFO, "Port %d Link is Down", dev->data->port_id); return 0; } @@ -1186,8 +1184,7 @@ dpaa2_dev_set_link_up(struct rte_eth_dev *dev) struct dpaa2_dev_priv *priv; struct fsl_mc_io *dpni; int en = 0; - - PMD_INIT_FUNC_TRACE(); + struct dpni_link_state state = {0}; priv = dev->data->dev_private; dpni = (struct fsl_mc_io *)priv->hw; @@ -1213,11 +1210,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; }