From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0085.outbound.protection.outlook.com [104.47.36.85]) by dpdk.org (Postfix) with ESMTP id 9D7E9FA32 for ; Sat, 25 Mar 2017 07:29:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=M1ikz8fO290QYtLe6fQK0eo+GHIGZdUUmo9JScfYt0c=; b=olMg90RCDCZOhwVGd2tcDTZqESDxyUZ6Qyb8FBf/08akN+jE07f5Dm9lisF5irx32zddHVW0lvDYDDkKdL7sziyuVJPWuMQFR7yg9TVdlQLNH9fimeIBf9Z3wFAvyOgishdr9Hq8AshyKwY3oddcOsMQQEYD3rMiJTbZmub4H2I= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sat, 25 Mar 2017 06:29:03 +0000 From: Shijith Thotton To: Ferruh Yigit Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Sat, 25 Mar 2017 11:54:54 +0530 Message-Id: <1490423097-6797-44-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.208.33) To CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) X-MS-Office365-Filtering-Correlation-Id: bb048899-f493-4eaf-d3f7-08d473483ce8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:RMaKm7AmDlg4Zb3CirYu4ss21Bq+753MLdzBSyey/yOAJB/s1Fi3L3Zv/llTMMcjtj1ij/gH+TUACppWLd5OwSOlszK5l06paPnIE+xiRCwrrQ9xakn4gLQIlcofidOej7YHce+NuHc1BuH+Ikp+Ac1ApLQOeU8Ppu39m0cwHgYve1Cax1oI9RnIuBpbuFwXlXj2/uQwFibHQTgwoZX8ufG3RkIO3lGQKKRGQx5BIbeLXa+HMi8Ya94ZznlaFEDoxRL3MAcXlGVCrignt0UhKw==; 25:0NjpMqTNsWyO2At7oD5oTJbawaYNYwVaeTL6rWCm57uMDoge/OJftgEvev4210c+OLQWhFBm96occ6FxnP7+ntCZTUaBPaoSSQB2MMdQB4Jteu4UJ4csiQsXvQzwfY0Hx82EEQO3GwT/5kGD8WF3hXA04qRK+ZlfOCE/Y6pQo+qn5R3s8wmgzg3BV8TGinPBOLHBSB2KWI+UQJRkscWkkoQ225AtupvOuNv/TVUA4k3+8xPXGJ75qSi/QcWhFv659Y9JfcCI3iagjImcBhNmPOvP3Ei0dlPqYvZSplSopt94vTkFL3rvgOfOKYFMSnZIyIYXWdurc5H8AUVRFxEFDRh88c0TN1940goBXK072jg+my5z797hTJMhnJdmHyTM67X05gRCVqheoKo1XgL6ghZwoSwhLnkEAjYrR8+IYJoa+GkqrOM2l7WPAKtUcF4o0TqiDMYM/GB+GxrAVd3HGg== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:Y+OX9i6kO0beaNK5CHypS0QECggSiBwdhy4RyYKqcASKCe1iR4GC8iEcGyDiQNsLUBJd56zgFZdxA7UOMp8cGjyPawxujzXloG5OOnaXqypHCOFMWTKLBDXqO9C7jD67sk5AcG2HOva7FfKp6R9BFLQd7atLt4OWGSPhsHgKZfkOKlBfv1NuvNYU9kYsEazpmGCAIBpmv8DNoy/KvwrXTCt4yvDWYPVgsTS4/RXQ/DE=; 20:eFfzCqYlInpp9qRvMMIj6RhvP9deapYHCjt/ytTkbKHyBCgAMZ6foBsBtifaADTsaDEcHyT6tRerLWk+xPx2/CWO3uytgEbsnb6TLqGk+iZq6jy30OImGOAFYHifrmucgAFlw5zYrRcJyfQvqimuzkyBoeFGdEzHYsn1pIbCFk7ep6MiUEKaRyLxZQBWquFdATPL4u2PtexnG1KB6PqgzHEV4VQrP+DR77NtlzGsZMSXa/XFMCQzzWtvatuA7f7Jx7qnnE8/A+lgWX5E/3zr8aVP7O3O0NUYTXaijSamcUnpHKIamFXWce65P1Pb1K3fJJS2myqeZh7Wd76zMypKZTw/lh82RkmC5lP/5+uLNIWUIqoIz0OiZBXzdTHfwjwXbEgRssaUdIw3zt2F12ZYlkTubmz50kpiq2Z16UqfwXuFmNuzymJV68xAwK8PiJeCBqQVAvnbZsfi91uKFoUyESdElwxbU3VQca8f93X6GGcHix4549bkJeLdtgqv+1DOQ1zCQGL/Q7J1Chl656yd4ay9871O/WpkWe7SoZ3Heue+4ggTAL7AxDeASvDFZzP7XZo1PbYrQvK7w9S/aDduX75yBr2puzrBcZ4hqiAAdjk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(6072148); SRVR:CY1PR07MB2280; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 4:fgqD6RCjYM/DsIrwfSa7ptMibFyYjAORehiuPr3dETpf12U8ZSJLWhDaoRBNqB3PAD/NISrIB3+KLYwYmXyLBDZYwxA3qDgF+WkLMCi3TKiNOYlR5tgDPo5oW4ZuJBrerJIy+hU/hwowyXOimrkZBNdnu7OouHv6wed5AWE965n4UnOgznXvIeG2ZErKYyelkIJkbwF2Ts9Oq8hzkdfU6lrU+JRHv/nKmIWH4Ce7NGJKehsblsRcoFD7IuRByGsN0jXa3Z9pVLaeZwCgR0RvjCGasVGdHg71UEvRs428OfWCimOpqhrXowF23pjMawHwT7hZfSyL6dOmDk76Oj/FKXKbF9eALcdzhutxfc3XkwPVJZOu1ilJzlV8GpnBGZbTYOtl6ERrBxcS188nmYbAWEhBGLxQgM/VZtKhpAcnLY4Ca8WUuNObjAdXjbXCzfavNf+MU8mYuD2v9DvB43l54JFouOHYxSDgKtjwh4J/pOg3V3kjC/qWRydBXDs9/etxTweBKnn//Kvspir9gmKRB6KUk6ib9EW++OJRPjEi8/VT0raLXQ0ykL197MaBux6Mgxyz2kCdX+GzyU4eIhW+WtU7sGmUi9aZ2rsi1r+f+qM= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(6666003)(25786009)(305945005)(81166006)(7736002)(6116002)(3846002)(4326008)(8676002)(6506006)(189998001)(36756003)(50986999)(76176999)(33646002)(4720700003)(5660300001)(110136004)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2280; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2280; 23:rZt1HbkjcZf+u5c8raoU7kTFSPLuVyq1rnOZQY3G5?= =?us-ascii?Q?r8YN+esUo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hxOPwmgjnSLkPj/c5Y3?= =?us-ascii?Q?28Qe1VS3Mne59/RS2mVh3XdXHwkNASVbqZzi/RLDcz75QVY/71BHOmxB2ZxL?= =?us-ascii?Q?jP/LGNfUKqRUbzFKh0wS+wmb5jALbCP+YjhBtY95Bf6b9YugsbdiS3B0+SzJ?= =?us-ascii?Q?OfUlQ3herW2BqwQ/bm1a2ocntbb?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:ZHWqGXGqReJAWKT/Wb/B0ZxeHx8Dho6AvfMk51woxTFFrwZqhTAxSfi68vkeOYqxaDxXyXfCjxg4jNGfEDyRoPyLefvQmqXRP9DZsyi/sQNN9bKMMtcMLxEiXQ4dB+XIC/AAkA/l1bAXWD6adELCQ9wfmUldKJm3siFIGXmK/LawZwFNnMx/6HxCo3HsE6i7gpsjzqV/Bqetn3WzVdkHDP5PH9xRTE379LtaZylhQVDp5MhFUxpf+Ug/JIy2j1lv5bbEQjB4LGdkZRBCSQGHvWA2y2udoioyGeYy7hFUjDf4RUbD7BH6TzXFzSxx1OIw58pyU4f74HaPARRRJi4DQ9TSRmPOjlJQsHlztwNC48XZTVW/6l+xXq9uXVsosNbtL3H462Md+b8tKVXi+LG64w==; 5:lMIwoIFy6tkZZt1Cd5FLjUQRvcjaHjsc9CEtEMcWK7/lWNBrctaH2mPwVDYBol3/Gig1bPBsvwVf6Ouq34lOto6vWdceWM6Q3B5JxAAY35JAeDh6kM4h7aDv69I3ACIj6uuqTkX4FG3QYqYcNhzjxg==; 24:2uKLA5EUpIZ/nCE73BW8VXraPs+6pUp8iop/eIv58YSmbyH4qqz2kstMm9/y2auYj3xetaIhG/YZdkdjxthx7QS/Nfd8zWyO0ZB7UzvEk94= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:p2rD67Gw6zDnE+8lVAVAvQYjVinMhSPvu/S68443Oqo7C1uqytLysGtdrG6HOgh5NwUUh/m3YHfYaKRcWt3yaofP3gW4+kW98LjU65/QsH2i9ePNs3yWFd7RaBRQWwvBGHy22Sy11nwvmQKcxnbSztPMK76WtwBOM91xRYR9QerFpvpgEZ65ftE/WmTZs+GdQ/pYTD74EJy7XNdecX56NKA5A+y7gvWqcFW2zLRRE3XYgMqNQ/ZVhQqjKbljYd1Z8K5j6FVVcCv7jjdDo6SkTkOJ6ieDa8Rk6KJO5YNcqTJfPKy6xXiD+8QAdto34aK1nxzBVAr4mzn1n8uLreZiaA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:29:03.9134 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 43/46] net/liquidio: add API to stop device 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: Sat, 25 Mar 2017 06:29:08 -0000 Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Srisivasubramanian S Signed-off-by: Mallesham Jatharakonda --- drivers/net/liquidio/lio_ethdev.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 4d0977a..76d775d 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -1359,6 +1359,25 @@ struct rte_lio_xstats_name_off { return ret; } +/* Stop device and disable input/output functions */ +static void +lio_dev_stop(struct rte_eth_dev *eth_dev) +{ + struct lio_device *lio_dev = LIO_DEV(eth_dev); + + lio_dev_info(lio_dev, "Stopping port %d\n", eth_dev->data->port_id); + lio_dev->intf_open = 0; + rte_mb(); + + /* Cancel callback if still running. */ + rte_eal_alarm_cancel(lio_sync_link_state_check, eth_dev); + + lio_send_rx_ctrl_cmd(eth_dev, 0); + + /* Clear recorded link status */ + lio_dev->linfo.link.link_status64 = 0; +} + static int lio_dev_set_link_up(struct rte_eth_dev *eth_dev) { @@ -1656,6 +1675,7 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev) static const struct eth_dev_ops liovf_eth_dev_ops = { .dev_configure = lio_dev_configure, .dev_start = lio_dev_start, + .dev_stop = lio_dev_stop, .dev_set_link_up = lio_dev_set_link_up, .dev_set_link_down = lio_dev_set_link_down, .allmulticast_enable = lio_dev_allmulticast_enable, -- 1.8.3.1