From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0083.outbound.protection.outlook.com [104.47.33.83]) by dpdk.org (Postfix) with ESMTP id AEC4BD382 for ; Sat, 25 Mar 2017 07:27:16 +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=rEZV6mF0gcu1w1jmTe/RS1Mk7FUBfd6bsBsfrQE/864=; b=Rb930q/kjzji+TPWh8oq/dg/gH35P3t3s7JmHeJgUOqn9d7sk8DvVhFPkJrCKDjWGxn124CBc0LUiyIqFtyfD5bxCB80FL7qgeZ1YmjuEA2dFgLgokJXDvEzrfLSX9dbCmGLtIgzyFomRz3y1BCBgEB28p7l02UOI/vX1QvSeVo= 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:27:12 +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:18 +0530 Message-Id: <1490423097-6797-8-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: a1b2928d-1e81-4bc2-72a1-08d47347fa76 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:nGPIo9NCXMu2yKfzIOAYMzFIhTnTT074FRgIdp8TWtwl/sU1j2LbQAWtiN4l0+BjswnS3qzjF9LiuXLawXsIheRzfyS+Nx7ddKxQwyZ2blLXyBUS/w4njqBqdDwH6/fiaeuCURk8iN7J+lvMvwKRm2XCYbemLzU8AEZKrNOY5LkEdKGGCsDTi2Y20p5BmrGRAdzS8fLy5fN1xJUeOp2dFlKgMbzf8lEfc4uH9Qw8q+IHXvAAFiK1c+fVyQ6EALiBDsXF+ddTPCjRWf9bt22yyA==; 25:NQ02O2cr1k6Pyb7EQ4dCMtMsl2a+YyxSlhd9rMw2QUgKZ+zn+MLWU8XYgHpyKLWJO6s+nE7fwZtTdG1X0DV8HjCvUTCsKvs36qOF8XL4LbqCszW2JKISOhJAT2zjz+1PbmM3oOEFx4MB2g/KNRkdSRYljqQMwQcZsxkU2bB8xYyK4agp5IfL6GMDee1g/2/Lf9LPYSsgkD5W1dJVCNXJs+zttajVr8dKhy4N2t7UWN6FVcCyVsur9znvmClaOSIBe8KmNS/fPIdaL+Da+iaQyfCIXFHpSG7ykeujoUjpPTgCteE/V578qszrcYesDXx++BrL4lSFlrAeeb5k12whliOlWMtVoVH8KvL6JWy65u4pWRzlMVZSHsXwFzygU/tUcSbkqYQG+URMaKQgNPJY9BtTd8pd2guvbiYqFabta5fFzQ5ynUgM3sURDhe0JJ5VMF4wUNV5dt+8tL38h+r/Ow== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:DRc+h6jN//w95rtweJeuMpH4vXxtZauGlcLcm1vn9FGNv70Qb64Ur3Ll3UIDu1ln22g8io5Zm2SojPrHVGR7M6ZLI+uheaL/CFOKpp8fILWrtO9vx063OG+hnvE1Bd7JbKyAeJ4GHB/rT90oDI/EmSwmbdu1Xco5BqlQGiGTLPBnwaX9Sbgv+3t2CnzRZMRZRKY8HySs9xNceFA+b+HDRbaSf+kb+hQJoK1Sb/VdRTEa1Hyx+QYVJVNEhINHmyXJ; 20:5IJr3HeGHw7vNEkKN3wzkqO216TjoxyfbEV+9nun2ZaLTj9Wha+hU8WY8+EsXiBQ7gMwdr/ndPRx5qjkGEaL+dlSao68KODu09hsZBnffYYFh+rQXdS6lQzQ4wp4KWd0MskfPQzjfRG/khV0hAofo+vrvEz5HT7pUKCcTU2OocrkENNSgYCoVUj+Tv7rts5Qfduw9i3okiG0t3YLRDu2p0A7Y9IXbtJTEh3x8ULTKQFI4kJUUJUS31gjpGr8c4pW8IrnDLOE78T5d/eobxcCZ7mnBngVNZB+GrpE6AjfjyFWdi1V0fWTyolNscVQ5xVBaZyY6NCJLQYM/d3//jda50NmGkpydYR9QhdrQZO4NBPE3fERX3FIF2+/e3KrUC2TsNBSCceVMBJHFo4Jotvmca54qIG2gtMCjpDb5EBhsRTKjjtX42Vs5xWF6FfuW4G4aYG5jTALA+8CbvXtZbl7ZeZWccbGm+1EzrYBz4uQA/fdgOVM8VmV3XnnhS5vHGg2qi53iFgawPKwe4sBvG351ftlkiUXbl2PF1MCg0eNVGVB8elfbN2oB5TJTpXTMHHuYTkWwnahqRhZ3P/zn29So+TTUIEL6qrPic2+ceTbXrk= 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:CGjGLu9qQBtfzCRsXgpy2ydg0Jho4CRdAGTiwV2/qLgj+yFm+F51pxp4xYC1pbrRLhacJz6EhlJDjYF6TRqnCwF+hjCxdUFlQid/qEDuUFO34IFC5TkAsc8G1IMFwD5l0l5SWrlzHMEsCzqH0SlfU2QJQ8U0I6YF1Be/E1ugBsRY2U3xhuFFFZwTPqvy/Ob0uvQJ6YAmkcAhAa53QM4etHBgj2U9R3bhtP04MTV6CJMlf/rEidGzuucN2OL7KlOQLjlsCntVo0KCKrxofEjcaOdamf5z4ckdudmneMq2ibsFZDSrS/4Lyaqgo+ce2Wd5ItyIm/3ER4456b+4hLXNUoDaT8LjY8H8F1xMtIP1JMVw90b3z4O1kSwH4aHcsjW+QHSVAK1/gEBg0P+MERdwgwCnPdBa3ZNdphj4UXxTSNU8yP+hV7czlKxk6NW6vTmK0+h+Cbo5iW3xWpnjmUs8LnWxjcYtz2dEPrenyr8uXvliPjvifJ4mzAH/MqdEjmTZWxhQsW1woVISSGDFp8V5fRVoBl+vUslyskKwZ8xSUk3jOUo38LzUAlOvihmr8AWtNMjE6KPjLxsHolzYhM4EnLs0v5vjWMbPtuKfnJ3mbHk= 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)(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:n5BBVXYZ5qfUu+BLbYBwsRkkd/0hbMGcSwP4whceP?= =?us-ascii?Q?Z9eFB1Yb+B3Eu7NNr8RRehaSw27wHbU+jCxej5rpgGD287BcnOPEhFC07Awo?= =?us-ascii?Q?uemOregNivMGt7o2HApPNKmQ8BWGoOE9zok1N/dmuzdwzQM1g45zDvPnnqZ6?= =?us-ascii?Q?mJQud/7nFuwe3VG2saahZMKNp/zquQpRv6Et4+BMQUaTNSh3clY+grWXAXfI?= =?us-ascii?Q?0oKCRH9/fYsRc9s/dq19YbGL5bi9HKZyg+c9rc8LIKyrIKq1CQtRVCyeakXO?= =?us-ascii?Q?TsufheM3tgFBdO9maRHCx9frEVsRFH5V5JRn2EQj9EHsSKgi1Wup4jweZ/SB?= =?us-ascii?Q?LoAi8DkumPurmRkpHunqgKELfDt/Uwtje/dmqA3njI0lAZuIE0AKvbROoBa+?= =?us-ascii?Q?qt8K/NVDDPrK6hrV0h9NaBBICwjQu4k84OfLwCuGnawue9720yE3u/Z76FHX?= =?us-ascii?Q?FJ76mtsRDoQ6K19sPzxctg3GxjLFpBGJaxAq/UtUfiWFcNrChmJxplEwKMjj?= =?us-ascii?Q?cPL3faeuUHJICO4iufCsb8u+bzKOFshM58UzB8cD62htp/Md46UrVI8exxhx?= =?us-ascii?Q?o/1iKoqQ7rg8R5I73dtKd/rtOiToh94KrUU1wg2BfODnNIyC36fSL6fbCkd6?= =?us-ascii?Q?eu86+3DZKYe3nlmW7xVNhTgl61MpPUUgbldymyOQEd3wIExPxR3+cZh3KTox?= =?us-ascii?Q?srgInZgpLyUCP6umYtjhAa4K5CK043iBirwhCFoFVvYaEIiql4YokRmOE6LQ?= =?us-ascii?Q?PRPwYlgOIETXW3Dk2hlCDOjiijOxpxS4AhOjNMAa7aPmKTPgZXbLqeSV/CcS?= =?us-ascii?Q?GgSmuoKfXYP4LMzu7LV7GFitUXNNfgnHgWp8UYljgEp9XTo4wp7Awfh7WNuS?= =?us-ascii?Q?rlu6xTJ+hlmpQjUIEYdrL9hIL829pCzt1xZJ/YRoyMssxI6a6obgw9icsyoW?= =?us-ascii?Q?a6Y3Ti17eVi+PRA4StHh0yaeDBR5+3LW2JV0c44qOQXKDZcO2bNE9ifEIElo?= =?us-ascii?Q?VrFfnUTLZ4a/zpclIGy0Vr2HavyShc+9BcrqKvgdCPPn2MIGs1dIzArGIhGu?= =?us-ascii?Q?zUWPxw=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:+foQ+5lYcCEl5C++rFiRggDOLnVWa+FKRsrNpQCia9WzBwnbndLA5haFhljodNqRAwIJDjsLv3xzlYF0DrSaZnFw6EKcXPIQNBTaqM0Heh/9/SkGzNx0aNxR0mPQ0cPs4R92T2Eg4/3HLQCOy+0IO3NrC1enat2wRxMNtXGs0L/Yo+lwWTep5BjJT56AXaEyDhAH1H67BCMaGakdrd9RAbjZpXYwm6a9gatEAzaeKVXEuPr5O9jht/Pcmv5wam7R7P2PG6e/0jTecRssrRKddHKljJofmZrxzeMbfRXXxZMMIZame8+8ehIM5rGZlNFe1LmLpkrapcn3Rde3mKF//E/67bQaTs/ohJgBvzmlut/oECub+Sn+shj17zy17xgeCfUmvJa+1s9MpU0vspFBgQ==; 5:Xqxzmczsa7nM3FITXVVjw4B3iPd0DlJbxK9Sz3DjX1flnYvFQt/VkocJcf+3Gbapbb3IiL433jZmTHhj9m5eh3+7YPfLt2EkMgxtSEzuB2peDQTsUikoBCnCDPtXgfFRpFzU9+IWir5p5/dWq1BhrA==; 24:l0Qx7LyrNHqxp8StcmILcr6ZleDhQSN1aNW7QG5/MGn3WGgLCwvX/F392JwQIHqnDMiK5aojMCeXY6ykTV9c1ZMSs42Onv3n6nltR5uEpKs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:pHG3chqrf+Wk/Qwn50m8ekHjDFWqYoFDGcI83xlf0YLows8YsHTGRQfFYx7LSwPtbvYF7ZTEYP0uE56oChLS3MNgmKYN9lWiP5eSXcNZHe2+cSwN9omd6mb6yia0vGia4xbl6lpg9FMUkH/EnVJ/vDGi7wg26Onhg3BIotU85EheXcXF7B0dA4cyLwaGosT2l8A7/zDQ6XtlvCBwrt7t/Gz00VBWih6MGE3vYEIKGN8NDxbEPrheBR5NRM/v8RN3sXJqQ1OuWI24aaO6LKQh08wo/MxQd+/snGd/PpzXAnPJAp8srAXDeEfDTrPOR1/ULFcCR8w3g+9anozj/K/9iw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:27:12.1159 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 07/46] net/liquidio: add API to disable IO queues 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:27:17 -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/base/lio_23xx_vf.c | 49 +++++++++++++++++++++++++++++++++ drivers/net/liquidio/base/lio_23xx_vf.h | 7 +++++ drivers/net/liquidio/lio_ethdev.c | 5 ++++ 3 files changed, 61 insertions(+) diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c index dd5e3a6..d9b9e2a 100644 --- a/drivers/net/liquidio/base/lio_23xx_vf.c +++ b/drivers/net/liquidio/base/lio_23xx_vf.c @@ -65,3 +65,52 @@ return 0; } + +int +cn23xx_vf_set_io_queues_off(struct lio_device *lio_dev) +{ + uint32_t loop = CN23XX_VF_BUSY_READING_REG_LOOP_COUNT; + uint64_t q_no; + + /* Disable the i/p and o/p queues for this Octeon. + * IOQs will already be in reset. + * If RST bit is set, wait for Quiet bit to be set + * Once Quiet bit is set, clear the RST bit + */ + PMD_INIT_FUNC_TRACE(); + + for (q_no = 0; q_no < lio_dev->sriov_info.rings_per_vf; q_no++) { + volatile uint64_t reg_val; + + reg_val = lio_read_csr64(lio_dev, + CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); + while ((reg_val & CN23XX_PKT_INPUT_CTL_RST) && !(reg_val & + CN23XX_PKT_INPUT_CTL_QUIET) && loop) { + reg_val = lio_read_csr64( + lio_dev, + CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); + loop = loop - 1; + } + + if (loop == 0) { + lio_dev_err(lio_dev, + "clearing the reset reg failed or setting the quiet reg failed for qno %lu\n", + (unsigned long)q_no); + return -1; + } + + reg_val = reg_val & ~CN23XX_PKT_INPUT_CTL_RST; + lio_write_csr64(lio_dev, CN23XX_SLI_IQ_PKT_CONTROL64(q_no), + reg_val); + + reg_val = lio_read_csr64(lio_dev, + CN23XX_SLI_IQ_PKT_CONTROL64(q_no)); + if (reg_val & CN23XX_PKT_INPUT_CTL_RST) { + lio_dev_err(lio_dev, "unable to reset qno %lu\n", + (unsigned long)q_no); + return -1; + } + } + + return 0; +} diff --git a/drivers/net/liquidio/base/lio_23xx_vf.h b/drivers/net/liquidio/base/lio_23xx_vf.h index 1c234bf..1af09d0 100644 --- a/drivers/net/liquidio/base/lio_23xx_vf.h +++ b/drivers/net/liquidio/base/lio_23xx_vf.h @@ -80,5 +80,12 @@ return default_lio_conf; } +/** Turns off the input and output queues for the device + * @param lio_dev which device io queues to disable + */ +int cn23xx_vf_set_io_queues_off(struct lio_device *lio_dev); + +#define CN23XX_VF_BUSY_READING_REG_LOOP_COUNT 100000 + int cn23xx_vf_setup_device(struct lio_device *lio_dev); #endif /* _LIO_23XX_VF_H_ */ diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 734f6c4..0487f3d 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -86,6 +86,11 @@ return -1; } + if (cn23xx_vf_set_io_queues_off(lio_dev)) { + lio_dev_err(lio_dev, "Setting io queues off failed\n"); + return -1; + } + dpdk_queues = (int)lio_dev->sriov_info.rings_per_vf; lio_dev->max_tx_queues = dpdk_queues; -- 1.8.3.1