From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0069.outbound.protection.outlook.com [104.47.32.69]) by dpdk.org (Postfix) with ESMTP id 3A7E4F94E for ; Tue, 21 Feb 2017 10:28:37 +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=Xi1wOwM/6nSnyqvFEBQ6QZvTjeiYwTO3pn8QorvKYVI=; b=mFsT5/CL3/wHa2QFSpZiWoufDJCC3Efikw5bU5R8aXGCc4MJYao68us3UP11BqO04eB43YLg4q6yr3Jtr9q4gr/LICVXcVxHtj90j/eK3eJy96hzbVDOIWYkgFW0FA4wJD1rbFk3hbYZDAwC5zS93NyWOvJ82wr/ClitOGpqlH8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Shijith.Thotton@cavium.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Tue, 21 Feb 2017 09:28:32 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:25 +0530 Message-Id: <1487669225-30091-11-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-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: MA1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (10.174.56.29) To SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) X-MS-Office365-Filtering-Correlation-Id: e227ce1f-94e1-4a25-1723-08d45a3c025f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:HhA6bNAsvYUY118c98lGfkgj1UW23v4k+eosMZ7W3QfMdrywP2JRVnP0+078Ga4QAc/cG3zajtHEhMS9Dp1GHFOl6e5cMSe126zgZHfiNv+9KJaQapJTC2cDG6TH6QPlMHF8VJYHotvX+hQFt6Smm5EKShU1gn46nNBYw0iCW1Zz40dVrWV5FEt0hV5wD6/9ouF6nyOBcSw7YZfXhNi4mhxnfevBPsN1kY3TDtBYGtUWpdqYpbWm2BMXxDAiJSyDh7vzpPH11tTadtTWjImwNg==; 25:6rNw+qoSBNfk2EgOEBbVrhZFa+MSkunVdg4n9VI71G9tpN4CjQZZZu7RRwRWHxjEWS7Y5r/sBf+Gp9RiBtqLvHZoGr7j9Mq5vRUokn1mUq3AMFMMpks90GpZJosYQcpx9hiCLJcTEfVR+i2HKckOhIC9oQlKJaQPSIqKAcUc4giOyTeSrpfHFFgttceI6yVZXb66zsqgiRr0tg11k1nTqG1uGGiG3F2W3ZCv2jXXG4BK7U5QKbgZ2B+pw3Ui4BdzDWfbuZ9f858+v8cNWrRMAQ2rjuCyCExcUU+abwTv2MA8mZ1abgr5wgqrIPlbKgwvw8pbJfcKReaH5Xkiyy8fWvRlIydIgN0m79ZHxv9X/gHbtZlb2L9I6ZT9tj3ocp2FNG4UDmNhkLsS6rADHq/+xF+4q5uqHg9GzBNzjWN+3EHfrVqcB8J1KebcpZ++x6u4mW6EVr+ChN3tQnVsHHG7ow== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:I9fuixMOWke0CvCBbYWiR5J5JIwGfYbR8TZsKB3AOdGQNHbcnTSXUEznToTQ/sfYmq+R2GYpZI228O04l9ije4XVDYslfCkWcuGNZ/5kvK7aH0ESwoZogiuAQgvZEVmom/sbu5+tLaFdgm4cpM5VHS1pVHPTAixbjPchTDzNQlOHAUpqRst5aMggDpVIzzLjlq1+1/jss9I52CG6W5Cqjx1U/aw2pPdGrUbqiU1HE5o=; 20:N6m+o+qTYamVLWU0F5KWo9Y3+6fq2W+953NqIgVyTDriZXWcx39loJPk+zYpkVBrKtUp0eAshnUDzB3hbYYOp8FkR0QI7BA7e8hJW9bFAFiRIK/mzJ1H+8SoJ5Ue5CIb97z6+HSapNLpFFTg3OB4UcimHGJWINQjyQtYI5p2LIiUCfnwg8XVXlSLSTb9Ahj31SWYUh5a9xOZri1k/Ph2tzuMxEP8lwylh5oZlDz2baEoj0ReCdwbB4bA3Zy+Z5TzPBEWhUCal4ZdGugvGVmJZGwRJ46YyWvt4OfFJetg3wTwbE2btI4iNWBu8YwO8adKmPRzaq61m21mYUsYpR57vR1emsFEF+dvEJfkNdMGygURXkuV5EeUkBtlZM7RbJGNQmw6EXBpGvm4/h141hOMdzfAYoi77okFDReID7UOSSzheRMxd0G03vYgbjdTSVyxk5E8s1B/RMPva+wAeYhqWhdEcw0xnfRPzpq35jTZUQM7ihOk4qusID7ST9CZKRkvujdB0E2OL8txhh58NqvQGDBLMwbbK6sZ5poktsS13HOdnxXS9u6wO54r4zsByD/fmPG3dmr6FJXkQxYPtkVmmpYOnpX+ZvZm04pL22L+2BI= 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)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558025)(6072148); SRVR:SN1PR07MB2285; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 4:ssJ6PbLZz16/7RNm5FAnBr68GW8L/atU74nd9S0wFlmpEmYRYZWEHtKUEiROIz2WjS/NR8j0IhYwfe9UrA11mWHYe1I5FZKZm+M9at5ZxB3+GyKoVTks8TmjiwC/Y4EyffcJ18iyO8oPXz1kj11HiqekFPYDrxo7CWaEOe/WC1fb+8h4Hp+50KgI1BXUaeqeACTNFtOg5wnqQ31C8vuFXetywHGmYWntpCxr11s77J2hubZuylYwaPr+7fNOCDpuMMGF5cMWnL8CAVtQEy3rFxZ0uhqr9s8z/RlT2f/3vrzsPuM0zBahnbgzpnIS4smCcfjnFy3D3L/OPt9FasLMf7Jrgv9K0fQu+mZxe8qTylkIa0oUrCCCh1k9wVNO1Pkqb2CIJHn34m48nLKnzIcEjPZ5+xL8bPNx1eu9lE3HnNlmNI6eOC7hkz5pcVjboyonDPlnmnhpJuJculrIdnIFDWkOOXdYMQXbCxUGTiC73uyk8/C/m0eCEw3v68+BSocr92JdmR4Lw/z0gJBRJKNH+xc/T5G2JMtXeIwuj2x7DvXXOtCX13b008O/Rq+3x7o4LGqGhcESb05VVBJEIcYJHKnF/MdgwYBpKB66Dp/Hwek= X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(199003)(50226002)(81166006)(42186005)(2361001)(101416001)(81156014)(305945005)(3846002)(6116002)(5009440100003)(8676002)(105586002)(7736002)(53936002)(36756003)(110136004)(106356001)(6506006)(25786008)(38730400002)(2351001)(92566002)(48376002)(6486002)(97736004)(50466002)(5003940100001)(189998001)(68736007)(2906002)(4326007)(33646002)(76176999)(54906002)(5660300001)(6666003)(6916009)(50986999)(2950100002)(6512007)(4720700003)(42882006)(66066001)(47776003)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2285; H:lio357.in.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR07MB2285; 23:4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vSI2HySoEvQYQypABkBmB2p+7F8tbeHu5RRjaZc5IEJVjqmzVquOWVPEGGT2MC9MS1kznpQ==; 24:mKkvmGpTHwhTk6SsYMHne3NUXQHnQzrtqLHH9/e+1ttVijhiq75ni6ECJhRPWOSEjKN9mE/aJmuUXbXfnRj4MvVp3cUds7FDvEeaRVPRxqU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:G7yRjQRI6DQy9wWMfyJsyvCwLC6T8DsNxjTobXIIWt8Oao424y+72qd5sFDt5AhO/qxbmpO6wKmhc+OOECNsxaiSfPI05XJzn/Pmt5Ui24hW40Lq6jTg7dH2+WkipMXrnkybyFdygTPGWVluW6Ct8KJq9TeHlfinLNOT38i/2JxDArOb6cm/igrN+8ROI6e1aUshU5XKI0y9Dfkn++YNI0/C8/+bOxhwKBQMK6iOsy9vtGdgA4abSB7ckWmrk5diPqd0ol+3e2FX4tCbnoy8ma9MUiu3g7m5ATjuuWxto6/jpFEJ7aRhJZQAyJJtc3Ia/+blgxsRJW0ZU+u2VdDMZQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:28:32.8843 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 10/50] 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: Tue, 21 Feb 2017 09:28:37 -0000 Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula 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 12061d6..bd6196b 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