From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0074.outbound.protection.outlook.com [104.47.33.74]) by dpdk.org (Postfix) with ESMTP id F1E3FF60E for ; Sat, 25 Mar 2017 07:27:38 +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=GGzQleiBl8Gb4MUV/2QUcVoCBiG3PFK2t4W6B80Zg9w=; b=m4XxRVb+0cFK43qJcesqoE3KilEAGDBYOnECkLLoihKrvICAGUNZ+SDrA0dvJdb0+LOf/ej0YTw7ui47gUBmCeINbkB82p9jnUOPQpueA2XcF5Pm5cNOP1y8GpdsbjtrPopsWumx0SNpDV00Wlxqyw61bMjamg2Rq0OOKuXIbxU= 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:35 +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:25 +0530 Message-Id: <1490423097-6797-15-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: d6d31ead-e50f-42d2-1223-08d4734807f3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:X+iZVTsg3OqP7PxuSNljIiP9vKghk3tfZ+/7TjHcFKrGsYkf3dJtwxm01KY0mLbS5JZUlPjXF/o44djptitMYgZxi5/bzdKTPp/x9RyJP9uZaTBJz6EAN2YJAiJKRSabkh9QFxuK9NJE/HBmeR6SV4f3JS/esnZqrKIQ3T0/NGIAhNZ2+HaCVH74AhaAOOUpswnSxntHf6gi0izPju6DQyYomFxKz789uI8U9Wc9Wxl7Fu28Rp+ef6sBjD9Q7CxSeQG05hHDoSs8S4JtVA6O7w==; 25:Ii+8QhwAuuXHApvG4xN4z+Wcdx8ZeXqnvchJS1P4eCZlrvwLNi5rjmWIMhplGlnuiL9CrXBPe3xjhNhqPkCImJ7AHE7fg8E7EbVWS5g+81wQJ6VCYWSxHoX03QpDWTbxcLbY+zeCYnmeNm/qaMw05Dubqr4ng/btRbLE7Y3rPskbnK2RxHMlFX/T7wwsbNWGSu/9GksD5+vCTMbei58XsPZhXrczfOdAyQEfCBHUORJjIU2niBGhBW7azIpVAT0y1twk82fM3u/hOk/5fBIHnN7m3MuwyCunXKLWAqQHlwiGIcAKSTeMPmuksD/iRq3qhN7NXUEtyNThy62nM1q1MqpqzkMnDQlpbkLuhULsoCTsWYdCdcliIHinbcIrbPkuPUuX8NDLARGTLFykvd6ygWoD77sHyD83ajLso+Z1T9w1zuS2GNTLtgaMmwc4D3fTAcTDl1WLhSW6Bb8kc8H6Xw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:jAjeMkLjev2HI9E7x9kP2NYQpli7ECpz7Vbp9KjHZS/L05QB6irPQ1t9NmWIp1ByLcsje8A7KvZ3ccsGiygu97BCpvXvuuJ+i+ijbmpAIhi4E3Nv8w91hkruYcRTTqdpOZEbZT+OMtFjXQT00L3iFO3HVRhgrufBuwjA+oeIFxVUrMBnW/6GHS/oeSex9siUzz1buleGAStBpNC9kXQBsevH96cM57FfsFtF1TwrJyEaAUETGvXbY8ULP0pu8Did; 20:2pkdWGV+z9aENRvhrVfNVys9K8QOKU5S0XtWQrLHMAXxxoE8hk4ssukWwF8mLNSBGZWHu2jypgTvfiTF6+ctcjCtHgDsvd0DxcsuCH5zv+gSG/SdyiiOck9FQ9c+aiyoVV13O7Amorl5QfSR541uiXfuxSXvJ8qCYiHSZ36g43RLtQS4vsue0Fky+rO+v6tIQLnFVWrkXuzgbNDo5ftLf0TsmUGRkGr4EVwFs6wBm6zeLxEIEQIqRaYbDQ0MXjQlPOSXbwzYNaRvXU/Z0AuGyk9X4boQtjSwFg3i6Tr1n+tpzKpX0A4QfOmrGx04XbtuWO3ds3Y6PZQ0Qx/zgnKdOymnlo4LaF9lyO8vEz/ASl2I0YeGHmyOMEzA0KvrF7ThLGPiZFZo/zYiEuwiXvOkLjbiuDa/JETKt5U+OhLjGk0nEGwIFmCv9Vw/M450WxTR6bganzIM7j62N9+J5wGIWeRublSdBgCqlxWkM881Px2fN1W9CtCNPZa3rn8If40tjN0VwWqnS3MPQF7jM9GVleyusmBrBcR/Ljuy44Li6WimJg47wVhjNlN04E4BYXomb08Ct+QF9qMcxv5/paQGAjxv+mc9Tf0t/glicRZyu60= 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:vCWuGqlzW8zmc7d95kcCe1LjQmkb+aBYylI1lVv7Hj9M65XmW0s179nkUzCaU2IusAX2TjRkQUvc0BaMJBwVD2CfUEg8yqP1vc2dI+cOHkxctJciEOBln+oytecWIkIdkeUG/Z/npAeTO6WEWmjLMFTKu+xe/cBplSicEnJeAmJqz9DpAG1MpWCr/oW3TT+ICy6xE8fOMZPqprziAangdqkEYchd7+bR85uJr50qrEpxxnMQtJdMjCryjXXx4WE/Hpc5ewwkQZx7HnyWS4ljOMoRqt1VX8wdYcwXyWWbB/F+76Zh+gkaBsmCUyrjChpFOxN1jpNepvmp5v2ToI87MLIMCSi1E0sE7zoKnpavrbbY6XpbzB8kPobHixDc+1qYzpaZOklKOJgV6q9v3Mqgk5VisV/6c8n49sGksMfd1BzU3+CpQAu1Zl8hE+HYzNSVcESjACKxjGQJRdVwUovgRxg1ZlUeWan4LSsXoiOC3CfXOi/wCimYoKZcCYposHMw8Jz6FuFHAQTtLPBr76cXVJAhjHp40yQBlcVkfyH35udCZAjNGyaRdTeU05i4WUyRzwM7sxgEQyF7TSntzMsr4JtDAeUfLBWBCUeZGh67lf8= 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:wzuQL1To8zox0BKVFU5QvV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GOOQ5TTH9buiQ424c55oWM+QqOATo9/oFKlKqqDNtEAhvUVdqnb7YmmRkB?= =?us-ascii?Q?9xhHS9+pC44jg1hCuKflFJONGNsR6EHlAC4z7w2CaEBojZqJ+bDYITSDamNt?= =?us-ascii?Q?ZLr69JA+UaWBn23DsYbQR6RId23lHaanekS9bJaPDaNXi6htI9zX3ssJuxAK?= =?us-ascii?Q?mzs0wkc3TuPAArK6WippUBdY65h?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:fSaifahJdiJ/mozqsZ6z8hxOej3Th0W0YxSVr6nOANIlEr7ABSwNOi1g74jb2ke1RacG/9gr0en57Pq7w9l/TPrmlhRR7ObCg89cxgUAe/20PguZpOZGhysFWMfL+hKyTjYBj/dLJa9YjO/0vcpluU1HonmTHz0jJN22cAgpVZm5FUkwtsqfuTT2UEL71W+/mvX1K73CsUF16+zhKsH2u5pYzZ66XCSDu21sy5jHZELxVPrz94fcpQ8E14GEUDXN1lfaQIUZTqOK6t74rWoXb/ewpOEenty7aZb7tEupr31/xR1a99+Umgir+hj0BmSYL1kH/yqBFswaIUGFmeOb3KAKuHvF6wGtA+TSzxuBxNOUauStT7DvBgWNg9rV8rzUpoe23xVaQOAOVQ/sU4aDLw==; 5:WWJp9omwI3lZf48jOU2NrkI0iDPHWsaOp651i64+AE7EqWsoZjcFSvfnHkYEZXrkkgpwgr3Mc+8I3yQwPbkOnQMucsd0s1E2YciXkbttGJh0uZAQ2U+ws4qAzS7+4YB32blzb3ZAwkYQNofwHHlj9Q==; 24:nHwJsmPaB3uRozV9nV7E/9X6J94mNpvwrFaROKDLjvwSx9FZtYV8YnLz1A95pNHkeoEYYSr5yf8PK3ChN411foWDVM66FjTgWKlHyFyuwGs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:F2M4M8A1VIYy1DqdLmwC7kyFNGjLxlQWi/WKyNr5Uw2CR/7QhVgBLZuikKPcPYTAWKsu4UZS4cIighgaBYEHtCBORec+jbVR2b11W4/ZLPBdG98KHFlnXu3Giw9OFykY/4p1uN8FUGVV4jjbku/Ms7nG5nWJQLtOkkTApiPirj80MXAqSTH59Wr+EXEIFHQnVr13Keh2GUPW+5rTxMRZt/bYHdOyoyQ4MrNhsDXGzRClIyGfVRLzTpC8BRjmF05j1PU+Gk7Yn+tfIqKKimWq6JxkXpldZfXfBYw7PyXFTp59zMQ1OdWIMMoWGo+lhQkMCj21aiIAfQ3U4krvV1y4TQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:27:35.0603 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 14/46] net/liquidio: add API to setup IQ 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:39 -0000 Map instruction queue registers and set 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: Srisivasubramanian S 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