From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0047.outbound.protection.outlook.com [104.47.41.47]) by dpdk.org (Postfix) with ESMTP id C0D121B179 for ; Tue, 9 Oct 2018 11:09:58 +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=2IrY2UDVw6nYmlpkV5keN2wPL+lJQZnkeiUDZgQPf/4=; b=a/boWyTG/NTrouq3AGhgLTZo4473HCaB5seAYnwiU/SAX7mGZ5XpQ79rA+WlOREtwvFa/acbFcKy8PhJomBusxps7mVC7a5H/AzNrRzm1r0HeR9MQUemtvS8HtKDDhRVp/aA1PsI2r+zvpaPsuE/PpD5U0J8AVGc9gC959dioQg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by BN7PR07MB4897.namprd07.prod.outlook.com (2603:10b6:406:ef::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.28; Tue, 9 Oct 2018 09:09:54 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Tejasree Kondoj , Jerin Jacob , Narayana Prasad , Ankur Dwivedi , Anoob Joseph , Murthy NSSR , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , dev@dpdk.org Date: Tue, 9 Oct 2018 14:37:52 +0530 Message-Id: <1539076076-19786-20-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539076076-19786-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1538744363-30340-1-git-send-email-anoob.joseph@caviumnetworks.com> <1539076076-19786-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: PN1PR0101CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::14) To BN7PR07MB4897.namprd07.prod.outlook.com (2603:10b6:406:ef::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6fe5192a-2904-4657-baf5-08d62dc6fbf6 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BN7PR07MB4897; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4897; 3:W3Sft9XIBb/E1hd1WuXa3Y1ZKGBQKXbgIXhbuVTfC6doa/nCbS4WheGxt3bQaoMrXxQSTZqshKA0whbXNPdA83h1esaNMpyh943qix48+fFC6X1dkFTCMhAQ+6sBACOZG3r9Z98twbjuvLVebvuU1hAemiKyHmHZxn16j2ny/4Unl6hVBjl1qYyEZaG7hP2Y7TtbJVEqp7mUnXv0Ov+4mkhfzeWpeGJIZnISOaFz/BgzhrCxSFDxJAQz8iaYzzHh; 25:IcpnoFSPTWTpXzXAmK+cJyAmGZjYMmOMP5LcSXeoWJqdY6PGHhwkaIjhR46sYergYD/Il0eu+368Ot1UB3POTUrseW8qnwW+uDRxSRgLYYspolXIAEZNsbrbrL04SnWJo4qWVA9/si41SgvCWakejKEYO9tipow4en96mWHGHmQibUgfTqfoqE8gVrAn5k5k8d7t0+NBViOa131Xa9CF3OiWNgoz9vHCSdSwCwplHWRuIVlVfULKXCa+8IYekRf2u40sPsPG8LZc6zoY98lGke1B8wFfNuTmXg8GK93k7m63vQgmue9GUZ7b6MVDAz8s6h0STXRYE4kN7u05ssbFPA==; 31:A+lhcRnZ6Lv2EL7jlfBC1oe5683IeoYuLlcTX9vZUPCIBF5AuSOH/rkKSWoayadlaTKa1WAAEptPapNDN5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iFyIJu4EWrbTxlv9xzmln2VRhm7pgTg== 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)(5005006)(8121501046)(3002001)(93006095)(10201501046)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(201708071742011)(7699051); SRVR:BN7PR07MB4897; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4897; X-Forefront-PRVS: 08200063E9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(136003)(346002)(39860400002)(199004)(189003)(42882007)(47776003)(106356001)(186003)(5660300001)(26005)(68736007)(16526019)(8936002)(25786009)(6116002)(2906002)(81156014)(50226002)(305945005)(81166006)(7736002)(3846002)(105586002)(478600001)(8676002)(54906003)(110136005)(48376002)(16586007)(14444005)(6486002)(6506007)(50466002)(316002)(53936002)(386003)(51416003)(52116002)(76176011)(11346002)(6512007)(44832011)(446003)(36756003)(55236004)(956004)(2616005)(486006)(4326008)(66066001)(97736004)(72206003)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4897; 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; BN7PR07MB4897; 23:f2vIr2+KzeY391Xk6bArA8VeQfMKRAC3cXvqMRv4y?= =?us-ascii?Q?udMfte8zkC93RqIA3zo5u4ury2/iHFq9KmnGlv0eeFKSDPc4SKwYeHQBAbg0?= =?us-ascii?Q?P1VCBub0bXt0r24B1pCSU/HbplmXDYOsNzAE4f4q2pDc9qVq+q+Uk09WQ0+E?= =?us-ascii?Q?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GOr0SB0G9wctDyfprEuXuuCnxxDK7hw9niFk9NgIQ88YpfhR0WWxuff77h4U9tjFOMHYdcCfJd+w==; 5:f9UbOS30W4Owek++nI8KgpYY9rzxuw6vChpY2nd/7wryU42VJWJlBRRvZrKbuPyxgn1GPyHe8GtskCy0Gu3UeUAtdhwJG7RW6Q4mgYkr5Gpbml3irQP2T+xb0wjVhSddHBOvD8G6jelgGBT2ZiTmXH8+he10Ux69YD+alBVv5Js=; 7:qC7R8GUAKCcDimSxTitxu6Hl+V+ZUzMm9c9Wn1PP1N9tBxb6496D/kYgIJLgTSqxZ5UcpEX159VFvgxm2vsQIrCRA82yKciGIu2gGMcEOi5AtCT+02+XGAaAbm8EmO0ETaGK54gNi6DqvFcv/zg8mc+BTAq1UPrfm5c4ZVsDJFDEyubEuL7h8sAB0B/eiQyfgbJz19CzD9DZzvPiP/zMcJRVfcVeDybtHRcQHIJtyQFsv5zX8ImYZb37qWLEOamt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2018 09:09:54.0156 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fe5192a-2904-4657-baf5-08d62dc6fbf6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4897 Subject: [dpdk-dev] [PATCH v4 19/23] crypto/octeontx: add routines to prepare instructions 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, 09 Oct 2018 09:09:59 -0000 From: Tejasree Kondoj Adding hardware specific routines which prepare cpt instructions. 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.h | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h index 2698df6..affbba1 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h @@ -7,11 +7,14 @@ #include +#include #include #include +#include #include "cpt_common.h" #include "cpt_hw_types.h" +#include "cpt_pmd_logs.h" #define CPT_INTR_POLL_INTERVAL_MS (50) @@ -184,4 +187,57 @@ otx_cpt_read_vq_doorbell(struct cpt_vf *cptvf) return vqx_dbell.s.dbell_cnt; } +static __rte_always_inline void * +get_cpt_inst(struct command_queue *cqueue) +{ + CPT_LOG_DP_DEBUG("CPT queue idx %u\n", cqueue->idx); + return &cqueue->qhead[cqueue->idx * CPT_INST_SIZE]; +} + +static __rte_always_inline void +fill_cpt_inst(struct cpt_instance *instance, void *req) +{ + struct command_queue *cqueue; + cpt_inst_s_t *cpt_ist_p; + struct cpt_vf *cptvf = (struct cpt_vf *)instance; + struct cpt_request_info *user_req = (struct cpt_request_info *)req; + cqueue = &cptvf->cqueue; + cpt_ist_p = get_cpt_inst(cqueue); + rte_prefetch_non_temporal(cpt_ist_p); + + /* EI0, EI1, EI2, EI3 are already prepared */ + /* HW W0 */ + cpt_ist_p->u[0] = 0; + /* HW W1 */ + cpt_ist_p->s8x.res_addr = user_req->comp_baddr; + /* HW W2 */ + cpt_ist_p->u[2] = 0; + /* HW W3 */ + cpt_ist_p->s8x.wq_ptr = 0; + + /* MC EI0 */ + cpt_ist_p->s8x.ei0 = user_req->ist.ei0; + /* MC EI1 */ + cpt_ist_p->s8x.ei1 = user_req->ist.ei1; + /* MC EI2 */ + cpt_ist_p->s8x.ei2 = user_req->ist.ei2; + /* MC EI3 */ + cpt_ist_p->s8x.ei3 = user_req->ist.ei3; +} + +static __rte_always_inline void +mark_cpt_inst(struct cpt_instance *instance) +{ + struct cpt_vf *cptvf = (struct cpt_vf *)instance; + struct command_queue *queue = &cptvf->cqueue; + if (unlikely(++queue->idx >= DEFAULT_CMD_QCHUNK_SIZE)) { + uint32_t cchunk = queue->cchunk; + MOD_INC(cchunk, DEFAULT_CMD_QCHUNKS); + queue->qhead = queue->chead[cchunk].head; + queue->idx = 0; + queue->cchunk = cchunk; + } + +} + #endif /* _OTX_CRYPTODEV_HW_ACCESS_H_ */ -- 2.7.4