From patchwork Mon Oct 22 14:57:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 149391 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2733013lji; Mon, 22 Oct 2018 07:58:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV62ZRZ4SEadtAubA+pU3+A4XpgMxxB/K3sIn5crgiMYsgAZcD+JoXPRdRJkDV+c4dRYah6Iw X-Received: by 2002:a1c:790:: with SMTP id 138-v6mr16499406wmh.122.1540220332883; Mon, 22 Oct 2018 07:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540220332; cv=none; d=google.com; s=arc-20160816; b=zjir3v/RLUr+O3atBU8p3j4EK+Dw78Mo7MdvrwOJwDZz4YQpg/QMYidXQXt/md6muA ZvOC7NtV07br7Ewr/SNmoz6icMOwxVZOlGgFArZsamGD44W3HPhf24ULIxgJWSFt+nGK o2vCZwHs4vlpfCKGDjuC0WSQAbg6G6fo8Bjd4D22pz5BG079+BymRlXpbcvPbPPNRLyK FgJcgd1yKO5xNDsmy9y5lvj2HZUu499SUIfb+owp7HR9UoicOTxrksJ6K0pKd3J9BQNC 8uFC7RWxWc69PyZYAFOw/cftRrKvqcPjUrFfF90Xh1SxWtUrAKolS83ptIvKQY9VpnrR gJsw== 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=D2vulyfcAZCwGOR33DQzyX4gHYNAQCdvS+sMlcL5b0orchxeG9BtrpvV2ZQPg40C4+ QH/RUIKDPqQRzlGU5WFRChDerrk4MpPXXPznhcNx2I3JRBBemVpKEPm7Um09tNkC3Moz hK1omfU80F+dsar2wlhcKZt8lgLDo6N6A5wyP2SP9wmDCZkv0LrkzRKir3yoizT3h6dz +6jB5wuGYCff4JEd3uKeJdLsLE8JcFmNyJbUicWzFUa8NAYrWZpU3SunmXZTU5V+rpTN Cnnf9xo57kHHOKmpTe3jWE3df/5DErdVmSQY2GEAdf72O1Jdjt/SchfkGUivp+O5w2jH tGbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=vmfbiky8; 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 z2si25439077wrw.97.2018.10.22.07.58.52; Mon, 22 Oct 2018 07:58:52 -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=vmfbiky8; 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 3970A1B3FB; Mon, 22 Oct 2018 16:57:47 +0200 (CEST) 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 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: , 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, }; From patchwork Mon Oct 22 14:57:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 149392 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2733934lji; Mon, 22 Oct 2018 07:59:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV61CVhLtf77/+7deCgLyGx9ZUS9vmNt3fwnCkmyoeAqJmn84KT8c3CrJcpcjfp0Uz248aXiu X-Received: by 2002:a1c:7408:: with SMTP id p8-v6mr16484939wmc.74.1540220386731; Mon, 22 Oct 2018 07:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540220386; cv=none; d=google.com; s=arc-20160816; b=HcYXIr0EUEyvSq/Dr9XuzyEoRTMY5HLN/3YSzJy4V/S0EW1kvJdgWYhAAVjBTe8ifq mJESV8e8CAD5mg2DsKJXlVTcxJxf2ysrRz6pd4a47FG8y3jldUHwYqvNurnjSsv5F9sB YOtvaUD5+z8UPxzeFRmFFv5YxF+t5dLwW9Hc9DLlOQekG5mPssE4l8DJIX37z7RCrzHk GHq25meW6kp2SmagJInTsYKZonvr0oGp+GCptNGX0HYuxms3QCF8g5mPti5Ja+cUzgcE byhwhxIcpoRs2CTPy0aXRsccstPINORc014gW4hYEy7GPnAoq/r+YtS2cBZU+0F2TfXx od7g== 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=mfH6KZh5eniC4ZfCOj9f1yCvMuuvVNn9wOkKfWUgX+s=; b=kRAzTSZzAnn5IPIVbg+HKE4oIC/pEbXJm58cAErw1A7sSsWYNsIH4BW1CybAKCgNKL tR9Dz1MBEBNhKSrPI44UyaIdD+z7AnId1a7KMh9meyrjB5Mpm3fY1skhexs0apBCNAwQ Tvc9jpYUPngz0OmWdMGC/DhJh7MvKsUQ0yZbD2wBl30K1RiFkwI6Yx4oRob1XUChfxtx aIsWpZ8RbKNbmRBehX8MR1QFXTXYUzu5R9srfJrwF5IBzL/TiIhA4E01bYZCvvZQLoJN 8byqYyFoiwpAjFUJQvBDxUFt3SkGoqMoELs0KCjVdh7buX4w8pIa+4k6BbCvog6gI20K lP9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=O1gEI2lV; 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 c6-v6si26260014wrr.448.2018.10.22.07.59.46; Mon, 22 Oct 2018 07:59:46 -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=O1gEI2lV; 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 37CB81B444; Mon, 22 Oct 2018 16:58:03 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20051.outbound.protection.outlook.com [40.107.2.51]) by dpdk.org (Postfix) with ESMTP id C8C7B1B419 for ; Mon, 22 Oct 2018 16:57:50 +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=mfH6KZh5eniC4ZfCOj9f1yCvMuuvVNn9wOkKfWUgX+s=; b=O1gEI2lVyLKJGrKOPKq1WS8+uB52KSj4nJ/zi2VNh8ZHH2XzuwBM7uWymyANvXcvvDeCT3/BcLHajxQI0ZHNH0AbEz5HrpV0ofJGPYLc9KxVld/PS7O/Zq+NMn+9+wImrguh+2o9V2o/oF7N+5hyBMJ6FkuY6ug8qStiWDQ4kHQ= 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:48 +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:48 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , Gagandeep Singh Thread-Topic: [PATCH v5 12/15] crypto/caam_jr: add statistics ops Thread-Index: AQHUaheZXSJ/bORa5UOaamv95meWTA== Date: Mon, 22 Oct 2018 14:57:48 +0000 Message-ID: <20181022145644.29277-13-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:NbhYUNosFj4rkTe+mCS4npMPhRoHredncQxyxAePl3q1ASY7hGG9gcQIpMqxPYUTeZn8BD5vQUZzeRss+QWSGtK2E/k90byQFIA/fXZp+n17TlfVdbYqCP8DaaKiiXiGnWDZEl7pOsZlaBKvJORLH0xhY0HC04zEmQw0MnHwOVr5PhsOJ6p8FE0Mt3eXbwQ6s9K+f4h5PuEmyDbcCeKis6lsiXxQIAj9qoc1GuXU/wWIqU4OirNiSgJdRI0tHv1ZNOTdz79n+matv7MwIBaH1oCsSLnYSIq6hqpqunr1tLxxZwFIOEJbdh0D/13iesDRjzALDozGeJH5s39hNpGk9BdueSkssIYa2f1HMV7Qr29FNHWrwMiibAWHrcLMKB5+oyEq/GLSTILuHBMEI7uRts99PLHKOiincIbl5cw9Iw/UXFzFikGlps19H/6xb1QQEqZNBE/EfjVL1+V1ogay9g==; 5:i3lfkLNXbfb5b2NuZ41evYl4BOI0FyuZvVUNGJyexkWBw8UmVoiUpWNNDo75GUIVAu/HmO9wAIkIEYZGl7NXQxLqywcW9MODs1e/rfleMNjugR7O+NjeG9UCi5aG5ySWZUGkRJQPayII8gVpir4tSTZgKNN4xd0QuYhp0vzfG0A=; 7:4nwniwjlaeFZJfSELfKtWNnov3xPpi2p5vJr71d2BWkpoct234tcaD31KHPAg3Un22HKZnLBs6x2A963ZisqHmiO/2a8xXEn1/DZoZRsHWqQ/bsG34Z7AutFWMfSLBjg0v0sXJ1rbbsabB2W14UY2rwEt+TPZ6XduTpxfAXf4N8eqLMR7IwLGq2Y8cFGZ+qSUZQ8b3ALKnxJU5ib43kusYZT0YLSigrT1y+c+jIywSK0EcwXzq/MMP9DKsN0+MDB x-ms-office365-filtering-correlation-id: 2972c4fa-c994-43aa-d18e-08d6382ebb4b 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: KYtoPx2tu3RuQHGcBI266m3R7fKu79U9XUSOAuetaErnj3SVmHZeHBPNUGQzFwyTCp6TzqlFS7aK+I0VdBCmIJMkkcf7Mx/Eo2EbFr1nHJ18M5jvEWGc/I8jLulujaX1MoipM/8jNl1s2qgdUqinExkkAf/yx/zQxeckLpH1FcBNlra/qqVQ7b3gEyAAvd0a7GKQYYOiH7F3nXrit2KHjX/X+5dT1aw7OcQIwWdKRzqboVHkBfYT8UZXZc1pyQU8CdMSPFp2JmSnmlkZ6Mr3JisbkC4lnenCmlz7iR5qRfrNwukMkQY8aUHrH9rQolK0BIHGv346BleUsI6nNUta6HVF5RnM/P0BLCI+i41MvbI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2972c4fa-c994-43aa-d18e-08d6382ebb4b X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 14:57:48.6897 (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 12/15] crypto/caam_jr: add statistics 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 This patch adds the following statistics operations: - stats_get - stats_reset Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal Acked-by: Akhil Goyal --- drivers/crypto/caam_jr/caam_jr.c | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) -- 2.17.1 diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index 0d3a49145..c89d76dab 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -103,6 +103,58 @@ caam_jr_alloc_ctx(struct caam_jr_session *ses) return ctx; } +static +void caam_jr_stats_get(struct rte_cryptodev *dev, + struct rte_cryptodev_stats *stats) +{ + struct caam_jr_qp **qp = (struct caam_jr_qp **) + dev->data->queue_pairs; + int i; + + PMD_INIT_FUNC_TRACE(); + if (stats == NULL) { + CAAM_JR_ERR("Invalid stats ptr NULL"); + return; + } + for (i = 0; i < dev->data->nb_queue_pairs; i++) { + if (qp[i] == NULL) { + CAAM_JR_WARN("Uninitialised queue pair"); + continue; + } + + stats->enqueued_count += qp[i]->tx_pkts; + stats->dequeued_count += qp[i]->rx_pkts; + stats->enqueue_err_count += qp[i]->tx_errs; + stats->dequeue_err_count += qp[i]->rx_errs; + CAAM_JR_INFO("extra stats:\n\tRX Poll ERR = %" PRIu64 + "\n\tTX Ring Full = %" PRIu64, + qp[i]->rx_poll_err, + qp[i]->tx_ring_full); + } +} + +static +void caam_jr_stats_reset(struct rte_cryptodev *dev) +{ + int i; + struct caam_jr_qp **qp = (struct caam_jr_qp **) + (dev->data->queue_pairs); + + PMD_INIT_FUNC_TRACE(); + for (i = 0; i < dev->data->nb_queue_pairs; i++) { + if (qp[i] == NULL) { + CAAM_JR_WARN("Uninitialised queue pair"); + continue; + } + qp[i]->rx_pkts = 0; + qp[i]->rx_errs = 0; + qp[i]->rx_poll_err = 0; + qp[i]->tx_pkts = 0; + qp[i]->tx_errs = 0; + qp[i]->tx_ring_full = 0; + } +} + static inline int is_cipher_only(struct caam_jr_session *ses) { @@ -1695,6 +1747,8 @@ 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, + .stats_get = caam_jr_stats_get, + .stats_reset = caam_jr_stats_reset, .queue_pair_setup = caam_jr_queue_pair_setup, .queue_pair_release = caam_jr_queue_pair_release, .queue_pair_count = caam_jr_queue_pair_count, From patchwork Mon Oct 22 14:57:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 149393 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2734087lji; Mon, 22 Oct 2018 07:59:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV61TrQvVksxDqnoiFiQCXqo6i7S5eWl6YqNA4U494uPxs4VU0qeYSwnR5Nrif2T7sCkHEb3Y X-Received: by 2002:a1c:34d2:: with SMTP id b201-v6mr15873661wma.115.1540220395077; Mon, 22 Oct 2018 07:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540220395; cv=none; d=google.com; s=arc-20160816; b=u6opI/xeDMN/+MAIvxLs6T43kk8PwLB2dBgI6WCYT6agrLkqLt+C7rkAIjchzJGLOC Ua6r8+MO34MZ4Qq4TFn50Pe0bXX5ZNU1IISlbyh/6bSmtkwykEIN/6K6wtV5djCrtwQH qpZ04AUW/hjAMA+APCVzITbkf4x/WF+xn4ULr0Xr5x/jHcn4GFOGvSD4zG9BZmXF/CSX s+hGIv764SimdP1ZS1MUWCKhaFUTLT3vYldbnJ37Nwn9OHHRWSDZVdDd0QhCPILIE/1x gTH27ske/8utJqdCK0vH+aMzAI648vbXA1i1jA+s91wb70UAP541Oso28AlfSOuILrJd 9b3A== 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=rJKxSWPZZXdC1WC8WxDj+pbeOlQgrVPcI2gHCu47CeU=; b=wBrrlSkkOhozpONu9bDIgjga5mRl8aknALX0yPVHlPSNJmzCxg5rJpC0+1Gg8iy+XK gPxpye10hNiDe+0zVNhqYNLZX9KzdgKXs8/N4IZlibmaqXU3pxvop/qtQKYtIKuJ4K5t hEWldYEMUmAU35qVdUf1KUDYCEsuDdcr1Zn0BgFfxRqAmihGQDCLZfrM3Bl/XcMcWG1x sXsfgpPmTsZG7sal1+JB1/wO9yxrM+04EZSr5iYfoVI2/bj8TCdOBAhuZjfZWBZ+WIWh 6Ly2fBcze6rv0jT/fRd04eH3OvmcTPTI3HUqHTOTOoFiOqe8ZyCM6UBqlldrFx53d00y nbkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="cxkTD4/i"; 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 i23-v6si101043wmb.154.2018.10.22.07.59.54; Mon, 22 Oct 2018 07:59:55 -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="cxkTD4/i"; 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 2C7031B445; Mon, 22 Oct 2018 16:58:05 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20055.outbound.protection.outlook.com [40.107.2.55]) by dpdk.org (Postfix) with ESMTP id 2BA5A1B429 for ; Mon, 22 Oct 2018 16:57:54 +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=rJKxSWPZZXdC1WC8WxDj+pbeOlQgrVPcI2gHCu47CeU=; b=cxkTD4/iSnPLqLgd5IQusKriaHmPUN1tAefGgBigLlGdBVPXaYeJ9k3/k1k6MO+e7Heou5V2XXwToAdMSPHXYemj8X94nGexNCIihYx/+K93eTPlMUyBxjCUCUM3lsC5ZBJsEZXw3WvfcRArVySW/pJ/LAlduDal3GNBmSFgNFc= 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:51 +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:51 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , Gagandeep Singh Thread-Topic: [PATCH v5 13/15] crypto/caam_jr: add security offload Thread-Index: AQHUahea9xTdA17CAUWiusarOotskQ== Date: Mon, 22 Oct 2018 14:57:50 +0000 Message-ID: <20181022145644.29277-14-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:7Vct9J1+YbS43lMRnsQjYEOE0pV1QdFpKhYrY5MyrF60ZaOrErt/0IaNJ+XocXhPoQmvXpoRZnum4PHxLU6Vlx0w80BOWLplzjJkYUzLvDMu2MLl9S8+1tmzKxP8sGNk+ZanR+XXaXcgIScFoFQiTsu3Mn36PqyRPnIGNBZ6YQ0nRV50d2YqEvkPX7TdM3CwvqRHNdEE4/r8CGDoN4rOEDOucYHKn8LumsXkVRQuYrjhUd0r5uzA4Ro5sqba4FnZ+H9tAnlp5WHkyFnZmXVN2k1SFNJ1NBCCpfztrPMQgpFj1Vt4MR0Hrh47hGUdlJPqL6ZAeLzzHH5mmZff7kyyl3Frr/2JF5HXZFG1uadgYkPXBSwDD+JSZSOKHJbqC2dFevOb324T0Qq+GVnARbjbrqWi4tDKa/Gk5lXHv/sT2W+iogCSHKIDp21nYMRD+YSX34BK7lmX+5Hle2U/1XDhhA==; 5:xA0sys41iZgpWP56IdRm+nln5qZ38HZgTJknRoZEtw2DLny3wOtEZPYdyR+pGc15/PoIsPTE94eQse74yHmXmY8bVo2aCBf6V51JkcwBe7cZfKrogj7SOOvdRnEFX9V2WQ2flcQQ7qOR7UL9dnnsTEpT7fTUZmfKOPyOmo93jgY=; 7:tvNd/Ezy+qxZ8yQ4KjFpN1ldODkn8kjw2y/Ija2B+2KNP5DF6iEug4ecTxNXhEYnq7/C9daD2TWSajqRw8MZPUF4LADixJtpVK9fFdGamgifcwqUL2HkOB7SFH1D6R1ssE6UOOgqruXcaAVv6Cj/6xoX3sEh6PBoK8GRbN6yJriaYCp7p6ICx09JG3NEpahSG5kwNdNHpYbP7XjNm5F05Q4fcGLIFbfwveqp59w0vIkN+mke/BHFUwl4oA9+CaW8 x-ms-office365-filtering-correlation-id: 9b26725f-8421-49c8-6c64-08d6382ebc84 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:(192374486261705)(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)(15650500001)(8936002)(105586002)(186003)(71200400001)(5250100002)(78486010)(3846002)(2501003)(4744004)(71190400001)(25786009)(2900100001)(305945005)(7736002)(97736004)(478600001)(4326008)(2906002)(72206003)(6636002)(53936002)(14454004)(66066001)(6512007)(5660300001)(6116002)(1076002)(6436002)(53946003)(6486002)(36756003)(14444005)(54906003)(6506007)(76176011)(55236004)(386003)(68736007)(26005)(86362001)(102836004)(110136005)(579004); 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: hgR+UylJ2EeRwpq2ts1UzQ1YPok/81XMZjpUeuTNCYtB0ERjOHrOuZcp4m01USFYKF8pQ3mOEMd7b3WatMtdHwVSCFkp2C7ta9WUoqcx5MEvcRFqu0gyTK6IW9QvCXcnvCFG2CUBrujyDt+6nJp+foItuh0lBp4dkNjFw2qX3q15cJ1h8izrQCTajRoQ2E3L7myrojcWih4wg2hUYC+9SBCZUK6DFchzwug7ZutruUQBJXiVOtm8NQU4mNeaj6gGerJHuK71qgrwCkfGaqc6ZEp/HdlrE13MYuedGVa21TOh49gqIjWV9Fjg25NTfyQHLi9iRAlRnR9+UIaB/zvIyqgB8wrlN+a7BdoumWwJ/Vc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b26725f-8421-49c8-6c64-08d6382ebc84 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 14:57:50.9226 (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 13/15] crypto/caam_jr: add security offload 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 This patch provides the support for protocol offload to the hardware. following security operations are added: - session_create - session_destroy - capabilities_get Signed-off-by: Hemant Agrawal Signed-off-by: Gagandeep Singh Acked-by: Akhil Goyal --- drivers/crypto/caam_jr/caam_jr.c | 425 +++++++++++++++++- drivers/crypto/caam_jr/caam_jr_capabilities.c | 36 ++ drivers/crypto/caam_jr/caam_jr_capabilities.h | 8 + drivers/crypto/caam_jr/caam_jr_hw.c | 3 + drivers/crypto/caam_jr/caam_jr_pvt.h | 10 + drivers/crypto/caam_jr/caam_jr_uio.c | 3 + 6 files changed, 483 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index c89d76dab..1c18453e4 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -14,6 +14,9 @@ #include #include #include +#ifdef RTE_LIBRTE_SECURITY +#include +#endif #include #include @@ -26,7 +29,6 @@ /* RTA header files */ #include #include -#include #include #define CAAM_JR_DBG 0 @@ -185,8 +187,21 @@ is_auth_cipher(struct caam_jr_session *ses) { PMD_INIT_FUNC_TRACE(); return ((ses->cipher_alg != RTE_CRYPTO_CIPHER_NULL) && - (ses->auth_alg != RTE_CRYPTO_AUTH_NULL)); + (ses->auth_alg != RTE_CRYPTO_AUTH_NULL) +#ifdef RTE_LIBRTE_SECURITY + && (ses->proto_alg != RTE_SECURITY_PROTOCOL_IPSEC) +#endif + ); +} + +#ifdef RTE_LIBRTE_SECURITY +static inline int +is_proto_ipsec(struct caam_jr_session *ses) +{ + PMD_INIT_FUNC_TRACE(); + return (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC); } +#endif static inline int is_encode(struct caam_jr_session *ses) @@ -211,27 +226,63 @@ caam_auth_alg(struct caam_jr_session *ses, struct alginfo *alginfo_a) ses->digest_length = 0; break; case RTE_CRYPTO_AUTH_MD5_HMAC: +#ifdef RTE_LIBRTE_SECURITY + alginfo_a->algtype = + (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC) ? + OP_PCL_IPSEC_HMAC_MD5_96 : OP_ALG_ALGSEL_MD5; +#else alginfo_a->algtype = OP_ALG_ALGSEL_MD5; +#endif alginfo_a->algmode = OP_ALG_AAI_HMAC; break; case RTE_CRYPTO_AUTH_SHA1_HMAC: +#ifdef RTE_LIBRTE_SECURITY + alginfo_a->algtype = + (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC) ? + OP_PCL_IPSEC_HMAC_SHA1_96 : OP_ALG_ALGSEL_SHA1; +#else alginfo_a->algtype = OP_ALG_ALGSEL_SHA1; +#endif alginfo_a->algmode = OP_ALG_AAI_HMAC; break; case RTE_CRYPTO_AUTH_SHA224_HMAC: +#ifdef RTE_LIBRTE_SECURITY + alginfo_a->algtype = + (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC) ? + OP_PCL_IPSEC_HMAC_SHA1_160 : OP_ALG_ALGSEL_SHA224; +#else alginfo_a->algtype = OP_ALG_ALGSEL_SHA224; +#endif alginfo_a->algmode = OP_ALG_AAI_HMAC; break; case RTE_CRYPTO_AUTH_SHA256_HMAC: +#ifdef RTE_LIBRTE_SECURITY + alginfo_a->algtype = + (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC) ? + OP_PCL_IPSEC_HMAC_SHA2_256_128 : OP_ALG_ALGSEL_SHA256; +#else alginfo_a->algtype = OP_ALG_ALGSEL_SHA256; +#endif alginfo_a->algmode = OP_ALG_AAI_HMAC; break; case RTE_CRYPTO_AUTH_SHA384_HMAC: +#ifdef RTE_LIBRTE_SECURITY + alginfo_a->algtype = + (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC) ? + OP_PCL_IPSEC_HMAC_SHA2_384_192 : OP_ALG_ALGSEL_SHA384; +#else alginfo_a->algtype = OP_ALG_ALGSEL_SHA384; +#endif alginfo_a->algmode = OP_ALG_AAI_HMAC; break; case RTE_CRYPTO_AUTH_SHA512_HMAC: +#ifdef RTE_LIBRTE_SECURITY + alginfo_a->algtype = + (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC) ? + OP_PCL_IPSEC_HMAC_SHA2_512_256 : OP_ALG_ALGSEL_SHA512; +#else alginfo_a->algtype = OP_ALG_ALGSEL_SHA512; +#endif alginfo_a->algmode = OP_ALG_AAI_HMAC; break; default: @@ -247,15 +298,33 @@ caam_cipher_alg(struct caam_jr_session *ses, struct alginfo *alginfo_c) case RTE_CRYPTO_CIPHER_NULL: break; case RTE_CRYPTO_CIPHER_AES_CBC: +#ifdef RTE_LIBRTE_SECURITY + alginfo_c->algtype = + (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC) ? + OP_PCL_IPSEC_AES_CBC : OP_ALG_ALGSEL_AES; +#else alginfo_c->algtype = OP_ALG_ALGSEL_AES; +#endif alginfo_c->algmode = OP_ALG_AAI_CBC; break; case RTE_CRYPTO_CIPHER_3DES_CBC: +#ifdef RTE_LIBRTE_SECURITY + alginfo_c->algtype = + (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC) ? + OP_PCL_IPSEC_3DES : OP_ALG_ALGSEL_3DES; +#else alginfo_c->algtype = OP_ALG_ALGSEL_3DES; +#endif alginfo_c->algmode = OP_ALG_AAI_CBC; break; case RTE_CRYPTO_CIPHER_AES_CTR: +#ifdef RTE_LIBRTE_SECURITY + alginfo_c->algtype = + (ses->proto_alg == RTE_SECURITY_PROTOCOL_IPSEC) ? + OP_PCL_IPSEC_AES_CTR : OP_ALG_ALGSEL_AES; +#else alginfo_c->algtype = OP_ALG_ALGSEL_AES; +#endif alginfo_c->algmode = OP_ALG_AAI_CTR; break; default: @@ -419,6 +488,24 @@ caam_jr_prep_cdb(struct caam_jr_session *ses) cdb->sh_desc[0] = 0; cdb->sh_desc[1] = 0; cdb->sh_desc[2] = 0; +#ifdef RTE_LIBRTE_SECURITY + if (is_proto_ipsec(ses)) { + if (ses->dir == DIR_ENC) { + shared_desc_len = cnstr_shdsc_ipsec_new_encap( + cdb->sh_desc, + true, swap, SHR_SERIAL, + &ses->encap_pdb, + (uint8_t *)&ses->ip4_hdr, + &alginfo_c, &alginfo_a); + } else if (ses->dir == DIR_DEC) { + shared_desc_len = cnstr_shdsc_ipsec_new_decap( + cdb->sh_desc, + true, swap, SHR_SERIAL, + &ses->decap_pdb, + &alginfo_c, &alginfo_a); + } + } else { +#endif /* Auth_only_len is set as 0 here and it will be * overwritten in fd for each packet. */ @@ -426,6 +513,9 @@ caam_jr_prep_cdb(struct caam_jr_session *ses) true, swap, &alginfo_c, &alginfo_a, ses->iv.length, 0, ses->digest_length, ses->dir); +#ifdef RTE_LIBRTE_SECURITY + } +#endif } if (shared_desc_len < 0) { @@ -601,6 +691,28 @@ hw_poll_job_ring(struct sec_job_ring_t *job_ring, } #endif } +#ifdef RTE_LIBRTE_SECURITY + if (ctx->op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) { + struct ip *ip4_hdr; + + if (ctx->op->sym->m_dst) { + /*TODO check for ip header or other*/ + ip4_hdr = (struct ip *) + rte_pktmbuf_mtod(ctx->op->sym->m_dst, char*); + ctx->op->sym->m_dst->pkt_len = + rte_be_to_cpu_16(ip4_hdr->ip_len); + ctx->op->sym->m_dst->data_len = + rte_be_to_cpu_16(ip4_hdr->ip_len); + } else { + ip4_hdr = (struct ip *) + rte_pktmbuf_mtod(ctx->op->sym->m_src, char*); + ctx->op->sym->m_src->pkt_len = + rte_be_to_cpu_16(ip4_hdr->ip_len); + ctx->op->sym->m_src->data_len = + rte_be_to_cpu_16(ip4_hdr->ip_len); + } + } +#endif *ops = ctx->op; caam_jr_op_ending(ctx); ops++; @@ -1260,6 +1372,52 @@ build_cipher_auth(struct rte_crypto_op *op, struct caam_jr_session *ses) return ctx; } + +#ifdef RTE_LIBRTE_SECURITY +static inline struct caam_jr_op_ctx * +build_proto(struct rte_crypto_op *op, struct caam_jr_session *ses) +{ + struct rte_crypto_sym_op *sym = op->sym; + struct caam_jr_op_ctx *ctx = NULL; + phys_addr_t src_start_addr, dst_start_addr; + struct sec_cdb *cdb; + uint64_t sdesc_offset; + struct sec_job_descriptor_t *jobdescr; + + PMD_INIT_FUNC_TRACE(); + ctx = caam_jr_alloc_ctx(ses); + if (!ctx) + return NULL; + ctx->op = op; + + src_start_addr = rte_pktmbuf_iova(sym->m_src); + if (sym->m_dst) + dst_start_addr = rte_pktmbuf_iova(sym->m_dst); + else + dst_start_addr = src_start_addr; + + cdb = ses->cdb; + sdesc_offset = (size_t) ((char *)&cdb->sh_desc - (char *)cdb); + + jobdescr = (struct sec_job_descriptor_t *) ctx->jobdes.desc; + + SEC_JD_INIT(jobdescr); + SEC_JD_SET_SD(jobdescr, + (phys_addr_t)(caam_jr_dma_vtop(cdb)) + sdesc_offset, + cdb->sh_hdr.hi.field.idlen); + + /* output */ + SEC_JD_SET_OUT_PTR(jobdescr, (uint64_t)dst_start_addr, 0, + sym->m_src->buf_len - sym->m_src->data_off); + /* input */ + SEC_JD_SET_IN_PTR(jobdescr, (uint64_t)src_start_addr, 0, + sym->m_src->pkt_len); + sym->m_src->packet_type &= ~RTE_PTYPE_L4_MASK; + + return ctx; +} +#endif + static int caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) { @@ -1275,6 +1433,13 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) get_sym_session_private_data(op->sym->session, cryptodev_driver_id); break; +#ifdef RTE_LIBRTE_SECURITY + case RTE_CRYPTO_OP_SECURITY_SESSION: + ses = (struct caam_jr_session *) + get_sec_session_private_data( + op->sym->sec_session); + break; +#endif default: CAAM_JR_DP_ERR("sessionless crypto op not supported"); qp->tx_errs++; @@ -1296,6 +1461,10 @@ caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp) ctx = build_auth_only(op, ses); else if (is_cipher_only(ses)) ctx = build_cipher_only(op, ses); +#ifdef RTE_LIBRTE_SECURITY + else if (is_proto_ipsec(ses)) + ctx = build_proto(op, ses); +#endif } else { if (is_auth_cipher(ses)) ctx = build_cipher_auth_sg(op, ses); @@ -1666,6 +1835,229 @@ caam_jr_sym_session_clear(struct rte_cryptodev *dev, } } +#ifdef RTE_LIBRTE_SECURITY +static int +caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev, + struct rte_security_session_conf *conf, + void *sess) +{ + struct sec_job_ring_t *internals = dev->data->dev_private; + struct rte_security_ipsec_xform *ipsec_xform = &conf->ipsec; + struct rte_crypto_auth_xform *auth_xform; + struct rte_crypto_cipher_xform *cipher_xform; + struct caam_jr_session *session = (struct caam_jr_session *)sess; + + PMD_INIT_FUNC_TRACE(); + + if (ipsec_xform->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) { + cipher_xform = &conf->crypto_xform->cipher; + auth_xform = &conf->crypto_xform->next->auth; + } else { + auth_xform = &conf->crypto_xform->auth; + cipher_xform = &conf->crypto_xform->next->cipher; + } + session->proto_alg = conf->protocol; + session->cipher_key.data = rte_zmalloc(NULL, + cipher_xform->key.length, + RTE_CACHE_LINE_SIZE); + if (session->cipher_key.data == NULL && + cipher_xform->key.length > 0) { + CAAM_JR_ERR("No Memory for cipher key\n"); + return -ENOMEM; + } + + session->cipher_key.length = cipher_xform->key.length; + session->auth_key.data = rte_zmalloc(NULL, + auth_xform->key.length, + RTE_CACHE_LINE_SIZE); + if (session->auth_key.data == NULL && + auth_xform->key.length > 0) { + CAAM_JR_ERR("No Memory for auth key\n"); + rte_free(session->cipher_key.data); + return -ENOMEM; + } + session->auth_key.length = auth_xform->key.length; + memcpy(session->cipher_key.data, cipher_xform->key.data, + cipher_xform->key.length); + memcpy(session->auth_key.data, auth_xform->key.data, + auth_xform->key.length); + + switch (auth_xform->algo) { + case RTE_CRYPTO_AUTH_SHA1_HMAC: + session->auth_alg = RTE_CRYPTO_AUTH_SHA1_HMAC; + break; + case RTE_CRYPTO_AUTH_MD5_HMAC: + session->auth_alg = RTE_CRYPTO_AUTH_MD5_HMAC; + break; + case RTE_CRYPTO_AUTH_SHA256_HMAC: + session->auth_alg = RTE_CRYPTO_AUTH_SHA256_HMAC; + break; + case RTE_CRYPTO_AUTH_SHA384_HMAC: + session->auth_alg = RTE_CRYPTO_AUTH_SHA384_HMAC; + break; + case RTE_CRYPTO_AUTH_SHA512_HMAC: + session->auth_alg = RTE_CRYPTO_AUTH_SHA512_HMAC; + break; + case RTE_CRYPTO_AUTH_AES_CMAC: + session->auth_alg = RTE_CRYPTO_AUTH_AES_CMAC; + break; + case RTE_CRYPTO_AUTH_NULL: + session->auth_alg = RTE_CRYPTO_AUTH_NULL; + break; + case RTE_CRYPTO_AUTH_SHA224_HMAC: + case RTE_CRYPTO_AUTH_AES_XCBC_MAC: + case RTE_CRYPTO_AUTH_SNOW3G_UIA2: + case RTE_CRYPTO_AUTH_SHA1: + case RTE_CRYPTO_AUTH_SHA256: + case RTE_CRYPTO_AUTH_SHA512: + case RTE_CRYPTO_AUTH_SHA224: + case RTE_CRYPTO_AUTH_SHA384: + case RTE_CRYPTO_AUTH_MD5: + case RTE_CRYPTO_AUTH_AES_GMAC: + case RTE_CRYPTO_AUTH_KASUMI_F9: + case RTE_CRYPTO_AUTH_AES_CBC_MAC: + case RTE_CRYPTO_AUTH_ZUC_EIA3: + CAAM_JR_ERR("Crypto: Unsupported auth alg %u\n", + auth_xform->algo); + goto out; + default: + CAAM_JR_ERR("Crypto: Undefined Auth specified %u\n", + auth_xform->algo); + goto out; + } + + switch (cipher_xform->algo) { + case RTE_CRYPTO_CIPHER_AES_CBC: + session->cipher_alg = RTE_CRYPTO_CIPHER_AES_CBC; + break; + case RTE_CRYPTO_CIPHER_3DES_CBC: + session->cipher_alg = RTE_CRYPTO_CIPHER_3DES_CBC; + break; + case RTE_CRYPTO_CIPHER_AES_CTR: + session->cipher_alg = RTE_CRYPTO_CIPHER_AES_CTR; + break; + case RTE_CRYPTO_CIPHER_NULL: + case RTE_CRYPTO_CIPHER_SNOW3G_UEA2: + case RTE_CRYPTO_CIPHER_3DES_ECB: + case RTE_CRYPTO_CIPHER_AES_ECB: + case RTE_CRYPTO_CIPHER_KASUMI_F8: + CAAM_JR_ERR("Crypto: Unsupported Cipher alg %u\n", + cipher_xform->algo); + goto out; + default: + CAAM_JR_ERR("Crypto: Undefined Cipher specified %u\n", + cipher_xform->algo); + goto out; + } + + if (ipsec_xform->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) { + memset(&session->encap_pdb, 0, sizeof(struct ipsec_encap_pdb) + + sizeof(session->ip4_hdr)); + session->ip4_hdr.ip_v = IPVERSION; + session->ip4_hdr.ip_hl = 5; + session->ip4_hdr.ip_len = rte_cpu_to_be_16( + sizeof(session->ip4_hdr)); + session->ip4_hdr.ip_tos = ipsec_xform->tunnel.ipv4.dscp; + session->ip4_hdr.ip_id = 0; + session->ip4_hdr.ip_off = 0; + session->ip4_hdr.ip_ttl = ipsec_xform->tunnel.ipv4.ttl; + session->ip4_hdr.ip_p = (ipsec_xform->proto == + RTE_SECURITY_IPSEC_SA_PROTO_ESP) ? IPPROTO_ESP + : IPPROTO_AH; + session->ip4_hdr.ip_sum = 0; + session->ip4_hdr.ip_src = ipsec_xform->tunnel.ipv4.src_ip; + session->ip4_hdr.ip_dst = ipsec_xform->tunnel.ipv4.dst_ip; + session->ip4_hdr.ip_sum = calc_chksum((uint16_t *) + (void *)&session->ip4_hdr, + sizeof(struct ip)); + + session->encap_pdb.options = + (IPVERSION << PDBNH_ESP_ENCAP_SHIFT) | + PDBOPTS_ESP_OIHI_PDB_INL | + PDBOPTS_ESP_IVSRC | + PDBHMO_ESP_ENCAP_DTTL; + session->encap_pdb.spi = ipsec_xform->spi; + session->encap_pdb.ip_hdr_len = sizeof(struct ip); + + session->dir = DIR_ENC; + } else if (ipsec_xform->direction == + RTE_SECURITY_IPSEC_SA_DIR_INGRESS) { + memset(&session->decap_pdb, 0, sizeof(struct ipsec_decap_pdb)); + session->decap_pdb.options = sizeof(struct ip) << 16; + session->dir = DIR_DEC; + } else + goto out; + session->ctx_pool = internals->ctx_pool; + + return 0; +out: + rte_free(session->auth_key.data); + rte_free(session->cipher_key.data); + memset(session, 0, sizeof(struct caam_jr_session)); + return -1; +} + +static int +caam_jr_security_session_create(void *dev, + struct rte_security_session_conf *conf, + struct rte_security_session *sess, + struct rte_mempool *mempool) +{ + void *sess_private_data; + struct rte_cryptodev *cdev = (struct rte_cryptodev *)dev; + int ret; + + PMD_INIT_FUNC_TRACE(); + if (rte_mempool_get(mempool, &sess_private_data)) { + CAAM_JR_ERR("Couldn't get object from session mempool"); + return -ENOMEM; + } + + switch (conf->protocol) { + case RTE_SECURITY_PROTOCOL_IPSEC: + ret = caam_jr_set_ipsec_session(cdev, conf, + sess_private_data); + break; + case RTE_SECURITY_PROTOCOL_MACSEC: + return -ENOTSUP; + default: + return -EINVAL; + } + if (ret != 0) { + CAAM_JR_ERR("failed to configure session parameters"); + /* Return session to mempool */ + rte_mempool_put(mempool, sess_private_data); + return ret; + } + + set_sec_session_private_data(sess, sess_private_data); + + return ret; +} + +/* Clear the memory of session so it doesn't leave key material behind */ +static int +caam_jr_security_session_destroy(void *dev __rte_unused, + struct rte_security_session *sess) +{ + PMD_INIT_FUNC_TRACE(); + void *sess_priv = get_sec_session_private_data(sess); + + struct caam_jr_session *s = (struct caam_jr_session *)sess_priv; + + if (sess_priv) { + struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv); + + rte_free(s->cipher_key.data); + rte_free(s->auth_key.data); + memset(sess, 0, sizeof(struct caam_jr_session)); + set_sec_session_private_data(sess, NULL); + rte_mempool_put(sess_mp, sess_priv); + } + return 0; +} +#endif + static int caam_jr_dev_configure(struct rte_cryptodev *dev, struct rte_cryptodev_config *config __rte_unused) @@ -1757,6 +2149,16 @@ static struct rte_cryptodev_ops caam_jr_ops = { .sym_session_clear = caam_jr_sym_session_clear }; +#ifdef RTE_LIBRTE_SECURITY +static struct rte_security_ops caam_jr_security_ops = { + .session_create = caam_jr_security_session_create, + .session_update = NULL, + .session_stats_get = NULL, + .session_destroy = caam_jr_security_session_destroy, + .set_pkt_metadata = NULL, + .capabilities_get = caam_jr_get_security_capabilities +}; +#endif /* @brief Flush job rings of any processed descs. * The processed descs are silently dropped, @@ -1976,6 +2378,9 @@ caam_jr_dev_init(const char *name, struct rte_cryptodev_pmd_init_params *init_params) { struct rte_cryptodev *dev; +#ifdef RTE_LIBRTE_SECURITY + struct rte_security_ctx *security_instance; +#endif struct uio_job_ring *job_ring; char str[RTE_CRYPTODEV_NAME_MAX_LEN]; @@ -2045,6 +2450,22 @@ caam_jr_dev_init(const char *name, return 0; } +#ifdef RTE_LIBRTE_SECURITY + /*TODO free it during teardown*/ + security_instance = rte_malloc("caam_jr", + sizeof(struct rte_security_ctx), 0); + if (security_instance == NULL) { + CAAM_JR_ERR("memory allocation failed\n"); + //todo error handling. + goto cleanup2; + } + + security_instance->device = (void *)dev; + security_instance->ops = &caam_jr_security_ops; + security_instance->sess_cnt = 0; + dev->security_ctx = security_instance; +#endif + RTE_LOG(INFO, PMD, "%s cryptodev init\n", dev->data->name); return 0; diff --git a/drivers/crypto/caam_jr/caam_jr_capabilities.c b/drivers/crypto/caam_jr/caam_jr_capabilities.c index 92aa429cc..eacea7db3 100644 --- a/drivers/crypto/caam_jr/caam_jr_capabilities.c +++ b/drivers/crypto/caam_jr/caam_jr_capabilities.c @@ -225,6 +225,42 @@ static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = { RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() }; +#ifdef RTE_LIBRTE_SECURITY +static const struct rte_security_capability caam_jr_security_cap[] = { + { /* IPsec Lookaside Protocol offload ESP Transport Egress */ + .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, + .protocol = RTE_SECURITY_PROTOCOL_IPSEC, + .ipsec = { + .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP, + .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, + .direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS, + .options = { 0 } + }, + .crypto_capabilities = caam_jr_capabilities + }, + { /* IPsec Lookaside Protocol offload ESP Tunnel Ingress */ + .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, + .protocol = RTE_SECURITY_PROTOCOL_IPSEC, + .ipsec = { + .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP, + .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, + .direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS, + .options = { 0 } + }, + .crypto_capabilities = caam_jr_capabilities + }, + { + .action = RTE_SECURITY_ACTION_TYPE_NONE + } +}; + +const struct rte_security_capability * +caam_jr_get_security_capabilities(void *device __rte_unused) +{ + return caam_jr_security_cap; +} +#endif + const struct rte_cryptodev_capabilities * caam_jr_get_cryptodev_capabilities(void) { diff --git a/drivers/crypto/caam_jr/caam_jr_capabilities.h b/drivers/crypto/caam_jr/caam_jr_capabilities.h index 7a94013e5..d3169b7e9 100644 --- a/drivers/crypto/caam_jr/caam_jr_capabilities.h +++ b/drivers/crypto/caam_jr/caam_jr_capabilities.h @@ -6,8 +6,16 @@ #define CAAM_JR_CAPABILITIES_H #include +#ifdef RTE_LIBRTE_SECURITY +#include +#endif /* Get cryptodev capabilities */ const struct rte_cryptodev_capabilities * caam_jr_get_cryptodev_capabilities(void); +#ifdef RTE_LIBRTE_SECURITY +/* Get security capabilities */ +const struct rte_security_capability * +caam_jr_get_security_capabilities(void *device); +#endif #endif diff --git a/drivers/crypto/caam_jr/caam_jr_hw.c b/drivers/crypto/caam_jr/caam_jr_hw.c index 80602b702..c6833185b 100644 --- a/drivers/crypto/caam_jr/caam_jr_hw.c +++ b/drivers/crypto/caam_jr/caam_jr_hw.c @@ -9,6 +9,9 @@ #include #include #include +#ifdef RTE_LIBRTE_SECURITY +#include +#endif #include #include diff --git a/drivers/crypto/caam_jr/caam_jr_pvt.h b/drivers/crypto/caam_jr/caam_jr_pvt.h index 333a192d9..c2d35ecd2 100644 --- a/drivers/crypto/caam_jr/caam_jr_pvt.h +++ b/drivers/crypto/caam_jr/caam_jr_pvt.h @@ -5,6 +5,8 @@ #ifndef CAAM_JR_PVT_H #define CAAM_JR_PVT_H +#include + /* NXP CAAM JR PMD device name */ #define CAAM_JR_ALG_UNSUPPORT (-1) @@ -110,6 +112,9 @@ struct caam_jr_session { enum rte_crypto_cipher_algorithm cipher_alg; /* Cipher Algorithm*/ enum rte_crypto_auth_algorithm auth_alg; /* Authentication Algorithm*/ enum rte_crypto_aead_algorithm aead_alg; /* AEAD Algorithm*/ +#ifdef RTE_LIBRTE_SECURITY + enum rte_security_session_protocol proto_alg; /* Security Algorithm*/ +#endif union { struct { uint8_t *data; /* pointer to key data */ @@ -132,6 +137,11 @@ struct caam_jr_session { } iv; /* Initialisation vector parameters */ uint16_t auth_only_len; /* Length of data for Auth only */ uint32_t digest_length; +#ifdef RTE_LIBRTE_SECURITY + struct ipsec_encap_pdb encap_pdb; + struct ip ip4_hdr; + struct ipsec_decap_pdb decap_pdb; +#endif struct caam_jr_qp *qp; struct sec_cdb *cdb; /* cmd block associated with qp */ struct rte_mempool *ctx_pool; /* session mempool for caam_jr_op_ctx */ diff --git a/drivers/crypto/caam_jr/caam_jr_uio.c b/drivers/crypto/caam_jr/caam_jr_uio.c index d6aec3e4c..58d86f961 100644 --- a/drivers/crypto/caam_jr/caam_jr_uio.c +++ b/drivers/crypto/caam_jr/caam_jr_uio.c @@ -16,6 +16,9 @@ #include #include #include +#ifdef RTE_LIBRTE_SECURITY +#include +#endif #include #include From patchwork Mon Oct 22 14:57:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 149394 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2734287lji; Mon, 22 Oct 2018 08:00:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5c5xD1MjJK+7OJjyITlds2VtJKSswv7j7qWTfGTSHU+7PXIguGx5Qp7cD+Z+px8aRcl6IYc X-Received: by 2002:a1c:cc0f:: with SMTP id h15-v6mr16391338wmb.1.1540220405936; Mon, 22 Oct 2018 08:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540220405; cv=none; d=google.com; s=arc-20160816; b=cxrMUEr/X3wHKA951Xl8di2iN+h6ZsYoqJvXfHXiM0O8Ng9ezrCm3zWggZv1ZC1/QT dVCh7dj/ADaZS3Oux9s6Q+S74U1LO+0iA944ZAe4eNW2bp/MLGa0SsF8Tve5SWvOsZwR ywfs5LwsupiZWwfEC2XhL4gtBidrpRyUZaGd1BnF/j1yGmQpjb4QJfY+kZXtsO3Yt1yM JURM+mrtcLlf4+aYYz86giVgxzLcC4nDY606j/JGTbBoEg9zaqEVFF6AXbiE6NPlTl1h Q/yiw1pKgXVfLDIV5u5GPw9Qp9q9zRYmg6FNxR3b85cT5LxUBGIvJ5idlCb5HGvSquIt 0/2g== 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:content-id:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=GjQ/H4gnbFu7OH79R2dlU8kN7+jKbQcdtdYuVG+SGUg=; b=lb/J9lUy94feXqUwyyzDfibs6jDK3DfGyb0Xf2IS+oiquPyOEr16uEZWn0i5xyn6Ad FMqB/Bp4GeedhXrOwDEqHO0NlJzUyAcPT4PwxDwP7EDR3jDO3JsraoCL/W5xm9nz08z3 pUeExutdsZIp8qTgx8k9RAcJGhfGa1QaKLGRVY+Jf5ad+zJWZzZlRjjlm7uPTEDYXes4 nhB+jxdR2/4kaBifPu37wUTHh3j6RK0ILYOf2TH43uTwMvGEm0IhcjTGtHnFZ/SuRo1e 4N50v2BoomBP/HwmgW1a4e+mb7Jijob48E2SuC7jS4fzWBH5b0ZeLDXHrlF6IMNqd1Zt zJEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=emd1iw+E; 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 n129-v6si9447023wma.25.2018.10.22.08.00.05; Mon, 22 Oct 2018 08:00:05 -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=emd1iw+E; 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 EF2681B451; Mon, 22 Oct 2018 16:58:06 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20049.outbound.protection.outlook.com [40.107.2.49]) by dpdk.org (Postfix) with ESMTP id 0EFB01B419 for ; Mon, 22 Oct 2018 16:57:56 +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=GjQ/H4gnbFu7OH79R2dlU8kN7+jKbQcdtdYuVG+SGUg=; b=emd1iw+EFEENvAMnHFvrw+QPoKPiVKm3nfOTcjeR6bRs/uGcFL91yzml0WrBSb0DQr2vRlE3WiZ6fZehg8EKtk64LBb2QSRr1LuVD9QwCF+LjibyfQXa746BarVhHJMU2Rh9gCR41bXSQm0QWxKya93YUJ31MJN7bsUeJEQkuo8= 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:53 +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:53 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , Gagandeep Singh Thread-Topic: [PATCH v5 14/15] doc: add caam jr cryptodev details Thread-Index: AQHUahebvxF9n0+Rkk21yxXIh2jimQ== Date: Mon, 22 Oct 2018 14:57:52 +0000 Message-ID: <20181022145644.29277-15-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:YmSlIEew71yCBUg1PTmGgBltFFAvRurVTO2MBzHxjoP9CsF/3ELY9J3tCAeckC7ZtcEKFkXcSdbI11n9mLslPgzO3QWvyrEpAwxaYxJEZdU27FTQe508yEznrW3dhFJw6SMkJMDH9aiWQBA3wshKfbzNZIUHLrQT8rRI5ImuqAxrolqHVS6dGL01Tc4PzLbPXzubFSgxhoqYxRqTsNM832IGJ9NZcjrXecw3akcAfEQtnpTAEM1UTV4Uai4wPqRLgIqKSY8o4FiTSaYpYKoj1IFNirbVp6aJzMh+WNVO2hScvzsTRsKEYZ0hLi3QEdCUK2YPRIHiEYIG5HgyI04t3y7Ho7Adf0o0aFBncZ4O/egII87F6dQpGiI7W3K4n9tI/dEo/o+06dgT44MOJzrmgQkbXslZHUa+yFHCvOPSYcezuRfcmKgkrpMviI1YIL4yUVsJ3a5A0Z/XcOWY1966dg==; 5:Ay6Sh50DitnY+HjFfuv0ZnoFC5+4GEYSbtLBMSw2VrEcwynHn+aOW19+TfOCytwYwhCYQ5GcL55dlBttYtvQBO7VDu508Eh4MqU9maLLaTwXPu+MT4K6rTlocOgOnXTTHpXLMh7w1wK8Boj7RGVPeU+w6+c16WSxQVsbASoUMRk=; 7:qSOEqraw/eWN5kuU7zVmKmQwAEsLwyik6hmB7ccZ9I04dGMTlxjxmHVw8lcZfEEBlNUXlB0TUU+Io/HR0+kS9c8QgyQ4KFIaHy7KYquQ55RLfqJkT/0VZ3UROC2xrMT91zbr7+BEM5bs/PtayAendVGTJ6lCLKpxoPyxksIpguzuM/nW2Yl2J6w4BCkhTcKLW+EBP4xFOOgIjaIXWD8YJj+W2NwTs7E7TspRgouRaISFw8HdUessmWNesa5ANvfk x-ms-office365-filtering-correlation-id: dfb63aa2-3495-429a-d23c-08d6382ebdd8 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:(192374486261705)(35073007944872)(185117386973197)(264314650089876)(278428928389397); 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)(6306002)(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)(575784001)(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: hGypDq9xUSv8vQpzcACnorm5zuCBPyOsxjKHc8OkdeJjivoHvgAxqEYOPeLl7oaUdTJTD6nocE5JYHMHcsCqVXlDkVF5DrjmyWti10bBYaU4jMY/QMDY+e2g4y9NifrdRUnbbA+YD6UC32ZNYOA9gIay9tgiwpd1SPZy20YyJ9d7PQQ+f2FwksZ/j8cxE/Jwf7TnVD3k9FTTRXqeRc+YenP0GlHYEouZg+M+pmiuiAIvAW90xXSyvjO75pMbcHdicIbkkGBskJE2P5EptDbLXOJhUHqi7gwHi4P3iis1LJo1GcKckMa1gvGFjlZXr+6nWMoTXFXJTxK9RQDeWRlMmstf/MgK0NQoAr3dCw8QByQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfb63aa2-3495-429a-d23c-08d6382ebdd8 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 14:57:53.0303 (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 14/15] doc: add caam jr cryptodev details 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 caam jr driver details, supported features and algorithms in the document. release note and MAINTAINERS are also updated. Signed-off-by: Hemant Agrawal Signed-off-by: Gagandeep Singh Acked-by: Akhil Goyal --- MAINTAINERS | 2 + doc/guides/cryptodevs/caam_jr.rst | 150 +++++++++++++++++++++ doc/guides/cryptodevs/features/caam_jr.ini | 46 +++++++ doc/guides/cryptodevs/index.rst | 1 + doc/guides/rel_notes/release_18_11.rst | 5 + 5 files changed, 204 insertions(+) create mode 100644 doc/guides/cryptodevs/caam_jr.rst create mode 100644 doc/guides/cryptodevs/features/caam_jr.ini -- 2.17.1 diff --git a/MAINTAINERS b/MAINTAINERS index 9de01189a..3079c187e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -855,6 +855,8 @@ NXP CAAM JR M: Gagandeep Singh M: Hemant Agrawal F: drivers/crypto/caam_jr/ +F: doc/guides/cryptodevs/caam_jr.rst +F: doc/guides/cryptodevs/features/caam_jr.ini NXP DPAA_SEC M: Akhil Goyal diff --git a/doc/guides/cryptodevs/caam_jr.rst b/doc/guides/cryptodevs/caam_jr.rst new file mode 100644 index 000000000..e87ff0915 --- /dev/null +++ b/doc/guides/cryptodevs/caam_jr.rst @@ -0,0 +1,150 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright 2018 NXP + + +NXP CAAM JOB RING (caam_jr) +=========================== + +The caam_jr PMD provides poll mode crypto driver support for NXP SEC 4.x+ (CAAM) +hardware accelerator. More information is available at: + +`NXP Cryptographic Acceleration Technology `_. + +Architecture +------------ + +SEC is the SOC's security engine, which serves as NXP's latest cryptographic +acceleration and offloading hardware. It combines functions previously +implemented in separate modules to create a modular and scalable acceleration +and assurance engine. It also implements block encryption algorithms, stream +cipher algorithms, hashing algorithms, public key algorithms, run-time +integrity checking, and a hardware random number generator. SEC performs +higher-level cryptographic operations than previous NXP cryptographic +accelerators. This provides significant improvement to system level performance. + +SEC HW accelerator above 4.x+ version are also known as CAAM. + +caam_jr PMD is one of DPAA drivers which uses uio interface to interact with +Linux kernel for configure and destroy the device instance (ring). + + +Implementation +-------------- + +SEC provides platform assurance by working with SecMon, which is a companion +logic block that tracks the security state of the SOC. SEC is programmed by +means of descriptors (not to be confused with frame descriptors (FDs)) that +indicate the operations to be performed and link to the message and +associated data. SEC incorporates two DMA engines to fetch the descriptors, +read the message data, and write the results of the operations. The DMA +engine provides a scatter/gather capability so that SEC can read and write +data scattered in memory. SEC may be configured by means of software for +dynamic changes in byte ordering. The default configuration for this version +of SEC is little-endian mode. + +Note that one physical Job Ring represent one caam_jr device. + +Features +-------- + +The CAAM_JR PMD has support for: + +Cipher algorithms: + +* ``RTE_CRYPTO_CIPHER_3DES_CBC`` +* ``RTE_CRYPTO_CIPHER_AES128_CBC`` +* ``RTE_CRYPTO_CIPHER_AES192_CBC`` +* ``RTE_CRYPTO_CIPHER_AES256_CBC`` +* ``RTE_CRYPTO_CIPHER_AES128_CTR`` +* ``RTE_CRYPTO_CIPHER_AES192_CTR`` +* ``RTE_CRYPTO_CIPHER_AES256_CTR`` + +Hash algorithms: + +* ``RTE_CRYPTO_AUTH_SHA1_HMAC`` +* ``RTE_CRYPTO_AUTH_SHA224_HMAC`` +* ``RTE_CRYPTO_AUTH_SHA256_HMAC`` +* ``RTE_CRYPTO_AUTH_SHA384_HMAC`` +* ``RTE_CRYPTO_AUTH_SHA512_HMAC`` +* ``RTE_CRYPTO_AUTH_MD5_HMAC`` + +AEAD algorithms: + +* ``RTE_CRYPTO_AEAD_AES_GCM`` + +Supported DPAA SoCs +-------------------- + +* LS1046A/LS1026A +* LS1043A/LS1023A +* LS1028A +* LS1012A + +Limitations +----------- + +* Hash followed by Cipher mode is not supported +* Only supports the session-oriented API implementation (session-less APIs are not supported). + +Prerequisites +------------- + +caam_jr driver has following dependencies are not part of DPDK and must be installed separately: + +* **NXP Linux SDK** + + NXP Linux software development kit (SDK) includes support for the family + of QorIQ® ARM-Architecture-based system on chip (SoC) processors + and corresponding boards. + + It includes the Linux board support packages (BSPs) for NXP SoCs, + a fully operational tool chain, kernel and board specific modules. + + SDK and related information can be obtained from: `NXP QorIQ SDK `_. + +Currently supported by DPDK: + +* NXP SDK **18.09+**. +* Supported architectures: **arm64 LE**. + +* Follow the DPDK :ref:`Getting Started Guide for Linux ` to setup the basic DPDK environment. + +Pre-Installation Configuration +------------------------------ + +Config File Options +~~~~~~~~~~~~~~~~~~~ + +The following options can be modified in the ``config`` file +to enable caam_jr PMD. + +Please note that enabling debugging options may affect system performance. + +* ``CONFIG_RTE_LIBRTE_PMD_CAAM_JR`` (default ``n``) + By default it is only enabled in common_linuxapp config. + Toggle compilation of the ``librte_pmd_caam_jr`` driver. + +* ``CONFIG_RTE_LIBRTE_PMD_CAAM_JR_BE`` (default ``n``) + By default it is disabled. + It can be used when the underlying hardware supports the CAAM in BE mode. + e.g. LS1043A, LS1046A supports CAAM in BE mode. + BE mode is enabled by default in defconfig-arm64-dpaa-linuxapp-gcc. + +Installations +------------- +To compile the caam_jr PMD for Linux arm64 gcc target, run the +following ``make`` command: + +.. code-block:: console + + cd + make config T=arm64-armv8a-linuxapp-gcc install + +Enabling logs +------------- + +For enabling logs, use the following EAL parameter: + +.. code-block:: console + + ./your_crypto_application --log-level=pmd.crypto.caam, diff --git a/doc/guides/cryptodevs/features/caam_jr.ini b/doc/guides/cryptodevs/features/caam_jr.ini new file mode 100644 index 000000000..68f8d8195 --- /dev/null +++ b/doc/guides/cryptodevs/features/caam_jr.ini @@ -0,0 +1,46 @@ +; +; Supported features of the 'caam_jr' crypto driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Symmetric crypto = Y +Sym operation chaining = Y +HW Accelerated = Y +Protocol offload = Y +In Place SGL = Y +OOP SGL In SGL Out = Y +OOP SGL In LB Out = Y +OOP LB In SGL Out = Y +OOP LB In LB Out = Y + +; +; Supported crypto algorithms of the 'dpaa2_sec' crypto driver. +; +[Cipher] +AES CBC (128) = Y +AES CBC (192) = Y +AES CBC (256) = Y +AES CTR (128) = Y +AES CTR (192) = Y +AES CTR (256) = Y +3DES CBC = Y + +; +; Supported authentication algorithms of the 'dpaa2_sec' crypto driver. +; +[Auth] +MD5 HMAC = Y +SHA1 HMAC = Y +SHA224 HMAC = Y +SHA256 HMAC = Y +SHA384 HMAC = Y +SHA512 HMAC = Y + +; +; Supported AEAD algorithms of the 'dpaa2_sec' crypto driver. +; +[AEAD] +AES GCM (128) = Y +AES GCM (192) = Y +AES GCM (256) = Y diff --git a/doc/guides/cryptodevs/index.rst b/doc/guides/cryptodevs/index.rst index bd1588537..83610e64f 100644 --- a/doc/guides/cryptodevs/index.rst +++ b/doc/guides/cryptodevs/index.rst @@ -13,6 +13,7 @@ Crypto Device Drivers aesni_mb aesni_gcm armv8 + caam_jr ccp dpaa2_sec dpaa_sec diff --git a/doc/guides/rel_notes/release_18_11.rst b/doc/guides/rel_notes/release_18_11.rst index a0dd1bed9..af9a6f89f 100644 --- a/doc/guides/rel_notes/release_18_11.rst +++ b/doc/guides/rel_notes/release_18_11.rst @@ -186,6 +186,11 @@ New Features The AESNI MB PMD has been updated with additional support for AES-GCM algorithm support. +* **Added NXP CAAM JR PMD.** + + Added the new caam job ring driver for NXP platforms. See the + "NXP CAAM JOB RING (caam_jr)" document for more details on this new driver. + API Changes ----------- From patchwork Mon Oct 22 14:57:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 149395 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2734652lji; Mon, 22 Oct 2018 08:00:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV61f2VeB4s++GGgCtNC5Uj1BJtZRqcw2MhdCH2mqfMDmqZ5M8wjTEgbipWYnh+p69hIxmMtH X-Received: by 2002:adf:ebcf:: with SMTP id v15-v6mr46699997wrn.76.1540220421629; Mon, 22 Oct 2018 08:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540220421; cv=none; d=google.com; s=arc-20160816; b=dQiw2Xg5u0IK4a0jPZ4dw3OjPm9XYrPo+SBs1+GwUSL3g+A4CmeXjpqvxRymBv6sT7 qf/FXJAu07HzL/TWVTALQo7kPF+rmpyhRNOuSRBfLwPieBdcrXFcdwmHK/IGF+C4WkrI 5zXGjt/pxO00AfzqsMZ2kjCFv4DW11mbhpe026s6NVVQ+hKpZdRnTPeDmywjhWERaPQd 4yMdWzL4VWHx81joTPflgIvdPfvHXeAiKadxI/HW0NpdNOYCF4Pv9fUsGHyKKzl6AD9Y HsxE1lAxxHFCXgQHm4kkqE2kegOv1vGe+1yefJAyqZL58e17WKuZJGrqzU/+KUhxmQBK vu9Q== 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=1fsE8LalGVlJR0D4pq+c6SvIiNlyDQvS6igSrX/UMS4=; b=WCISQu6UMVUDdWQpdRDqvfXBq3DWC9YDTAn04EjOG3SBQG3fuhTHv05/d9ZRYv9I2o u7Om3J5+/R8nKAr48cXva8NrEB2FlI4PX/OzNxsTbHGm31ID0MzX2GqHpG/LjQeEoFeM nU3kMvDVTZqMqYmPyDi2RMGU/i9PdhmOWbhdqGsAegZ84aTMz+eNvNGyOwuHEI7c/RI+ KvWVHwDFX1rnVJ1AEDzc88vwev82SbmWpe/JCVEyXcaTdHRiuxcZ5Tn0GP7lITCqlpeT lgcww5+uF/3JVxdGYCdLlByJchExnFEr5LbqDWXtDTRXW3j13bXslDKo8uzt8QzcfW01 2UoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=XlTh1gWj; 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 80-v6si10627019wmu.166.2018.10.22.08.00.21; Mon, 22 Oct 2018 08:00:21 -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=XlTh1gWj; 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 4D8D31B3EA; Mon, 22 Oct 2018 16:58:13 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20061.outbound.protection.outlook.com [40.107.2.61]) by dpdk.org (Postfix) with ESMTP id EC97D1B433 for ; Mon, 22 Oct 2018 16:57:58 +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=1fsE8LalGVlJR0D4pq+c6SvIiNlyDQvS6igSrX/UMS4=; b=XlTh1gWjiotgsAGigbfe0S+2uZIn0HnTCZ0f1BN5INNQ6+eh3lRM3E6YJCKOvhyisj3e+XpcIxdXJbu8WzEHKKklhoRPMIMDi/gPnjdMWdKxQmifH0EuCA45djEAallfr24xyZqXZ9ayhlHrIpQfzFoLjzQdNDH4qT54l7o71hQ= 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:55 +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:55 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , Akhil Goyal CC: Hemant Agrawal , Gagandeep Singh Thread-Topic: [PATCH v5 15/15] test/crypto: add CAAM JR driver validation test cases Thread-Index: AQHUahecTtzPPE98Tk2vPuM96Sl7wQ== Date: Mon, 22 Oct 2018 14:57:55 +0000 Message-ID: <20181022145644.29277-16-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:fcH4sF1V5P0LLyZTac2XXgggasPZm086RGbu3ojnvDr9lNqg2nSYfEVbTX1D8l1CQbw/JGQ0uqCYFVSkE0Hn/BUjoMNGAjj9nGTSdPqesbxUaoaxw/c2ndPaB5qt75q1Q2gU3Dh1ES+2GQ9TfPR09tIdP4dzmid92wB6WnWUK/ctusEG4iNiLCvJVs6bjxZ/HtSkO+P7fe2Fm+BzZbKa3u3EA9vcZDyI/6qTIb37SDycSvgjtwzy7mBeXsm4R24xB0qKgLc3gM4R+zi3l3icHbGNrOTNf4BDp6fTpuDBlp8y2g62yatAjkHfb3HoGLe76rb3eanvnSX+iCt8fLxmj3gU/hinoPSzk30AR0DgAO8EBaZdwDzRuD6Pk6MWG+zLUEhEEUk2jJYtg+iFwrZiXdTrbY2PJynbIx10eakkquQArpmmkxOKtPA34FjY7VeKgtLzYaDtfgsu5iszpqpFpA==; 5:c39B6SwC+eCTqaH+MeoB1wRSKYha3pcYFi5Bmd8QXEnjm/TkGs+FnMzmhtyXQGQZ46XCBA3jM+HM+fOfx9ZEQ3QPhSqK0xMz7SYAmnLYfwuP5KYe/4uS3AGpBC22Y7nH3nWs0nyMp9aMuPrtpWuteJBhWu2JJpbl/U3oWKFqXYs=; 7:1mdj5WzXLF6V8NNeZT4KfPnGwKoIw+2n/3ttotiWNC268v43F/y0Qg2p4LrhH4hhwISzVj1nO6l+ukiU8r2wjRBa2swuCC/xC/JEuDIJa19xHV947H99rwFOfti5m7ISTfrBFvkrs7RWXvKIXvJYItwuvQhlNJ6mAcvxW1fzZ9oYsnoA9ztcaiRMMhv+67kBhvRD4cU/EI0bETLYNwySDTxXJJTFV8QYO2HNljRAgdWXn3XAto/h/jl3+GYA2TCF x-ms-office365-filtering-correlation-id: 87c38e11-1591-4b1a-2141-08d6382ebf1a 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)(4744004)(71190400001)(25786009)(2900100001)(305945005)(7736002)(97736004)(478600001)(4326008)(2906002)(72206003)(6636002)(53936002)(14454004)(66066001)(6512007)(5660300001)(6116002)(1076002)(6436002)(53946003)(6486002)(36756003)(14444005)(54906003)(6506007)(76176011)(55236004)(575784001)(386003)(68736007)(26005)(86362001)(102836004)(110136005)(579004)(559001); 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: u4krSrK0nPTBS/0B3BVEqDm9gBvztNPaIXdC/fhXRJcHdXY+AVHvTmUfLS3HNsXms9z3VIqSphH1Wzv83D1Y0LCvTz0EZZRjMEKFbQk0MAzWVlQDidvtU9ezsba/qEGLOYnTJ9sqrFblaMLJRNX8/n7isYEvuXtljl8thALp0kefvDt4NTN2kOZYd/hsIgE7cyb0jTTZV9uawm+b+Wstssdvmg0PlrFaT9CqWtM+9Q27Y7zyfJ+y+JYNp1jfTXfzwP+XaV8k4WWsWKz3QnOq7NFsaDWQMrdWzjMMkoM3ll0cJsNhi+0RLSWkn25nISqkp8SR9RHTr83HE5gGlqkpKw5Bm7dhb0h78rUkHYd68ms= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87c38e11-1591-4b1a-2141-08d6382ebf1a X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2018 14:57:55.5734 (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 15/15] test/crypto: add CAAM JR driver validation test cases 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 This patch adds the validation test cases for CAAM JR driver Signed-off-by: Hemant Agrawal Signed-off-by: Gagandeep Singh Reviewed-by: Akhil Goyal --- test/test/test_cryptodev.c | 138 +++++++++++++++++++ test/test/test_cryptodev.h | 1 + test/test/test_cryptodev_aes_test_vectors.h | 33 +++++ test/test/test_cryptodev_blockcipher.c | 7 + test/test/test_cryptodev_blockcipher.h | 1 + test/test/test_cryptodev_des_test_vectors.h | 14 +- test/test/test_cryptodev_hash_test_vectors.h | 14 ++ 7 files changed, 206 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index 32600dea2..84065eb49 100644 --- a/test/test/test_cryptodev.c +++ b/test/test/test_cryptodev.c @@ -1876,6 +1876,64 @@ test_AES_cipheronly_virtio_all(void) return TEST_SUCCESS; } +static int +test_AES_chain_caam_jr_all(void) +{ + struct crypto_testsuite_params *ts_params = &testsuite_params; + int status; + + status = test_blockcipher_all_tests(ts_params->mbuf_pool, + ts_params->op_mpool, + ts_params->session_mpool, + ts_params->valid_devs[0], + rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD)), + BLKCIPHER_AES_CHAIN_TYPE); + + TEST_ASSERT_EQUAL(status, 0, "Test failed"); + + return TEST_SUCCESS; +} + +static int +test_AES_cipheronly_caam_jr_all(void) +{ + struct crypto_testsuite_params *ts_params = &testsuite_params; + int status; + + status = test_blockcipher_all_tests(ts_params->mbuf_pool, + ts_params->op_mpool, + ts_params->session_mpool, + ts_params->valid_devs[0], + rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD)), + BLKCIPHER_AES_CIPHERONLY_TYPE); + + TEST_ASSERT_EQUAL(status, 0, "Test failed"); + + return TEST_SUCCESS; +} + +static int +test_authonly_caam_jr_all(void) +{ + struct crypto_testsuite_params *ts_params = &testsuite_params; + int status; + + status = test_blockcipher_all_tests(ts_params->mbuf_pool, + ts_params->op_mpool, + ts_params->session_mpool, + ts_params->valid_devs[0], + rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD)), + BLKCIPHER_AUTHONLY_TYPE); + + TEST_ASSERT_EQUAL(status, 0, "Test failed"); + + return TEST_SUCCESS; +} + + static int test_AES_chain_dpaa_sec_all(void) { @@ -5148,6 +5206,44 @@ test_DES_docsis_mb_all(void) return TEST_SUCCESS; } +static int +test_3DES_chain_caam_jr_all(void) +{ + struct crypto_testsuite_params *ts_params = &testsuite_params; + int status; + + status = test_blockcipher_all_tests(ts_params->mbuf_pool, + ts_params->op_mpool, + ts_params->session_mpool, + ts_params->valid_devs[0], + rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD)), + BLKCIPHER_3DES_CHAIN_TYPE); + + TEST_ASSERT_EQUAL(status, 0, "Test failed"); + + return TEST_SUCCESS; +} + +static int +test_3DES_cipheronly_caam_jr_all(void) +{ + struct crypto_testsuite_params *ts_params = &testsuite_params; + int status; + + status = test_blockcipher_all_tests(ts_params->mbuf_pool, + ts_params->op_mpool, + ts_params->session_mpool, + ts_params->valid_devs[0], + rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD)), + BLKCIPHER_3DES_CIPHERONLY_TYPE); + + TEST_ASSERT_EQUAL(status, 0, "Test failed"); + + return TEST_SUCCESS; +} + static int test_3DES_chain_dpaa_sec_all(void) { @@ -9808,6 +9904,31 @@ static struct unit_test_suite cryptodev_sw_zuc_testsuite = { } }; +static struct unit_test_suite cryptodev_caam_jr_testsuite = { + .suite_name = "Crypto CAAM JR Unit Test Suite", + .setup = testsuite_setup, + .teardown = testsuite_teardown, + .unit_test_cases = { + TEST_CASE_ST(ut_setup, ut_teardown, + test_device_configure_invalid_dev_id), + TEST_CASE_ST(ut_setup, ut_teardown, + test_multi_session), + + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_chain_caam_jr_all), + TEST_CASE_ST(ut_setup, ut_teardown, + test_3DES_chain_caam_jr_all), + TEST_CASE_ST(ut_setup, ut_teardown, + test_AES_cipheronly_caam_jr_all), + TEST_CASE_ST(ut_setup, ut_teardown, + test_3DES_cipheronly_caam_jr_all), + TEST_CASE_ST(ut_setup, ut_teardown, + test_authonly_caam_jr_all), + + TEST_CASES_END() /**< NULL terminate unit test array */ + } +}; + static struct unit_test_suite cryptodev_dpaa_sec_testsuite = { .suite_name = "Crypto DPAA_SEC Unit Test Suite", .setup = testsuite_setup, @@ -10634,6 +10755,22 @@ test_cryptodev_octeontx(void) return unit_test_suite_runner(&cryptodev_octeontx_testsuite); } +static int +test_cryptodev_caam_jr(void /*argv __rte_unused, int argc __rte_unused*/) +{ + gbl_driver_id = rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD)); + + if (gbl_driver_id == -1) { + RTE_LOG(ERR, USER1, "CAAM_JR PMD must be loaded. Check if " + "CONFIG_RTE_LIBRTE_PMD_CAAM_JR is enabled " + "in config file to run this testsuite.\n"); + return TEST_FAILED; + } + + return unit_test_suite_runner(&cryptodev_caam_jr_testsuite); +} + REGISTER_TEST_COMMAND(cryptodev_qat_autotest, test_cryptodev_qat); REGISTER_TEST_COMMAND(cryptodev_aesni_mb_autotest, test_cryptodev_aesni_mb); REGISTER_TEST_COMMAND(cryptodev_openssl_autotest, test_cryptodev_openssl); @@ -10649,3 +10786,4 @@ REGISTER_TEST_COMMAND(cryptodev_dpaa_sec_autotest, test_cryptodev_dpaa_sec); REGISTER_TEST_COMMAND(cryptodev_ccp_autotest, test_cryptodev_ccp); REGISTER_TEST_COMMAND(cryptodev_virtio_autotest, test_cryptodev_virtio); REGISTER_TEST_COMMAND(cryptodev_octeontx_autotest, test_cryptodev_octeontx); +REGISTER_TEST_COMMAND(cryptodev_caam_jr_autotest, test_cryptodev_caam_jr); diff --git a/test/test/test_cryptodev.h b/test/test/test_cryptodev.h index f2d41aedd..a73a49e72 100644 --- a/test/test/test_cryptodev.h +++ b/test/test/test_cryptodev.h @@ -65,6 +65,7 @@ #define CRYPTODEV_NAME_CCP_PMD crypto_ccp #define CRYPTODEV_NAME_VIRTIO_PMD crypto_virtio #define CRYPTODEV_NAME_OCTEONTX_SYM_PMD crypto_octeontx +#define CRYPTODEV_NAME_CAAM_JR_PMD crypto_caam_jr /** * Write (spread) data from buffer to mbuf data diff --git a/test/test/test_cryptodev_aes_test_vectors.h b/test/test/test_cryptodev_aes_test_vectors.h index 5db46f4c5..fff28bc9b 100644 --- a/test/test/test_cryptodev_aes_test_vectors.h +++ b/test/test/test_cryptodev_aes_test_vectors.h @@ -1171,6 +1171,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP }, @@ -1185,6 +1186,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP }, @@ -1225,6 +1227,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP }, @@ -1239,6 +1242,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP }, @@ -1253,6 +1257,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1279,6 +1284,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, { @@ -1293,6 +1299,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1305,6 +1312,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { .feature_mask = BLOCKCIPHER_TEST_FEATURE_SG, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, { @@ -1327,6 +1335,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1375,6 +1384,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1413,6 +1423,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1459,6 +1470,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, { @@ -1472,6 +1484,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, { @@ -1484,6 +1497,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, @@ -1498,6 +1512,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, @@ -1511,6 +1526,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP }, @@ -1525,6 +1541,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP }, @@ -1564,6 +1581,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO | @@ -1579,6 +1597,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO | @@ -1594,6 +1613,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1607,6 +1627,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, { @@ -1619,6 +1640,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1630,6 +1652,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { .feature_mask = BLOCKCIPHER_TEST_FEATURE_SG, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, { @@ -1642,6 +1665,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO | @@ -1657,6 +1681,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO | @@ -1671,6 +1696,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO }, @@ -1683,6 +1709,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO }, @@ -1696,6 +1723,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1710,6 +1738,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1724,6 +1753,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, @@ -1737,6 +1767,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, @@ -1750,6 +1781,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1764,6 +1796,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX diff --git a/test/test/test_cryptodev_blockcipher.c b/test/test/test_cryptodev_blockcipher.c index 6df132126..1c3f29f6b 100644 --- a/test/test/test_cryptodev_blockcipher.c +++ b/test/test/test_cryptodev_blockcipher.c @@ -68,6 +68,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t, RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD)); int dpaa_sec_pmd = rte_cryptodev_driver_id_get( RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD)); + int caam_jr_pmd = rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD)); int mrvl_pmd = rte_cryptodev_driver_id_get( RTE_STR(CRYPTODEV_NAME_MVSAM_PMD)); int virtio_pmd = rte_cryptodev_driver_id_get( @@ -111,6 +113,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t, if (driver_id == dpaa2_sec_pmd || driver_id == dpaa_sec_pmd || + driver_id == caam_jr_pmd || driver_id == qat_pmd || driver_id == openssl_pmd || driver_id == armv8_pmd || @@ -631,6 +634,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool, RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD)); int dpaa_sec_pmd = rte_cryptodev_driver_id_get( RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD)); + int caam_jr_pmd = rte_cryptodev_driver_id_get( + RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD)); int scheduler_pmd = rte_cryptodev_driver_id_get( RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD)); int armv8_pmd = rte_cryptodev_driver_id_get( @@ -707,6 +712,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool, target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_CCP; else if (driver_id == dpaa_sec_pmd) target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC; + else if (driver_id == caam_jr_pmd) + target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR; else if (driver_id == mrvl_pmd) target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MVSAM; else if (driver_id == virtio_pmd) diff --git a/test/test/test_cryptodev_blockcipher.h b/test/test/test_cryptodev_blockcipher.h index 57e678fc1..f8bd85838 100644 --- a/test/test/test_cryptodev_blockcipher.h +++ b/test/test/test_cryptodev_blockcipher.h @@ -30,6 +30,7 @@ #define BLOCKCIPHER_TEST_TARGET_PMD_CCP 0x0040 /* CCP flag */ #define BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO 0x0200 /* VIRTIO flag */ #define BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX 0x0100 /* OCTEON TX flag */ +#define BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR 0x0400 /* CAAM_JR flag */ #define BLOCKCIPHER_TEST_OP_CIPHER (BLOCKCIPHER_TEST_OP_ENCRYPT | \ BLOCKCIPHER_TEST_OP_DECRYPT) diff --git a/test/test/test_cryptodev_des_test_vectors.h b/test/test/test_cryptodev_des_test_vectors.h index 0789881da..f1b8cbd45 100644 --- a/test/test/test_cryptodev_des_test_vectors.h +++ b/test/test/test_cryptodev_des_test_vectors.h @@ -1069,6 +1069,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP }, { @@ -1079,6 +1080,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP }, { @@ -1103,6 +1105,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1115,6 +1118,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -1195,7 +1199,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | - BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC + BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR }, { .test_descr = "3DES-128-CBC HMAC-SHA1 Decryption Digest" @@ -1206,7 +1211,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = { .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | - BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC + BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR }, { .test_descr = "3DES-128-CBC HMAC-SHA1 Encryption Digest" @@ -1254,6 +1260,7 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MB }, @@ -1265,6 +1272,7 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MB }, @@ -1276,6 +1284,7 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MB | @@ -1289,6 +1298,7 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MB | diff --git a/test/test/test_cryptodev_hash_test_vectors.h b/test/test/test_cryptodev_hash_test_vectors.h index af1e29e68..a02dfb3c3 100644 --- a/test/test/test_cryptodev_hash_test_vectors.h +++ b/test/test/test_cryptodev_hash_test_vectors.h @@ -393,6 +393,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -406,6 +407,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -437,6 +439,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | @@ -449,6 +452,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .feature_mask = BLOCKCIPHER_TEST_FEATURE_SG, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, { @@ -460,6 +464,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | @@ -472,6 +477,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .feature_mask = BLOCKCIPHER_TEST_FEATURE_SG, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX }, { @@ -501,6 +507,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -514,6 +521,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX @@ -545,6 +553,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | @@ -559,6 +568,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | @@ -591,6 +601,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | @@ -605,6 +616,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | @@ -637,6 +649,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | @@ -651,6 +664,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER | BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC | BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC | + BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR | BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |