From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0047.outbound.protection.outlook.com [104.47.37.47]) by dpdk.org (Postfix) with ESMTP id B25C44CC3 for ; Tue, 4 Sep 2018 06:03:48 +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=CjDqiC633Vj+HhB5yAk3Yz2cmRLxo3hw1Fir4dZGYss=; b=BsD5yfJ9clqTwrWTa+qeTQHZvTXbZYHS/H9KwOipstHKy4J6jxA06O7mP8KknZh4jw+7eEgMmk0X4ioWdW0zVbBpgDQdVfX5GmrIgX/Lfbvvt/i2a2W+5eyXC5JIRx2bnQO9rzfSFcPYa4j9B+ek/VaIRTRNkfUA4fBuaX/pTPw= 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:03:43 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Srisivasubramanian S , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Ankur Dwivedi , Anoob Joseph , Murthy NSSR , Nithin Dabilpuram , Ragothaman Jayaraman , Tejasree Kondoj Date: Tue, 4 Sep 2018 09:29:14 +0530 Message-Id: <1536033560-21541-28-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: ea5ffe5e-3269-4b21-c982-08d6121b6a5a 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:9AjTDJXImr/0eogFWuEOtUssQvu7V8v3yxWvy1esE1XpP5/CENh+BIjP3+Z/zTeCH1CDQ3Q8+G+n17JEJLOdY9PJKp7cq+IgdyeMzhV0rytsNWTcMJouvsjggf4Hiczn7P/HFR6/DEFqLJgMhZJ7vOMZiYLE/U4EVOcj6oD3gPf+pA9c4dh3XH3dyKXkshN5WV1+e2Iz/YiaNQLWOC7BWHqrnjh8sLJUjygHn1M5ivu8fOnt42xX7/bJyJJ7HmxR; 25:5OnnT/AzbhkIb9Z2FOoHRg5zP5R5FEQV+NS1FeB6Fk63d8ePZH1q8M7O0v3sDhRsRZJsWZbAUCa95SZkZM7xoO/4KWs5kzq3tsznOpqGo4lyK4J8jR+UlhjqhvPZIr7C8kFqKkEQuapSBOeKdNwobLxcjUdn4Gy0y2vgnveaX+WZWBpVa5xyMNkRC4jm4EETY3M9qTz15TQWKXoX1w3wuvwK35idq9yJi6RGuOUgY+8F7/HP0d9LtVzjw5lTN2zUSO+5ZBLFD5sLw+xPFYDXOZHhfp9kjRwE3O5rgl88E8EwmBOgS7s33ru1i/++tip3xuFmI3Zo6EMF6T6a691mNw==; 31:q7Ngt2lNamvICmgqpVgtydxw1Wx9gaMukvbMA0uK1A0mrpcm4OYptsUJt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320d5fJCCPqA8pBdCVH/UBYwhWeBvoa74AkS5ORJi3oovyiI6DI5LA4kDpXUBEZ/Lkr5JyPjQ== 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:tlMANrn3JXeclc/5GBvQ9A9IOh3i7KBgL/2z3+/nP?= =?us-ascii?Q?oRkMBg+hXLD2f4X3xMIQf04ohZWZO5YdzskrBMpjz013gjYes03VMtl1NrWa?= =?us-ascii?Q?ivY+hD60G9617GYOX+H6eIVmX0xolmoAbH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JIEujt/7cvFto4e16EFAFoN8AH3QfHQLmOAf/9bQjFiXotV7VZEmk?= =?us-ascii?Q?TyzhJEHCp/ukAsupGZaQDYnOLGEj5JLMHkSrvhQq0sX70m0RvJV4h5qai+NC?= =?us-ascii?Q?jZGqZwz0dxuGxVEPKSz6GxH6tiUrB+mG2+8XaTLJPFwxjuiJKxs1qYs9J6zF?= =?us-ascii?Q?DMA3FcecDl7Unh0P0hrYak3ziex97N59zRBnWCy43Szwjnq9YOlvVkv4VojA?= =?us-ascii?Q?SjGiIMi4OmaAhe4Hd4=3D?= X-Microsoft-Antispam-Message-Info: ZqoD2rfSxaOatiuOlKXOt/lc7Q5XLZT8yltTJaF+qq9Tv+gar5pfVNBh4ibrIFoRf6tz6YekSaMN/KU2EjUtLJjxgs96OipqIyRGarJy+LmkM6KTpqV9wDYaS5yK2ebZnQJ+h1QY8zV2Y57NghVVdqBG12DEKyFA8PIs5yv8/N85Mx2YY8KMivK7M98mwVFExHe0Cu3hf00Y7XO1mzzgJMEekuG3fEccHbSTrxn4BVIbMuFHK+WULTWnSNqDGHZoIsD4ZElcRb3jwYFPdXsQDfr1KHVAlf95REiQgWwrgRxGZPELmFBUjZlQATm9HY/YS7epKgCqyphwz3bTUabuD/mKgnRxMIFJ7MEdaBdmjDE= X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 6:gmnLxUjLOXRnynps4BrjvfgJiIPE3cBqQBP1mEZpW+rh/s3DxVfvE70VIbtVSlGITW8il0CxqH1i6XuOtgzRbCdckVWqxjDBuonlxG7w588446LNdhvJLYA6cVClwGjR7pfkNzuzJGmYuniLdoRok2AELe18144EmeclzSjbIDjQ5Nj0yk+fEM09EvModV9QWX2VPnRqPRFuflf+IjJqCfh+oBIPqckMxFuQS0v/49QuQ9uGYQGY9ZMQFbSA6LM97QElw+VMVee5ZwGVFibwAKym/1CgyzhXk9ltuGsbSYbqr++lYHFNV/iibGMgbYDCrbI29I39odnjD9EYfG21wZlMau2N/xePjUDg2a4EkSlAO43U0QhdX8UpsAekZ5crRL11yrPRgGUyUK33Gi+dFO95blListX/w6QmlIIP+TUCLnhShNgsUIQFfFlMub5ARW2ejaFjAWWhGY0ISLGNXg==; 5:9AT7EGorWGfloJTH0Xuz7I4yHVPb89kY2QGDdSRsjr7Vawk+X7dIXOLw7lxYlaiGL8gv4/Xz96VkC1alyER2eFSRIqQVkVXqJelzehdYsT6soZvLhcvo+qIR8sZei9AXUIfvYG9X3APfR226cKrSwj10SSy95FH9rni0ZjcKhS8=; 7:+actXvn5tdzUOjMxLmFOR1b60yICDIUqYzV+9GVHoaXh9KHqwx4djqvq3qx7yaY0aB/+mgjcYyR1+eJKRH4Yb2gLnaltr4GW5s7jzklRsbyKnKIwJ6OEQ/8bu47FmBE7gSWvkVytQEAN/2/NpDBas+L4VYpO+1d1smSzWrbYH+iPGgKsmcwS7vPdNwh+KXiZXH7Z6PQmbD1A2EQWgk4nj+H0wQ+pxeSWUZbNEQkIud0lqOxK9mz+OUliozrDsQZ8 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 04:03:43.8974 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea5ffe5e-3269-4b21-c982-08d6121b6a5a 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 27/33] 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, 04 Sep 2018 04:03:49 -0000 From: Srisivasubramanian S 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 b9a634b..cff09b2 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" /* Flags to indicate the features supported */ #define CPT_FLAG_VF_DRIVER (uint16_t)(1 << 3) @@ -188,4 +191,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