From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50087.outbound.protection.outlook.com [40.107.5.87]) by dpdk.org (Postfix) with ESMTP id 448C91B94A for ; Fri, 12 Oct 2018 16:41:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iE6C5ACxmE1fLlODqBZNappLemN25lUKnfiOC6z/xOE=; b=wG6QD4Z/itwcyZYs1M4O8HlqXVOF+SPKfISPHwDDAuiYCj/Xv5fMLNl55UNI3tqNpTU+lWPY3z7V25+8nAgZi2kT8cJsowpXQwxkEPS25EKm7Hj3heyPBS3/slB1wvpIOMFc4AUBB6mVGhTZuF+AXNADw0TYMotRs3gvChpGzTg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.23; Fri, 12 Oct 2018 14:41:45 +0000 From: Gagandeep Singh To: dev@dpdk.org, akhil.goyal@nxp.com Cc: Hemant Agrawal , Gagandeep Singh Date: Fri, 12 Oct 2018 20:10:48 +0530 Message-Id: <20181012144055.9461-8-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012144055.9461-1-g.singh@nxp.com> References: <20180913060846.29930-1-g.singh@nxp.com> <20181012144055.9461-1-g.singh@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0039.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::25) To HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: de53c2ab-35f6-49dc-e3c7-08d63050d5f6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR04MB1530; X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1530; 3:RfWUgpqGxcImXvhWsXJ1YvI/ijmVL6pzHsVn7RrHsf3lx4xrXGCgKcie9ifgguOk7wejmXGKLFvwo5MiYZlq+bKkb0LEC+4vuP6tFpKVsG1kxBQDzLcMbGokjJKSp2vKxBFNWtr1S4zQ06dnLpvTuJ+Ytnceb2cpwHlB26zI5Xdvpk/vYbIL33HtWtdWLLxurSZuovSmc4R7chlgQUx2XwoKOatPAWw/qtFzitXGJ4fnkryLCZgkMkPjazT+WaoW; 25:/kKJ/at7FTRI3/ihfiaKEpWUY4Z2zgYqszf4rlLH9AXUENcdA0yPkwSH8N1KxxVG3M3zN12K8TP9vDrkbDU47A6iS3k7jHTE8SwQTA3LwsMBKzfPr2WXl8qrdyRYmwOQuQDx7lYTo6addAwZVac36QFCln5aNAh1P5HU0xSrhT+YCv02o3jOyPUP1r85UhqUdjT94hConszL01RFlxxHpM8NExeDi2WbmlKF9kWpjXqJDFZvU+yKEE5PJGt4ZgWuINnyiQOo43AXaYlFcqknlu209HpVhphbOwgxpZBezU35GVLLALjjH8vYNF28ZPzC45I3E64y2DGGR6uizPv2yA==; 31:CaHN+vIWwSbt8479AwT42b+t7AEkAYToH+3JTlmk6bMjUevOJ31yKMuTEoI68IkwNzBvzpoLxDob9iYciqVMIW7bSi5DejZisDJZ0bYRo5CK9p2aEmLf38mr2cORYa/XTRolyWuatUoTkh7SKzL9KWyBhxVIVWVKWdlzfmjd7duQwz7C63QN2JScDrNTsiJVht4oaugt94Qq+XxczeokfFplhEaaE3EfRgyxchcwx4I= X-MS-TrafficTypeDiagnostic: HE1PR04MB1530: X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1530; 20:suOnR/r4RfReS24bRNwHJrWPVPjxUDxvF0tzpgA3YlQJbF/zrZkL7pxmyo4o+/1APQ9NiVhFKdIjc9caeOJn8iVjENPWzGN1EC61K3OGFuzzMx2cx+0Z5L8oK3qwbo+3JA5K+Cdpo4YqX0/iVHJUbt5uC9eOf/pl2UaZx+PQrazA2oYHHrHypTXRKP3AMEXFN+Fi/1Ujo9eXBL39BBWRn0PkaowJE46UdR2H9bXV52QIEYjUiwr/uvixtLtTQDnxa35iWJ46O3ChgtQ2gSBG303rNRJXuSaIfPATM335MdXIc7M4Iu0S/sIvyVNennQdiQNGkIR+UOiZhyUKdRjw10ERWHHIYI1OUUdekWHoGNw7xIgE2tun6JWP+N8XPbfxzjeLdRzPAIzgJCtes58mkqpLlumPd7AO1seVSYL9UAsHkYtDgI/AUrM2oa/6fB0bItpuravaXG74dA/QVSaiOFstlma3scW4p8dzOo5eoIKkEWzjcEMhM1MzeH4ANuCW; 4:8LgEcw6jSEXpBkyfuXzjdVD6cAEwFQm+oSegoY6xTSy69bMXCmmOR68Fe9kGPciQsOa1DaF5zfp6MPAk2oY8hVGCl8D1nUDy4GVZJ+6CDgpqhT3IBdgnc9IebhGmlqp6KoZbZtYMGmxKD7ZyJLqNDpewTs3PNULFZVLoMbP7IarW7gvUohwyu2/3F95ESMJUjcTlX+98RlGhisl8Pf21YOMNpNMWaXCJdorSxdi/rqkw2dfq3jkcvQ+r1AT/nG2xSSdsSGdzPg8SOPV3q/8ESTPteuYI7LojqfgebDqRP/m+BmZ4+P5EvwuN2IpMfHf6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); 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)(93001095)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051); SRVR:HE1PR04MB1530; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1530; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(396003)(136003)(39860400002)(189003)(199004)(316002)(305945005)(8936002)(386003)(55236004)(6636002)(6506007)(106356001)(25786009)(36756003)(16586007)(5660300001)(72206003)(52116002)(53936002)(26005)(6512007)(478600001)(54906003)(68736007)(186003)(16526019)(50226002)(7736002)(105586002)(51416003)(97736004)(76176011)(78486009)(3846002)(2906002)(66066001)(1076002)(4326008)(956004)(446003)(2616005)(47776003)(11346002)(1006002)(6116002)(486006)(14444005)(476003)(8676002)(50466002)(48376002)(81156014)(86362001)(81166006)(6486002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1530; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR04MB1530; 23:udDggDOoBR28TdDSbWxUWHiZqjFtxYB1ToZ9RuqxZ?= =?us-ascii?Q?28f9G28bMIRqhzyahSAE0QA6bOAWYjEU6Ij/RQRePMZT6ME44FT6lfA+nJ67?= =?us-ascii?Q?ZXr8IXGju3s3FmMsKVZlJo6BGU58vuHa5TeIdpvaIq+aG5Xv7PXNngv5VRs7?= =?us-ascii?Q?Aa4aT9IL1VvHp/rGSRkwE9FiJpBp0HIbSqiWRD59K0MTNPdOJ3nqFcYdDb4p?= =?us-ascii?Q?EYweSWXo+Frf3qANtuYd9/r6b17+cJQXASllopYOPeuzZDWPtp3J7aD/bWX/?= =?us-ascii?Q?on+us4NcfssVRAe7Z82silH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U62rfMi0s5JDwfVlazLHOQ+Yw2247ea0SaIxkVRC5+WTOp/f0huMeJ8I08hKFbQkDSS4Orw8uu1Fmm+p81GK5nIeEhZ8sQRgfMSirTxuIzC4V5gKbZczla+Z1SKD0l1kGzR4yKCQ0hPPGTDMyhS888dtJV4NGzIh/X8noGvyj4=; 7:/dASIIPT7sAe0yWqfplmxwAFl72ESiD8332vJhPK1UZYU64RY4DefAZDUciwccwAn0UTWE+nfDpIbOQ8b9TkM+xs6oSKRr+2K17VvxUgoYN8uqRAO5ICfFd93KS5xfMVzus8pqZmoP0IZBz5wNrprKcNi+WmztlOebBdimqvBVivmXFE29KMWyDnHOICoPNWFhvAkgEqfNY+PE6lamv46Ic0YEtYAjqE64TNy4szCLOqFAcmIWU+7+HIpxIyp9Yj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 14:41:45.2716 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de53c2ab-35f6-49dc-e3c7-08d63050d5f6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1530 Subject: [dpdk-dev] [PATCH v2 07/14] crypto/caam_jr: add queue pair config ops 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, 12 Oct 2018 14:41:48 -0000 From: Hemant Agrawal add following ops for configuring queues - queue_pair_setup - queue_pair_release - queue_pair_count Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal --- drivers/crypto/caam_jr/caam_jr.c | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index cdae2a4fc..78bc75f69 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -97,6 +97,67 @@ hw_flush_job_ring(struct sec_job_ring_t *job_ring, } } +/* Release queue pair */ +static int +caam_jr_queue_pair_release(struct rte_cryptodev *dev, + uint16_t qp_id) +{ + struct sec_job_ring_t *internals; + struct caam_jr_qp *qp = NULL; + + PMD_INIT_FUNC_TRACE(); + CAAM_JR_DEBUG("dev =%p, queue =%d", dev, qp_id); + + internals = dev->data->dev_private; + if (qp_id >= internals->max_nb_queue_pairs) { + CAAM_JR_ERR("Max supported qpid %d", + internals->max_nb_queue_pairs); + return -EINVAL; + } + + qp = &internals->qps[qp_id]; + qp->ring = NULL; + dev->data->queue_pairs[qp_id] = NULL; + + return 0; +} + +/* Setup a queue pair */ +static int +caam_jr_queue_pair_setup( + struct rte_cryptodev *dev, uint16_t qp_id, + __rte_unused const struct rte_cryptodev_qp_conf *qp_conf, + __rte_unused int socket_id, + __rte_unused struct rte_mempool *session_pool) +{ + struct sec_job_ring_t *internals; + struct caam_jr_qp *qp = NULL; + + PMD_INIT_FUNC_TRACE(); + CAAM_JR_DEBUG("dev =%p, queue =%d, conf =%p", dev, qp_id, qp_conf); + + internals = dev->data->dev_private; + if (qp_id >= internals->max_nb_queue_pairs) { + CAAM_JR_ERR("Max supported qpid %d", + internals->max_nb_queue_pairs); + return -EINVAL; + } + + qp = &internals->qps[qp_id]; + qp->ring = internals; + dev->data->queue_pairs[qp_id] = qp; + + return 0; +} + +/* Return the number of allocated queue pairs */ +static uint32_t +caam_jr_queue_pair_count(struct rte_cryptodev *dev) +{ + PMD_INIT_FUNC_TRACE(); + + return dev->data->nb_queue_pairs; +} static int caam_jr_dev_configure(struct rte_cryptodev *dev, @@ -178,6 +239,9 @@ static struct rte_cryptodev_ops caam_jr_ops = { .dev_stop = caam_jr_dev_stop, .dev_close = caam_jr_dev_close, .dev_infos_get = caam_jr_dev_infos_get, + .queue_pair_setup = caam_jr_queue_pair_setup, + .queue_pair_release = caam_jr_queue_pair_release, + .queue_pair_count = caam_jr_queue_pair_count, }; -- 2.17.1