From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0071.outbound.protection.outlook.com [104.47.37.71]) by dpdk.org (Postfix) with ESMTP id 9D226FABF for ; Mon, 19 Dec 2016 16:22:14 +0100 (CET) Received: from BN6PR03CA0017.namprd03.prod.outlook.com (10.168.230.155) by CY4PR03MB2472.namprd03.prod.outlook.com (10.168.165.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Mon, 19 Dec 2016 15:22:13 +0000 Received: from BY2FFO11FD007.protection.gbl (2a01:111:f400:7c0c::151) by BN6PR03CA0017.outlook.office365.com (2603:10b6:404:23::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14 via Frontend Transport; Mon, 19 Dec 2016 15:22:12 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD007.mail.protection.outlook.com (10.1.14.128) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Mon, 19 Dec 2016 15:22:09 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBJFKMhr029110; Mon, 19 Dec 2016 08:22:05 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Tue, 20 Dec 2016 02:24:07 +0530 Message-ID: <1482180853-18823-29-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131266345322288315; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39840400002)(39860400002)(39400400002)(39410400002)(39380400002)(39450400003)(39850400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(104016004)(189998001)(47776003)(48376002)(4326007)(2906002)(97736004)(68736007)(110136003)(38730400001)(76176999)(77096006)(50986999)(85426001)(6916009)(2950100002)(5660300001)(626004)(105606002)(2351001)(15650500001)(106466001)(86362001)(92566002)(8666005)(69596002)(305945005)(5003940100001)(50226002)(8936002)(356003)(81156014)(81166006)(50466002)(8676002)(33646002)(36756003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2472; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD007; 1:HN8F7ws6IfpSlRjLmxC57LuazEvRmtz5Rg4T1o4iFHK999u6MuRXFzb9+7ycW7RBjphVkeQAdgFr4L9K+gu0Ki1YyC4jytVMWbuWHsLQCdhHGDij27/KY9yIDplGpbdBcTcIsTqiklT306JL+CcxztSNIMe7+seeKiP1/qrXCUfMVgiG+OMkS3Kmdm046aNjsRyw4p8keCRoIY07ZtoWKz9wkPPAJKG3yLgU++ES/uNklw/QeharK8+jiD55pIv3s2Eiq1sMdV2EQvlNwY219sU6+s/BdF+dkhkkuQJp2NRCxjrLdkQ0ZYm8e4RR14O8weFvRfx430c4P2ShQXaYqZ4Jg1/weEu5HCOjzMqJDIzdwFQaZDy9EM3Hsh2muH5SXYdNbZA7nevPJ4+8Ws3mzgeBe6choVV5ZVN8lJHtswDyF5dmIzqeVsb9tLYERsqIyJDiFue+z6UkhUEeH5SwX6ygt2kuQQUrkGpKYzFzLydHaiUzCy48Kg+mqpJEAXbdWeh3uo1mYRBLugSJ+QJTibUq5U14axyScoh+lkvJ9lOzld9u+4gGCQ8m9xYcJsn5Pj0DoB483r2tmqWXl0JgnYhHu6lsvYDPm2BVPVWxgTNQrB0fxeVC7OLme/qwpjMbuIuQqao09Id8/llq45a26/vilbAoYLs5MKh1A49jdbqkdMu81rKdL64lAtTKFUNNn/8GmsebchN7/LCLVBtWbMbXFedAislDqWUK+HinwwF6qqTx/f0Qu2/jyTNT93MyQWEcYY5PvJyQsxGWRHExSw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3e4fefe8-cc0e-47e9-a849-08d42822ce47 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 3:71Rd8faNG4eeypCiaDZvZs4j07A9yEB/c96K5k0bOBxpkuayksBNfKLHhpaY/boZwzwMJWSCXnR0CvtpE90HyKiiIUy5MVjY48A9M/9RFMTEGI67O9j7/ATVjAo924pU7RgO/CXvv8NOPje7zro+FdcgUvqSbWzciEzigqCcd+DtQH013pwlB2inZZxP4Z2qAcYxtrnXrcybVGCdlRti9xaDV0HxlQrx38rYnkOgtmjoLiHRGY788rRB/EFbs3fLtC/9TFCNHsBp+3WFtjd+G4raCyXTPwqyZInuGNn++kCxfs6TcEipmDGGJk1AbTNQoTTbPFT5+gbDzdWWcQF1SSB1VzumIZgT2pGOwiQmpPQ2Z0/Q5+Am99YdOQTOrJ+F X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 25:nxzGxI2P/CJj9d6zO6ksWOpB+xBTxkm06ketO1xcDdSRIrEWcXxejgzNh1XrX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-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13015025)(13024025)(13023025)(13017025)(5005006)(8121501046)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123561025)(20161123559025)(20161123556025)(20161123563025); SRVR:CY4PR03MB2472; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 4:rKpN4Fmegost4vX2qIbmo7Tl9G++OImLE0lhr/0bKFLuiM2Y9YaqlGM/DKulIzc7AddfBLs028tGZ5nlQAqvZhHkWcgp33meGzP+8q4fQF2wi8+lCStDEtb9JDrkPpC4REy5GOMHzvzXv7OfMSQ+Mp5Xyrad+e/TowC1N3qFPbNfRDBDaUw2I/7+K8PEDgLgkZMQDHBhywJS+O7dfjAxdCxMqFBqq7Ve4hwScEN0J03P+TZyRhHN7ocanS7DxAD8k6VaKOf6W6P4gTbEGd62QqJoTxTQ6Q5/c22hts6+uewT5LnuZec53S1EDpwgX7W/4NByMYAHsqPjn4AxoGnGmLlood3kvU1UvraWln3u/c8UoKntSEwEoZpZwxQ5+g7lXVJ7L7fm79Dl3Uf9HGj4a9WmcWAaSPH18N5jyp7C6BnPnZgbxWWnxBKhFcnteLt+ryv0MKZgwsifM3M0l+p066FEiVsEFi8ymxDJlcxQMjwaSkPY63dOfAdEMI0QlI678J5Zg2Ir4o+8r3HuLOVzOd0ZiJNeov5AKcX1+XpluPO6ZRwLsZ6nZ8UjH/6nWghVkHWljRnt0yLHBgPscmwHjnaKFnVmdPE6G+x+W46b7KAKK1M1YNGy3k8rGOfaLAEB9P3xlXWyi63nxEIsBe20JlH5NmF2dUS6L3uZhRyrTr93mwXse1aKw7wfC9u+3Q55pLP7cddOGJSMiF2nmKaRdgBK6lGxwkSfKXA0ux/KbUc0D7yc1DJ1D2XI5hebKseq X-Forefront-PRVS: 01613DF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CHfT5fDej4epzYD9LKiY63Mr7Eq7fMI7UF7zavnjULJxbSK; 5:DISeqDEX42+L5ToURH2t0Xl71xX2lsngZ72XHKguTX+K55MhkF1BnquOUg2mxzSjtecFzq8mG5/gl4VVIce6FT55vU2lko5NuAgRdZ/YzcZ6od8VDMiWGZu4JduGZS5BvOpwpJ8TUE4LHsvil1r1TPPV0WsaK3WPDLadbySSXLXGkau4gHEsCir8mUJk9bgX; 24:HXDLpGMOVevjYKnWxTKG40dUKUem+Bcsbs1rlx74nEIQ42WD6NvcCpEAJnrMlBnPRKG4MOybaAP8YV6psa7rn4uGMly9o6nS8FNsfxPR7QQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 7:IjDiS/oK8BKK1dkf3fgyRQyV1iMAmmG2ZMe3DMF8Rdjm2JB/DIlok9Pw+U3NkqVMS3MCFCmpdNq5xzwCFQnGazD/Nr2sS+l9XreZKUw+iu7BRxQ6lWCmv8YWQJ1xFErHwLiAcsu+cRHFG5SMrX74ps5H8Ep2hKELJRlJvACujIn/K0ziMg5rLZr+I/Nx6lckCouk53vkvoUPtZ9OvGgz0Uvg4YH0wtO8NCYbEZJJBVttilpQtHx6GQ1dFyzNxtmEMEC7XQhFVjt/sD4zODb4m3NLuT470GsrcLVxmPk5YDMBud3x1o3KtRmMDEm5xT4KdAOM/R0qgBpEqvoJs9jfcguKANa3zTptV6SgVP4djqCrnkrLsDJyl86oD+V+F5/5d+aDhyJvHFtgN6IxUCAYRILNVH7aJ3UCDweVULE36Y1J53r+rsVzTeqOZo5Cmbi7m1dDFDrbdavmUF2x3jqyRQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 15:22:09.1555 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2472 Subject: [dpdk-dev] [PATCHv2 28/34] net/dpaa2: link status 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, 19 Dec 2016 15:22:15 -0000 Signed-off-by: Hemant Agrawal --- doc/guides/nics/features/dpaa2.ini | 1 + drivers/net/dpaa2/dpaa2_ethdev.c | 107 +++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index 0746d4b..0660cab 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Link status = Y Queue start/stop = Y MTU update = Y Promiscuous mode = Y diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index c705014..0d53003 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -55,6 +55,58 @@ /* Name of the DPAA2 Net PMD */ static const char *drivername = "DPAA2 PMD"; +/** + * Atomically reads the link status information from global + * structure rte_eth_dev. + * + * @param dev + * - Pointer to the structure rte_eth_dev to read from. + * - Pointer to the buffer to be saved with the link status. + * + * @return + * - On success, zero. + * - On failure, negative value. + */ +static inline int +dpaa2_dev_atomic_read_link_status(struct rte_eth_dev *dev, + struct rte_eth_link *link) +{ + struct rte_eth_link *dst = link; + struct rte_eth_link *src = &dev->data->dev_link; + + if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst, + *(uint64_t *)src) == 0) + return -1; + + return 0; +} + +/** + * Atomically writes the link status information into global + * structure rte_eth_dev. + * + * @param dev + * - Pointer to the structure rte_eth_dev to read from. + * - Pointer to the buffer to be saved with the link status. + * + * @return + * - On success, zero. + * - On failure, negative value. + */ +static inline int +dpaa2_dev_atomic_write_link_status(struct rte_eth_dev *dev, + struct rte_eth_link *link) +{ + struct rte_eth_link *dst = &dev->data->dev_link; + struct rte_eth_link *src = link; + + if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst, + *(uint64_t *)src) == 0) + return -1; + + return 0; +} + static void dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { @@ -431,6 +483,7 @@ struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; int ret; + struct rte_eth_link link; PMD_INIT_FUNC_TRACE(); @@ -440,6 +493,10 @@ ret, priv->hw_id); return; } + + /* clear the recorded link status */ + memset(&link, 0, sizeof(link)); + dpaa2_dev_atomic_write_link_status(dev, &link); } static void @@ -532,6 +589,55 @@ return 0; } +/* return 0 means link status changed, -1 means not changed */ +static int +dpaa2_dev_link_update(struct rte_eth_dev *dev, + int wait_to_complete __rte_unused) +{ + int ret; + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + struct rte_eth_link link, old; + struct dpni_link_state state = {0}; + + PMD_INIT_FUNC_TRACE(); + + if (dpni == NULL) { + RTE_LOG(ERR, PMD, "error : dpni is NULL"); + return 0; + } + memset(&old, 0, sizeof(old)); + dpaa2_dev_atomic_read_link_status(dev, &old); + + 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", ret); + return -1; + } + + if ((old.link_status == state.up) && (old.link_speed == state.rate)) { + RTE_LOG(DEBUG, PMD, "No change in status\n"); + return -1; + } + + memset(&link, 0, sizeof(struct rte_eth_link)); + link.link_status = state.up; + link.link_speed = state.rate; + + if (state.options & DPNI_LINK_OPT_HALF_DUPLEX) + link.link_duplex = ETH_LINK_HALF_DUPLEX; + else + link.link_duplex = ETH_LINK_FULL_DUPLEX; + + dpaa2_dev_atomic_write_link_status(dev, &link); + + 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); + return 0; +} + static struct eth_dev_ops dpaa2_ethdev_ops = { .dev_configure = dpaa2_eth_dev_configure, .dev_start = dpaa2_dev_start, @@ -539,6 +645,7 @@ .dev_close = dpaa2_dev_close, .promiscuous_enable = dpaa2_dev_promiscuous_enable, .promiscuous_disable = dpaa2_dev_promiscuous_disable, + .link_update = dpaa2_dev_link_update, .dev_infos_get = dpaa2_dev_info_get, .dev_supported_ptypes_get = dpaa2_supported_ptypes_get, .mtu_set = dpaa2_dev_mtu_set, -- 1.9.1