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 56351A0547; Sun, 17 Oct 2021 18:21:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8060410EA; Sun, 17 Oct 2021 18:21:29 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80075.outbound.protection.outlook.com [40.107.8.75]) by mails.dpdk.org (Postfix) with ESMTP id E9D5A4003C for ; Sun, 17 Oct 2021 18:21:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kFJANlhRvLvHGbl9J/F1dwj7jVt2OLKo1MZ4WTqH8lj/gMEqh7CLFfYJKhMeRY5RgcC587/9g37+4JL4bIFJ2LXbgXc4yXUQ2cdQQfPxZo6vmVQhUZc67ZgQWGxFlGOhr69sqYtMgEWzZ5kA0CksAlxj5VN0RleNTDQe135s4Y614utObsuNbmGyrF0fFzea8/UWJZdjnAlbe0dPaNRqVlcjzg67+zj6P1PDNuSASuBMDH1nbezThE2Jb/yRBXqm5ELsTNeCK2LB/e21LqzREA17f0aj6u1ZrV1wPctwg4wsywAaJ/sx04o5/E2kS63dvGE5THM0zT5mJU0vpycr/A== 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=PgFTkfyqKXvcLE7ASC0SqLlOUTs2DR7QDk9455Ygq4M=; b=hL2oE2KQa8Ad9mi8OWPlydxOJyWV556x9oZmcHrAk4NYjyUt6eV0UNRm8OCkB8nsx5B0TrANV4CYWSxQd4ViiVmj2xUv/wvSjzOrXGi49fB5uM7VejBAXfr069Plpmbz+14irZd5nC6C5g/ENx9wV1Xmgp+me/YviJkaYiJIAbQ9uUktBSeQa0jkhSndRs0oOaaFIldmTP/BT2MwN/LEEbyQxG4h8AXKe47aV7z9EIT25vH6zXafq7/ORDshRDlOAyYH3uxhnTSStu6xVPcz+/ymHbSPBExfRH9YkP7rEGyPsqpqWtAWdt3dNEQvZHO0L9kdwHVCB/8DKNqgwKcwvg== 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=PgFTkfyqKXvcLE7ASC0SqLlOUTs2DR7QDk9455Ygq4M=; b=UnCkFaaXbO0oQzVZ7fUDE8TAgVIj6swbjqpiJaT8IF0zZif02bNbxYdqnf4R/8hiIQDlfEJuCFSg7XWQ7WLpAet2Wb6F/0rBxl2TSp6WhHnuZkO9771zPTGQjSUNEbJoXg3JVscS3nohouyU59GGt7t0s5SqAmMsx0BwK6JNxZI= 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:27 +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:27 +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:38 +0530 Message-Id: <20211017161651.9220-3-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:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3dd637d-dbe8-44c7-b154-08d9918a2b81 X-MS-TrafficTypeDiagnostic: DU2PR04MB8615: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IDy5EMA23qJGz/NmpaVUw1Ka7RiKJOq37jwqdaoS4eXjITbJsnNkGa7djFoLLYBNYBWC2Az1LmzwkMoKxlg3KJE9klLHj0mXLKWM/Vd/+hRl5Uydp75S8h7uKr9WvgzAI/pDXWaFWoi/waLDXQjbTn1R0sxiDQrrZ5ycMO42pPaPhTt16XXvB7N4kDMhktYPYPM9v5w+2R+HWmmuhC8gq4wUv0MjJ/snDLday++/mal+kRBlFLkO9Is9Uqzx1fEl9zit0CpdnULqGVDdTXuzJ4QBpBTDgQtIE5L3tQL/Hci0uL95tbHL7VZtkdzNT/F66LZbKWtTTOJ51Fpy0VGtFxT0/9qDheQhVinDw1irAYpIRIyIm9ez0pEc9UoDgQFb4lzEtkefINw9ERJu1yJIOHSGtmQV3DRUSB4FcobHr1jIWjglWfW8OFmVujY5lcayXSHNiZ17CF48260arGMvi82DQVkY4XV7Enuoif6dmrtjaBgYzO1UCJLzph55sUDMe82C0LhTnjXTk+cCrSKVjFudGP53WqZ4UpQOyvGE+WAE6C5K45n3cOt0IGrSMAifjJLqmuDxI7IUG9sWWx9/6uZR4UN/XTH/0pQWWL/OLz5qwzS7GlFFHPFNb+dDRNYG6GDF7GlEeKVtVqoMA5eLKRYe5zppibj80rM0Q8AgOvCukXDSC6NQCMNbFCU1om2h2QHjkkoaVtIBoHs+1bUNTA== 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)(6666004)(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?idmppo3KflcreXQ5n5N6wrEzY7jGxF2aJkJyA+eOpjIKtUzK6OMShvJXl3O2?= =?us-ascii?Q?cROTDNqWxhcZeX2dhy54HzuuiYkATbpQbcyCU45jlxa9c7nhzQUg7Q0omVyd?= =?us-ascii?Q?KGIkJyYix7siLyP6QbhEJeZVydZplhPeenzfjes/NbeLCvoTQA2X8etZAHgG?= =?us-ascii?Q?EX7FUkeJz3rUWj1ASbzlLWrygrxoL1k56lBppXlZj++OrDwmRREU/isJtam1?= =?us-ascii?Q?4hrmX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1VnnWUl6wmkPvQ6jnxlZ?= =?us-ascii?Q?tfvEyumcdYkHCCUynBE5vkW8DOlD8hzjWMHvyCa78VjoDLj4+OKJ5pUEAHPC?= =?us-ascii?Q?tvVVfJkATiDMw0T1kqFGzSbprBvqqZZ1tiy3g4td01T76gFNZT4TAFA5gobS?= =?us-ascii?Q?Rfi/M+wVKgCUUPAgjs4Ef2mgSav4+uYKEhPwKXjTbq5dCdDHAP6IEGOclqRo?= =?us-ascii?Q?9Odsvp5BE8GYXWN6hR+3GWf1?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3dd637d-dbe8-44c7-b154-08d9918a2b81 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:27.3160 (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: YPd9yJRZuc+eFdYgM3yWvSIcMgc7hT2TEwmniZUAfWahGQmvt+zhaoortVYfhvnMqWDSCFb4u/utvVo6NrQL5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8615 Subject: [dpdk-dev] [PATCH v5 02/15] crypto: add total raw buffer length 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 The current crypto raw data vectors is extended to support rte_security usecases, where we need total data length to know how much additional memory space is available in buffer other than data length so that driver/HW can write expanded size data after encryption. Signed-off-by: Gagandeep Singh Acked-by: Akhil Goyal Acked-by: Konstantin Ananyev --- doc/guides/rel_notes/deprecation.rst | 7 ------- doc/guides/rel_notes/release_21_11.rst | 6 ++++++ lib/cryptodev/rte_crypto_sym.h | 4 ++++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 09b54fdef3..0e04ecf743 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -179,13 +179,6 @@ Deprecation Notices This field will be null for inplace processing. This change is targeted for DPDK 21.11. -* cryptodev: The structure ``rte_crypto_vec`` would be updated to add - ``tot_len`` to support total buffer length. - This is required for security cases like IPsec and PDCP encryption offload - to know how much additional memory space is available in buffer other than - data length so that driver/HW can write expanded size data after encryption. - This change is targeted for DPDK 21.11. - * cryptodev: Hide structures ``rte_cryptodev_sym_session`` and ``rte_cryptodev_asym_session`` to remove unnecessary indirection between session and the private data of session. An opaque pointer can be exposed diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 256037b639..ba036c5b3f 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -232,6 +232,12 @@ API Changes * cryptodev: The field ``dataunit_len`` of the ``struct rte_crypto_cipher_xform`` moved to the end of the structure and extended to ``uint32_t``. +* cryptodev: The structure ``rte_crypto_vec`` updated to add ``tot_len`` to + support total buffer length. This is required for security cases like IPsec + and PDCP encryption offload to know how much additional memory space is + available in buffer other than data length so that driver/HW can write + expanded size data after encryption. + ABI Changes ----------- diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h index f8cb2ccca0..1f2f0a572c 100644 --- a/lib/cryptodev/rte_crypto_sym.h +++ b/lib/cryptodev/rte_crypto_sym.h @@ -37,6 +37,8 @@ struct rte_crypto_vec { rte_iova_t iova; /** length of the data buffer */ uint32_t len; + /** total buffer length */ + uint32_t tot_len; }; /** @@ -963,6 +965,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, vec[0].base = rte_pktmbuf_mtod_offset(mb, void *, ofs); vec[0].iova = rte_pktmbuf_iova_offset(mb, ofs); + vec[0].tot_len = mb->buf_len - rte_pktmbuf_headroom(mb) - ofs; /* whole data lies in the first segment */ seglen = mb->data_len - ofs; @@ -978,6 +981,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, vec[i].base = rte_pktmbuf_mtod(nseg, void *); vec[i].iova = rte_pktmbuf_iova(nseg); + vec[i].tot_len = mb->buf_len - rte_pktmbuf_headroom(mb) - ofs; seglen = nseg->data_len; if (left <= seglen) { -- 2.17.1