From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0046.outbound.protection.outlook.com [104.47.32.46]) by dpdk.org (Postfix) with ESMTP id 84ACDF95B for ; Tue, 21 Feb 2017 10:29:00 +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=vSk+l12ina1tw9BSLk/T/n8UY0CgeHzAkeSdKxgHKxc=; b=QEqeZhaVW9yrjFvEq50Iv4uO5FghqDx3H2ehXfy6uT/8st1ZhAqd7vvmOvOCq5SW/gzyLf2gggY3jBevQl5eABGLmukJp5oQtWwhXScshN6d+Ek7T+mKNynram7tnBXAqBpLztdLccoPjTu0Z5mtnNTypOCwcPHIZp+dzd7zKZc= 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:56 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:32 +0530 Message-Id: <1487669225-30091-18-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: b3cd20b9-9e73-47b0-7694-08d45a3c1076 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:OO3SrANeoLrxvl7Ht8MYXr680LMw6mGQyZ5v/VdtRKnZH5EEgasmHfuSlELQAEMzETFjwR8Jiin0HvK85ozgVuuypVFRrhlXFbZfKIU3d8b0fuV/f/YD4zGAoV8ZcK5NJzwuhQ/BtKrSBdeMwDUMYT3z9a6dTOKd30YTauUtSTkF71kDlyKZnqM6kmEPDPEsAX4BI9XYbglK4X3Ge5wLNX5M3FKans0CwIje6aReeAEDM95IT6Q3QtkLzfGO6BOodxgR2q81F6kJ3B1Z0sGZFg==; 25:xoQHP09/bT74SxjzKVX/z+bZgcYXvgOPhCXXEEl7OK6yd8U6uxBIaqtBt0/iW8ZGxWUtV4JbpCHzgGYfznvp/akLYJ7MAdkRzThLnihhmVMUWJAcnre1+H4e1ScwkYj7F8KebpKii9v95JbNZN8VPBIQnyxY9nmyyYuzzEm3R4lNuUKknBtSQAtkByJeCHiOlkWfJtMu36tydgHl+oE0DCPRJmUUusQxxAIW5j33eF87ob6ltje290fyNwz1qHjiQdFPJEK9Lt+mc/pjnRQvKepkGW/r3d9R+7qgQBM/kb4oORKrqInoCNF8dNWi3m/Pjf2V6KGmIokNiQrmlKoIaKvW4vCa/QioHxYf86rOpD5aKR9yUHVt4qka+m42JrKFNQKe3gfxoig21K4BT0ImoHdLXjLEy8ANwijDP3EXhfvBKXbIHWTC1HzFbbBl3Sb0RAqgxWWtJdaWcgvBflZKtg== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:eUDrhp0qPUJYZUXmx4hqYW3g2SnN4xunCKq/uxZenN+p5dhMS/0LXfhIF1PBemdaFRvDlUFoly9ViMjt0h7RSgqJXeYYUj+p70xZjfe7lFB4rq4Nj3fhEbmcSQiRdS0LSggVfYyoI/MRWJX4UVypJ2yTee2kPn4WUWt6Aan1SI+fHv/Lpvg6OmoG1UIXOZG4Q/QSXt+TVrPGWWBxvzpFNexXB3411K1987jsdOxRBszW+Y+DmXrZ14bVprFLsyd+; 20:0y/7i0lypTXgrNhU3W8cmVlHBJmS7kq0UH1bgfV8iPuUiHfFmIpxa33mP3a+m+RVtoeljjpcMcwRvu1AgcOwnMELVA3kcRuzAVYMaxWU9MCRzEZTs2C04uubku/AcGYYRr2fE3A0ObCMWNC2qL5CL8+6TJcEAFOdx2LIthKWI86y3L8F3zd4/PNq+wzxWcngtPsi21NfsZQH1qzPXXuGrVcdZE0cDEguUaX5AHGW77n9VHHCLjt5B9OAE/C/wneuTztOrHMg+I9KcHqERU1cRgdH1vqhY/84NWCSvjMayi4q/P5pAue0mCif/GySNEAs6sb0CWHDLwsNoQTODnvyxq0ENiRDr1R1o8wZTfRWFbWwf0R+XlFph3ar5DHNIiRf5gpS9mVNNahqGU93nyUdo1h85asfLEbZJV3zI+txbQfYedcGAxqww/OeU7zwmqKnIyDINcYyaqm119D55NIPwXPe6pSVBHvi1JKSdFtNPcd9m+FaYjleSMwDN9L5LYpcx+fsejFiqowikNormZXNgr+gjAWAZUvTeXc1zTLLA8nzkRnmDKspPhLijTD5Hv5cPsZ898JuCr1CggRjtoNtgyq9mQApyZCcuKANhQfKAwY= 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:ceJabiTBjlqBbKhbrXEQIMYwJgyIAEqYmBgS/Qg3QSCr6lrSolRkobrkt7D5VIxwougW2ijpdbeOdQT7zFl1tvofSTnvMMQvjJxP354OxHirUYAb1HFt++wt2uadMQbf26r7TyOJX59QXV5NhK2+oxiT82/VwYHy2/WUrPNFCzh9S6IeV32oSQWfggnfKA0k4wYEGQJBCiFnZJmt4vv+tgQqoD+/badt2VzvSkriWYMAWdLqu2ImHq89Ln1DeyK33cIADLYrGjwgdhSPqYN5A7whB5gsN4VupZlQHghxQYXLbJR8z4p324UTEBIXcAlayG9O2Z5khBBFkql/g1Lo67Gj6iAz9wZBlfO803ARMY3umdraitjlVyyhpJ0TzakZBdgW2zKwRh8YJenz06+OcS3lVqaSN2G9OBVY7E6RnesXwu1c6dDi/mOIOSwbXOUSQQ6b0G4+cHChBSE/UF6ySxU2luplnkBb05KrUEf1swzngcoRXc51cAD6BtPHfzom7xDtcMoxN+RVrQTl68N4fUOsxF+KrctFfxuDe++Fzzd15d1y07MCp9uHOklyTkC8IW1fEXjNf4J+p66Gz52RmocP93VSjAe4gUT8t5fIu2o= 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:uh42tdSuA6SYjBXeY69li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7vYMQJpwYqluIemEovm93HoEfpI7nuF314Yn4joQJ3uyybw==; 24:uf4Mtie5gHH7yhSYd2hdFr3/9ctggSJntqeAJEUFAncmAJFVIP6hjtJMLzOU/CdcPGNXTgyexw/Bjazg2JMrivj68kUX6Ye1I85vWOb3xMM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:Ss2321zC4MUGMkwN/XkeoLQV43iCo4B+Eis/n/iVdGONsWB/WDIqb0xBIP5FADb0WooLObTpwkmu84VrmDiBmwTlHsPKn68O3P08eqtQgCeo6VzYMtcbta+F7z0IZDMQb4X/IrosYARbbRv615HyYmnETmfP5Msyo7SSyh8Pxc451iGWLAUCwaYVb+THjWBArrGqwOYAiamPVC4y/QfXiFqs8b0ePPX21BSImkb9FeFFUOjfg2Evrhan9rm9DynEyrnRgACtUJ924KGnuDPU8Bb7pY1VK5QaY8yxGQEKSisc74zS9b4wquHS4O9hcLRMm3mb0nDStM63OSxPZdajbA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:28:56.4787 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 17/50] net/liquidio: add API to setup instruction queue 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:29:01 -0000 Maps instruction(input) queue registers and sets queue size. 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 | 44 ++++++++++++++++++++++++++++++++- drivers/net/liquidio/lio_rxtx.c | 2 ++ drivers/net/liquidio/lio_struct.h | 2 ++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c index ed5b830..181f830 100644 --- a/drivers/net/liquidio/base/lio_23xx_vf.c +++ b/drivers/net/liquidio/base/lio_23xx_vf.c @@ -199,6 +199,40 @@ } static void +cn23xx_vf_setup_iq_regs(struct lio_device *lio_dev, uint32_t iq_no) +{ + struct lio_instr_queue *iq = lio_dev->instr_queue[iq_no]; + uint64_t pkt_in_done = 0; + + PMD_INIT_FUNC_TRACE(); + + /* Write the start of the input queue's ring and its size */ + lio_write_csr64(lio_dev, CN23XX_SLI_IQ_BASE_ADDR64(iq_no), + iq->base_addr_dma); + lio_write_csr(lio_dev, CN23XX_SLI_IQ_SIZE(iq_no), iq->max_count); + + /* Remember the doorbell & instruction count register addr + * for this queue + */ + iq->doorbell_reg = (uint8_t *)lio_dev->hw_addr + + CN23XX_SLI_IQ_DOORBELL(iq_no); + iq->inst_cnt_reg = (uint8_t *)lio_dev->hw_addr + + CN23XX_SLI_IQ_INSTR_COUNT64(iq_no); + lio_dev_dbg(lio_dev, "InstQ[%d]:dbell reg @ 0x%p instcnt_reg @ 0x%p\n", + iq_no, iq->doorbell_reg, iq->inst_cnt_reg); + + /* Store the current instruction counter (used in flush_iq + * calculation) + */ + pkt_in_done = rte_read64(iq->inst_cnt_reg); + + /* Clear the count by writing back what we read, but don't + * enable data traffic here + */ + rte_write64(pkt_in_done, iq->inst_cnt_reg); +} + +static void cn23xx_vf_free_mbox(struct lio_device *lio_dev) { PMD_INIT_FUNC_TRACE(); @@ -298,8 +332,8 @@ { struct lio_mbox_cmd mbox_cmd; struct lio_version *lio_ver = (struct lio_version *)&mbox_cmd.data[0]; + uint32_t q_no, count = 0; rte_atomic64_t status; - uint32_t count = 0; uint32_t pfmajor; uint32_t vfmajor; uint32_t ret; @@ -341,6 +375,10 @@ return -1; } + for (q_no = 0; q_no < lio_dev->num_iqs; q_no++) + lio_dev->instr_queue[q_no]->txpciq.s.pkind = + lio_dev->pfvf_hsword.pkind; + vfmajor = LIO_BASE_MAJOR_VERSION; pfmajor = ret >> 16; if (pfmajor != vfmajor) { @@ -355,6 +393,9 @@ ret = 0; } + lio_dev_dbg(lio_dev, "got data from PF pkind is %d\n", + lio_dev->pfvf_hsword.pkind); + return ret; } @@ -394,6 +435,7 @@ if (lio_dev->default_config == NULL) return -1; + lio_dev->fn_list.setup_iq_regs = cn23xx_vf_setup_iq_regs; lio_dev->fn_list.setup_mbox = cn23xx_vf_setup_mbox; lio_dev->fn_list.free_mbox = cn23xx_vf_free_mbox; diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c index de98fc6..4a687d8 100644 --- a/drivers/net/liquidio/lio_rxtx.c +++ b/drivers/net/liquidio/lio_rxtx.c @@ -141,6 +141,8 @@ lio_dev->io_qmask.iq64B |= ((instr_type == 64) << iq_no); iq->iqcmd_64B = (instr_type == 64); + lio_dev->fn_list.setup_iq_regs(lio_dev, iq_no); + return 0; } diff --git a/drivers/net/liquidio/lio_struct.h b/drivers/net/liquidio/lio_struct.h index 29059a5..2806c37 100644 --- a/drivers/net/liquidio/lio_struct.h +++ b/drivers/net/liquidio/lio_struct.h @@ -155,6 +155,8 @@ struct lio_io_enable { }; struct lio_fn_list { + void (*setup_iq_regs)(struct lio_device *, uint32_t); + int (*setup_mbox)(struct lio_device *); void (*free_mbox)(struct lio_device *); -- 1.8.3.1