From patchwork Mon Oct 22 13:31:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 149380 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2635991lji; Mon, 22 Oct 2018 06:32:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV63nrbUtVqGyOy/zOtpzAqZUtxqTvwViLVAbbnEGTHthN+zi3wKlBXGs8mp6N84R7VzOw/Bm X-Received: by 2002:a1c:970e:: with SMTP id z14-v6mr6320650wmd.100.1540215148930; Mon, 22 Oct 2018 06:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540215148; cv=none; d=google.com; s=arc-20160816; b=Te5lFxKVJZ2Etay6u5Lxfi51Rqh//1Nrd108WsfbdnAaLz9JIxOrTqKrZgOhCaOQOb GFo4m56BJAkHTFNE2DOnuHE1m2lF9gPydivUSZ2Os+9lEHh59IlRLoSvvJT44QhA6xbc 0QWAYYCv+2uDtItHHHDo0iS8J8SF50w5zTuyDZLk7GQeD0cCSRhXyyZ75mYYCrPaxcEt t4wg0ynOdJLmUs1Re2m4i3W0361f/lOPOsUrIqK631NlA2XlkXfeBOtVYwST4JZh6Qf9 0pRwAsbe5v/O/Kd47irQOQzf8BMZC+1vN89WDqRPoTo+b973vDjlsAMRuJc9aSTposrp LmRg== 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=92doOnC90vGGv4fNs0Oje2/1nUirtun+4vSqG7ZCzNw=; b=xI5lhG7HlMikqNNiDRW39CyDLhK1cZRDhwyQSB8zrOHFAbaijYTqtdCMgWWsDAR7a6 WlbjJYBUN0/pseBNkbV5ErMJa3xKH5FFEJge14J8MR5AvGTbYSKF8D41XVg5xzCdqtnX 2bUZB4imTCTo44QFkI6NE/Cv65m9CCjG4CNS2xVgl7LqxGqvjinwWQ8OAJa8kg80+HOy a65A+1kutGKSsUkmisXScRhsPq1FDXfFW79d9DxSNZqlIuwUQwRk/GclaaJG2PxIGHtQ SaEe5byjckHHhv3vC6O+EGp2cOUffodRRzkXgr2wMvqwlpuhinufdVdHstwf6PVClwtE WEFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=kxAh9gW0; 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 t143-v6si10216572wmd.37.2018.10.22.06.32.28; Mon, 22 Oct 2018 06:32:28 -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=kxAh9gW0; 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 B7BBF5F11; Mon, 22 Oct 2018 15:31:24 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10067.outbound.protection.outlook.com [40.107.1.67]) by dpdk.org (Postfix) with ESMTP id 666D358EC for ; Mon, 22 Oct 2018 15:31:17 +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=92doOnC90vGGv4fNs0Oje2/1nUirtun+4vSqG7ZCzNw=; b=kxAh9gW0PuGF+mLn8HcPezGHOs7IAHMJVo/XpJKPBQMC0vRIawCHjafshshaCxlBsk1S2fsZFLecVRM/LNbo3GHsYCWaW19Byjl466KE0AJtJf+TUixk24dfaD21TmF+fmnpygzfEtzDvMb1hAGnDQVoq44RuYpgeUIU+FbXua8= Received: from HE1PR04MB1530.eurprd04.prod.outlook.com (10.164.48.20) by HE1PR04MB3131.eurprd04.prod.outlook.com (10.171.196.142) 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 13:31:16 +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 13:31:16 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , Gagandeep Singh Thread-Topic: [PATCH v3 07/15] crypto/caam_jr: add queue pair config ops Thread-Index: AQHUaguBAulGlfJHTk6Ss661O+R0gQ== Date: Mon, 22 Oct 2018 13:31:15 +0000 Message-ID: <20181022133021.11264-8-g.singh@nxp.com> References: <20181012144055.9461-1-g.singh@nxp.com> <20181022133021.11264-1-g.singh@nxp.com> In-Reply-To: <20181022133021.11264-1-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0016.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::26) To HE1PR04MB1530.eurprd04.prod.outlook.com (2a01:111:e400:59a8::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [14.142.187.166] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR04MB3131; 6:cx4glHopZEvzI/Jii1xz5odGUXs8cqwWefU9mF5MbVyC3pER1RAXdGThEDyqVe0zPb8Rh40wCMn2Mom1dEQHdUsiirUimBeDN3K+9oijqC9sxqa1hwt9okZRbINwEUCXwMiZT6ZR0MEH5urYHT59IQjBYkzOUrDwyiP6WcHx3e9OaRqbBmsUnnYBGx0YF9rFtwTlHmCWimcdzXnDJgXJISItODS5VuTWocxEhXioWKzS4cLEJt6ZxPLeHKHuDeG0ZAaz1btTcajyrLZJu4letjqZ8r/snlQRyR7t0Nae8QNhmn7hTA2yx8ZFQf1aTC5eB4+/A5b6/RZu9UBrmd1ainY9ru98126/ny0om5k4lorlBwbKDM76BagKcq8sfflOLe/AxMkMz1DV9KLu0LZivfUcXdhuQE8VCXvubECxBWmmvbDObK2TazR6wr4aN5Tbx7p1++zprMMq5uq3McLVGw==; 5:0nIA0GCzE5e5ABWYxTq5TGvsvnliYBOPKgFGA1+MMDvzew06ggxyrcaum39OKaa3OpcIVrjVhGp19zlnWaxy9qOe0cCAotVbJreBNq1vhyVbvdltIutRFp1l2elTrdlj+xswd8iwbl289MBCwdnLTwEsRU7SrZLR8AlinOJrIbs=; 7:vcmlyEmqtqnTfxykHLDMfYbzGBSgbeX+0Vrz6tqB9ayf971oQL8980SAD3wf0MZkepTe3/8w6yfEFcs861SUCJ16UFmAJjqVvh/lkZh6BTZHJh8Yd7qCwtEEDCYGADbz1A3Kjr+iSl3+IoM68rXz7xuaCCvw2N1+d2ey373dzRmvuNC/BqkAYMjbBl2UJ3CBWh1JLSVrD9ALKXesGpVAtc+HoSpF412w4vM4gqa0alxKwPeC880nerpsVfYItqno x-ms-office365-filtering-correlation-id: 026acda7-8120-43be-ad47-08d63822a431 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR04MB3131; x-ms-traffictypediagnostic: HE1PR04MB3131: 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)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:HE1PR04MB3131; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB3131; x-forefront-prvs: 08331F819E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(136003)(346002)(396003)(189003)(199004)(110136005)(99286004)(316002)(54906003)(81156014)(14454004)(25786009)(72206003)(81166006)(2900100001)(8936002)(106356001)(8676002)(6116002)(3846002)(86362001)(2616005)(476003)(6506007)(386003)(102836004)(1076002)(11346002)(446003)(26005)(186003)(305945005)(478600001)(4326008)(2906002)(76176011)(68736007)(7736002)(6636002)(97736004)(486006)(52116002)(36756003)(55236004)(105586002)(71190400001)(5660300001)(6436002)(6486002)(78486010)(53936002)(14444005)(2501003)(256004)(66066001)(71200400001)(5250100002)(6512007); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB3131; H:HE1PR04MB1530.eurprd04.prod.outlook.com; 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-antispam-message-info: k1pYO6Y7hQXAJ1riyTAH/zz7ARH0w5PQDRwU+1AVsM3XXsj19LFs6t0nqHJyQKXf6Jpgamcy/DOQWiKdL3ZNFzdYKWgkHdQITwu8V31CmPTZWtsN7W2+1SPAfC0ZDlbOPM7oFeV37xo+SVuSfhcrj2EFMUKFYGUVUb3cj8ZG412oVUP9IANXWYbQyFmPX9HcwDEC4kpFIF/suIFTPV06Bh6Jd1yIRYoZYUgagtJvG2n2kfsNef6/2WSnLfFgIcfuQN7Hz3VUQHID2qS4wlBbmKZVkL4DVYsxdx/PRR3XblUG99JD5PO2y7pwd2rsBZLtJiQel+DLwGf73Tiust0/ZE6AHyfQ39ngOe4PqcJ0Bf4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 026acda7-8120-43be-ad47-08d63822a431 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 13:31:16.0041 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3131 Subject: [dpdk-dev] [PATCH v3 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 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, };