From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 520E745748; Tue, 6 Aug 2024 10:42:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B1E240E45; Tue, 6 Aug 2024 10:42:01 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2049.outbound.protection.outlook.com [40.107.105.49]) by mails.dpdk.org (Postfix) with ESMTP id 3D66440E1E for ; Tue, 6 Aug 2024 10:42:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=a9RW0U+Gxpa/AhgATtkhYqrZOq7AZ0J7uEzRYQe29qgwlMhA61BN7aPWTelFiRTM/5VASiYZ7GdRaOveb2ZQKq8yyYxKIfIVAe9AUhlI/E+He6a8kBbQ3kZznUGy6deftajp6rwrB92lM5ZlqhbzrlWT3iTgkJZq9ejp5PKJUtD5i5EfEah0b9rmdtOOCIBJgyBelOsNNdt8zRmZmLE0zONeewNXzcxQV17XaPyhFiYBeboe0WRHdHVi6X3qdvA7gnkKFAUxowpDAsXOa4VQHC7BGPwcaOn/CJo1DBML89fWxAHlaU/qh4EauXOBNoCaVKU69ehOHer12tWgZdlXDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uv0XgJFRFDc39L/2W/cmDuqLCsEXOpxKbHq3SNZ9At4=; b=TvR1AJL+8z5fZwQJ0PjPU5HC9AqQjZ6Lrx9DGukJ6CzzgX0wUKixgQQPVyA7wwsY50O4vrhYE7AK4TIAQtFQ1cixSkLEdXarenOaePstp35ZxlBKUsUHVppjMvXtyb/34uCH87o+6t1gJZ5HU7YybmfnFLBMU3Z1527DCc2lQv7q+qNVGf69l7V5IHyiFfHW50sObXUA4R3p1Nsp8auJofwx1dnGGlZsYyM/Pcq5xEAnL0Wlqi6E/WgfjJUGzKTQSQH6zK1YhMZMVUJt79iOyEtaWML6yK8Zyranz5hSoAUPFuha5DCwy7KDxwkTAfYzVvpLFYoNXmdWAiGC3Zgwhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none 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=uv0XgJFRFDc39L/2W/cmDuqLCsEXOpxKbHq3SNZ9At4=; b=Je++A7RWNsz3YXoXcwLuN1tNMCvqsLbq40pK0H8Ds2Mmz2jNnvJNIZEOZo9dfL2z9dHnMGzLTrzk/dWJyST2KExpMjPro9RvXuSgkKNn2oD0vKtq7JSDAS4kYyVUUPN+ITo3OB67GXxS0IoN6LLtfvBZgbmfL4xRY2KgvaMpakLACKhI9iACax7zu7rVSjoSo+4h37A7TdZOQBATCKkgabs/tIQ+IOEzhBk+HXzvpRlHhegpEJ3BvH9dopgMTj5tY/GISk3I63Q1p+J1lwi+LgOBIwwfZG9+hZ4zCQt5PHBbq75rWlsXQLAOQOFfFgmP8cjnM2LjorhCNSWCuoMSTQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) by PR3PR04MB7210.eurprd04.prod.outlook.com (2603:10a6:102:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 08:41:58 +0000 Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325]) by AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325%7]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 08:41:58 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal Cc: Jun Yang Subject: [v1 3/7] crypto/dpaa2_sec: enhance IPsec RFLC handling Date: Tue, 6 Aug 2024 14:11:32 +0530 Message-Id: <20240806084136.3212615-4-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806084136.3212615-1-g.singh@nxp.com> References: <20240806084136.3212615-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0041.apcprd01.prod.exchangelabs.com (2603:1096:4:193::15) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|PR3PR04MB7210:EE_ X-MS-Office365-Filtering-Correlation-Id: 14cc42e4-72e6-48e7-4912-08dcb5f3a246 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?wijITvTT9DFFTx0uOgO3Z/Imxiih3FOhPsdIXVPh41DAO1MjmlMbSVotLkQV?= =?us-ascii?Q?gkqjMkNoxKlqpS5s/Fs4b1Pzl2u850SkoXdIfwCQDV4OIwrxnFzOx1p+qYF5?= =?us-ascii?Q?0V/ymtNcl1DolzpKuzzNvnLv5BCDmhzu0ZluG1m+218BT8x7jKRLgEbJeGFi?= =?us-ascii?Q?2ePrva0QcDeqZZeVoPZ4MfrFMgKYyUVDznuenTFWvt9muCTnVeOZK9rfTQQC?= =?us-ascii?Q?fDa2ftK1Qv3hZMdqs1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=?us-ascii?Q?WyFKn4Gj1CSZuwugNwkBfig+R7IG4yyHW3A6YhGTgCCr82xqVa5tUBDlXFN5?= =?us-ascii?Q?Hbi5sGkvJxUvgOdUpkVeh2L5IkRKqouWlxslo9bVGs6J2kivEcFawlsMvndV?= =?us-ascii?Q?kcsOY3h2WbxppZRLjf2gbC26E96B8mI5n6S56LKkVdjkgjSpG1wr6v+YfaI0?= =?us-ascii?Q?Dn7wMlBkwGRR1YsiuaDlxpZxpIDc19u/Vw8n518Sb5OrUygdLF407iM441Dr?= =?us-ascii?Q?yPmcrg0h0LBQRoHb0WkrgFxcMW8fjw65+EoDsUcnAQJ1iYdwWw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?njFCQ+AKWKlZWqXeM3QuFznpR+ZD9wYPN5gyoBMXziN+liKDIpkcL6eQX4wi?= =?us-ascii?Q?vNeSlaMBCG/VEaLjlA8NGG1Ga3cG1ajG1yx9Ubh7aSERT9+evs40CL8cM139?= =?us-ascii?Q?5PdVVWiLrQxSSgBhvX9h2Hft6n4g37osPQrNqdtkSSaxIMAFIVBSpfUuEzB4?= =?us-ascii?Q?t0YHJsm+jX92orGjRJQ1wICPmaOMrKlAhPBa+12ZMwBaRcQc9H3cS02vU/Lu?= =?us-ascii?Q?eSM8oh6ECHRvHWIyRh2QYRFutNgsObs6qtA9Uoppt99oUh2VZ8c1tQX9dNQH?= =?us-ascii?Q?FplaEWgIDNOLKBlgnmpJx90JL3vL61uZX6k302auPmAoA+MMyKGUrWk87c2X?= =?us-ascii?Q?YC4BCUsAsjphIPoIsGsF5p3tICaoUSwPfp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?= =?us-ascii?Q?xHseOgucWOJ0SwEZ5y/AhfntFt6KATugZp3MHu28bhyhmDiY2tz+v2RReR0V?= =?us-ascii?Q?Y9VI9PTlhYux9sMUglxHPL2WedZZc5XpKe/47u8NY/5MS82E6cNATlsMkank?= =?us-ascii?Q?9cISOYYDU0PxYQgrdbzIByApGiRdxG8sYLhm8jVsAX2f9Vi0r89v+AcmRk1o?= =?us-ascii?Q?msOb3l3KuXHUXU0Xnhi8UMaqBdRDqulBsogWyrCBX6nJd6UGlx3nHzWyGX/a?= =?us-ascii?Q?MjlknmPIFvV+ppc/J3FVaWfcUH6tU9qdP5QXyvRygXgwoVkoM8oeHCzsqRrY?= =?us-ascii?Q?LswIG9bPns+64D2Q/JOMxaLCrEYMiznwrh4gFNEE?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14cc42e4-72e6-48e7-4912-08dcb5f3a246 X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 08:41:58.5771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qDE9v8Qt7MY5p/5y+5ssioPWYmUt39twXY0k5Z1EVrTdHmd9a9wOe86b2ziEIhIs X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7210 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jun Yang Point Response FLC to FLC(SEC descriptor context). Response FLC can be used for debug purpose in dequeue process. Enable data stashing only. Annotation stashing is disabled which is not suitable for SEC and impacts performance. Signed-off-by: Jun Yang Acked-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 44 ++++++++++++--------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index e0b8bacdb8..0e30192b30 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -2005,7 +2005,7 @@ dpaa2_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id, struct fsl_mc_io *dpseci = (struct fsl_mc_io *)priv->hw; struct dpseci_rx_queue_cfg cfg; int32_t retcode; - char str[30]; + char str[RTE_MEMZONE_NAMESIZE]; PMD_INIT_FUNC_TRACE(); @@ -2065,8 +2065,7 @@ dpaa2_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id, return -ENOMEM; } - cfg.options = cfg.options | DPSECI_QUEUE_OPT_USER_CTX; - cfg.user_ctx = (size_t)(&qp->rx_vq); + cfg.dest_cfg.dest_type = DPSECI_DEST_NONE; retcode = dpseci_set_rx_queue(dpseci, CMD_PRI_LOW, priv->token, qp_id, &cfg); return retcode; @@ -3060,14 +3059,19 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev, struct alginfo authdata, cipherdata; int bufsize; struct sec_flow_context *flc; + uint64_t flc_iova; int ret = -1; PMD_INIT_FUNC_TRACE(); - priv = (struct ctxt_priv *)rte_zmalloc(NULL, - sizeof(struct ctxt_priv) + - sizeof(struct sec_flc_desc), - RTE_CACHE_LINE_SIZE); + RTE_SET_USED(dev); + + /** Make FLC address to align with stashing, low 6 bits are used + * control stashing. + */ + priv = rte_zmalloc(NULL, sizeof(struct ctxt_priv) + + sizeof(struct sec_flc_desc), + DPAA2_STASHING_ALIGN_SIZE); if (priv == NULL) { DPAA2_SEC_ERR("No memory for priv CTXT"); @@ -3077,10 +3081,12 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev, flc = &priv->flc_desc[0].flc; if (ipsec_xform->life.bytes_hard_limit != 0 || - ipsec_xform->life.bytes_soft_limit != 0 || - ipsec_xform->life.packets_hard_limit != 0 || - ipsec_xform->life.packets_soft_limit != 0) + ipsec_xform->life.bytes_soft_limit != 0 || + ipsec_xform->life.packets_hard_limit != 0 || + ipsec_xform->life.packets_soft_limit != 0) { + rte_free(priv); return -ENOTSUP; + } memset(session, 0, sizeof(dpaa2_sec_session)); @@ -3330,24 +3336,26 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev, 1, 0, (rta_sec_era >= RTA_SEC_ERA_10) ? SHR_WAIT : SHR_SERIAL, &decap_pdb, &cipherdata, &authdata); - } else + } else { + ret = -EINVAL; goto out; + } if (bufsize < 0) { + ret = -EINVAL; DPAA2_SEC_ERR("Crypto: Invalid SEC-DESC buffer length"); goto out; } flc->word1_sdl = (uint8_t)bufsize; - /* Enable the stashing control bit */ + flc_iova = DPAA2_VADDR_TO_IOVA(flc); + /* Enable the stashing control bit and data stashing only.*/ DPAA2_SET_FLC_RSC(flc); - flc->word2_rflc_31_0 = lower_32_bits( - (size_t)&(((struct dpaa2_sec_qp *) - dev->data->queue_pairs[0])->rx_vq) | 0x14); - flc->word3_rflc_63_32 = upper_32_bits( - (size_t)&(((struct dpaa2_sec_qp *) - dev->data->queue_pairs[0])->rx_vq)); + dpaa2_flc_stashing_set(DPAA2_FLC_DATA_STASHING, 1, + &flc_iova); + flc->word2_rflc_31_0 = lower_32_bits(flc_iova); + flc->word3_rflc_63_32 = upper_32_bits(flc_iova); /* Set EWS bit i.e. enable write-safe */ DPAA2_SET_FLC_EWS(flc); -- 2.25.1