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 C6DF8A0C52; Thu, 12 Aug 2021 09:16:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 04B1B41202; Thu, 12 Aug 2021 09:16:11 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80084.outbound.protection.outlook.com [40.107.8.84]) by mails.dpdk.org (Postfix) with ESMTP id 76A7541200 for ; Thu, 12 Aug 2021 09:16:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ew1PU4bQ3ECcht084rq3i2Yor+LkyJXJs2Nj+H5n74dzQbjv8TmdHZpWpdzLl5IiyuZtg0/PurF1LDAt8OCYalv94WMErQHf7+R4S5Fg+A5LB2IKKlpAagu8lZjsZI/f3mkjICNi4veTAye9BkQHUUJYq6F93YThUIUCXjqzTO9JyA7q0p+hd63vq2w5m+RMmuoCM+FPez0yF+ituAcymwk8X+D0uztx7TOdp/qPR3eoW0kHxuaTAY1+jsc0vuKwTo1JiB+TiTqJ3uJhXWtvgIYOLD3W7vhnERyX1bmybqn9sALleFvNzI5ctF4f2az/sopkekNhXDQe0VOl+J164A== 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=m2eNvVAe5+cyYe75avwGcCnv1YC+D7RHKnwYTpq+P6iZ16Qk6NdFibQda8SdOHX6XhWz2BGV41a4DbPXSlgygVxqyAgCADCxX6n9KUGg1pkjQvfEFKqUrTfich4LG2F3rVbs8GAEJfTfMj8U9XapK63VqSidTt3rzvYknyXlE9cU28rAC+4Tor2e8nL8EIQ59fPZuwviKcmTaa793nxTuMo1yReDCJJ/ObJBiyRYmm1gANrIwi2A81bLvKbHNHKHlrbVWBZFEDEsyy94VPxctv2Nid/CPHn0lJnkprq/0LPC3f/DsIphS+CCQs9wQB0rwYHv1Nm4B/QEmQLfxhy28g== 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=YYgyhoPh+Rq6lOSIZqJBZXSqUk046CaGr4vU68/CpBMyRUKiqVNpl8nGPKJxKvsAxF8Hda8OxrAbTkCDQ631kbUTm0UTOstJHMm4wKbl9MmnGuM8Jg2FxsP+n9G0OQltX9GeZLGIksbZglQgGuCDydF72g/5mTIDdnjQaH/qQ6A= 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 DU2PR04MB8518.eurprd04.prod.outlook.com (2603:10a6:10:2d1::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Thu, 12 Aug 2021 07:16:07 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::2590:514a:df1f:a793%9]) with mapi id 15.20.4415.016; Thu, 12 Aug 2021 07:16:07 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: Gagandeep Singh Date: Thu, 12 Aug 2021 12:42:30 +0530 Message-Id: <20210812071244.28799-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210812071244.28799-1-hemant.agrawal@nxp.com> References: <20210812071244.28799-1-hemant.agrawal@nxp.com> Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0105.apcprd02.prod.outlook.com (2603:1096:4:92::21) 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 SG2PR02CA0105.apcprd02.prod.outlook.com (2603:1096:4:92::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Thu, 12 Aug 2021 07:16:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93149790-e551-4da3-1522-08d95d610da3 X-MS-TrafficTypeDiagnostic: DU2PR04MB8518: 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: KHaljBlIGxY85r1iXfQHGSHNtIrE3d34zpPVnLZCxM1EnnaoOozAd4smlyDRJplyVzIypxcuGw/e2BeSHrLA+PbsogxQWFH+0fO4UU41d3maeaHqqsZTpINGCPKBsGd6T/9qgxzGgQgddUnlpAYevAWD2j+CdFymM+gFss9D2ICn+ZFyHgw0uj3+rzrZbZ9r92RXaSd/x5RRfXu4C9LxIIC6V4dhA/dhJLiOmeP9VKeWnL77keFTtSdOTX9gYD3EPWQT2JxDiufeZmr6vhnJDqCQmzNKUdLldRhutlmwuko2UVxC412wMMq3DMZR7ORxAmiIpxfCTUfs/BReaqq4VqtlwnFWzA7+Y3LRjEvTolbM5exz9SfYC3ZufLuUn1asXwPw2ofO9K0zHkBHaTpmYxxh+/KHE3Ki2I3jM9db7rTCyxP6FdLwyF1jKbWUGy6IZdpYMCATcT3dBHJeZkna9UhiQ/Gw5Tw+ztddHEB0cR5deoQ6mKoXuPmBw5Y+GAOZdgZqAkJWnse2xngc3vsCCyCeL15su99fskWuTvRrc+8vH6Vacg6eFfb9T5FkEA/KJDrlPwf58P0xcb/wQBkNfUCTPqlR5tzKvSyGdLlIrii7JOnnMLlA+ski/pVTnfXfr6HzU+9TKBOBE8dIxTntjJBYW4eLX2FNaY7IVQAvkvthMLlsnxO6sMoZItFnwiAf+B1GFA9WUaYsol6v/gKcqA== 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)(376002)(346002)(136003)(396003)(39860400002)(366004)(5660300002)(6512007)(1076003)(52116002)(38350700002)(38100700002)(36756003)(956004)(2616005)(478600001)(44832011)(6666004)(83380400001)(4326008)(6486002)(316002)(66476007)(66946007)(6506007)(2906002)(186003)(66556008)(8676002)(26005)(8936002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?gIWPQiS2ZjLbGBbHGJdZX5So8Ov4ZGzg8bSJkRdvmMaec97BBbvoPpSiZuQX?= =?us-ascii?Q?qg1VOK39NkEUZdZDgKvjYJa8m9erzQEufduBkbfCWzkr1h5pBcBLHcWZnc2d?= =?us-ascii?Q?D8iOYSvC+jUsnbz6f7wJJTAYdJ5QVTZefVwkaPvTDLyKwFKsbhQmO5upaLtx?= =?us-ascii?Q?OZLKd268DT0fcqb0bmax+WhOFOv4gQPIsaoaMPnzGq4gEvjfmtrQqijlqsus?= =?us-ascii?Q?Utl3U+9eUJAi3Uc3mMvzge9DPpsJNyHZI9LIi+m7T093Dnu9rJD1WliwPIYf?= =?us-ascii?Q?f2Oi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?us-ascii?Q?QuNff4VZp7K9u7hWNzRRgaHe72wIW3tUtVOBN+HtBL4Yp6J1QJVsC++KDDsI?= =?us-ascii?Q?bcUs4b39W1SGy9ROcs+mcjcIryI7m7UG6TuWpWN20iRGiG0K5KDuXoaThF6j?= =?us-ascii?Q?Kex5U6NvtBkfFXf4lnbK7P5W?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93149790-e551-4da3-1522-08d95d610da3 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2021 07:16:07.3609 (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: X9EUtMTS5IIXRKTY926lgVF51IkK9j7s+24Sr6vLS7CCdXyzbsb14AN0hUwni3iTpzNnOLKlhb142M+6zSa9tA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8518 Subject: [dpdk-dev] [RFC 02/16] 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