From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-eopbgr710080.outbound.protection.outlook.com [40.107.71.80]) by dpdk.org (Postfix) with ESMTP id 318DDF96A for ; Mon, 23 Jan 2017 13:01:43 +0100 (CET) Received: from CY4PR03CA0019.namprd03.prod.outlook.com (10.168.162.29) by BY2PR0301MB0742.namprd03.prod.outlook.com (10.160.63.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Mon, 23 Jan 2017 12:01:41 +0000 Received: from BL2FFO11FD039.protection.gbl (2a01:111:f400:7c09::163) by CY4PR03CA0019.outlook.office365.com (2603:10b6:903:33::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Mon, 23 Jan 2017 12:01:41 +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;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.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 BL2FFO11FD039.mail.protection.outlook.com (10.173.161.135) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Mon, 23 Jan 2017 12:01:40 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0NC07ep019311; Mon, 23 Jan 2017 05:01:37 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Mon, 23 Jan 2017 17:29:57 +0530 Message-ID: <1485172803-17288-28-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> References: <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> <1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131296465006272008; (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)(7916002)(39850400002)(39860400002)(39450400003)(39380400002)(39410400002)(39840400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(50986999)(76176999)(106466001)(6666003)(5003940100001)(2950100002)(6916009)(38730400001)(105606002)(36756003)(15650500001)(81166006)(86362001)(8936002)(68736007)(81156014)(8676002)(77096006)(50226002)(305945005)(356003)(50466002)(33646002)(2906002)(48376002)(54906002)(104016004)(53936002)(47776003)(85426001)(110136003)(8656002)(5660300001)(4326007)(97736004)(92566002)(2351001)(189998001)(626004); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0742; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD039; 1:oxgplBSUValVZwGZP9TaEZSpZ7iLwaijViUrAdacmn3eOik98LfVhZ07FbhwDOFMFqeOsaBloQt6pYJelvMFeHY3v9YrFuxIAwuorJ8djfQVNH7qd1BGPa21zutG+8qjJk7QA5YQtcs4lIKsjq1siyg1Luo5LttgojTjsrnP13BJCRQlZ/Wezms97Jl0uFoHx2p2zXO+I2j7n4sC+mY+zIZyEizEnY93Ot2bzHp8PYtUdsB7XmEpztrNJUiJ4djPTsGUA4a5T/eZZB3YFEgYE6UvV5mNbU+0JQH55+B89WxeaxDt4SBKe8wDGeTPvnwVta6CCUXfbH5wQLN4Trm/OZhDSwQi5ojPIDCirk7E+I4sa0LKHwm5cg7srgS1yJuaG5UJHGS03Y/bCYJW+HiwOTzeNuYwcFCR03T/rZIA98WB230rNBLSCwjaZ68wjy4AYBSyg2uK9ir6k1zRhnm7yA+PC6ZW9Mlh9A8temQdOPYZUa/VUzkHIDkZ7771Yw0V//5ZhGYDkt1x3O6/iDzVieZN502qj4rvpA6Ymb62Nq30B0sNy7LkffiH4CA8Lfyzo5JHCqN971HNDQa1990NKxDVrrXIvza+VjJBsF3rEZtV38NIJ/u+VwtgSOfcoQSA4vIPRLT1unIxctxTh0L6slgdYKcF2bqLRahOCmbfflqHrpdOZa2+POSnjPuRq6zAsrdQ/ysMUUOo8vgL0+wrT1O/mcSV9cSsS4cnq8JtF29Divzzp8QvC+CvEQdaPcTb MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 9708256e-b909-4886-3ca9-08d44387976b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB0742; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0742; 3:W8/QtN6Go8e8XViuBMHbv+02s3Zll48YgkLqVKQcIfyB7DVoAB2IdFSWvJZnQztv3VskJXOh/1gN0x/swZy0tGm54X7KTN0FW9KpVpoT31IlS4bLTdlwcDqu5UPK5YGHBLHujI1MxsP2OPGnDkeOU+Fti47Kk9/wHWBLE9FXk3MJEMVrAs2likEJ9Pch3l2GXv2cgYvc/aK/3JC2lnzSuuuglOo+kBua096PMpZsH2TOPTZvakD55+6c8d9d87uyWVKrAPjWr25Pl2a6cOkpz7DdYJKwYVmh2dVV6svoBQonuNw9bDB3d556G39ucS+pt79IytZwa4dgwkHKz6q4G8EvQDt75OfkgHjBzNNEBVys7NLWhpOc5MoktbC4QoUd X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0742; 25:Qtvva4sZAyL3RyhlHKrm5XkPE1vXNbxA/n4liYS//e1CSKfmRoZ99zNBqHJJSFAyetc7rg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31EJGUG79nV8Y= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:BY2PR0301MB0742; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0742; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0742; 4:YX4dQe0d7TBEOIB22Y68YeGTFy4xT6sFH6156zm9J1D1rn6cQdRkLW9G/RhjRJttCicloU5EbGnSEPDkUbkqaBkldI3gVEmadM5wSXiGlNkb3+OsUTaVQ/a3RuolqhRUfZrR9SCd6U6ySlQzBvKvKHDt0GJxw3463Eg+zSpLI0ffxzjL5CBQkBBkbrWMenVe4PFspQz0w939K8NT5fLtNy4158y61DsGzSJShM+EkUo6ZZVCE18IPqOXPwLQPNcuuP4jkUE8di/eR8enOqHf4wapHx2VT0xfCofUYpnybhMhKGHVphNPPpawqgM1UcNfnPSFyO3wg8hbvWGyphSBi2p5UaFaZSI9pdHz5Da8wWU1pXTfGKpjmoxf8HLVyBNcsg3BktrsEgPuYkPxtLcxZp33MIEh7Bjxi+TTFQu5OTKI64qCaBE5tdKd8I88ZaFlfDHhmioSZk3rJxYbsjqF4h90tN8ORz7PcrMldsgeF0Tz7ogiUFMOMQ9AHd81RFf8ErdDzTEfPDaiL3uVbReAzXf3qYyjxieXhjztTghzoJeMSb9GDZabzm6PPtMqBg0QAwWEwgzkyHMXhgO0Y9JNUfa0yrio/9tfcSPk6A2guKNzRaDY8sSoNt4f0cIDNtVQeFuBVKCBLwFCX+BKMTBih7lfYJMULStLQQ7qjhieGRAfuOM/F9nWC4dUpyecR4557+2HjfNyEs2oXRgtSu4YKx5dOJMWY0nbTOsvYJ2GYHlYDyOy2W1c9qs24U1YYSwt X-Forefront-PRVS: 0196A226D1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0742; 23:Deu+UAAvSjlhdAKbgGjaGL8BEgSlnSvacOQZzAf?= =?us-ascii?Q?KRpOh329BoL9wlb0kX0nZUtFhzJclg9opqpqi/hWJ9BFY5cTwuWTAgU6quqg?= =?us-ascii?Q?uXlNdP5Wx4CLN3xXmMXJ+9LHCeFnSyA/Kn0j6QluS05MK9tr7JAe2Sp0evJV?= =?us-ascii?Q?elUU27jfwwjJfuF64jnpUJWb91xR3evCO87ZZm8D+KlZlyVzO0Lg39GjxMSm?= =?us-ascii?Q?p8Vxd+HLS3c7zfQhnBKlHprzqp2/0o1JCZbYSmAxunQ1S9inCaRNfNHAFVUR?= =?us-ascii?Q?gzRNk+3mxDwAXmPPErxU/UIhTMjw3IB8/bRSKxrN+WqFE0Q3QtzFzJFr6sob?= =?us-ascii?Q?sAvf2jbguvkE0X6LnrwnAuqFvIL8O6zMnMvYqiS55ZHyS8gVaMSC5fxW9/LA?= =?us-ascii?Q?eZJT0+pGeERmJeAmeQaDuo8FQLWhd46nBTxAolER8pHHJ1B+hGWtNo28HeR3?= =?us-ascii?Q?wqXa7rVF6YX+jOt4DCChgUtYgBgzn75r/tVjPORYVoPMYlV7KsZDJgdPLo39?= =?us-ascii?Q?MBbCAoLp6RvYKsZ/8GiBuCl/i1Jv5zxu1ybLFOGrmmZ8aObtWa4VRh5p1NQ8?= =?us-ascii?Q?/uE+95vHfC+PLshOjjaaB9OsXzefg3wmmxpempLbw1aDFQb7gfmdV/418kjB?= =?us-ascii?Q?HFs5jAhv9gffwLWA8I6S+n3bNY+hLz4RKLaY3MIW1jhMZwRkaaQbLwNXRdPS?= =?us-ascii?Q?vshPcpbACE8rJbYojZy+Fg/NqPSwKKhOyphc8se2opX7MUg1XsN/ABfnIv54?= =?us-ascii?Q?1SsE+bZhBIKbYIEgd1PuoQegG/r5AuT2lHD+OA50k70CvitvqNP7It3rIpkO?=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dPTWbOldcC2A+rxXHftAF/0fMG0VHIzDqMlDNcQmv1mJRX9UQ16tyaU2dDVtP1p5w/3ll/N4n/SqBghwl8Q; 5:cJn/EG/6mPO4fPQ5Q2zgr5oxNcgrZtHamr8r1P+i6/z0mf7InkgoYonBx19oX7WI13kC7iYIAPaKT6n+T+1lNk3LPmFw7QVCRpMAbe4MmIubFfqgbbzTo4bULOEWEco4o9bN8Yl6Vk+xwu0rBhYyjvyFUNciX0ttcE1jV/cu/BFNIrreUC/IMiooXUMlJhqJ; 24:rpWeJiDDFslF+yRhW+chVoKC5MLkAtTVVqz5g2dIQTSVFoLBhWe4nB+619AYEu2pCMvaw16rKZ3zXF4Eu8xCK19Xf42igHC+Bn2lu9ACZK0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0742; 7:yYvUI3wzNd8hm4BnaXOqOxsAz+AUAz3u/53Em1a0PKa7atyIy7k2k+AH3HS6HiSdn2ByrxObBoR0CBZpUeV2Jhtbg3YtkD7sD2JBhbxbkvTYC2fVKIV1TQlnUWMOdVAY3NRJZORzcXZcH13lNclNuloefYbqTW8UA8uNsKgDGH/TW5sGEFAxEPJ9BcS4TfwHqxmeu8gmxLcnlkZ6lrZft55SCuNe3xvmSaPh0ieqNDHkvF0yrEGZs7JL7nPVaNCDNR/AmbM0Z5ej6tgsmGlUrg4YAnFfLQW9NmI+vF2xmMBncS8wvQXIJyELJaDy6H+1IrqYnNjHDZ2qzie39Ub484cnpv3SpXtEepiHuT/7zUvDUsJyJao0VoVLLdvI8Mb1WVwD7YmCkAGbTcXawj1MEMdviTNEORWGoUCkuXnEflspujoi7Oi6ImR2iZbm8g/r/AiZfbyUfUK8Qav4uLzHaQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2017 12:01:40.4400 (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: BY2PR0301MB0742 Subject: [dpdk-dev] [PATCHv6 27/33] 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, 23 Jan 2017 12:01:43 -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 521a066..4e08096 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -54,6 +54,58 @@ static struct rte_dpaa2_driver rte_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) { @@ -430,6 +482,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(); @@ -439,6 +492,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 @@ -531,6 +588,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, @@ -538,6 +644,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