From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0049.outbound.protection.outlook.com [104.47.33.49]) by dpdk.org (Postfix) with ESMTP id 0112E1B1F6 for ; Fri, 5 Oct 2018 15:02:33 +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=/k6s0wYtABI0aOiNP5FEcnD+VFbflv/q/0nfR18GSwk=; b=HsWcn12I3qBJ+/OoH70vNrzUwwNofZZDzr+EWj+RPxP5k8KyMgT1F1lRrU+CK8QB5kmXcjZepD2XN1gTe6ehHUWKCVF5uoBBXX6EAjr25FTJIGoV292bE5A1Wl07F1qnzKj1HGzNnOAL1kZCs0fs3+dg3KiM/2m7o/NnzYag7No= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.21; Fri, 5 Oct 2018 13:02:27 +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: Fri, 5 Oct 2018 18:29:19 +0530 Message-Id: <1538744363-30340-29-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538744363-30340-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> <1538744363-30340-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: MA1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::22) To SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3dd6adf0-7df1-4aa3-97d1-08d62ac2cfd4 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4910; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4910; 3:QJlZvkX1A/WXr1jig2WWWmfSz9XnIDxDfsZV9oF4BNvF9aS+NCcrTpIzYpG0aVGn69u3y2QfsKp2ikQUYc0nHsFRjnZxoCbjM6mTm9vyGP57nspjIsJYjShnRYNpBiDJ3BuzLC+UgcrFhUYsbGH7rPhrCg3d1nZ4YMxA2UEcxE5FzUzpCnWWDgDwfJ7e7eQ0G+Cq04TiC6V+yjF7xbrUPpGG6rEy8oqwYvKbTZxhXqzFBcb2kDAp6UelvJ0NBHci; 25:gH6Af9CoPN2SvLAEInPEpLj8Cp7FqodZhlvRW+Y0KM1WGYv5asnt2NOa+KEj06NeZ3EGrFuIY0mTkzokN1uyb+8m44S99Z231ciwLSh+KrfuNPh1z18JWQUFUcJGc2zhBjBAuK09Rh4AFLDh+DOtxNeza7Cob29mshyOW7GOIbQdn2QFatU6k3pMdnxOOroOIZSp3Jp0M+fErxB/97JgwelKMjPJjzVze4FHXNOp1pPuPf5lyOPXkQRi6xmRcTsuAvfs7Bx3edzmoBmHp59+B2yd+RjM8V/2sLsKCupg2CO5NFAwuikWfGxXfL27SkNioZthuvLs8tvp/YLfHg7Cmw==; 31:PWliPADFdzzTUCD/7qK+wm0UidCs/dIk3y+MdsHSKX7ImUrP3IMCv8ok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9dXPDaKWqrYZIAh6eqwABLcTR6EIzOHV07j8HCLpFKGVs7j+DEmA6JEprwFRHjRMpoA== 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)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:SN6PR07MB4910; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4910; X-Forefront-PRVS: 0816F1D86E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(136003)(396003)(366004)(199004)(189003)(51416003)(76176011)(11346002)(50226002)(25786009)(8936002)(48376002)(305945005)(186003)(16526019)(110136005)(6486002)(3846002)(446003)(52116002)(6116002)(81156014)(8676002)(97736004)(5660300001)(50466002)(4326008)(956004)(42882007)(2616005)(68736007)(478600001)(54906003)(7736002)(81166006)(6666003)(16586007)(107886003)(26005)(55236004)(66066001)(386003)(47776003)(6512007)(72206003)(44832011)(476003)(316002)(14444005)(36756003)(105586002)(106356001)(486006)(6506007)(2906002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4910; 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; SN6PR07MB4910; 23:5aqBgmMNtwTF+rxZ6+VMdKHMXEwZOyPd01sam5Zjr?= =?us-ascii?Q?jtgFD783NTPVNIeGAKeLqHLih8q4JUhhRVhLgetpOY78s1lnjx/zp8xhT+pL?= =?us-ascii?Q?J+bUU8Ob1tlVxdYKhc1fQ15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fTuLGzrVH/+d+wcURQeWQgXcV2MUdDOg9k4oSL9gGnfsnEhD7yf0erURhLcG+pPTMyD1uVfBqEmamdvoTa7fY2+OlJAa/O2qeUeIC0E5d86H4p4ddygF9mVrrV4uQGFI7pWo2eeE2o53WXqU+xwcuTHkc6XDemKJkCH9eoyiRaIblNaTGDDUtnGBIK/Fb/sRbA==; 5:rLeTIZ8a0dryCAmHmWszWX8q9+PyPDGroLNBsuFyXBTIJlFMrbkPZgg9BvhyE8e6B2UTujJl3eXd1kFg5iYnM060qzlj3kHEftg9/+972Fb1gLT/vHV4iwwLZ38LdnzHWQvTt0wrx1ZRLr8EvtOtweMx4mO01UKNKuVtDG5Pxfk=; 7:9FPWXT2HC1QxbUixW+OgDS9+z2YGmwY87Jy3/+rgkGxAkkWf5QiDssIBz4j2goM3gXdHOU7w5SprkNpzto7xJF2kjFQlVZuvvRAk8Euj0aZMIUi5rH7w5UzOWR0jX1QWGRU4kEWtSmiMu7RRwDekMHEjuMNGPNDYqG3zyVVw6HwUC5iO3qMWyl4CBkmTecnwUGxYIlfwHI1comU5FDYnB27RbI5zO8QJUQJKJVdgsfsBr22XQPFTtxgzvBZNY2yv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2018 13:02:27.3239 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3dd6adf0-7df1-4aa3-97d1-08d62ac2cfd4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4910 Subject: [dpdk-dev] [PATCH v3 28/32] 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: Fri, 05 Oct 2018 13:02:33 -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 affbba1..6f4d6e1 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h @@ -187,6 +187,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) { @@ -237,7 +246,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 16fad49..4240051 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c @@ -341,6 +341,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, @@ -432,7 +457,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