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 94431A0C4D; Tue, 21 Sep 2021 11:59:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D1C840DF7; Tue, 21 Sep 2021 11:59:34 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00054.outbound.protection.outlook.com [40.107.0.54]) by mails.dpdk.org (Postfix) with ESMTP id EE6E440683 for ; Tue, 21 Sep 2021 11:59:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3QqdIkPLSHTj6aq1NkZKFIhQmHegE9O8fZwsrsb9cGB9yAL7DEo1AAVvomDk5Pk5fnHz5Y6gqLKTWZ/oxdsppJqFWOdoox+YKjbnD4opRBVW7JoL6nxC+c9WMoh2OKunLsXd1HRcH1+Zd8oJD4I3YgA6J8ZhnZ6wr5WRdnrmuRYB1us7kKmKJbQuLKLz/LJv5fBPXl+2pl2eoNc1ADPeGk6kk3L0pvkqrSqwN8QLeCytRwdYdGEBq9rLKRgHnxvJ3Y67/NP/VGKTMvF8jHfUp1ygcu3RwHzseoMfjMWJMQVrOzGn8O/y8nrLFWyb5cK/ijJmB9BGcmCOTcNYhjJzw== 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; bh=vrtdl+02mzE+nRyWJtxKilHw+XZGRTn/+tfJe7MnLKg=; b=nZCskLVO4o764fYVI7uIbGaOoGzt8fAz+ROsU9wrjiin04hJax9NO0n5lazjR4fxINvBL6+aCrcDK/Lj3sOeDUSNYXUXQaphNHwZb1aqdCLb9+CEgvAB1aNLGa4yLO8s5ySE/rvkHMeCqIyqvobQD48NzsJtJezrHNGC3mYqfxeLdz//ptiB+Z5wV1U1YwlloC/Y6s161xXqc5CnUZae3VPStUfvAwqznyPpETY1UqN1qRVg+njt1TP13WwH11N2EKXobFXg+alMRzco1/rFiG2s2QrXgFBFGHU+hd8vNDQwT1GClWxm8zDSs1WSoA0VM/+zTGPnKHW9+p8PeNXMZg== 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=vrtdl+02mzE+nRyWJtxKilHw+XZGRTn/+tfJe7MnLKg=; b=Bv/rzqJKruEU6mXmvC2Kkr6m3K+/B9lxCilLwnvIab18Uhh+dxa7GDJmHXtRwZDhMy6bsrNBvf4ESe7VN/2SEfvSMELtNzIc/DvZVXoORNu+rhE/tS57q+nKFhr9mxhKjlhHEQdQuAPDUpMOuMwZEtW6pGsIyzRSYqN0mL7hTPQ= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=oss.nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by DU2PR04MB8920.eurprd04.prod.outlook.com (2603:10a6:10:2e3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Tue, 21 Sep 2021 09:59:31 +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.4523.018; Tue, 21 Sep 2021 09:59:31 +0000 To: Akhil Goyal , "Ananyev, Konstantin" , Hemant Agrawal , "dev@dpdk.org" Cc: "Zhang, Roy Fan" , Gagandeep Singh References: <20210825071510.7913-1-hemant.agrawal@nxp.com> <20210907075957.28848-1-hemant.agrawal@nxp.com> <20210907075957.28848-3-hemant.agrawal@nxp.com> From: Hemant Agrawal Message-ID: Date: Tue, 21 Sep 2021 15:29:21 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: SG2PR02CA0135.apcprd02.prod.outlook.com (2603:1096:4:188::23) 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.11] (122.161.79.231) by SG2PR02CA0135.apcprd02.prod.outlook.com (2603:1096:4:188::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Tue, 21 Sep 2021 09:59:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3cece1a7-82b8-410a-e4eb-08d97ce68169 X-MS-TrafficTypeDiagnostic: DU2PR04MB8920: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True 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: pIOha0i6XuVS3E0Z7DwkFvnJmgwPa7FMLYtu/5andU2LvJlD0efAHwWnLo1fKhilMaj3Xtw+rac1TYOK+mXb2jllacRXUPf8FW1cq/XE89NbfVd+ozilfV+s4evlGHSLw3DkVPPaAl2MbGcZAyjwKfDnaJaBOU7E/j1sNBmGPmX4jKwCb7o/MTav8t8pQVRNleFQZugdmDIma/hfEsHYi1I/D8P/vQx3hgPX51y/1d+0EfGhqrqNGCwpa8bnpz8/yBXjUR8A/rKm0LZwavQv5fa5al2E8r5xtb2YTmi5fDed5/ifsBOrDrBjcDNRk/+rSJcCBUoWvGZbHtzJ9aSW6IUT9xA5ysCZ1tJZ8mjATrqlyQsR0+pna0PwkgxmmK7suvCEYcTGcT7hx7Dx7mZhawsbCtw56yC7ZXd4+Ag+z34RypAUIN6L/IEx2NepKH30GmVS9qTb0SG2tJGjlovI8/BLbQiZY9QmOoh1RnR4b16Cf/Qg28TW7LEtspkfCo78xacdy3PLDPdXa7TAqCZEy8ceeymejhX9jwEsnOeaUKR3l76kKNURpwJLvPSUU0/0h5mWvFAPwg0ceyECV7WwsAzsCq3zp20ORmZovuZOk5P/5xe/hn4XsoecN2CbN0OPa8syVgjr4Fzy9e9b5EGQoaZmWeUBV4YbrQjeEk23mOsRPlcoWWlJYW29kFpC4yeY0aig9kn0SlZDlT9ZL5HOMtx0ilMILptqRbx4F8futmkUSnuAeFHPipurejU7u/2599UmJMQg1q2TgEAIBUjbCw== 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)(44832011)(31696002)(83380400001)(2906002)(5660300002)(38350700002)(110136005)(186003)(6486002)(52116002)(2616005)(8676002)(956004)(54906003)(38100700002)(66476007)(508600001)(66946007)(53546011)(26005)(6666004)(8936002)(55236004)(66556008)(4326008)(31686004)(316002)(16576012)(86362001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WXVEQjdWcU1wSXNzeld3YnQ3eTFRZHlMc1BpdC9CVXVpTTRRRG1LeWlwNFV3?= =?utf-8?B?eHhXb3l4WU03YVNKQVU0Mko0RGFYY1N2TjI4eWlN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04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2021 09:59:31.0843 (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: 8VLfWs1zAKTmhYyiZqO1ZFi3QLGETiXh2oqUjiQzEY9eNVWxohMD8so8oKZQVmzfdHzJf8CYA2bcM3kpsW1uSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8920 Subject: Re: [dpdk-dev] [PATCH v2 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 Konstantin On 9/21/2021 12:58 AM, Akhil Goyal wrote: >>> 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 >>> --- >>> lib/cryptodev/rte_crypto_sym.h | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/lib/cryptodev/rte_crypto_sym.h >> b/lib/cryptodev/rte_crypto_sym.h >>> index dcc0bd5933..e5cef1fb72 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; >> That doesn't look right. >> We should take into a count mbuf headroom and input offset. >> Something like: >> vec[0].tot_len = mb->buf_len - rte_pktmbuf_headroom(m) - ofs; >> Same in other places below. >> > I believe the packet can expand into headroom based on the protocol support. Yes, total length is representing the total buffer length available. The security protocol shall take care of the headroom and offsets.