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 4D9BFA0C55; Wed, 13 Oct 2021 21:05:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A7F74125D; Wed, 13 Oct 2021 21:05:06 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2056.outbound.protection.outlook.com [40.107.22.56]) by mails.dpdk.org (Postfix) with ESMTP id 936E641255 for ; Wed, 13 Oct 2021 21:05:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HbuXrt4fbg7VKRH4NSY/XJD3RFJFQA2baCRlRjqvFxZyNK+L0o+HZ3nty2U8p88BaCUvsu3oCky/SAXfdmY4R4cyGUWm0Eii+nXBEJAMcgrkxwMJI5pf3Bekpeh3al9IW7Zrr6M8K+EOUihdd6YS2spMm4gTgN7dmP/jC01wG/fRnOpjTvTXH/IVpUeTnPnF+Q0r7EhcR0PZtP3ef+tFiOvTOYUOCuMf8cN7eWMvfNPzXH43JpNVxRbhbhqN0I9YvfFCvd7nX+vNS46FcV/UA9p+sUGAJkbg+rU0L7nvJha9ZRUwPrm3dHBB1dxl9CwZmzH+/LiacDJSS0HPOjh3kw== 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=BcieUuF6TDZ+VTE+bEnzlHxrEhAPc1TtT4OggNW97Sk=; b=e+opoDM3pzG0acXOHri4ynp23jatoGLyYmXw0X3dXOuhe2L3YvGG48cvPuwmtUO2lv+Dssjptx5N5hC1lifw99aRf71Ao8KyaRHBy6WD3tQVA5/OZXOV/QA0k0k2x3tSPhr0iWEJYOTMNN6fvSR9c6gAzSnj9uW1HhccV5C4xh1edzlBpFezC5cy/Mg3LfsSjW49nq6Tt5YRuS7O9dlRonfYvD2wkL0h6MoYNTkWewDpsJ8O8tRpFtnBt4Gg+OZse4efEUXTA3XK5y7uE6tO46Vjlkz/vJAI7S3lRwpI6vf56lraulUbzXRfjEmlMmg0ZJhW3bfJhL/cyxMmETvvjQ== 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=BcieUuF6TDZ+VTE+bEnzlHxrEhAPc1TtT4OggNW97Sk=; b=L9Ddi5zJGMKKeym/a6yhnd068YiVdezR+pf5iDlOAzee61CJbStXLYQLWy2OfnWtOFNcepyPnRzxn2IrYlACJymbBq6+qGRjsVYmo7jueXcwpCNBkOFk6o2yADkrWCJUf2+xmLLDMfz4aOGy+sMsX3YhVfDvZ5Yvg6As7PmxJ1Q= 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 DU2PR04MB8870.eurprd04.prod.outlook.com (2603:10a6:10:2e1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Wed, 13 Oct 2021 19:05:03 +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.4587.026; Wed, 13 Oct 2021 19:05:03 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Thu, 14 Oct 2021 00:30:19 +0530 Message-Id: <20211013190032.2308-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211013190032.2308-1-hemant.agrawal@nxp.com> References: <20210907075957.28848-1-hemant.agrawal@nxp.com> <20211013190032.2308-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR0302CA0011.apcprd03.prod.outlook.com (2603:1096:3:2::21) 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 SG2PR0302CA0011.apcprd03.prod.outlook.com (2603:1096:3:2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.4 via Frontend Transport; Wed, 13 Oct 2021 19:05:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 530d4b9b-881f-4daa-85cd-08d98e7c5ce3 X-MS-TrafficTypeDiagnostic: DU2PR04MB8870: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tKntNR8XnCYmnF9L3NWTSU4Owh5WS6RNtjUsGpH99KcWpaih8ZFF1Sa3EaQto1OtnXOjw1m410q+O1QrVtkH+B0+zfh3+PvsOeNjM67ESUoSTWBq4gyOPM+I4M+ZrvrtAtGweOmc1a/uB70M/Er0VKxlh1yZukPYggQupaz/1bnjYQjMGgiyMbV5h1yPsupyJVtluARfzq4qwLEkNQS7xiR3mcu5xa1dtLOsbwFOU36QccIlZG5BqCCPqzAX9+z5ZUVtPFospZIIyfH38rrsUfeQ9xuU6Ki127+BDMqpc0+koyH/xzmNxS8NqRFhWmAdByzzpfJOcArk+HrbVpOTCB+abxGCl0uVOuac7XG8KrK9XsXj34+nxnyQO4BbpQ+FiAW2qbLJyD6TnIgX9O4zwCgcqQ+nxhmZlBY7QGe7ePfOWl1qYDCQ3y/aiZH4xmrMxwwN774GAAoTiLGLCINHuz78WTeXDAhiK//XchmJ2DQNGvCDSFbtTgs48yiLJOUdIDJZU+fkeHyc2GurQxE4MW19O076Pp/0WGZY1XT7qMbrkvBkd7KyI/Du8qRkE3IgJLB+erKBbqmSiE/+gxYbONjdZ3RXPOldYatlsgYP1xhXArrU+pEvG+/1OSzvwcJKQpxcdUQIOTj2kkGU1FAhPUJYSy9AB5jaKY5YSdCH0090mRfgzqfm6cvo0t9abpE6zIh7QcRSoh9qsgnl4fJhsg== 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)(66946007)(66556008)(316002)(6666004)(6506007)(36756003)(6512007)(2906002)(8936002)(1076003)(52116002)(186003)(4326008)(956004)(66476007)(2616005)(5660300002)(83380400001)(38100700002)(44832011)(38350700002)(8676002)(26005)(6486002)(508600001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Y2vcyls83gs4sKk/6x33mkARvufIIYOka0iFuCioWKOxuNIuVs+E6rxWR4Ti?= =?us-ascii?Q?artcAfJhrN0VCQ2hznJ6LknPSzCOw5qWGuwAmUedPVL3DB3BXFfmV7UW4uTq?= =?us-ascii?Q?crCrcDfaz2q2u2M8Cs+lxbE0tkBr3jSj7HrCNF1odBnY3ziq74WNg0Uh5xaX?= =?us-ascii?Q?mNzfQ9Q47UWxV4BZq0K94GKAGLpNhbjw1QV7H8wxMRa4UryNAw6J4ewQRAZT?= =?us-ascii?Q?jtx8tLLNwg9VUt96/q/8o0Y4F5CWMeVKs9C+u7dkVJg527a3P4pnlLIWa5qQ?= =?us-ascii?Q?4rgJTe+OEb3iJPDOLEMcoiGGoVqUJeByTOZThng2eqaNxcyMgp83uCGYASoL?= =?us-ascii?Q?+fcdTx/gmfTdoeuGzCuhnaWRnezDyvoN789wbYT5z/1B2QhZdjbTj2/okRgX?= =?us-ascii?Q?1yVGICO9xjq8lXermip/8RL454yRI5UZBk24zpkKU6VEHjXy8wKyFTwqOGRa?= =?us-ascii?Q?6L+COcmUvfICoCrZa/QYjJ6Kq4zMZod+M5LcPq77lQ8QwUHr99tl17/763Hp?= =?us-ascii?Q?4AuSoequ7i0zU8dL3XMiL3AlU5U9njIt95nUFnQ48hOnSZvu0CKH1BUvCxSe?= =?us-ascii?Q?UQ5U1TO6/ate6jhFtciZNxIKOm/KGQ4o7zYPFow5KHyltubrFYtHGHALvAm3?= =?us-ascii?Q?3dfDMDVUJB8Zmg7Ux/REQWpUUW3KnzP6onFQjl0DZu1dRupcrwx6eGCur9uR?= =?us-ascii?Q?s9Uxqom57U6lnDbBXeECh4SwSCMomSpu+2IhPJja6KNLCtM91txfu/8JMYgD?= =?us-ascii?Q?kjDk/X5RwynYUHmor2bRDJSslXn75pEPFFxxribUU/tSJrkbCnIwKQZq1XYq?= =?us-ascii?Q?4D5FebvPQ9F7N7hTwnZMIXURZMbgp0w3A1dTCZty9n0slcsbvw+0zBHQTtN3?= =?us-ascii?Q?FGl0bJep2urnFtpzOxD+wT5djRNPcA0Pu6r9TyRmjAd19evfLmnwVraL5eIw?= =?us-ascii?Q?czD7VrmHkYewTWwpehmP62QrbUQIWQyoF3FWy6QiEzyph9vb11tNjJKydkYL?= =?us-ascii?Q?RqF3JjYk16Shs5SXEWBP6rJKjrfvUTh2J3D+W5lWIxn6RqVb8/dXQC395jpz?= =?us-ascii?Q?Fnt428R8s1s203UDelLpeodsZmba8kFxE0NyqcjD6N39tdiUbWV2VbZUijoA?= =?us-ascii?Q?afpo22cs6+YZLRhRzJPvbzQs4loyAK7mGxBggAE+xVB+Qit+y6NV2b1hpy7D?= =?us-ascii?Q?U83dJmnPqgfIokDc332/B+AAZci274uNl8t9vB0xRgx7h8KGeOckMhMljKKW?= =?us-ascii?Q?UsE7iqDM4SFBxvBEsgwdqhbzM5AGimRiBfsRuU29Cq8/PQIYqLhv73WA38/k?= =?us-ascii?Q?kTdxcxxp9UJGI774ZXdPA7As?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 530d4b9b-881f-4daa-85cd-08d98e7c5ce3 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 19:05:03.7270 (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: TazLJOxA6UGoH1TzOs4aW7Jo7aApigvQk70ZVz6xfcf7hUfRxdi/d6daIYGiwtqJStAv1bUk+lnyWEO5lWHw/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8870 Subject: [dpdk-dev] [PATCH v4 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 --- doc/guides/rel_notes/deprecation.rst | 7 ------- lib/cryptodev/rte_crypto_sym.h | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index a4e86b31f5..53155459a0 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -188,13 +188,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/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h index dcc0bd5933..6be283e83c 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; }; /** @@ -980,12 +982,14 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, seglen = mb->data_len - ofs; if (len <= seglen) { vec[0].len = len; + vec[0].tot_len = mb->buf_len - rte_pktmbuf_headroom(mb) - ofs; return 1; } /* data spread across segments */ vec[0].len = seglen; left = len - seglen; + vec[0].tot_len = mb->buf_len - rte_pktmbuf_headroom(mb) - ofs; for (i = 1, nseg = mb->next; nseg != NULL; nseg = nseg->next, i++) { vec[i].base = rte_pktmbuf_mtod(nseg, void *); @@ -995,6 +999,8 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, if (left <= seglen) { /* whole requested data is completed */ vec[i].len = left; + vec[i].tot_len = mb->buf_len - rte_pktmbuf_headroom(mb) + - ofs; left = 0; break; } @@ -1002,6 +1008,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, /* use whole segment */ vec[i].len = seglen; left -= seglen; + vec[i].tot_len = mb->buf_len - rte_pktmbuf_headroom(mb) - ofs; } RTE_ASSERT(left == 0); -- 2.17.1