From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0083.outbound.protection.outlook.com [104.47.42.83]) by dpdk.org (Postfix) with ESMTP id B98012BB1 for ; Thu, 2 Mar 2017 12:38:39 +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=lZ62sQet6drNJhzR71FuUDwo730q8y2hdg3qZ7eZrtqv6uWMtxJ+g3FhMMrzk2SO04GrSF+Vn+z+EFH5aonLwG+mMrirv/snFt6aRBrzxHZEvVYskJw6fAH7K2VpfZLW5aIhop1FfrqcUw7A8mehjc9PU24j5rnF+6y0czsS5/M= 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:35 +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:19 +0530 Message-Id: <1488454371-3342-15-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: 320701b6-5b9d-4aa9-2039-08d46160ab25 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 3:7Assre7mm7qbINhfkQL0ikmnX+04Ye/2Mi9EsI3AS/zx+7lgNnrdhePwjAzDChDpd9g4N0dj2rG8tAFzPdY/zJu6ZAJ3MF4J6M7Dn1ooD7bgRJhLaOCpBq6f//4nV/Sj5tXzCxw2DO2lY5Bg7S1gf3Z85C3mNibcWEQYASgyUw/2p+hyNPOhcaZRcEzrPE6cpTuWoyMSfrNBtxFJnRiM0+ytavxGtYmksmvgfzihjzfIP63oiM6OgkDZiL/6Yb9rSns4o786bFTZFj3zB+bQJA==; 25:ZqgeiwC8NbuPijp/OuA0dI6dqrKD83bIt+RteKO2M2N1Yg8gactl3M42YOy8csCp+3nOr9YoQl+1CUwZrbJ6DCFx+nQs2yP9ui4S3RLqvPw8SRQI2jC7JwbS97EdDkKevNO47JrM73qjbHWJY6dCdfHlvZd4oDFBT+3etxxVXU65iA0NWnietZaeGHGTci3DZo4HBSSxOOCtmL/WAzTUwuuhJCT5ZEu52/FLngl9HkCSAZZaDCj8v8+Z6/GO5o6h8So2ylyKF8YeRXF7x4CqTcjxMnbQeDG0rMx1G/gCaRR1X4tUF5fV7AC4T1/3C893TuOkFwwdFxlnFa3B4bPoJtSLB2FRbRM8CCNgt4fCPqICftPJy3npkA9hJUqeHWFwV14h0VyR6OO8lq5cv991Gvp+dgIwXlpCpf3WRIMioSuBbXEbq1cZhfhuEEXF0Q9om0Qf25+HaDEZtQTRKZgMWw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 31:F0kgH1kRPa5nqmCv8Ca+k6hIUyuSfoJtvYmwTaUPGppHKv72ibqWlYwQ6ymnbziVPfaUlERBfXDkQxmeO/2LemoFCBdnLuXw1IJlpAV97pDoh3b1JZybtPCbQj09jNUXqRi1UpNduZm8lSvoeJs7PWxoeGmSRfAX9/r5ciCqtq5Up2WFc6QUCY+M7m2qDEUDmfFN7J5xI/ZjTeM7YoMKSTlMvW8VuseZnnmKdseF0Bc=; 20:2JzgBZFs+NnLjpPi7eRF/4DakkGGl1hm34T3vX8mer8Rzwhuq1/hZBT8ekL+46Ys2beWiBhViXpztc23JvASaBs0XuglxCURNTz9GICqZAAjt1Iat0aeZzqYnT1TRJuTzqrJd8uQT2X+XPVBHBeHwXb1EqDzAnAPZL1gYlRKNcVnXiFSD/c/XZqXX5mtWKDwbwXYjHF/StFyJpWhM44Aa0jFoGYAtb6UWE/rPQ+xg5CWac7SkPUM4+VlyXGeJS9KdyDcDKG58P0ZGQUj/86b9TbQYFYke4zNWsxcwsCtTEVMdN4JMEXFBdHeLhyGG8/yD7HZDkwlRvG/bAwRqAJvE1kkRR4AkkMONS1p6wpIeAjkMZ85yqcbA9vTjJnuvilBxyO9Iu/9lgHBb9T/LYMHF0xVkPffQCAsGSLlX5ENCZ9ttozjbuN2gPw2uI0UrVtTBLwat7F5x4C82nYhGVZFjqB3BLbepGepPP9DoM8kqRqWsPn9lBkF75EquYRiKt78uUJbRo0swYbY+xcmMlJygvhUz0S2aVRf46ncMEPI9ClIHHANN7yUvChNFmCwESYWUdg/w7RAw0mZxXYQuoeLsQ+glDcEg97Zuy7YuLva45Q= 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:NVAap6swwjIcyyucAB+EF0KOF86OVosL4/9MgCK1bhjV+40Ez4HiJkZDv81ajGoDoVuEgk94b3RBsxU0EYXydE1t3wCb5Arn+gYQN1ixPAZlm8jeai6MkQ+3sihYfCukm/+TzUostwQScxSYN8fT2/wxjZZQ2eLWbptc6HQxyystt7TQd9P7umwEoMzImcC8uVSiTUgTtWuhlw7zg862UsfIQHFsNSzNzVGdoUnRpvOgvvprdXlNDtDJnIJegNFNEkOohckEAPzsmWgBFr+95ryRdLhctaVmwHPIzGBZMicD6V6k3R5AyffiTDotJn2xMYiEOee20jNxe5w0UamJ4Asxj/yn/LOi6Qg3U3eTE6sqHkoB7rId70exMRNFsZIKIrV2/X+HMfSSw7qXXOPV897CFsRjDxcfosEIQaNF6DkZVBaEi17Un79TZsNL1+25XoG2j0QCeNNL/41GdQ4ijQYv/Se5BGd+AggZFGWZwM8B9huaPVQchjuuk7FS01EeibB75wgGdwcZCVnh69Z11SnkOVusuHZECpcQyfa1EWuKPzu3E5yMnIDvFo50e6cqBBgcIVRASy+RdCuH8eC5DJwD+2Aze46Xp4IWJ2T9k8o= 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)(6666003)(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:/juvdQl1+zJ2mCfEPxHbvY8bEyAxuKD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xBGHbuBy17WywxqGpRRS081wlFQMDpQpgFfBKTpi?= =?us-ascii?Q?QBQZbv+vowWSVDcfqjuukFT1djD+M157yU8bbb/4hZF9g2UB0xCaam98oDlA?= =?us-ascii?Q?VzHzV2sJZzWOCJruPN7Cqx7R8maQ114Sp6BE7s1aVQFTM3civ2KgVNCj2tNu?= =?us-ascii?Q?fdx2BJJaZnRjlbTTxthQhAHK2sepUA7j+KOor5fHHJgTwzN0A=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 6:nACjts2DlRk4GXB2T1pC35wPGMhahkZd5nOYJJJMntIdxZkJkzD1YxVXT1lG1xUvZCIjta7BkjSfEWaHTor+L4VGnLK4Jtdh7z/Cr8ts9vLsvHJszONu1zr4zjHsm2D63HF+90qegvP8pAksAvcY2mfGzbTAB7bhLpJ9A9fDuOdTbXkp8jquISUb05cNHaakaKNxvkcjl5TmMoq9ICzEDBqEk52VIAM3/LzhrJnTU9ZlGGK4DmPdQ593j19K6vy42WXcUy5SgZyM5JoVIGDrUYVItv8uscAukiLTM8sclUwQYS15v1s0i3Gp1iabHFqjuTKndN0hBrn/+kgFRq9LsuHX31s5h4hGZOeYcnNs1lTAuHza7d9m6EVSMZbC6xUabjFU70OzM8UugOuBII6XNg==; 5:J/38bwXfCFqZWPG7Ou3YRmennH7MtmNCkNakVvc315aYfKxwIH2pTvpFteaDSAxQl13SIyXpOL5Tf/M3LT6p0L+ZXllk0R39/2HF/AIW64a4wunG6tpnajDISL5gqzO7chqypV4UXewQfS6xGw+yrg==; 24:Pqwqk5etFYoROeGMCo/5TdfsR+gB6nFhjhX5n8RA50cInPyepM9Ina/ZIl4zG6wSewfBIWtL3H5dgcJbugFS1x1BaTdOq+v93Uu06tMLVSg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 7:hBv7sSrDRxwkBzfImZSTUTzxUzmKY6pO2Xc/+4xCUttQzPuiXmmmdUoBXzyr5AD00b4iWkvzuvA1MVKo0FRkYhGeEiubDNRwBBX5B0fBkwQ9k/q9xCTpfCmAZjSvys11QDE8cRIUs01Q6kxZWntDwUzmDgUPEvnUrCAsZAtg3/jQ9hvi98Dzm/BwUgZCeRymCO68Dai9t24A+/xu5MaPoUFoKu4PTRAkiXJFNrhVuf461zY6rQcAu88UviBuP0kbM13AQ73BJoPCCShSkltXtI8N7c6hVEbuqkTFPOp1jiRI7chzP0sRpqJn47Bn+vOKmPYwTVUNPGZuz0dVZb6nhQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 11:38:35.7798 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2277 Subject: [dpdk-dev] [PATCH v2 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: Thu, 02 Mar 2017 11:38:40 -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