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 A2D80A0547; Sun, 17 Oct 2021 10:31:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3452E40041; Sun, 17 Oct 2021 10:31:12 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130047.outbound.protection.outlook.com [40.107.13.47]) by mails.dpdk.org (Postfix) with ESMTP id 028284003C for ; Sun, 17 Oct 2021 10:31:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R9Up9ByFPKcQgYnG4jmdu6t7l1xXZrzgF9i8R6S4yejp4xOQAbgTKJ36gJdim1eOci1C5FmdIn1GFM6IgzGbKJBUrKm8/daKW5l2U3q7PzmCG9HODJRQYiIFOqWqlnFXsxdZG9Vlipu6Duais7feMJpaQmORlVFWm5k5phL/sFu675+k4kCXzk3Yc7CPSYqHgY7dgBdmBp38OHAGrd9yQkWohEBk79OIIJDVt7LsvvcvSEgylb/SjRX5zonUFHQiivIJ6yqp2EAFpOCvNjkSkuklYRcR3IrvsVJMreg2YStIX3+ZmmfPHVVGgusAdcZh/wicLAYcihYDeQ94ROSNMw== 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=/ClcKHYvn5H+3jb2FZ4sPl5HyqB3ejlG3h72ug629y4=; b=QhuAQI6zb7Wwe4e3iKWDx+3k2wOmcKReSQCuRz7DbfGMsXJILJR/ETpAo8pCOH1+etLhdMVTGTOlqbyFcaMQEaUqAjztflGLSyWA+50aZcGwaAcvkVuJxnVRl1eZ0nnrz/xPhxAF93JlzRBs0lclilGoWnB4TWehdrXHU6pFXg0xe/d/FPXalabD5l5DwJmI1tGF+NdUL0EYKaOwNmQzZh7OqQoNHb2l+7ibIecgDZzJd6Zf6NJa64li4Cb639HsPq1K9B5j0W06RjgoLeZ++5GZ6e1ej4PtQhjf+9CPJVfmz/7f8eP6n1wvpBnfk/eCNc08C/jA8exIdQVdKzoSRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/ClcKHYvn5H+3jb2FZ4sPl5HyqB3ejlG3h72ug629y4=; b=MQ6mdAihZDjvFQmBdYPx0W+kjcSUhZbdvShgA+sDDzN+g8om/tPXIjVrjoqpGJhoH9CnxIWOjFU2qle0qbfT/DG94+hEi4z/14mkYN9xihnJVwnSxV/DGWGH/ONLHx7Irs7akD4lF0sdUgFLdTf/vdTNMlEAt4uMtPcEwrNj0KQ= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8552.eurprd04.prod.outlook.com (2603:10a6:10:2d7::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Sun, 17 Oct 2021 08:31:09 +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 08:31:09 +0000 Message-ID: <4ba65d0b-2cb6-e75e-3999-6e6f9e98cea1@oss.nxp.com> Date: Sun, 17 Oct 2021 14:00:59 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Content-Language: en-US To: "Zhang, Roy Fan" , Hemant Agrawal , "dev@dpdk.org" , "gakhil@marvell.com" Cc: "Ananyev, Konstantin" , Gagandeep Singh References: <20210907075957.28848-1-hemant.agrawal@nxp.com> <20211013190032.2308-1-hemant.agrawal@nxp.com> <20211013190032.2308-3-hemant.agrawal@nxp.com> From: Hemant Agrawal In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN3PR01CA0112.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:96::20) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.5] (122.161.69.94) by PN3PR01CA0112.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:96::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Sun, 17 Oct 2021 08:31:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 29715875-0776-4c3f-c3de-08d991487841 X-MS-TrafficTypeDiagnostic: DU2PR04MB8552: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xX+5Tv3Y6djAfPlfOIv1x2iNcodigOHRSsFReS5fQRPPaoHV08hZctUG6vvWXYo34+Xb4uGCRtio7vSdhS5cjBGixk/LAOcDUpPku5ovCfLEpk/eLRTgCgE9p3KOKTnHMpHZmJcC2R1lqkFZP6DkOjQsZSkkR8sYoQQx9/uEGNtv+yPFnK83m/hi2bycggdIyV2YUKsyfW7OaApGmLtsDgDPQu5cK7ThibifvSFNO03t+71z0zmcWvVtI6Fxsaeghgex4/qKkwv5f4esvjNwRSvNYnc1QKad6i6DPVkGjKM3mn7Itgs2dlslm7VPshE1IUuhyzUdU05pJhzPvaknDH0EvWhScZhXozXPgjwhV1WnM3Zvl1E9hbFKHSBcgKy5aCEgML4b/G4qWLyM9ral6jb9h8hOOtLAix1U7a3BK6tvtt3nkX4dtqnXxNTLQyM3Hi9MO6+KvYX6RmDxSm5N4xcevEL1h2yKyiKJ7hOSrkY7euPzkOunCctOwyj64L/clwOmLN2A/njmu2Ztp7hsdoLtnDWxhGW5kqt5+NzAqkiFaV3c0Oo+fjzjyVVcycEmaPokPtw6hyUZJJeRNV9I3/Ug5oB4R56REgrir6U/79KfGGb4MJYUPo2VGqY8IOrZpJ87NujIIljs8EpW7A7A7Uu9a0sfFg5EgWQ1IZgJXH4xtEZHKOnuseSXJXZNILa+OlS3BARsZRC81V+btY2jiCe5zw1VK8IER4OuILWyw7VDoNj59VzS61y8dis0Jsl3KHgQOC05V8kwa46iShaNVQ== 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)(31696002)(316002)(8676002)(44832011)(83380400001)(52116002)(508600001)(6486002)(55236004)(31686004)(53546011)(5660300002)(26005)(38100700002)(86362001)(38350700002)(186003)(2906002)(16576012)(66556008)(66476007)(54906003)(8936002)(956004)(110136005)(6666004)(2616005)(4326008)(66946007)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?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IK503vu/?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29715875-0776-4c3f-c3de-08d991487841 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2021 08:31:09.5424 (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: saSP8IJbUgPQ0ZvB2x0uFGFkffYXGiY0HL6+tlaPyVi7r2FeiRMgvPaWwMEw04SXSEMkdMTyrWec3EFZ0oZqdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8552 Subject: Re: [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: , Reply-To: hemant.agrawal@nxp.com Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Fan On 10/14/2021 6:09 PM, Zhang, Roy Fan wrote: > Hi Hemant, > > I still think it is enough to use rte_crypto_vec as well as > rte_crypto_sym_ofs is enough to describe the data including both the data > and aad. > > Imagine 2 10 bytes segments case, encryption/hash size of 12 and aad of 8. > We will have > struct rte_crypto_vec sgl[2] = {{.base = x, .len = 10}, {.base = y, .len = 10}}; > union rte_crypto_sym_ofs ofs = {.cipher.head = 0, .cipher.tail = 8, .auth.head = 0, .auth.tail = 8}; > > The driver shall understand there are 8 bytes not included for cipher/auth. This is the protocol offload case. It won't work in that case. > > Regards, > Fan > >> -----Original Message----- >> From: Hemant Agrawal >> Sent: Wednesday, October 13, 2021 8:00 PM >> To: dev@dpdk.org; gakhil@marvell.com >> Cc: Ananyev, Konstantin ; Zhang, Roy Fan >> ; Gagandeep Singh >> Subject: [PATCH v4 02/15] crypto: add total raw buffer length >> >> 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