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 4367DA0547; Sun, 17 Oct 2021 18:22:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E23B54113F; Sun, 17 Oct 2021 18:21:46 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80083.outbound.protection.outlook.com [40.107.8.83]) by mails.dpdk.org (Postfix) with ESMTP id 789954003C for ; Sun, 17 Oct 2021 18:21:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N4mmEmWIO1kHYWAmnGXUMjBDuvLnt5ixajpLIVZLrUG35mGbCq9tS6ccPR4bssl+H1xj/78Y3U3vouxC2sRDqIdCZ7mOKiQskA7mms7CAA2MNaQl16agRT29ojh52TGmebq0a6ucfFhbiW180Jk4EI22h5yPKN5pKTHq8CH7nNiYMRUNLjgJRLxXtrLzRVlkk+hfvOZh6AdXxxWK93kJeTYNkvllJfVLTXUdZ5LRiuN4L0lbqNkBui/br1m0at362TINxBIkymNUGMqBlKoREw/TMCKSE3+CJUjSP9HWpm4JfSfHw1wqS6H/wHEwMIujjAjgxRhxTpWRT+RSgwByHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=bDzCrvooZf/IECefjBGTAHwjpotedB9NJ8ycBmuYfOA=; b=VICu45y+tsPJrEe+eB68SQPgaTNx5ZAuwAxwoB+Z0YbCTE2yeiva596IgiZa6oD/KIwQYdCXakmk3+D6mXUpcuIcb1ACRKj2VZ92BXRKy/T/1kTLe4ZzTbois56kEy5dEtamYgignymuRlGZO9lHWKG3NG6pnnCwsAJmNMOP6+0ow4w1GSnC+bLuwIaTk9MThLWBirUl14tIuJebIiNHyQ4dnX6eOuj8xFwqdMbjkcQ98zBdDWzHSHKF/hWtylc7rYMAjUpxlsUkG1u5RVQSj9PG2QZJNcF4KSj/olVKsZYDK5rIeO/2x9bOKw17XV7x163OZ6y31o+++n789EZFWw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bDzCrvooZf/IECefjBGTAHwjpotedB9NJ8ycBmuYfOA=; b=BPg6xj2DzgbNXc+GDstP8dzpPCJ7U9HfpCBjK3ljp4zy9+SGtPoo3mY90rKyYxUGAy0mY0WpSZj4JMI891ykmCMkF5ZbiCzONQeLnbY+MMve6rJHROqmU292Bekf68eo5XZ6qaQqe94jOMs6iykgbm4bTQX0tcKKFwZ5UA1sVBw= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8615.eurprd04.prod.outlook.com (2603:10a6:10:2da::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15; Sun, 17 Oct 2021 16:21:43 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%3]) with mapi id 15.20.4608.018; Sun, 17 Oct 2021 16:21:43 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Sun, 17 Oct 2021 21:46:45 +0530 Message-Id: <20211017161651.9220-10-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211017161651.9220-1-hemant.agrawal@nxp.com> References: <20211013190032.2308-1-hemant.agrawal@nxp.com> <20211017161651.9220-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0053.apcprd01.prod.exchangelabs.com (2603:1096:4:193::7) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SI2PR01CA0053.apcprd01.prod.exchangelabs.com (2603:1096:4:193::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Sun, 17 Oct 2021 16:21:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 29373efe-9a2a-466e-39d8-08d9918a3539 X-MS-TrafficTypeDiagnostic: DU2PR04MB8615: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:534; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oWR+/lGnBiF10bUFwXpoexRWCFbtBILRkqSE9RaHv8NmbhZ/qJ5cv2W9UGs4nsocBmTRGU8WwjduvyBtVer0Srk9LYw3HD3c2j6TwSu1rcRwZu78FQ+WlmGJqHhjR97kHfqZGULip/qiEQQl7atKRN/i3R2g2ED0IMSMyhl0DsJDxjq5Pji0zBu75yiwXFOUFBzl9nzWlxnqJlYq66QwMa6VUyLRDVow7SuE9NwaN8V/6D4Dwpowh4w86Zu/QWeYTaScleLmINhPoFF5Pev1RICAOmPEYlZOUoLacGC0YBK/TEEwWWaksbASg4tB6s9LBoLNrg6U8JW0OA7YDhOi5Ykf2to+PIJ5YlLIN/35VmoQ0sIYBCK1HNnin8UavTjY6sqMHnKB4hFVsVJ0WaONFpc7YX0sbfyN6Zbyzw1XtObhqU65jhUvYFv9Q106UNQj2IBeIzmK3aiHlJDFTGpUUm8sJG9iPyWZQIxxiKDvdatgklDaUJkwgETqA10F5BhuDdj6dYTcARhLDvEPtuUMsUaGiXE3sEh65NN/Wcfihcl75KpWCj/p8GLmGpni2KUCT/pPuXJebEJFSho4NrbtpHOsIHvTRmaOnvq2e7GxnhoykW3L8ILhW5o92zGfny4goH0aXdD5T5GKjUY42DU6IvMLNOMvh6NPo06ab1TBaiMZG6bruHi1EHoRRaJqYomNS1znyrbJN5kmMJzs2pwL8Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8630.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(6486002)(66476007)(8936002)(66556008)(66946007)(86362001)(52116002)(36756003)(5660300002)(38350700002)(8676002)(38100700002)(508600001)(6506007)(26005)(44832011)(4326008)(6512007)(2616005)(83380400001)(1076003)(2906002)(316002)(186003)(956004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vmOuMVNFV9QJNkRt62/kBseZVUiEpulYoXhjpDWlEYO7PnVCFQD022tTXyV7?= =?us-ascii?Q?95XP/Jl4g8XhSVptDeqj0kiv6eHHErthF2sItzbbDjKCrgZIKVBtL1lwYLT2?= =?us-ascii?Q?3I/UKvM6mYr+Wbm7bGmmrf6wxyMJjNaFOLqe8B3ijqDB3V3AVcRQdkEDqLo8?= =?us-ascii?Q?Kgxos2wY7bF3wocpMmrRNyu9jjY0oXoyPO7ceSF/DH23Q0gg/wlMH1tMESlt?= =?us-ascii?Q?3idp73eEGHWr0lUg/TCThLGcUcq9SdI3vMm/c316Y8iSQ2HkcnWm6SAqq1Zs?= =?us-ascii?Q?dHUqDwhQaDAT056HMwMrIofxPcwSxlLqNS/DcmZyGg8biZ4fT8F+gTnWmPvT?= =?us-ascii?Q?WCJOKUV2l7aHUgJjqNNxfJylX8P4/BmphErzvdmnHzpTJWQbSngb7FHq362P?= =?us-ascii?Q?FEDh8F8C0QawmjWb6ajgkuvno3BAVLsN0ahZ7rZZuLKXbD8HGG3tSgB0VcH7?= =?us-ascii?Q?tzjDZDdYIylkD2/CQWRvEKipHQMb5iw5An8p88aMnRLN6GUPfOj/s/pChuL9?= =?us-ascii?Q?K2astHkpN0RQanpQ6poEglRKX/Gx2r0obO4i0HuSLB3VfiVk9mm2KaoRwdRj?= =?us-ascii?Q?/hALTWm5x8Fn1L9/se8W7ZSTalubDXBaThbVqUNgw7mnnuzc4Q2Yu1Zh8lwD?= =?us-ascii?Q?siUbwuQyJp/sh0OHaIZn1w8s9AOILXfnJDWXozKW9Kw3ctIdD5u/Mocl4cTj?= =?us-ascii?Q?Y9xHPYMMTiPjlYtyCSFXG1LCxl2zjXkstc+ok8LJAO3S61WL5uGQHtHAuu8z?= =?us-ascii?Q?fMNb/HWlCYj2KC+yiwisAf35t0QzUjx8BTRYK38wSQDnwR8MpdRUWhc44l/g?= =?us-ascii?Q?u6BAwP2uimzKlW6YgXV0mT8ydOu3TyoH5Oa2MgWe47+36/Zs2tfQE/4J5fyE?= =?us-ascii?Q?nZQLtOigklDSeafquYXsPc94Vd6zBiZjvzYP3au/vNikBwHuq4AS1C2hD/ck?= =?us-ascii?Q?QqkFjLbj3sEztDwKP8OB5Zg75Z9wa52jGrlVRMgJbAul5TDNXRlw0qhKiKXt?= =?us-ascii?Q?fQe1J/0wC6QEAzg932deZRGZG8GqpDN3bZVVDtIRUhEdo4RHpO3XC2LmUGMg?= =?us-ascii?Q?CWyR0QE4HYHoquL0TAJo9LrqFPYFt6tjSwaiEAaWPfQ/+W+h/fjprmDO24ZH?= =?us-ascii?Q?gZfpPVPeRGZXNXjA3zgMu+5uXSv4WN5nTXY/OO0IgrBnKMFEp7wkYEoFcGgk?= =?us-ascii?Q?mVbm/niJ5JNq9Vc3O+MNNsQu7tyX0sjdMbOpt8WjrDqMd6c+K6pnmnKBFv3F?= =?us-ascii?Q?BtOro45+o1+RtmwcBeCGk/+69ItjYZCeEfFrTDiRIGCCJPPJBOrgAZ+oRaym?= =?us-ascii?Q?D14Nd74x71NLkkTYCIqvHvlv?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29373efe-9a2a-466e-39d8-08d9918a3539 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2021 16:21:43.6024 (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: jAaGhiWrzojqI1mhRR+p9Smhc5uel4gcu2Q6iRbDfKmPWQEU/L1PRCp5sn1Z1i+u+djSJW+IyRzrYwNjyLXfiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8615 Subject: [dpdk-dev] [PATCH v5 09/15] crypto/dpaa2_sec: support OOP with raw buffer API 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 Sender: "dev" From: Gagandeep Singh add support for out of order processing with raw vector APIs. Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h | 1 + drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c | 156 +++++++++++++++----- 2 files changed, 116 insertions(+), 41 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h index f397b756e8..05bd7c0736 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h @@ -179,6 +179,7 @@ typedef int (*dpaa2_sec_build_fd_t)( typedef int (*dpaa2_sec_build_raw_dp_fd_t)(uint8_t *drv_ctx, struct rte_crypto_sgl *sgl, + struct rte_crypto_sgl *dest_sgl, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *auth_iv, diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c index 5c29c61f9d..4f78cef9c0 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c @@ -24,6 +24,7 @@ struct dpaa2_sec_raw_dp_ctx { static int build_raw_dp_chain_fd(uint8_t *drv_ctx, struct rte_crypto_sgl *sgl, + struct rte_crypto_sgl *dest_sgl, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *auth_iv, @@ -89,17 +90,33 @@ build_raw_dp_chain_fd(uint8_t *drv_ctx, (cipher_len + icv_len) : cipher_len; - /* Configure Output SGE for Encap/Decap */ - DPAA2_SET_FLE_ADDR(sge, sgl->vec[0].iova); - DPAA2_SET_FLE_OFFSET(sge, ofs.ofs.auth.head); - sge->length = sgl->vec[0].len - ofs.ofs.auth.head; + /* OOP */ + if (dest_sgl) { + /* Configure Output SGE for Encap/Decap */ + DPAA2_SET_FLE_ADDR(sge, dest_sgl->vec[0].iova); + DPAA2_SET_FLE_OFFSET(sge, ofs.ofs.cipher.head); + sge->length = dest_sgl->vec[0].len - ofs.ofs.cipher.head; - /* o/p segs */ - for (i = 1; i < sgl->num; i++) { - sge++; - DPAA2_SET_FLE_ADDR(sge, sgl->vec[i].iova); - DPAA2_SET_FLE_OFFSET(sge, 0); - sge->length = sgl->vec[i].len; + /* o/p segs */ + for (i = 1; i < dest_sgl->num; i++) { + sge++; + DPAA2_SET_FLE_ADDR(sge, dest_sgl->vec[i].iova); + DPAA2_SET_FLE_OFFSET(sge, 0); + sge->length = dest_sgl->vec[i].len; + } + } else { + /* Configure Output SGE for Encap/Decap */ + DPAA2_SET_FLE_ADDR(sge, sgl->vec[0].iova); + DPAA2_SET_FLE_OFFSET(sge, ofs.ofs.cipher.head); + sge->length = sgl->vec[0].len - ofs.ofs.cipher.head; + + /* o/p segs */ + for (i = 1; i < sgl->num; i++) { + sge++; + DPAA2_SET_FLE_ADDR(sge, sgl->vec[i].iova); + DPAA2_SET_FLE_OFFSET(sge, 0); + sge->length = sgl->vec[i].len; + } } if (sess->dir == DIR_ENC) { @@ -160,6 +177,7 @@ build_raw_dp_chain_fd(uint8_t *drv_ctx, static int build_raw_dp_aead_fd(uint8_t *drv_ctx, struct rte_crypto_sgl *sgl, + struct rte_crypto_sgl *dest_sgl, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *auth_iv, @@ -219,17 +237,33 @@ build_raw_dp_aead_fd(uint8_t *drv_ctx, (aead_len + icv_len) : aead_len; - /* Configure Output SGE for Encap/Decap */ - DPAA2_SET_FLE_ADDR(sge, sgl->vec[0].iova); - DPAA2_SET_FLE_OFFSET(sge, ofs.ofs.cipher.head); - sge->length = sgl->vec[0].len - ofs.ofs.cipher.head; + /* OOP */ + if (dest_sgl) { + /* Configure Output SGE for Encap/Decap */ + DPAA2_SET_FLE_ADDR(sge, dest_sgl->vec[0].iova); + DPAA2_SET_FLE_OFFSET(sge, ofs.ofs.cipher.head); + sge->length = dest_sgl->vec[0].len - ofs.ofs.cipher.head; - /* o/p segs */ - for (i = 1; i < sgl->num; i++) { - sge++; - DPAA2_SET_FLE_ADDR(sge, sgl->vec[i].iova); - DPAA2_SET_FLE_OFFSET(sge, 0); - sge->length = sgl->vec[i].len; + /* o/p segs */ + for (i = 1; i < dest_sgl->num; i++) { + sge++; + DPAA2_SET_FLE_ADDR(sge, dest_sgl->vec[i].iova); + DPAA2_SET_FLE_OFFSET(sge, 0); + sge->length = dest_sgl->vec[i].len; + } + } else { + /* Configure Output SGE for Encap/Decap */ + DPAA2_SET_FLE_ADDR(sge, sgl->vec[0].iova); + DPAA2_SET_FLE_OFFSET(sge, ofs.ofs.cipher.head); + sge->length = sgl->vec[0].len - ofs.ofs.cipher.head; + + /* o/p segs */ + for (i = 1; i < sgl->num; i++) { + sge++; + DPAA2_SET_FLE_ADDR(sge, sgl->vec[i].iova); + DPAA2_SET_FLE_OFFSET(sge, 0); + sge->length = sgl->vec[i].len; + } } if (sess->dir == DIR_ENC) { @@ -294,6 +328,7 @@ build_raw_dp_aead_fd(uint8_t *drv_ctx, static int build_raw_dp_auth_fd(uint8_t *drv_ctx, struct rte_crypto_sgl *sgl, + struct rte_crypto_sgl *dest_sgl, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *auth_iv, @@ -303,6 +338,7 @@ build_raw_dp_auth_fd(uint8_t *drv_ctx, { RTE_SET_USED(iv); RTE_SET_USED(auth_iv); + RTE_SET_USED(dest_sgl); dpaa2_sec_session *sess = ((struct dpaa2_sec_raw_dp_ctx *)drv_ctx)->session; @@ -416,6 +452,7 @@ build_raw_dp_auth_fd(uint8_t *drv_ctx, static int build_raw_dp_proto_fd(uint8_t *drv_ctx, struct rte_crypto_sgl *sgl, + struct rte_crypto_sgl *dest_sgl, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *auth_iv, @@ -466,20 +503,39 @@ build_raw_dp_proto_fd(uint8_t *drv_ctx, DPAA2_SET_FLE_SG_EXT(op_fle); DPAA2_SET_FLE_ADDR(op_fle, DPAA2_VADDR_TO_IOVA(sge)); - /* Configure Output SGE for Encap/Decap */ - DPAA2_SET_FLE_ADDR(sge, sgl->vec[0].iova); - DPAA2_SET_FLE_OFFSET(sge, 0); - sge->length = sgl->vec[0].len; - out_len += sge->length; - /* o/p segs */ - for (i = 1; i < sgl->num; i++) { - sge++; - DPAA2_SET_FLE_ADDR(sge, sgl->vec[i].iova); + /* OOP */ + if (dest_sgl) { + /* Configure Output SGE for Encap/Decap */ + DPAA2_SET_FLE_ADDR(sge, dest_sgl->vec[0].iova); DPAA2_SET_FLE_OFFSET(sge, 0); - sge->length = sgl->vec[i].len; + sge->length = dest_sgl->vec[0].len; + out_len += sge->length; + /* o/p segs */ + for (i = 1; i < dest_sgl->num; i++) { + sge++; + DPAA2_SET_FLE_ADDR(sge, dest_sgl->vec[i].iova); + DPAA2_SET_FLE_OFFSET(sge, 0); + sge->length = dest_sgl->vec[i].len; + out_len += sge->length; + } + sge->length = dest_sgl->vec[i - 1].tot_len; + + } else { + /* Configure Output SGE for Encap/Decap */ + DPAA2_SET_FLE_ADDR(sge, sgl->vec[0].iova); + DPAA2_SET_FLE_OFFSET(sge, 0); + sge->length = sgl->vec[0].len; out_len += sge->length; + /* o/p segs */ + for (i = 1; i < sgl->num; i++) { + sge++; + DPAA2_SET_FLE_ADDR(sge, sgl->vec[i].iova); + DPAA2_SET_FLE_OFFSET(sge, 0); + sge->length = sgl->vec[i].len; + out_len += sge->length; + } + sge->length = sgl->vec[i - 1].tot_len; } - sge->length = sgl->vec[i - 1].tot_len; out_len += sge->length; DPAA2_SET_FLE_FIN(sge); @@ -528,6 +584,7 @@ build_raw_dp_proto_fd(uint8_t *drv_ctx, static int build_raw_dp_cipher_fd(uint8_t *drv_ctx, struct rte_crypto_sgl *sgl, + struct rte_crypto_sgl *dest_sgl, struct rte_crypto_va_iova_ptr *iv, struct rte_crypto_va_iova_ptr *digest, struct rte_crypto_va_iova_ptr *auth_iv, @@ -593,17 +650,33 @@ build_raw_dp_cipher_fd(uint8_t *drv_ctx, op_fle->length = data_len; DPAA2_SET_FLE_SG_EXT(op_fle); - /* o/p 1st seg */ - DPAA2_SET_FLE_ADDR(sge, sgl->vec[0].iova); - DPAA2_SET_FLE_OFFSET(sge, data_offset); - sge->length = sgl->vec[0].len - data_offset; + /* OOP */ + if (dest_sgl) { + /* o/p 1st seg */ + DPAA2_SET_FLE_ADDR(sge, dest_sgl->vec[0].iova); + DPAA2_SET_FLE_OFFSET(sge, data_offset); + sge->length = dest_sgl->vec[0].len - data_offset; - /* o/p segs */ - for (i = 1; i < sgl->num; i++) { - sge++; - DPAA2_SET_FLE_ADDR(sge, sgl->vec[i].iova); - DPAA2_SET_FLE_OFFSET(sge, 0); - sge->length = sgl->vec[i].len; + /* o/p segs */ + for (i = 1; i < dest_sgl->num; i++) { + sge++; + DPAA2_SET_FLE_ADDR(sge, dest_sgl->vec[i].iova); + DPAA2_SET_FLE_OFFSET(sge, 0); + sge->length = dest_sgl->vec[i].len; + } + } else { + /* o/p 1st seg */ + DPAA2_SET_FLE_ADDR(sge, sgl->vec[0].iova); + DPAA2_SET_FLE_OFFSET(sge, data_offset); + sge->length = sgl->vec[0].len - data_offset; + + /* o/p segs */ + for (i = 1; i < sgl->num; i++) { + sge++; + DPAA2_SET_FLE_ADDR(sge, sgl->vec[i].iova); + DPAA2_SET_FLE_OFFSET(sge, 0); + sge->length = sgl->vec[i].len; + } } DPAA2_SET_FLE_FIN(sge); @@ -706,6 +779,7 @@ dpaa2_sec_raw_enqueue_burst(void *qp_data, uint8_t *drv_ctx, memset(&fd_arr[loop], 0, sizeof(struct qbman_fd)); ret = sess->build_raw_dp_fd(drv_ctx, &vec->src_sgl[loop], + &vec->dest_sgl[loop], &vec->iv[loop], &vec->digest[loop], &vec->auth_iv[loop], -- 2.17.1