From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20063.outbound.protection.outlook.com [40.107.2.63]) by dpdk.org (Postfix) with ESMTP id 9F74056A3 for ; Thu, 13 Sep 2018 08:09:32 +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=dtdB71x1kjuu21jx2haFNLimF507R4qwFFUjaNOYLC4=; b=uh5uRbxNmvWEFQru7RsZiGqNhdH3s7nQdKNhWak8/amsiwtEpBd09hpL8pBA8hE4eAxwSBcbROp6l/4Y9EBDGBCjfl+AqH0hLOXDA3ikWlmQlJw7z5fj7MYbF3/HQi39CeqXPN245dlUpRmQaX1lifjDYky5yzHYsSDzzhEDxSg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by HE1PR04MB1529.eurprd04.prod.outlook.com (2a01:111:e400:59a8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Thu, 13 Sep 2018 06:09:29 +0000 From: Gagandeep Singh To: dev@dpdk.org, akhil.goyal@nxp.com Cc: Hemant Agrawal , Gagandeep Singh Date: Thu, 13 Sep 2018 11:38:41 +0530 Message-Id: <20180913060846.29930-6-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180913060846.29930-1-g.singh@nxp.com> References: <20180913060846.29930-1-g.singh@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0095.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::11) To HE1PR04MB1529.eurprd04.prod.outlook.com (2a01:111:e400:59a8::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 651f06fa-59c6-4956-eb69-08d6193f7824 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR04MB1529; X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1529; 3:j52s+PSAItVWyCT3zwIHjAaaQkcxvZVXvqymLPhknq2GKgwRIY/ioNeVsnmpj+n8lNi0woi5ghTPcq75LHJA/dfNZCZLZKJFw0FmFtzcX6XA4I3eaR7lESmFlSQYp172eHqYwivSGfPzGPsssC6r0CmF/NqRD5rR+Am1FdPhdcWKLVqOARY8MSuy5SNFMyUY6b0F7Hfv7Dj2qi90eGi8tWwFzM50hBmbg3jKFY9vb//uN5X8aDvZrdQ3+RAVtRvF; 25:MVcVsLGLC5bUlvyJbGcXlzw9lO6MIGLf8YfZ6PyC1Ab50uRRMoJFBFPPA4DKVWwhp+xKBiJLJiZ8/hPaKwcwbjnjaM+tHY9Lx9GE6SwSn9QScK5OHtkJ7ZZAnZaMCVZy+yyudvH4L/FNmP7qeO8Z56Hk96LXkIFrj/WIOBkEJyRIkQlgi1ey6/4Y8EO5Ihh4Fyvj6E6fvxvHp7QRc6DzfOwYC470liyLjLWBx4oUORRoJIq7JyR7XfDbOFU23kIRJcPh8rbyvrk+OpT7Izh6r8vAH5y2hDLw9e1MYN0SQem7fBmO9xCsjDKRRTN1jMeqjQLB1NL6XoAOh+72yqATEg==; 31:dvWIyxlxwuLVYfbvtHZt+AT1zMO8uXaPkFu5C2xyBBLep60ainHr2gsvi1mvDm9M3DO2P37zUUFwfRO0Ygpu8vgGBTDh3jCZ8BfByiqiKYWha1+0RlQW1P0F078khqXznGkPxIJz4LOsuEqjKnmnCiqc8GNFL0NEP+kM0j2YFNgxKL2OK1/uAqG5Wvf+8G4e6yxKSd/ssdUl8g5ZrSTzcrhVdjMaji4bU8iqIOifjD8= X-MS-TrafficTypeDiagnostic: HE1PR04MB1529: X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1529; 20:mcopWFHkmqRkHwOlD+0pQURlgPvL/KPbtvUiFQnmywn2NCCaJSVw95uvRmJ+CllXp+5o8NwIFSjcGk3BkWqbO266HKLrFylzwhZF3pC/8dJEZEnEZ1INAWAi4JcDgdwPy7JAR2dlWJTVv+FSsk+Eih24tWXpAzhVMZWnespk8vIaBT3OkwfqqBwmBcfTGl2YQEC+D7Y2V/ehLu40cqRO4v1l4ZIlv2oYW7J4Cu7l7+CoRIWL/oV7BVCNQ1bsW+dIIX4/kQdlCL8KSOwLGWA4wkjSyzaagSGkoZ5vICN7GMH4zObhi5+7ZBErR0Ab4fS4islVcki8ptDX8zEM9i3Qw0FzzKEGBLKCEgQ1LENfQnh5PFGI6YzXVdckelxqZnANb4x3zYVa0T+021HRIO6PQX/97kk8KOCZzFoNez8RpzqLLr4srp3jSb1IJzyewnR8Bh1WHCtcgVqgmJiZJfzVLHJP06ynKnU8I7YrPQcjDthZTP0aWbtHawjIxlzKuAms; 4:5BFptogfuu/NoFvTv84TPRaGCf9dKuH5ntEOI1IfuVfHbN6KMSDEuEiR9Hg2TCwNbfrhA49K0Se59wdcXAfO8rUJbAMdvp4kWc9Yw7cQZS8916YDgsVfsMnkQBgZMX7Jg2AyiB+7Fw6mZHlxRlL1z3Snix1tQ02DrWuNTER907bA4DhNNkyOE3pn9RJHd/0SFsC6PBPvYhmyGRgmjzIjW3HlxCsYUApklHVZtsVZTDKxtTeW3hCQsj/Di8iMtnD2+IMTWjqOkAoA4T47ztXEnesdlyjtTgg0pftIU9sB2ixRLDSGjlkG8mFcFqBb5i3P 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)(5005006)(8121501046)(823301075)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:HE1PR04MB1529; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1529; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(136003)(346002)(396003)(189003)(199004)(2906002)(6506007)(386003)(5009440100003)(6486002)(51416003)(6512007)(52116002)(486006)(2616005)(68736007)(956004)(53936002)(476003)(446003)(11346002)(305945005)(26005)(7736002)(55236004)(76176011)(186003)(16526019)(50226002)(478600001)(47776003)(1076002)(3846002)(6116002)(48376002)(105586002)(106356001)(25786009)(14444005)(50466002)(5660300001)(36756003)(72206003)(66066001)(316002)(97736004)(8936002)(81166006)(4326008)(8676002)(86362001)(6636002)(6666003)(54906003)(81156014)(16586007)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1529; 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; HE1PR04MB1529; 23:f5ozKjpJcc58cWMGBQ6mCKIpBOnXl4ty4+QjssWRg?= =?us-ascii?Q?ISIG9JiITej9jMuZ65baY+R7LmQbMa3IlTqVcvCHMzthxOe65e4AUQfyMWDm?= =?us-ascii?Q?mQQqYuZb5dY6cVSssw6xWFP+/WmPHKQHeZ0yeY4CTu1a+AAdoLX9ER75RJt1?= =?us-ascii?Q?mRKzEYEQpzhGo+sk5lzj+i8G6kQP9zIe/msH9XdJijF22QdKQpvw7ab9QRKw?= =?us-ascii?Q?XiZ1AuADs2PzxTjCefO831gpClTwcFePCZ6TyQsXr0Rn9F69vGJMF2e2Wql6?= =?us-ascii?Q?OX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ilMN94ii2rOxSB3gJMu8IpiwajHJbKc/R5E+JqR3p2D2qbc5w==; 5:PjGJQyXejwYtnn+7fjbiQQeIbTpKF+fRj0Vm57CnuAFcj62h20fB6DaItp5d+LLYFmPwL0PQTktDCBMHzOau0utRhr0a/P8O7vIXC82SWWGQCCkwuEfePOIVHJXnAwH4d7B3osX1D72KtZ+yk4pbVyhAYUA+C2hSDamCDmqcHpE=; 7:6nRZGplEZB3Zqa3ClxaxevwUAgIAY5Ft7tO2xu2n1FoAWyTHPD6qnga1J+L4s0o3l33d0UjTnVaD263Cq5AE7fA5FGz691oM7U2Sfhh4gwYaOwh7LySD7Ul5iwjzL8l8Vs1I5WES9ou8O9zh7doJLsLzOM1InfqFUYUyqetqECwwwrJ8oDSjiSPix2/9cBKwMgo6EftvoXy+nslJZtEG+BL50dfVy7gzXxrCwB2hfsgkatECIt4JIDYXCgwmFsiN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 06:09:29.7104 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 651f06fa-59c6-4956-eb69-08d6193f7824 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1529 Subject: [dpdk-dev] [PATCH 05/10] crypto/caam_jr: add queue config functions 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: Thu, 13 Sep 2018 06:09:33 -0000 From: Hemant Agrawal 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 43fe5233b..f05e966b0 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -104,6 +104,67 @@ static void 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; + + 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, @@ -186,6 +247,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