From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0065.outbound.protection.outlook.com [104.47.32.65]) by dpdk.org (Postfix) with ESMTP id 8D60E1AF03 for ; Tue, 4 Sep 2018 06:03:57 +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=WPH2qmTNimWKYfSK5nHaUcjkou2+nM3bc9yCvfEnt64=; b=WkvLGb1ry559a+uOVciaDOoXhtQ487vCvrMvf/qe0V4UM54H2PTfqT3a9mmMqI2sFyAcyW3XwCs8MBGpg/Go8/vpuLiR2RK2ZG1BTOI0sV9jLE2Bk1AYdRFziKSv+N9nYwyZ6xozT6TaM6d7NSde+Yr+JTPLyYQg+QSKSyz1f0c= 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:52 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Tejasree Kondoj , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Ankur Dwivedi , Anoob Joseph , Murthy NSSR , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S Date: Tue, 4 Sep 2018 09:29:16 +0530 Message-Id: <1536033560-21541-30-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: e5aafb43-0433-4ea4-2a36-08d6121b6f8d 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:yVSNaeJSadVVxyvTVTJufWOygo9rDa69iQti2pyyM32ewW/lGzlmTeJJCPhOU234XC2VrYw4Dml8l5P61vpAQsYCrGmg9ipRMz3pGrKTct/T+GZIPrJ0d+inKKXl8R6EC4j28FvF0UHJ2+zy5pc6vcTI7Y8NyYnUVkE9C0+xSBOtxNc+B178hkewG4Pgy1DhqJvdpjdHcPeH0Fs3sYcv0zn1GGEk8Vz8c/ToMbRuTkZ21lQHBS48Ve3JyaxHsUye; 25:Vkph86OLxCwYoy1F4OXWmgDgvk9f3w6weLnqg4jM06RnkTQphWO0RXjWekhZx3gpLn9GDqk9GMIWbpGtqwqUeNIcmp4yJ0GkfK865ZzUNcDlOu/CXqsRGlJBIt7b2ULTCK4dRvuFYNqbXgheBGjDo1o3ymmYBuXHzFB8Ts8iZ5eD/QqZC6YEL8Fs1ZTgkAwOy0/F8a7r7ZCzcWJtfuQwwycBV0sYABWX8j7Un3rFxuYfN+ebrtgPyNk2+Z1KlZV5WajPXGLlHqhPTnZunNOqCnWrHuw7aqaUgyn3hq6N7JLXltCTCJUPNWBiipJNgO+di5/YjP/gQVknXpmVr+MNLA==; 31:IAHuMzmcYPF/rzi2ClALPBWgxR5pkfB+qwxe/u3K7r1RT12RGd3M7nrE3G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hvAQ4xD/AwN1t90W+eS+UdPmb4jnlotjIH2pnmtIJo3wrDSYJtdo3AQ2a9eEqq5PID8GjgNvaoiYg== 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:MvwWQwKAxglHw3AlRzcmlmPrnaRm2/q0/IQsTwVpJ?= =?us-ascii?Q?ANIbsK/ugvi34F9usslIhVA/o2QzQGDN/MruwKYr8lHvqFUtXYzoV6gseXbb?= =?us-ascii?Q?jOv5yjbDAamhYOnycmvEakK57HxX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rAOHE9hYlWsUaaTpwVDi5FxCGv1DQ6xYAZU1VCFTvmrSt/g08qg+ULHuIVjgHOOL1JTwxhNUb03Lxti0ZZr2goxItG7A+EFEl4aTRItu5YuqlLvRCF+H8nTZzuLBcQyFqPJnSgpAuz+R55RR3+DkuQ==; 5:YQwTSOH7O/5nq9dzlYWtCZZ+XOM3zqu9SqeLvfP0EaB7M8EIYBPWt87KjaWL8jlV8pd5zvrfs9YHenNV2reHOzCA/d2vEYwWDDeUL5GqFSfj8Oxqf6BJiYh5gy5Dsa3TBDxunPHI2+aRMPgSBt0DBGaHhuTAlyr4wWLfcu5fSJI=; 7:M5PZhGvNqTFofyfpPrPYB8AvTJOVR6JvJmgiFOoTGu6ZaW0L3SY0e0514ZSIC7AOV2/IPMnW2WVEoXKIGsKgV4EcIm8kCt+S4ytMx3d+5FxLl8rutcuy2LDCAHRyTo8dPXwMjANU67gSQG9QCIARTuhHxXTgU3LwQfsV85fRlyE3D2FsASwUqULqMLmc9fikrk02VaGIZoSl+zmKxtELzE0ed9cGvaQowUU/pPKnwoU05ykjcwtYqOKSZnHwtlJB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 04:03:52.6161 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5aafb43-0433-4ea4-2a36-08d6121b6f8d 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 29/33] crypto/octeontx: add enqueue burst op 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:58 -0000 From: Tejasree Kondoj 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 | 18 +++++++++++++++ drivers/crypto/octeontx/otx_cryptodev_ops.c | 27 ++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h index cff09b2..f2d7ee7 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h @@ -191,6 +191,15 @@ otx_cpt_read_vq_doorbell(struct cpt_vf *cptvf) return vqx_dbell.s.dbell_cnt; } +static __rte_always_inline void +otx_cpt_ring_dbell(struct cpt_instance *instance, uint16_t count) +{ + struct cpt_vf *cptvf = (struct cpt_vf *)instance; + /* Memory barrier to flush pending writes */ + rte_smp_wmb(); + otx_cpt_write_vq_doorbell(cptvf, count); +} + static __rte_always_inline void * get_cpt_inst(struct command_queue *cqueue) { @@ -241,7 +250,16 @@ mark_cpt_inst(struct cpt_instance *instance) queue->idx = 0; queue->cchunk = cchunk; } +} +static __rte_always_inline uint8_t +check_nb_command_id(struct cpt_request_info *user_req, + struct cpt_instance *instance) +{ + /* Required for dequeue operation. Adding a dummy routine for now */ + RTE_SET_USED(user_req); + RTE_SET_USED(instance); + return 0; } #endif /* _OTX_CRYPTODEV_HW_ACCESS_H_ */ diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c index 438208c..b20cbe0 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c @@ -345,6 +345,31 @@ otx_cpt_session_clear(struct rte_cryptodev *dev, } } +static uint16_t +otx_cpt_pkt_enqueue(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops) +{ + struct cpt_instance *instance = (struct cpt_instance *)qptr; + uint16_t count = 0; + int ret; + struct cpt_vf *cptvf = (struct cpt_vf *)instance; + struct pending_queue *pqueue = &cptvf->pqueue; + + count = DEFAULT_CMD_QLEN - pqueue->pending_count; + if (nb_ops > count) + nb_ops = count; + + count = 0; + while (likely(count < nb_ops)) { + ret = cpt_pmd_crypto_operation(instance, ops[count], pqueue, + otx_cryptodev_driver_id); + if (unlikely(ret)) + break; + count++; + } + otx_cpt_ring_dbell(instance, count); + return count; +} + static struct rte_cryptodev_ops cptvf_ops = { /* Device related operations */ .dev_configure = otx_cpt_dev_config, @@ -436,7 +461,7 @@ otx_cpt_dev_create(struct rte_cryptodev *c_dev) c_dev->dev_ops = &cptvf_ops; - c_dev->enqueue_burst = NULL; + c_dev->enqueue_burst = otx_cpt_pkt_enqueue; c_dev->dequeue_burst = NULL; c_dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | -- 2.7.4