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 85309A0C53; Wed, 25 Aug 2021 09:18:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C63B411C7; Wed, 25 Aug 2021 09:18:51 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2073.outbound.protection.outlook.com [40.107.21.73]) by mails.dpdk.org (Postfix) with ESMTP id BC52C411C0 for ; Wed, 25 Aug 2021 09:18:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ppbmo48DkoT7FFPubtJBkeyisBmceniiTSIuhxp/XcX2ma9ZcCVaZTA3MLHiMym7UIKLZJQKhqy75rtk3OXeb8cgXjttEkGAp/30JJVEY7b3UaplI/wtfW87vLqOenv3buvrixVg88bNLroXbnSsMgPTikhAm70Gtk1QmSW5QG4g/M42ytDv7C8GphKAdXLlr+3lqe0G6R1oALMIBZZGZEeI8vxPo/JvjMpzdZzleMhEZkF+NlNSFV9Fn5s68/X3fzkrkbwDlnLsptOd5Sag8s8IENlELIqEjqsZ+rHJ5hzP9ToAMnW8yaCKotqkmtuUl2vZ8iRTskZ+2HhGgMDjpQ== 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-SenderADCheck; bh=DJH8xh7Zu9m7tWjgSU5tGNWKgbIzKqpsoiVAso/5kQU=; b=U3JnJTftaPszTSCogqYCGhuclSUVtPD2iZCN363brCCcTPAuBxi95giknySQAoZNWf7yyalPoiNDQZCzVlbKq/lLi1EIHL0wSA4bkgZDcXbNoi+ccfAJrJVhegE4iNKIH/2EZFZKV8Z5Ly29QIu089KfhkN14tjjmG+9SIsBUzvtaEJrqvHJs5J1QwXtMwGtHo59ZrEFIwubVmECVj2NVT2ayMKDO9I6Ot3UI856p1pQiiSnzcBfrFORxW7guwQhLsyR/32t311uNkFilUiYB6mphQB5r0duMxfdUQay8SLZ5ldx5wjbCFyi96lZlG9YWDLDunELunu8xLVs3Bgoug== 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=DJH8xh7Zu9m7tWjgSU5tGNWKgbIzKqpsoiVAso/5kQU=; b=P2CyehgpDPguFHV9tymwdLCM1u0/pJNAFfZZcCToBVQUF0+vEr31wFA/6CNWKM9ciVWnLPiB1Icbj8CUDXvpM9CbSc4f9AqBsinpfs1+71V21bxOkF8cod8y5Y4njXnlFpjmmhjkK1MvZgDOHKsV7YramqHK9myt+iESJUzJ8PI= 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 DU2PR04MB8614.eurprd04.prod.outlook.com (2603:10a6:10:2d9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Wed, 25 Aug 2021 07:18:48 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%8]) with mapi id 15.20.4436.025; Wed, 25 Aug 2021 07:18:48 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Wed, 25 Aug 2021 12:44:57 +0530 Message-Id: <20210825071510.7913-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210825071510.7913-1-hemant.agrawal@nxp.com> References: <20210812071244.28799-1-hemant.agrawal@nxp.com> <20210825071510.7913-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0126.apcprd01.prod.exchangelabs.com (2603:1096:4:40::30) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dpdk-xeon.ap.freescale.net (92.120.0.67) by SG2PR01CA0126.apcprd01.prod.exchangelabs.com (2603:1096:4:40::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Wed, 25 Aug 2021 07:18:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2536a8a0-cf65-471e-8d51-08d96798952b X-MS-TrafficTypeDiagnostic: DU2PR04MB8614: 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: 5VkBODdFuCYyYq1a+IRRk5kBw75qIn11P5urihVPPrGY+PPCG3cKb/3PNYzfH1qnXidui9s+M8QhuNwxqG5tDudWF6lRDFyluA9rUF/bhfTy9I/VoWh5zAv10qvQDZmtk7NBOuv+CJn3vzidRDyaJWTAobWh8BM0oTcFMcmGdl6/1YfYnRt2eNceAXQeGSYaAUKOGVOeI6fVMvbLvCa2aJ97y1/d0hPT5J4uNfrB9K+OgMK9yKnBevffr5kL8I4axW/Kr3ujifWFUl4mPLFuZwnhLx6TC8WGAVJe8vZjb2ux+xX/eqhLdcXHLAIsVrdCjCzT1EG9x/wxonX31tK0FqF58nUsdf5LoapDAePgEJt5CPCEaJTt6v8ocrIl9/ZG2s6YOpdTxXQLUJOVqKZJeiPghkoXlI1bEZv+LQe9laerD7AZ43SySXWGo3E8epxnbg/awlXg04/7aPbElb+YDatQMLU1Di/xorikWABemzmsQdX4Wa+EajK1zwIxtRSud+w1ULjzZ30OXuVwQhGQQBKR+zZzCRrs85l/9B0CkZhNKtk2miWMrxkM4SnmxP7Xu0/J/cEWOHVD5ZgEYSzLPGT+wfWjoaFmMwXYvPthk/JuoQlkb4O9jtC5BvFPvUwp7tNQUZr9BBVW73ZhlomXLGMnhMOwvIfbxAcwTbW/Pihi3DeIxAf7xcNvZ96orz96dUHidd/ORZWNK1yOCvJKMA== 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)(136003)(376002)(366004)(346002)(396003)(39860400002)(186003)(83380400001)(6512007)(66476007)(66556008)(4326008)(86362001)(38100700002)(38350700002)(36756003)(316002)(6506007)(66946007)(1076003)(8676002)(26005)(2906002)(52116002)(2616005)(956004)(6666004)(5660300002)(44832011)(478600001)(8936002)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zg0ZKIqh44eJG/WY8HIf8W3/PddAmphveUjpmC+oqowcZ2f6cfI+qOzTL3uW?= =?us-ascii?Q?FKZ6i3YzfHODr9dXmBykXs4LpL3eT7/TxeL6yZr4XfIX01dDVlPoLhCE1Ur3?= =?us-ascii?Q?igLhNFxBQf/Dpe760O/5zZ/3lJ8JgqQltKTHxg9PluOA7duwD6pbC2L1lpAR?= =?us-ascii?Q?4I9j6+PR1qJ28rnYZ5W1+WEiLtKiiB2FNCwvDCJnASBE+o5lbOXMpRzbVBRh?= =?us-ascii?Q?f+QltpZJp5srG+A3U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Oj+RjQPFquUpSjZlrJbCox2o1Eq3JtNKwsTGNK7J6TIdBvTXkH/TlLEsEp5c?= =?us-ascii?Q?QVyum9BUbacUASChnC9j4ZCwm/ls+Kv78UMrcdgX6f0CN/ZmUbOunPszeRQ/?= =?us-ascii?Q?ZLf5Tt3vwhuLZAI/cXwL2kg7Gigeqf0LTGUZf2YxvsJYcuaNZHdhCRcVV2bi?= =?us-ascii?Q?DYBBDjxVh+jW7KuhYm48scTu?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2536a8a0-cf65-471e-8d51-08d96798952b X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 07:18:48.7210 (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: eQbrHE4zlxAFub0sF+eHFs4aIYcc0BTVieOSmg/OvdqLTNw3irkqLyfjg+WCNG9nm23ODA2hiwpblIrszGom8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8614 Subject: [dpdk-dev] [PATCH 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 --- 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; return 1; } /* data spread across segments */ vec[0].len = seglen; left = len - seglen; + vec[0].tot_len = mb->buf_len; for (i = 1, nseg = mb->next; nseg != NULL; nseg = nseg->next, i++) { vec[i].base = rte_pktmbuf_mtod(nseg, void *); @@ -995,6 +999,7 @@ 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; left = 0; break; } @@ -1002,6 +1007,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_ASSERT(left == 0); -- 2.17.1