From patchwork Sat Sep 16 10:52:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 112798 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1616702qgf; Sat, 16 Sep 2017 03:56:51 -0700 (PDT) X-Google-Smtp-Source: AOwi7QB4KzvkzJoNq4Nppk/xCOmWZUofg0w89pz9gyPGdyWXdjuCe1FruCbaZu4WQOAcEU/aFWMq X-Received: by 10.28.71.88 with SMTP id u85mr4581082wma.22.1505559411438; Sat, 16 Sep 2017 03:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505559411; cv=none; d=google.com; s=arc-20160816; b=Lm4cJjPk80ESNfOclj57Oetmo0AJeX2BHtmmd7Rz/mVfNYUZGZ959Nf24yoeIVkSuW gat4/pi+D8y6blLaN+nAMEpJl3BGRZsqwWBGEPt7u4a/EujCsZGzLP9VZNedNzi2tTfh ETdzAJAMp5UHT6C88B/eYW7jZwLSaaR98mnbglXYC2siwO5buRsHonWrKbgMvXIWFE84 XXZCEqSiDPAuoIwFsCvptm6HS5B+xVbwfqIj4HbzTc7rrFYpua380sdDK8PXlrKGPKvZ xgOZ/weqmAXfZhC1aW5FU43uE6Qot7ku9yqD/ahwGmF76J6920uwtra2Z/EXM6LEEBRP WlRA== 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=slMMeuT2WsQ6Nrn1UuiURVqMN1+vwNp9QVwxYuY8etU=; b=n7eGnr3iYNO/9XGosojnodkYw6yOeATcprYwRV+h5ZxD73lP1ltWrqkaltZdHsLjY+ xf3hAuoRwWXw31SPPFF/MmyhAtGZ91UtEWNy5svatC/SPRm43672Cg5JrWERbrakj6+b gmbQnJ/ZJbA/0VjdHUtpvePKaNc84ZY77VNnCvsrg+kGL6Lp6SunZzr8TcKVivb3lKnj bmyekRnIXXs8a+ui+tPzFWnte4tsS7jKgwZep0jPHcm5tNzVh971dOu/ZXz5BcOfYTcO wWG5iZr31fSz2bcH+p6drMD9Kw2yPoO7/9bYBVqmKTBeoh3lM3ypcUplx2kokqJ4R+gZ uQRw== 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 b58si2450556wrg.374.2017.09.16.03.56.51; Sat, 16 Sep 2017 03:56:51 -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 [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0BE871B212; Sat, 16 Sep 2017 12:53:48 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0040.outbound.protection.outlook.com [104.47.34.40]) by dpdk.org (Postfix) with ESMTP id 8400C1B1EC for ; Sat, 16 Sep 2017 12:53:40 +0200 (CEST) Received: from BN3PR03CA0096.namprd03.prod.outlook.com (10.174.66.14) by MWHPR03MB2701.namprd03.prod.outlook.com (10.168.207.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Sat, 16 Sep 2017 10:53:39 +0000 Received: from BN1AFFO11FD045.protection.gbl (2a01:111:f400:7c10::187) by BN3PR03CA0096.outlook.office365.com (2603:10b6:400:4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Sat, 16 Sep 2017 10:53:39 +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 BN1AFFO11FD045.mail.protection.outlook.com (10.58.53.60) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.13.11 via Frontend Transport; Sat, 16 Sep 2017 10:53:38 +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 v8GAr6v3028328; Sat, 16 Sep 2017 03:53:36 -0700 From: Hemant Agrawal To: CC: , Date: Sat, 16 Sep 2017 16:22:30 +0530 Message-ID: <1505559161-29222-17-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> References: <1504860327-18451-1-git-send-email-hemant.agrawal@nxp.com> <1505559161-29222-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131500328189876145; (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)(39860400002)(346002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(5003940100001)(2351001)(189998001)(356003)(50986999)(76176999)(305945005)(106466001)(68736007)(33646002)(8656003)(50466002)(97736004)(6666003)(6916009)(2950100002)(104016004)(85426001)(5660300001)(48376002)(316002)(16586007)(54906002)(2906002)(36756003)(53936002)(86362001)(77096006)(4326008)(498600001)(50226002)(105606002)(8936002)(47776003)(110136004)(81156014)(81166006)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2701; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD045; 1:Z9mPOkHpmtqLhjv7ZkF29vMUixRqtEieW5Kjcwj8kQvtQRijjk2Yi3vhyUf4DPlmkJwdpWm7kGLHWYL628+oFRHrLbDdddbAjgmZ5mRwiKADiwZb7Wp91HAJ0CBqKPA6 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fac0bfbf-a823-46ec-2e18-08d4fcf13001 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:MWHPR03MB2701; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 3:gh0oLRyZCKI8T2Wp6b+ysVJim2mT/lLTGRDHJ4ir+S8KT3fO73dkfsCAmsVN/uzh8RigrVd+sxNZX0B4EjkkQ6px+8G1nLHUJIXNu41ybFjBG5E9l1ZSiR2QBgJ5khG2FNe+lY/gz91icIr0Ag7CwZSRc54KGmChk5X442kzytmIcNT9arHzundBfj+d35dfXecv0CHLQhLcG3uv1nNCxKfAgaxW11J1P6ksuvX6tdrUheqS1Nt/YXdy3NHSQKbsuAzx1/Z2b9+oo+h7ovehFA4djl0M7E1iWHH8MwDcBikpERZB0A1N2cg2+6YnurnGJ2iQNC0imoberWWyb5d+Nx8yksBn1sEisJNSdJy69eo=; 25:kPaG8/FRCvKOrk570lmxDzTo1dg2pTCVEj8SeCTWQsunMakQDw8YR8Ug6uQAWH/X/qo0gN4tmRQ2KyCbtniNF3NiFhv60M6PznHdFX79D2IQksCmHPoZ7dtHu06Zk05RppacNUf/CBz62KST9XZpzCgwW1LOEQKLHyUUcfuz7ZeVbF1YkT9lD+E/0uoupHG5JXq0EtCZyBup+ZGuKhf7N7AFPODZjH6OCymyE4bIlbFybvIKjOHWmXLrZI/Q58er5aALNfjss8G7Xo4ELHIqBLNN/RxbzNO/6UFRK1zwMJ0NrVllFkkFfFDDs7l8WDvc5ZANLzhpXhmOGPARAZO28g== X-MS-TrafficTypeDiagnostic: MWHPR03MB2701: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2701; 31:3/SnAR2p6KsPLVd3o47bgZvStwzOV5GrHY02AU811RbbyW8L9QFOCHSxCP8iIQ2tMT+QZvxDKhUNr0jJVCq32dA+nNABFEx/+jl222XUP/+wPUCi5SnuDHBiZTE4HsjgJZSevZb/S2mHPJZJgNLNfW31Oqw9rgK8sXIEL0p4QpZjFZt5f3kxzRqCn0LnlH/yROWt3+1P2Jyg6i4QB2DlCkRzDSr+6CPaJ2SrKzn04CE=; 4:r4EmZpf+xgBf6NoVgfX+QcbZ3YIkO1+6kz0bXOm9aLL35IuntscSdYa1A0BZj38ZY70goHnim1dheqbVS0TGDX0b+gvEW38aeiewg0kf2EZHQ9Yy+RMThvIfl3hZ2K8Z82NklMktLD0kfqk4If7tBIakDMKa1YSNMNFMDmVklogBUiQslDoFr1H7lt2MdLHiIdd3r4DHM2Uc2/C2UFOmlyGcYka/LZFehxPVH2xuj4i3vyaKrnsVnePNljBJj+Nrpsf1hdYgEh/8Hc5qCHoehhtlK5r8ehEGm/0EM5/QDeE= 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)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB2701; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB2701; X-Forefront-PRVS: 0432A04947 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2701; 23:p48ot9yBRDSfkqSxnnT0KBzISyqGQeInG2tRJA6LD?= Q2fbS0J0HZXPMGAQQfLHqZ4DKouBDqhknl+SWAmuiEWoeyxA5r5nSRUkZzB9KIuupQWZ0HocDZzuSEq1IUk4VoB0eACmpurlvSwhUoTqDajFexVrguHu/23BR5U+VJR0Qh6iFSQf/U/hh1gSxpZFQmdZ2kpdh1mzS0n3mJV3+9pBITuouXg2Y87pgo+dzP1w5Vgj8En3TPMEx8snQ3CAkft8S4Rf5H+HtmXJmYjuBirzkaspDXlQuP/pnyuSS1ZA0M9gms/xjoXL3icIvcHms2q+Q6MU+oFfkZN3xYqHSpInDTIHl4lQMB4Ax5wzx4r5oNCzM2J6czEKI6WlcKoRp/Ga5dzx5GgJ6D2GK0Cl7HX5hTbDVTUjqcTHexzEqzEzLSDIX6CagkEwgwAlSn5F4r5yxZK4xLGJlD9pW/kUBHgJSBsRuijw0XQfJ5q24sLE68taqUIzVGrGZUegyZ6sKTsTKZb85VrP2qqb9PlWStmK4oKeyrYk40BqL72zr/O3T+cfntbVgNDPyxL/uxNYNyZy+eI6gSRadUAuWSIn2B7KFwyvzO62GXzjWin3WOEa7aA6Pf1UWuPda6z4aK/BHEYHcx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/xCGUgy1rpio/4EgzP2l1ilzOQb+aaII=; 24:P68A9/1M4nTOR9ZKV2tzTGEY9tgGk3CA76OHHiHlPdj1Lxkp8YmZgn1E/cOdwAU5VI+ge4T+kWYxIMGe+GiLAaXSf9k9QrJz9QOYlCeCfeo=; 7:GOPeI7Q7qXG5oHq9cUzt04lmtI67AYSsPfatzorR6ncKIMnW7MXZO18HbIAM24iTsgIsaLDVCYk/HqI2ajkZW3A8Z+OBJjg6uBjrC2J+d3i3Yh5upy/LJuguStDiC5/pEANQnh9mEbBVZ6c0wCEoV2SRjbvsJRU6iU6v22hZKPvQXEWZtmTzoZQthftaN9r+PVaRkeCFOUvB/BhkOzWGeR2yNXHIxX12zy7W/D1t9DQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2017 10:53:38.7068 (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: MWHPR03MB2701 Subject: [dpdk-dev] [PATCH v3 16/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 | 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 72c9e67..d5fa644 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; }