From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0082.outbound.protection.outlook.com [104.47.32.82]) by dpdk.org (Postfix) with ESMTP id 824CD2C02 for ; Tue, 4 Sep 2018 06:03:07 +0200 (CEST) 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:X-MS-Exchange-SenderADCheck; bh=KxbTXUmRadcmtkBbCJ+oZ6wtH+3rVQah0kWQp0UkPAA=; b=btMqWmnCaRTUu8kPKwYHJMzWa3ANi8dR/jbAwDwaP0qGqj+8Jdc/kjCn/7jm5rKby4H/DZTdCtPhdGyaVCvm1UygOjiSiVjq1SPfCSNvaAaXxBJafVRy1gppKa5fllZtWHyJWKHViDAo6loOHnG4Ea2QAaYgMw5DC8RQoKJMwzA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.15; Tue, 4 Sep 2018 04:02:16 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Anoob Joseph , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Ankur Dwivedi , Murthy NSSR , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj Date: Tue, 4 Sep 2018 09:28:55 +0530 Message-Id: <1536033560-21541-9-git-send-email-ajoseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> References: <1528476325-15585-1-git-send-email-anoob.joseph@caviumnetworks.com> <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BMXPR01CA0023.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::33) To BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d55175b0-b0ff-41b8-4ee2-08d6121b3690 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4902; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 3:9y/xUgWLYxMc4cvNeqhymD/pTU1Nl4bK5qeoOzjonuKL3Wyqa2S946lnHft5NyTYzjCyHDjwM/5pTApi39Hiv/NYVrcVtOCB/QgVzfnXowKOm89sR4x+v8cAB2my2BoGAq0129KCMtXg0C82YacZJ4VzBwTwLjsH2l0In6taaskhTh+9aYop3iMzJe1TepMPjWxXygDdu6CmWtm025yEIHyPoos9Dsf65A7chC5styGLLPPDejbuBgSsDjugs2ga; 25:KcTJJOXZvgkm2KPlyT2ILWlK7Jgo25lMg8kxbEap55NELdm++ozpsUquJoROk2Ec0iX2QhLR7jsFgL1f8tESFjLuAllVDwQvSIJoQBdNDiHmuiKFd+/0aI1XihpOejX+pxAStPUwnLPY/WJchLXHAm8iLmvMuLTwFQU1WmJKaQ3B4f/FRpUM7OyBXx8/2QEcQePqO2+SE7Td3BG426seiO05yVMfkajY4Fj37WUJQN4MSOv8atfhnPHoZOihZh3onTSU1A7Ex6lJkBm2Hz4kCXK6K6R6cR/Yi7ko0OdS+1CEc9f7yaVYxMyRQWYP190jX0/h7wuc6TMpm1bcWQ3oMQ==; 31:jQRGXr1748y/QYVV1/TnXvTBkBtaPF1iQBwJelvcwf5UeRRG5U07nIZpAPEW/f8DPMjzkkdv00/DlmPsreJ9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PDFFxnSGATem8yglMG98LXmg4S1zgv+e1aiGqoMYmwh4L2bdZdLTw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699016); SRVR:BYAPR07MB4902; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4902; X-Forefront-PRVS: 0785459C39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(346002)(376002)(39860400002)(199004)(189003)(26005)(51416003)(52116002)(76176011)(81166006)(305945005)(81156014)(7736002)(105586002)(316002)(6506007)(106356001)(6512007)(8936002)(446003)(54906003)(25786009)(6666003)(68736007)(50226002)(110136005)(53936002)(16586007)(42882007)(386003)(5660300001)(2906002)(72206003)(50466002)(6486002)(36756003)(6116002)(107886003)(2616005)(14444005)(186003)(3846002)(478600001)(66066001)(476003)(8676002)(47776003)(486006)(956004)(48376002)(11346002)(4326008)(97736004)(16526019); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4902; H:ajoseph83.caveonetworks.com.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR07MB4902; 23:iGsQK5PJNAHIaRFepD/l+MTc7n9+S79dH2jRPPc6P?= =?us-ascii?Q?V4so81zF5isYVeu7pVjmvPi7MrT+Plvem7f/aOvqe7paN118w9EltauhOFCL?= =?us-ascii?Q?yhXhPFD66Z3jXu49joNmVY0C6YEuBeTetrXM/lFB1wS2B5YTWwy641y+C7i6?=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k0iFdur71lqgFUX8JHGgMmc8IVdkcSm14F9?= =?us-ascii?Q?ISy6SBKbQqSyH2EkENB38AEYVkfg1XipI4AHmhVW0GP/VV4AIWyTkggIv1u4?= =?us-ascii?Q?umOgOigIa1com/7IMIANac3rZuql8alaLL84GrALdTL8E+6lX61UhktsMo5r?= =?us-ascii?Q?vnSeJ0UY+cgI7rHz69kg5dFi34idM42k08pPqntP/Slo0pRda0JgJQBnt3o5?= =?us-ascii?Q?j9YHIhZsv9pQRdVrZo=3D?= X-Microsoft-Antispam-Message-Info: dzNom8CaIbud1kq6AmnHa4/tQxTgTPrD0Vv4vUYJ9Q/E1qCg9U3AodFmImX/C6/WyLsJIIIQiAoyCWj1Ldb3Sejv21Q0AEURP15xgfGYeOyYWSDX+egdS3U4Vp6wJ++xadC8WUTXFrnNvW/wFYqMmdDW2wENfEnSoCnkuWsAeJjKAUtu5DcbduAvikeacVG2Hd+i7sB2gFM5sW2D211Upi0WUgAqS8q9ADXjTquHvC0h4dT8t8b5vdwqBQqiPK8NZuoOue+mQArK/njeiqpz2lSBq8WWeFerrHkbpNqqI22Q9SSy7RY8QboQ1jJUcfVbaJ1kwZJ5SIcFulTBLqJ2DdqI9efGoxivYn5ZtzlGyjs= X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 6:+Ee2PzuHVKEIw1P1ue0RVICgtfs8j5z1u23cGWaboiLCoqrT3SyMuFrWSrQMj/Xt8en6TbUQvq5ca3RwjKYls6ViN70dEylW4FmXp7vyME8yftBfRV/mCGErHu7bVovESoBzwEJcOAZ9C/vsKwUsj4OZaruUXQBchqGZaAuWPKl6DZrUZAzFLuJiJB2QpF55yckoSp1Z2KNjSKS0pK0sMZMGYoS0/YrntdgG/0dYKBYqfnPiDHd/z2XN5xEauaxKIImK8PwGxVypUTTx2ef1WA7q33HGljiLZBzxwfcfrzX/2OxQslnNaFYzKpU89jiLLDEzhxq3QLsTCLgpmTqyRdRNIVU1l2zps++H2MO9aVv6IGFC5GWGgMOgnvJXYP0gz92MR9NyHsl0oXmzAhY2Kqc9Xp2PLt/LcH6e9eAgkx2zUdUVSTl1G2WQrQYwkormxE42KW8SFzBHdxJ8o3mkcQ==; 5:XjnmGW46/ZW1brsVm/562/Hb26DGQN7dbkZwyeax6SDyc48/7d1UsOG85Af28AaigkVkt2dSJ0s1nBBmlyyFvUlGnQxTTlBpr3zHG0Ul/8dHglLefoTN0yvo9MoA/TiZCF1gz5HYWS4ap6HK5lhr4o+BwFNU6/nhRDhvo67K/2k=; 7:rBMJw/V4U1SluEU8i22OAdrhUyrjIE8hTvNVtylwkSBdHSWAUOKPx6Cima0hnzApP7KkY30lf9JyJd2rl3iLR/nnzvzWsONwqekj1AOQJqKgaBV0XTzL0VBerimmtNmIRAw1TunSMkzVaY/4P4Tf3Ovir0IKYWd/y1qqPWajWhDAA760GWHum7NDjgbWgK2rKgJVqeuF15w1yxfecA2gkLCBtvmud9Wi7GN15rK2ujf9o4ttV8LNTbBMelkRSff2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 04:02:16.8347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d55175b0-b0ff-41b8-4ee2-08d6121b3690 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4902 Subject: [dpdk-dev] [PATCH v2 08/33] crypto/octeontx: add hardware register access for misc poll 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, 04 Sep 2018 04:03:08 -0000 From: Anoob Joseph Adding hardware register accesses required for misc poll Signed-off-by: Ankur Dwivedi Signed-off-by: Anoob Joseph Signed-off-by: Murthy NSSR Signed-off-by: Nithin Dabilpuram Signed-off-by: Ragothaman Jayaraman Signed-off-by: Srisivasubramanian S Signed-off-by: Tejasree Kondoj --- drivers/crypto/octeontx/otx_cryptodev_hw_access.c | 192 +++++++++++++++++++++- drivers/crypto/octeontx/otx_cryptodev_hw_access.h | 11 ++ 2 files changed, 202 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c index 211b6ee..02ec3ce 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c @@ -3,11 +3,19 @@ */ #include +#include #include #include "otx_cryptodev_hw_access.h" #include "cpt_pmd_logs.h" +#include "cpt_hw_types.h" + +/* + * VF HAL functions + * Access its own BAR0/4 registers by passing VF number as 0. + * OS/PCI maps them accordingly. + */ static int otx_cpt_vf_init(struct cpt_vf *cptvf) @@ -22,10 +30,192 @@ otx_cpt_vf_init(struct cpt_vf *cptvf) return ret; } +/* + * Read Interrupt status of the VF + * + * @param cptvf cptvf structure + */ +static uint64_t +otx_cpt_read_vf_misc_intr_status(struct cpt_vf *cptvf) +{ + return CPT_READ_CSR(CPT_CSR_REG_BASE(cptvf), CPTX_VQX_MISC_INT(0, 0)); +} + +/* + * Clear mailbox interrupt of the VF + * + * @param cptvf cptvf structure + */ +static void +otx_cpt_clear_mbox_intr(struct cpt_vf *cptvf) +{ + cptx_vqx_misc_int_t vqx_misc_int; + + vqx_misc_int.u = CPT_READ_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0)); + /* W1C for the VF */ + vqx_misc_int.s.mbox = 1; + CPT_WRITE_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0), vqx_misc_int.u); +} + +/* + * Clear instruction NCB read error interrupt of the VF + * + * @param cptvf cptvf structure + */ +static void +otx_cpt_clear_irde_intr(struct cpt_vf *cptvf) +{ + cptx_vqx_misc_int_t vqx_misc_int; + + vqx_misc_int.u = CPT_READ_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0)); + /* W1C for the VF */ + vqx_misc_int.s.irde = 1; + CPT_WRITE_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0), vqx_misc_int.u); +} + +/* + * Clear NCB result write response error interrupt of the VF + * + * @param cptvf cptvf structure + */ +static void +otx_cpt_clear_nwrp_intr(struct cpt_vf *cptvf) +{ + cptx_vqx_misc_int_t vqx_misc_int; + + vqx_misc_int.u = CPT_READ_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0)); + /* W1C for the VF */ + vqx_misc_int.s.nwrp = 1; + CPT_WRITE_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0), vqx_misc_int.u); +} + +/* + * Clear swerr interrupt of the VF + * + * @param cptvf cptvf structure + */ +static void +otx_cpt_clear_swerr_intr(struct cpt_vf *cptvf) +{ + cptx_vqx_misc_int_t vqx_misc_int; + + vqx_misc_int.u = CPT_READ_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0)); + /* W1C for the VF */ + vqx_misc_int.s.swerr = 1; + CPT_WRITE_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0), vqx_misc_int.u); +} + +/* + * Clear hwerr interrupt of the VF + * + * @param cptvf cptvf structure + */ +static void +otx_cpt_clear_hwerr_intr(struct cpt_vf *cptvf) +{ + cptx_vqx_misc_int_t vqx_misc_int; + + vqx_misc_int.u = CPT_READ_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0)); + /* W1C for the VF */ + vqx_misc_int.s.hwerr = 1; + CPT_WRITE_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0), vqx_misc_int.u); +} + +/* + * Clear translation fault interrupt of the VF + * + * @param cptvf cptvf structure + */ +static void +otx_cpt_clear_fault_intr(struct cpt_vf *cptvf) +{ + cptx_vqx_misc_int_t vqx_misc_int; + + vqx_misc_int.u = CPT_READ_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0)); + /* W1C for the VF */ + vqx_misc_int.s.fault = 1; + CPT_WRITE_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0), vqx_misc_int.u); +} + +/* + * Clear doorbell overflow interrupt of the VF + * + * @param cptvf cptvf structure + */ +static void +otx_cpt_clear_dovf_intr(struct cpt_vf *cptvf) +{ + cptx_vqx_misc_int_t vqx_misc_int; + + vqx_misc_int.u = CPT_READ_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0)); + /* W1C for the VF */ + vqx_misc_int.s.dovf = 1; + CPT_WRITE_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_MISC_INT(0, 0), vqx_misc_int.u); +} + void otx_cpt_poll_misc(struct cpt_vf *cptvf) { - RTE_SET_USED(cptvf); + uint64_t intr; + + intr = otx_cpt_read_vf_misc_intr_status(cptvf); + + if (!intr) + return; + + /* Check for MISC interrupt types */ + if (likely(intr & CPT_VF_INTR_MBOX_MASK)) { + CPT_LOG_DP_DEBUG("%s: Mailbox interrupt 0x%lx on CPT VF %d", + cptvf->dev_name, (unsigned int long)intr, cptvf->vfid); + otx_cpt_clear_mbox_intr(cptvf); + } else if (unlikely(intr & CPT_VF_INTR_IRDE_MASK)) { + otx_cpt_clear_irde_intr(cptvf); + CPT_LOG_DP_DEBUG("%s: Instruction NCB read error interrupt " + "0x%lx on CPT VF %d", cptvf->dev_name, + (unsigned int long)intr, cptvf->vfid); + } else if (unlikely(intr & CPT_VF_INTR_NWRP_MASK)) { + otx_cpt_clear_nwrp_intr(cptvf); + CPT_LOG_DP_DEBUG("%s: NCB response write error interrupt 0x%lx" + " on CPT VF %d", cptvf->dev_name, + (unsigned int long)intr, cptvf->vfid); + } else if (unlikely(intr & CPT_VF_INTR_SWERR_MASK)) { + otx_cpt_clear_swerr_intr(cptvf); + CPT_LOG_DP_DEBUG("%s: Software error interrupt 0x%lx on CPT VF " + "%d", cptvf->dev_name, (unsigned int long)intr, + cptvf->vfid); + } else if (unlikely(intr & CPT_VF_INTR_HWERR_MASK)) { + otx_cpt_clear_hwerr_intr(cptvf); + CPT_LOG_DP_DEBUG("%s: Hardware error interrupt 0x%lx on CPT VF " + "%d", cptvf->dev_name, (unsigned int long)intr, + cptvf->vfid); + } else if (unlikely(intr & CPT_VF_INTR_FAULT_MASK)) { + otx_cpt_clear_fault_intr(cptvf); + CPT_LOG_DP_DEBUG("%s: Translation fault interrupt 0x%lx on CPT VF " + "%d", cptvf->dev_name, (unsigned int long)intr, + cptvf->vfid); + } else if (unlikely(intr & CPT_VF_INTR_DOVF_MASK)) { + otx_cpt_clear_dovf_intr(cptvf); + CPT_LOG_DP_DEBUG("%s: Doorbell overflow interrupt 0x%lx on CPT VF " + "%d", cptvf->dev_name, (unsigned int long)intr, + cptvf->vfid); + } else + CPT_LOG_DP_ERR("%s: Unhandled interrupt 0x%lx in CPT VF %d", + cptvf->dev_name, (unsigned int long)intr, + cptvf->vfid); } int diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h index 40db69c..f3c7a45 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h @@ -7,6 +7,7 @@ #include +#include #include #include "cpt_common.h" @@ -19,6 +20,16 @@ /* Default command queue length */ #define DEFAULT_CMD_QCHUNKS 2 +#define CPT_CSR_REG_BASE(cpt) ((cpt)->reg_base) + +/* Read hw register */ +#define CPT_READ_CSR(__hw_addr, __offset) \ + rte_read64_relaxed((uint8_t *)__hw_addr + __offset) + +/* Write hw register */ +#define CPT_WRITE_CSR(__hw_addr, __offset, __val) \ + rte_write64_relaxed((__val), ((uint8_t *)__hw_addr + __offset)) + struct command_chunk { uint8_t *head; /**< 128-byte aligned real_vaddr */ -- 2.7.4