From patchwork Tue Sep 7 07:59:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 507504 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp4012058jai; Tue, 7 Sep 2021 01:04:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqkn/a7Cw6tw7hmsabsXAzCMYcvmvyEabe+MjHzXjgjg0iu/mASlI5zVXVmj2pFBZqDHM9 X-Received: by 2002:a17:906:b183:: with SMTP id w3mr17104244ejy.394.1631001858684; Tue, 07 Sep 2021 01:04:18 -0700 (PDT) Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id b17si10121512edv.518.2021.09.07.01.04.18; Tue, 07 Sep 2021 01:04:18 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector2 header.b=Zn7eo+25; arc=fail (signature failed); spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A56E941145; Tue, 7 Sep 2021 10:03:55 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2080.outbound.protection.outlook.com [40.107.21.80]) by mails.dpdk.org (Postfix) with ESMTP id 8421A4114C for ; Tue, 7 Sep 2021 10:03:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f62JmamteUkI1RA66Kw0e+I6KH+de+aQH+3/ecaaFusJGTUADC5ZQ9Q5nTxMLawSknfGp0MW8gNcVanP+i7O4riVOowpCjQX8xr0rgbkoAZ/H+3xrt7gDZkUE/0sqFWA6phuS6g6z2KVCAC8I0mSZu5JY7upo2GtNhr/vrBqSxjqOd6JgPYxeljdjTKQfvqB7OteFeRuY7mZQmAW9cxyr3mas/AssDXKEbEX7bSkPeoAGdFIh7hj9X7Gx/Fu8r9HBLPPDf2N5kwP8hDop5K4BLjEoN2sqh/jkjYXjfmsqk9BLh27dO/UD3Ueg3QrdgHKqE/t43fXGWGUYWsCR/TWdQ== 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=OJhjpqS5isWA1V0dAOumUskQMlOSWfQ1VOyUDLYsNFI=; b=mZW8NclmQPYdWPIBNJ+THPEJI6yDg/vc3igiGMeo0HFgjZMH5yLnEWWvH+uS1eLNiKsZXtUf90z1bE893VBjkX6XuoeKFSnWG2Ysucmfq7ApT1+c20ehsG1zoTZdEMMxJykZXfmWlhHTTgtNtmfbc0Cg4Y/+l9LCAAi7jVf5fvrRiUrXvZiE1V8MhIXeQHebPiaLTYdaNfF481IxuGmouVKADTB1N33bNHS6ubgkw07ntWcl7jPxuAvQ77DIHZoIwx5soKCPTWRpAbMubV+HUXEhTtShT2bgev6r1F76lV2Ula6+JJm3ME+S3L8hDe0Mp5L+ZuqR4N+c0ZuS5uGGFQ== 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=OJhjpqS5isWA1V0dAOumUskQMlOSWfQ1VOyUDLYsNFI=; b=Zn7eo+259XFckAeZfRx6a4QSA0+Zgo7WfKOerRWeIJCs4ooYyyc2POT8mHq8htV9McGfyBedr/sge8QJ9UMJs7aroD2i8sc57IJZWIOaaJhzUzd47qV/OzD9IuJOXew+5bt/2bpCWdI2ai0RpJFte2Qt+b+bNawT2WoaQoXM++s= 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 DU2PR04MB8709.eurprd04.prod.outlook.com (2603:10a6:10:2dc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 08:03:52 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::945d:e362:712d:1b80%4]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 08:03:52 +0000 From: Hemant Agrawal To: dev@dpdk.org, gakhil@marvell.com Cc: konstantin.ananyev@intel.com, roy.fan.zhang@intel.com, Gagandeep Singh Date: Tue, 7 Sep 2021 13:29:44 +0530 Message-Id: <20210907075957.28848-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210907075957.28848-1-hemant.agrawal@nxp.com> References: <20210825071510.7913-1-hemant.agrawal@nxp.com> <20210907075957.28848-1-hemant.agrawal@nxp.com> X-ClientProxiedBy: SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) 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 SG2PR02CA0068.apcprd02.prod.outlook.com (2603:1096:4:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Tue, 7 Sep 2021 08:03:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19e5229b-7b23-4e87-9963-08d971d607e5 X-MS-TrafficTypeDiagnostic: DU2PR04MB8709: 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: nPBtReWSC+uMgKHexjZRf7MVvXimXh+H1o28gP3IrygkDcg73ecgFZfH9Y2qKRz5pmuul9dnLXnrpY4VBODr2dFlrKPGr+pOQtHgOuuxvBi5+k64ffC7bHyrs0MvE0wItQzNGGY2PjiYXAkZzyM7y9N4bXtjF+9hyH1yCyyp19gEnjbc++i8tXBImQwaasGDVusH8vRPZa2nvsQ8wsMzQVQmH3/i5ZnwgEk6bLi1AvA2BFHyrtVTa9M9N9FfkyhzhVh1YYDVPN6w6x2u93r8RTl8KTjyKrsj+4YdCITEZSLLpvpWNo22qJ5M13R6dicNnfTXV7XNvlrxINSaqMX6HXDGHpLkVIeR/JTk1f1n++sbImrVjXFrf+MuFdSgUawUlORAJk3yIt6olmcYXO6X6Pu1K1HkjMhkH4Who+9bk5Gl1C0/j8j60AMtszY44l0KelJ3jc3brd+S9u6BO0IBkg1ZudlD7pllQgIVfCrupt0SUiKPm5YZLmTvIR+KFKFzhB6ov3msX6RO3xkfBy4XX0bxrt+ScpkCLtbu6Zf84oTT0R/gBWM6b4XhUPBcgOCDkv0sCIgKFd50aro/+GFMM4MvEWXHxO8Z1uqOGrBN0Y3HdizyzlrF0Of3t3I5ic7frQmk+TiE37hqAktwpiTsYbkJy9zz780488VFdu2mZC9HA7v7oJuevUASJRKFLW60elZ92Kkk0h7TqZUIXPlbHg== 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)(39860400002)(366004)(396003)(346002)(376002)(2906002)(956004)(2616005)(86362001)(83380400001)(478600001)(316002)(6512007)(4326008)(52116002)(1076003)(5660300002)(38100700002)(6666004)(38350700002)(36756003)(186003)(26005)(44832011)(66946007)(6486002)(6506007)(66476007)(66556008)(8936002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mqDPQxYsrnfs9o2dliNzEXRdt2YvWwYO6+RFM3kvwaYQ79QT7TDf2J7oK78A3l5K3y2PRVH3lJvQpJ8d2EzJ+b3QpwrsphBBDFYDcf8d812vlfVkJun7CAjCEikhTJ1a+GecT9O+picyPN+tiJcdoEU24Tik0IkZg8F+1uqsETtH8qi+FwiaqmP9hGxkOYnLvYGv9SVT1wmh/28btp5yq3FTMoOuN8AP+662hZWhIjFugYyjv5lzuLjmnHsP/8GQ6vIQC2ntOBjFfGcuOd9JhCC5lP72/lEAvuvF4gus0ydowfw1qwL8XWzwBlWaxaluj4hk1MlfaF+kXjDzZws7TvAGZrsRcUYB9UTzCsJE8R+8n1vMcuBELDRGC5qMMmT6oSbUlTr7JOj+P+MgcDc7JJb5ySjghWeprUnIkIcbFF/PY8x2yV0YBf9es/mtrQIqKqGUGQ7KpsFU8rL1FiT9ev2/EZYuivR8c5pqBgay3A2fWQEcmNo1YSiC8Zudf+uQErqkvJCZPmU5nV7MVlzv7LJy3DOkc/tTbLh69WbfAvsGvpwCak/7+37ts70JEz92aky8uNAzp61VN1DT6J0Cua3Bgm0SiGkbLlE473mvq7oXthAT4A+jRZBFGxo3Q5/rdk7RY0ml1yqcX7mPiPBkd+2S2zFtbB9O4ycNxJxYx8yV2HIEjs3aV0jwVhBavLIkz6n7izTtVHhvU9nfP41Z5QC1Db971jbGW/ZaHJCHEC0lBTxYFBJOLeQrk10Nmw8tfDXavTNmA49kB/0SMZ9CXwSj6Rn8Rf6/qKuYNA6AHROkhXRSTH3KT3zqnfkYLxq5qaAWoAhTuk2PF0l77a6yyrK5mkUefkaVuT1eKcfY+tyUvNURW2cO3QKDc11H5TUxQSHlpvQNfgJqFZDz8LY0tIcqitwoM88zuCsjzf9iaz1ByNPgLk/JmI6UYi9ZIY7rgfZIT7cgf1OgvHmybD2DFE0LfF/VmGyyxccZGFJupedtd4xIJw2S5uvd1+DEPljJGFAkFOUJ2EzqYqstFInsxxA2p3kPV1QwxHoxmqCCuTt2fj3oMwRp1uFESbip9snjnzdw0oOFSQ2kgAwEKVK6T+89TInR0WYsKCVOaotg5pmCTj31+eOnj+YXrSUCpvp4EysLdp9KVWTrYotRmSFVtWWThrIl6XKM3TVRgNMQOOj7CKpvhyzsJSGs1IuONBWx6OBkFw2ryGqAoZTg1G2IT5nYSPaxIve00QZyE69kRXW0Yd1pN1qSI3icv7MtNtsYEm5fLbZRfOEp5yCPcAlnHx/2gyWwuY6/3Yb3tjnp9u3XhtW9bHGTH4nd7ZL7GK/P X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19e5229b-7b23-4e87-9963-08d971d607e5 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 08:03:52.1731 (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: rniDgrdewpyOklLnIbn/feh30pkiRqLvsFL5wu+8sY18yvRCHRDw7nG+rL8EtSe0IY5QIMKHknZbvswC3UYGhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8709 Subject: [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: , 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 --- lib/cryptodev/rte_crypto_sym.h | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.17.1 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);