From patchwork Mon Oct 22 14:17:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 149385 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2689257lji; Mon, 22 Oct 2018 07:18:58 -0700 (PDT) X-Google-Smtp-Source: AJdET5e93IBe4tcjCnzOD1B64hmmxb8vkDOe+gmVy+z91RMbcvQr4miq4VUkHgd+JhxLjsL9hclu X-Received: by 2002:adf:9466:: with SMTP id 93-v6mr5119837wrq.200.1540217938848; Mon, 22 Oct 2018 07:18:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540217938; cv=none; d=google.com; s=arc-20160816; b=ey5+gTOYfCmT3p+qvItppGfVaUT3w3VSUYY7RycRAkUzmUHVlln1HSD/anCjsibpAY 56VFrPBBPJAQZ2BmcfzITRChHvmDtE+nbBRDKGaaojolXoMZB/v3SbiiJ71SqCyKlXVF n3zBaHeSrg8Tq2BA3wBchmnTvHZtDL3SIWmb6UW6cCVr2PlA5U4iYayPUtZQxv7Ginpq jB3ENn4uX4xDx1Qx6yBxaDjkeEJGUNnj6idFDvWkqy+cSxaT9TEmvyuUu9CdUa1auA0p 6oGrayPyjYw11V4W0rfeJP14soG1KjAZCFeZgTh+0/NxDI166KkuYP/mCmEiQqAI2XgV K8jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=2cLIzGbm8caoUzC/jP7HnfqP+qve+NSSRZRpEOfwFZo=; b=jDEcUL81ICtI2hb0qHV8VspTbuF1/PV0GKk+iX8fkxtFIHYp7HgHvnlU2uavz2XLPw 3/jnZmsHlm4q0NZHyJCxeV8gN0+NImOx32GppswNFl6D+s8M0GZ3yoV84qagvtXxAZaH BhDPTqFGmXWBRtW4Shm73IZrQtDiVtpNEhsl5FIzUbUj2SjG193GPjX3vcL3HjDG1RJb eXLCaOElbEc1MtBurYM0Py3/R5Wxwt8C/Fo7cgn84sTWs9Zi7SLs7t+g4ZqDmylyY8dV UwZNHUBb3GDuamG/Sm5C+G72LWwjQDpcuMQi0ptUj18BijiUp55EXiHQAGJzbhpLbTjh Oo8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=IgFw9oB0; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id r64-v6si4048125wmr.110.2018.10.22.07.18.58; Mon, 22 Oct 2018 07:18:58 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=IgFw9oB0; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 749521B197; Mon, 22 Oct 2018 16:18:00 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40055.outbound.protection.outlook.com [40.107.4.55]) by dpdk.org (Postfix) with ESMTP id D1BCD1B115 for ; Mon, 22 Oct 2018 16:17: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=2cLIzGbm8caoUzC/jP7HnfqP+qve+NSSRZRpEOfwFZo=; b=IgFw9oB01554XN7cd2lkLJ/85sfD0qcwCv0X4L+nSpuqBZ6NGkYe90WC2PwyRzRIPEBX5Nqytz30g5sfytdjQsiHKDhm0rJJMR6bB08fafmyFPta9EggKKLpakYveQSWJ8W1UOjhNrmZh7QDYWxNgeyjsIEt5j3l8u3KvZ/SrR4= Received: from HE1PR04MB1530.eurprd04.prod.outlook.com (10.164.48.20) by HE1PR04MB3242.eurprd04.prod.outlook.com (10.170.251.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.30; Mon, 22 Oct 2018 14:17:47 +0000 Received: from HE1PR04MB1530.eurprd04.prod.outlook.com ([fe80::95cd:198:d5c5:59a4]) by HE1PR04MB1530.eurprd04.prod.outlook.com ([fe80::95cd:198:d5c5:59a4%5]) with mapi id 15.20.1250.028; Mon, 22 Oct 2018 14:17:47 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , Gagandeep Singh Thread-Topic: [PATCH v4 07/15] crypto/caam_jr: add queue pair config ops Thread-Index: AQHUahICxwOTd9bKHUq5tjlEr4bS9Q== Date: Mon, 22 Oct 2018 14:17:47 +0000 Message-ID: <20181022141657.4727-8-g.singh@nxp.com> References: <20181022133021.11264-1-g.singh@nxp.com> <20181022141657.4727-1-g.singh@nxp.com> In-Reply-To: <20181022141657.4727-1-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::11) To HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.142.187.166] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR04MB3242; 6:pbl8jGJDSz0/Kcw5YQqFYSNB8YGSv5OPqbbx9tLyBD3D0maLwcT8wfX6q46/5oS4CZ0N90NZUtSg4f8Ds7T6MEtE+HppbePu5sy58xiYe29aVUaS6Fop2kNiYg7+TQYCxJu8YdJN5wMIq3y2Ek9hXCsLpsrsFhtuUFeLoXcXMTrkgiZuuT7qKl0skL4UlwLh4ULpd3RXQv1Vm6JgRwUcCYNTKCNdgTZogjDPdwCP2kkoym2BPKrpOO9bEav3SQhcZz8/lSnUBi8zdl8MnaANIZ2Uyzghg5s9WjH+/HP0KdlemVVkt7oSfvuvU/N/y2CCIQJbHF8qw3OZXv0diEMQlU9ORimMUmVYQ0Yg5lPk0hshnSAwwpfhwhQHL3S36YG4fyiYS3zGl2AOQZbZe5DvZeeOfFt7Z0VzzO8w9crb4oGQZwrEG6VrnYmSyRmUDSmO86f4lJuEm2f1vHGZI9LIjg==; 5:noJaQVJyMCyZiYaxBni6ZkursvHCt2QZkO+RQUr9Dwyj9OKksE6lEMk/zsS+gXooI8OyvJp0IKTe2XKMNj9nceB0SoWzlH29VsmcbUDFixyOrfC7UteiuiOVlTiypRUdoG5RN04CuSMXKc0LCZkj5GQa8TE0RKeZ6yofpl5snA4=; 7:VCnjmJGdYLg/kkLBPHke5CWqQ74bdhIMyZ+C1d2CUI4uWR6+tBgs5HQsTwiGDi52xjaCR8yiFzcWFjixWZZ1svw5j5glXnh3jM9gF2EkF6YJYdcEYvGsTFkLgEJ5dcmXUWiu7X6ZepTBHxKhLE5cjhCnD1ZpI2b7tb2+qgfvwG8PnSaLO8SyujUp86bpfF+QlXctLpWTvcJITiTljv4blmvt4pAmNeP+jFyuKdO5S43PkAPGZq88OytnOF3PMlXr x-ms-office365-filtering-correlation-id: 77166b40-1a0d-4965-e792-08d63829243d 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:HE1PR04MB3242; x-ms-traffictypediagnostic: HE1PR04MB3242: 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)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:HE1PR04MB3242; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB3242; x-forefront-prvs: 08331F819E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(396003)(376002)(346002)(39860400002)(199004)(189003)(86362001)(68736007)(72206003)(1076002)(3846002)(6116002)(5660300001)(71200400001)(71190400001)(110136005)(54906003)(105586002)(78486010)(106356001)(6636002)(2906002)(7736002)(8936002)(305945005)(478600001)(81166006)(316002)(81156014)(8676002)(4326008)(25786009)(2900100001)(476003)(53936002)(66066001)(6486002)(14444005)(446003)(6436002)(6512007)(99286004)(52116002)(76176011)(36756003)(14454004)(256004)(6346003)(97736004)(2616005)(11346002)(486006)(186003)(26005)(2501003)(5250100002)(55236004)(102836004)(6506007)(386003); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB3242; H:HE1PR04MB1530.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; x-microsoft-antispam-message-info: U5qeDL0GqHx4udgNxSNUO7tb5sevA57j5Hgxww9/wie8y3MzEH7KhSkQMdm+y4YDofduWDEZtJWvUoWUj9xlkhIQwikRWx3Ppc8vy+DLWRHkGhBItjfc2bgsTisJU0kDcmxXk086JY7hdzaqDMCUgFvxZ+ZuNyBzqpDuGElRNUXfogTjESksQJVIBDIwAPUpSq4HwX/dc2sVziQCWo5xv+twgxXaUQ8eWxwuMBpYntrWaZKGKVntsMs9Wh0MIjZhhmHys5DbcQtNexnyMszAazbg+eIWAWRJ7DuGQIl0mMDcam9Jj9yyROSca5TDFi+oQMNsKokOV3cXUGo8QXqWkHE1xTHN5NpGhacjg2O4ay8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77166b40-1a0d-4965-e792-08d63829243d X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 14:17:47.8089 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3242 Subject: [dpdk-dev] [PATCH v4 07/15] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Akhil Goyal --- drivers/crypto/caam_jr/caam_jr.c | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) -- 2.17.1 diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index b03b9625b..931070bef 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -96,6 +96,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, @@ -177,6 +238,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, };