From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0069.outbound.protection.outlook.com [104.47.42.69]) by dpdk.org (Postfix) with ESMTP id E05ACF8AA for ; Thu, 2 Mar 2017 12:38: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=LBcMlOHuD2Bq3EgOqyZ0O2GfsSYsbdZWiiiF77vb+ATonob6TMvPP5K3Q0tZ+sV9T46pEa0VXdMsMs+a+cZDTwBHkRWkTZtXmgQUPhNboujNyTu20R1FHVKriYrhL6NFHl6FrAHoOJ69FfNEzalx+hJD0tbD/YbSL/StRANH4MI= 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 CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Thu, 2 Mar 2017 11:38:12 +0000 From: Shijith Thotton To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Thu, 2 Mar 2017 17:02:12 +0530 Message-Id: <1488454371-3342-8-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> <1488454371-3342-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: BM1PR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.163.198.156) To CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) X-MS-Office365-Filtering-Correlation-Id: 1b4e37c2-176f-498d-7dbb-08d461609dad X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 3:g3bWB3WXqT9mmzF5T26UPNVBHVIyNu1dB928Yut6Q8nvO0KHsetfrb9oUGM3cqyW0tVaACjFGAO313eCz/BwtrujAwcy5CrYSX4jNjp8cHypQAqoyJMsWfTzFJhQyIsI7DZcKBfJdC6NnBUAuY7A2LJSN30XhYNK4uQ7uEKNMbaQZrrB5o9QRzV2XDHeFNxJOPUAS4AA1/Zz9gdDP/U9CEhI3YkCRndX7Ddyu16aaBxcEGft0X78tuahMVa5A61AV5XJC0wmQRznHMx5SRxKGQ==; 25:P0hZiLA8blWtfL0diccQn/9aNyC1jnhCuQhTrO5b64zMPiNIcP808ZhWwguxBdzCinNyAjrGMs9jiSOSm1hpTjg7zEbUMIsqnuWDTL0P+eevdrHD3WBcxDY414QGGL7EquhcxVTzIZ37urDWFsyWLTKnk6zPdQpDhVCHp5SHwhMadurU//NcobtNlzk8S6jx2TNeEwItCGRhQ2xXZLJqps3R5iZaYM4PHDTLkRFRHujAhNEowcNhuLnkDKBwabvtuLR0XVrlIh244IYlFb24IfmVMIGmTR/ani4odNiJtmehK6IehudFW4bBmvqinj8FR6ZSKB1d2PBwXmIe+IWjCB1oM11e5E1CJoe4S7+Pz4X2Y+wqUF2tM4g0ie4O5+f1DFEI6ZO+I3Icuubfux92mePDjGO/XxvFKZDDKbBhdn4TS8Bpib1p2iGiDAatWSYFYYCeOdXA589SSE2BoxdvDA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 31:HVsJS32yrDFynv50kABQIz9GZqrXOkEU7LpkcwuktWFGyDOw5gw/pf6pCWqmWf7HbL3c/9EGm85VHupn6YLeE2n9PT0cppUPyVlWdeLyyNqte5sKgB5rBqNoWYrKGHIQewfI7CG0fQjMXGMJ/GarcMlhehn1lUmDgwlPLybfRQKmk0OvI4OTLqn+n0bOqwGXA2zq8j7CGFefnBrHkVkeigHwGQ79NOw72LWOC2XXzvXsRhfPlBai/Y3zMLhzHtb6; 20:6T0GgNOcMUzwtfaG1aAoV0r5ikKhuPh068HN+Vmm3af4RPesg3oLXwPJ91OMEggKH2ED3dSLZt9d+hETzowo5atTwE7oMY8Ru7nOJy/VI5fsbcNQssDAcEzX7Bc9JCcdAxDt/d1eAAFk1bT2VTe+cjWBGs/Wos/6gbWmK/G09cBB5K0P2Mwvj0EkXetgX3+oJIlShRMxSHLUGoUR1wHLpXiXtDMcvudIj1hw7TI31rnrlOFBnCuZ6FygTPFDbmVtDZ4lQaVT/RQFIiD0qzOZ0EfKFVhbXaEV/S+/uHuZcrOcSDtnLjPpW+BdEvGr15LbSVqOOwr4yXbGs5XbYuad4VxjxH0E4Ji6Xjxjz7tkazNMg+sZE78LSmgBRRiEJfCsll1VdPbDIxZntLjO76FXRbJ2+INpvtNE1MzLaPtPiKb7FlRu1q6QbqOPu4Zq//YVy633oe2Yiljpi6dTKPpDT/oNSQgEGYgLPt+Vf+wv6fJJv1qJLQ554vznLZwiBDh39b3fKD3ws7hdFlAozuT/+Ey5EcnepyvOAOW/bJaRjsh+OD3O7OKpEnVz2KBVm9e9lPa/+L4dT6fXWVqch30CDyLGy4AKJc5lcaMOf5Hi6cA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123558025)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR07MB2277; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 4:HBRFqpaqSMdv2dRBQ/GlkA/qp3S1g/54nb+bDPs644zGsXFkbaKV2ncdiqJs3a6+BmHfpuBFXvIjYhgXYscdU3gXkFJCZLlb+bwo+YkdC2w3LKTqocSfONH8+wIeMzOoFsCMqbqo+PlokuqoOSIfCayeoCM3WB4Nyar82C0C+GZT6EfII5eGPyhPWdXOzr3mGhRqO75XDm/FZhccNIFlOUdvZaB7VeJTpHFotBjdYiWwQXco3AYtoqhH2wYCIokH5IzbOajp+BAho7ARZAmQ40MDLbPh5TIm8WeKirPKhU1IMmz2NkWm10Nr6kNZPDinVlo3PcqAdZ4UUDbd0ik3HC1uqKimnWm+aOAUdTE3FEXr1LSdAVbEZOP5S+IdgbNPA28lgvCqLHMKB2BVrvBGq5CtVXzddDtI92asu/wfcV2M4gC8d8XXOrp2H1qvgMCPaZoIlOWE0A8XUEC7HeQQwHBg8zEFmhSeJj8ZkecIDthKh1uFjljOeTp+UrhVZQHYUIppNH9LBU1F+tVBn214EPKKSCxaJ0yjJkjLvfEcHPkVwTivrX6rBv4ST9CTqJZrsedD0ELhd+8lXBhfZtl02Vc9lMxs/V/3OQuMBXSziBs= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(2950100002)(6916009)(42882006)(5660300001)(92566002)(4720700003)(33646002)(48376002)(50226002)(2906002)(5003940100001)(36756003)(8676002)(50466002)(81166006)(110136004)(38730400002)(4326008)(305945005)(2361001)(53936002)(2351001)(25786008)(6512007)(189998001)(54906002)(47776003)(6506006)(6486002)(66066001)(6116002)(3846002)(50986999)(76176999)(5009440100003)(42186005)(7736002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2277; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2277; 23:9AGjOAT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ascii?Q?/MzUVQ1wrF/r2QcGK/GsSonDwR1IVppZLR4cHjzWirVpwDIX6MpkvtOdjwC0?= =?us-ascii?Q?Vp1QoasB/9XRlBKCdKEV5/nDO1ep65UNtVQD5Gx9YxCx8FlUme/XKefLJUY5?= =?us-ascii?Q?CtjPGNHCTyDYrqj1dUR4AwypE9d01vgrS35BAsz+xGYKr5EVCdNlO9pYhgWI?= =?us-ascii?Q?Eg/rVpVunYTPOYjxYVDODEt8v2n?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 6:3ak+A+UcRXviSzRYkpOGVTMoAGRBt4h6Ll3vz6+lGKaG0CXFO4cKJUAofpECwxHnY7ksB+ye3PSGLxPNLlFyZ9Ms8JTktMAxBdE282FARW4UJcrOT24QBapyqevB8VWlLFAAeY4jcso5trG0uFvTse5F2lElUlDX1a9/nr8dHSY+dD18eFVkYkYwQmWWf+KtgMxyclbAGljRuG9id53LA0epHR/QeVcDeRRtjocq/OLJW4SA8flSs979K9TuINdVyd27+EkB7zO/zSckyeiWh9eM3tYd1ezhNdMy8BO8LYNpLkO/Kj3urJ5HNcGmFeSRw2WWFm+aT48rRcaDpN9TNXLE0GgnGWZ31HJvulWjBC3dZmlA68PJ1n1KcjOtGSHiTvngpXz2SHI6sbRlYzYNiQ==; 5:f+xMkDVVQijE/vxft7AiKfYXBF5k7xWo9JixA7uLuY/PFJb2H2L0ZEXjcTg/fmILms2QRFVe0S10viHPVPnzrzeUqzFRRY5DDDuDm/5SExKWHMd/5ors6YDTd7zC4ot8Nvi1xfQ0C89ykcr4RdWMCA==; 24:YBcmHfwgwFyqbw8b+wLg5U9Bhjh8CRZOy2llyY34JhGWM3CB6bZrL79hpMQEwzFLJ9VyuArVlMJvESf+3kzvlrM0aBEWai/b9kZECkIqbyI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 7:paufR02an4uEq/OOq2ELHzsgoDZGqb92V0+tmgKf8YyysqKisrncmRGTFp8wyAqiJzcLLTCokeqbTuDOXGZuUmsJaNDYDA/k0JuI2OCp4rBvPKul5QPzABynnIv2zt3W5hylpflbRArK1iW/O9pZqYVRSu++wa91sIBNlPMW97g7CICepbTQwe1/Y+Zlm6/PA+sk/LQAhyxYXoMSjElQExgo6x+dWcvXPDpA3nLxHXpkU4MOTINWPjF6+Wc4BcsC+u4rHjk4sSNR7T954yLEgNJ98raFtnMbVGvFZkRRdFrxVge1GRVFmkFuO+P5q72w47YsY+QJCs+g0HmhT8+8HQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 11:38:12.7947 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2277 Subject: [dpdk-dev] [PATCH v2 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: Thu, 02 Mar 2017 11:38: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