From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20073.outbound.protection.outlook.com [40.107.2.73]) by dpdk.org (Postfix) with ESMTP id CDB261B3A3 for ; Mon, 22 Oct 2018 16:57:39 +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=vmfbiky8W7l+TexzujHJEMTtrGFuwG8Cu8/57YE+3VJgUe1j8KDbXq3iwA79Mvntn+8kS88OBWHr6qS7ICJmp2XixqbJ+MalHpLnTFUWc41Xeo+0OqHbm9iqe9j6CPC9IDW0WbdllNRby7dlJuJKzEL+GrfMpZPb5AsOK1789gY= Received: from HE1PR04MB1530.eurprd04.prod.outlook.com (10.164.48.20) by HE1PR04MB1305.eurprd04.prod.outlook.com (10.162.249.27) 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:57:37 +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:57:37 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , Gagandeep Singh Thread-Topic: [PATCH v5 07/15] crypto/caam_jr: add queue pair config ops Thread-Index: AQHUaheSgQvvPQQBcU6MAhsxHGRX9g== Date: Mon, 22 Oct 2018 14:57:36 +0000 Message-ID: <20181022145644.29277-8-g.singh@nxp.com> References: <20181022141657.4727-1-g.singh@nxp.com> <20181022145644.29277-1-g.singh@nxp.com> In-Reply-To: <20181022145644.29277-1-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0067.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::29) 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; HE1PR04MB1305; 6:t5017KyM4bF/oCi/Ro7k/3Xwz2qW8nqweSiGLedaU47jio/Tw+MWBcfWokYFKKBAuMLgr0QnU/3HDO1HrXN9YD+JdXZmmfC1e8MAInNtSWcF/lYw7B6tqOdlwZFOSRAIKbsYun6LpIiWNsm5ogGdjgTfqEGjwSU8HdLDAO6GG4L9+pd0xvOJL/P+FUo2afUwzs+KAqBJjMA60jP9o9g2/4pRdZ2YSk+U/mU44vMo442lvYriQc3jx/HvvzwXeYAduu5eryuu0hVy2DHKxNwGfPCsvW9w1i8uQNk18sgX83zNJr2aD3DQ9JOIrFX1lcpyx+cpUXXc2Pf4vQdRJeW0InV0ycVCZ0C5zseDTVGq474QN/IlzuUDyHYVmyf6QOT+QZKqe+8sZneLmpFWc8c2wnKIFvLOWN1v2QWIx84m3YlXLZhbhdSJ+sVBVrzJvcltYoecWXdw23bom8CftmZckw==; 5:gDE/OhyDeOeDuPrS8SbKgqNniZmy/12yS7BXjJ1WWYgQcyYU0F3iwDwkIgKv0uMQmeDJ5IDLuyrDTSAgf8rfzUJnYHeR64CxBZyi06SeVis+3JHUnNuK832OhsFgoT1H76DlUkSQJHmLnAOMsUlMxHj/d67NHiAlxUrvVZfdDE4=; 7:aEXZ4Fq3v0pOCxLMnIhWDVqEr/0IsqI6PBZqQkoMHzBa8KmiwdfmTLeAkAnEUyH7AY56mLpztoXAY4dzlN45rMXSyyWsGsL5Z6hEf574G3KhwXq0sG9IXNND8osXMDjDBHgsVWapQTYPk64iq08/ThGCkyscN70zMcYgMtIFAN1IOIUraPWXQzYB9wq5bLYTzdYuPWb8hab1G1IU3lG5N+Uaca44HVXIwku150VIPBLXz5DsoX0KDQ5/HIsMYB12 x-ms-office365-filtering-correlation-id: c1daae35-3d2a-48d9-49e3-08d6382eb45d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:HE1PR04MB1305; x-ms-traffictypediagnostic: HE1PR04MB1305: 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:HE1PR04MB1305; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1305; x-forefront-prvs: 08331F819E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(396003)(136003)(366004)(346002)(199004)(189003)(8676002)(256004)(81156014)(81166006)(11346002)(476003)(99286004)(446003)(316002)(52116002)(2616005)(486006)(106356001)(8936002)(105586002)(186003)(71200400001)(5250100002)(78486010)(3846002)(2501003)(71190400001)(25786009)(2900100001)(305945005)(7736002)(97736004)(478600001)(4326008)(2906002)(72206003)(6636002)(53936002)(14454004)(66066001)(6512007)(5660300001)(6116002)(1076002)(6436002)(6486002)(36756003)(14444005)(54906003)(6506007)(76176011)(55236004)(386003)(68736007)(26005)(86362001)(102836004)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1305; 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) x-microsoft-antispam-message-info: eczVhopgb7uPLM7oceRWk1ukLZGM0R8urkDGmjqc3++SfQWc8EUmU+Tnbh42HwByLtS4SQ2NtEIq7cKgkUB6AYEhoI1PSNz488zanZi3UKI3IQ4RrHV0+KZZA768xBPZh9qInie4Prz5wngocqQJIZcQzIX7vuKrkg3ck2EkrTCIbx/+aI4UBYU6N2imHVekjkQoc68DdidlkkVv3kV0661mnZsqGNL8jxRPqfQle8mzZFg12HjcWv2sycbR0Kz2ujt0kGv9/1NH/tkvVBNI4oMqBLqlH4XXdEupKJoXvdCVRK0lpBbr6Rl77OMmxOYl4dbFYiWKC7YxKmIPjFmFfT7qMZrEy6FG3kr+b3iED2A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1daae35-3d2a-48d9-49e3-08d6382eb45d X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 14:57:37.0361 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1305 Subject: [dpdk-dev] [PATCH v5 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: , X-List-Received-Date: Mon, 22 Oct 2018 14:57:40 -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 Acked-by: Akhil Goyal --- 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 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, } } =20 +/* 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 =3D NULL; + + PMD_INIT_FUNC_TRACE(); + CAAM_JR_DEBUG("dev =3D%p, queue =3D%d", dev, qp_id); + + internals =3D dev->data->dev_private; + if (qp_id >=3D internals->max_nb_queue_pairs) { + CAAM_JR_ERR("Max supported qpid %d", + internals->max_nb_queue_pairs); + return -EINVAL; + } + + qp =3D &internals->qps[qp_id]; + qp->ring =3D NULL; + dev->data->queue_pairs[qp_id] =3D 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 =3D NULL; + + PMD_INIT_FUNC_TRACE(); + CAAM_JR_DEBUG("dev =3D%p, queue =3D%d, conf =3D%p", dev, qp_id, qp_conf); + + internals =3D dev->data->dev_private; + if (qp_id >=3D internals->max_nb_queue_pairs) { + CAAM_JR_ERR("Max supported qpid %d", + internals->max_nb_queue_pairs); + return -EINVAL; + } + + qp =3D &internals->qps[qp_id]; + qp->ring =3D internals; + dev->data->queue_pairs[qp_id] =3D 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; +} =20 static int caam_jr_dev_configure(struct rte_cryptodev *dev, @@ -177,6 +238,9 @@ static struct rte_cryptodev_ops caam_jr_ops =3D { .dev_stop =3D caam_jr_dev_stop, .dev_close =3D caam_jr_dev_close, .dev_infos_get =3D caam_jr_dev_infos_get, + .queue_pair_setup =3D caam_jr_queue_pair_setup, + .queue_pair_release =3D caam_jr_queue_pair_release, + .queue_pair_count =3D caam_jr_queue_pair_count, }; =20 =20 --=20 2.17.1