From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BB1D9A0524; Sat, 4 Jul 2020 20:16:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 093581DBCD; Sat, 4 Jul 2020 20:16:13 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2071.outbound.protection.outlook.com [40.107.22.71]) by dpdk.org (Postfix) with ESMTP id F0B9A1DBA6 for ; Sat, 4 Jul 2020 20:16:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nxsxwgJVy8jE8bCY3Dz0dRW2E1pZG64DAXC2KLrpIThrdwku0ChQt8U3Cy5gvMW3TDq8m9CFVpeV+lt41kLANPisrRMEQ5WLQp1+6NLkZ8MzrbpDlMBxovveQ2PQmxNxFb1+adpnyYjxTchk5p7QQduLp+mD9jjxFAATNXCaMTCTypwojols/RC7cM3LPJn86MY+WisW7UH6tcVzCncyD3lw5o0Vc4SH3vZ94dvlH0OqvuSa99ndExZfAp1a0hib5smlPlO71CD02DI4egwQQyjkQz35cNLz67Tf1ze9ia5ENBgU79LL8E5W2P9MO6D0k1Q986Rp181btsQTvZQkog== 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=J3Yhy9dIhdYdUE+22oTOc+nWvLJOBMaMe0ick5ZI26Y=; b=StC6Wwmp3tcwyIclsrgfVpFnxFrnnJaxQxDIuDm85mKXsXWtn3zJ2orEQkwnGtBtvwHhb4B0UrR6g997nNYTcwDnev8+YqObN6DDceuEPVcyfCA4cT8wnv62t6fvzLdDJGHUulBoAnQSvsAyttm3VimpkVlt0cmun7+v6akyYslK+dWzcsgq4oz9GBcKu8yRd2Hv0+f1tTxJK0toO/8XCwTtY+Uaysx/SwJ7RJwx9qmfzvj59cxj4O+RHs4navEXtU/rphIWoZfOumh+SObY9Sm0eR2qnW6wx+EgU8mr3B0awJyodzQz2ZauI14DRWCrgJxFaRiJAa8/GG+mDiJ/2g== 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=J3Yhy9dIhdYdUE+22oTOc+nWvLJOBMaMe0ick5ZI26Y=; b=ihsO5muZ0V1pUaT+2ASaOngq9MdGr+2N5gG9RmOzwqM31AE/o+5qzBh8ekf4PJJwLqtXZ77N3CPx4hCLW06SO8zDnt0wC9QRP6+zAfM2Am4wntkul89H8kx6f+Pp67rymCZ4vxDEM5fdy88gYT+99G4KT2A96ZP7+cT1mnWHMQw= Received: from VI1PR04MB3168.eurprd04.prod.outlook.com (2603:10a6:802:6::10) by VI1PR0402MB3568.eurprd04.prod.outlook.com (2603:10a6:803:f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.29; Sat, 4 Jul 2020 18:16:09 +0000 Received: from VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::b077:1fe4:d352:b464]) by VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::b077:1fe4:d352:b464%7]) with mapi id 15.20.3153.028; Sat, 4 Jul 2020 18:16:09 +0000 From: Akhil Goyal To: Fan Zhang , "dev@dpdk.org" , "anoobj@marvell.com" , "asomalap@amd.com" , "ruifeng.wang@arm.com" , Nagadheeraj Rottela , Michael Shamis , Ankur Dwivedi , Jay Zhou , Pablo de Lara CC: "fiona.trahe@intel.com" , Piotr Bronowski , "konstantin.ananyev@intel.com" , Thomas Monjalon Thread-Topic: [dpdk-dev v4 1/4] cryptodev: add symmetric crypto data-path APIs Thread-Index: AQHWUThwVrYw4m7l8kKR81UTdxPeb6j3tmWg Date: Sat, 4 Jul 2020 18:16:09 +0000 Message-ID: References: <20200703110923.26452-1-roy.fan.zhang@intel.com> <20200703124942.29171-1-roy.fan.zhang@intel.com> <20200703124942.29171-2-roy.fan.zhang@intel.com> In-Reply-To: <20200703124942.29171-2-roy.fan.zhang@intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [45.118.167.83] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ccc51c40-9712-4f1e-f179-08d820465398 x-ms-traffictypediagnostic: VI1PR0402MB3568: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0454444834 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: j41ggni4vN7XRnaSw1xpOZocUm4Io80ucoGZ7NlSX6LdS0wPjJHoiniBevGOlP8s4Zk9n1C5RgBFqXD2SKycPuwon/RmQhotvSzEmUK+sSITMSP0XkiUasnsFsEZBv1lfNjQbm2qbvW8jFh4Iiwv050XYKoOvhkxh9zw3U+bQAWtYQASNkjAv/0hVsddz/Npd+zkHX2uUI5crGuSpCrdSyIrz+6pK6Y3lluzeEBT6F7eZhoDjSpEZZkGvAmlGRkfYO4Fp+bgi1N3Jl+fPmZwxXT+iMsgydAgZvaFMa4Usmby7vkUhbU8EbB0bimTVkgdqr/9uBCVIsnoztxjX3oNZcotZGe1YJZR+aElcj5DldiNdlZVHk/mFM5w2ZOVLx4I x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3168.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(346002)(136003)(376002)(39850400004)(396003)(186003)(54906003)(8676002)(55016002)(71200400001)(86362001)(52536014)(9686003)(7696005)(6506007)(44832011)(2906002)(316002)(83380400001)(4326008)(110136005)(478600001)(5660300002)(19627235002)(33656002)(66556008)(66476007)(66446008)(26005)(64756008)(8936002)(7416002)(66946007)(76116006)(921003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 2eOdSnbHIRhGGZ/KXufVcnmetPRzDn0nBtya15dL6YC5EVKOFoXLF4wXoJyiiNxZBZlHj70bw634Bn1ieK6NdLq/OU879HEJBNMmmwFrRLJF4Rl8J70RxgF1FlMNCETCtIv75phn02pqyf41WmrmFbfiHx8GBneZq+tUVDVcDfADxJkJZ3HpfK7V6S/pJAcpos2SNjw00uP0p6a57p1XC3uD5r9FL1vqF8UxjXm9ARQAX+BYJB//79VJm1LGnP+u2CKSxoL1BuUtrmbRViPTuBKDt0TdhrQpqYycxNEZBWCI7pW3N0mMHozvoAypCAcR7r/vkseSn+EDnS6Rbv2zElqz1+Kiit7ON+0Gu1+qfOOkr/zNKecXNRjm1eHOWImP658ql//ArPa44ODGPXrdze5gYxrQ6LK7U0TJhPim1GRi7k9hNmtevN1ZxjASmrG8DV40ZU+vb51K9Mhc+QIAwp0YWu3VJhxB8bvPGko0r4k= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3168.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccc51c40-9712-4f1e-f179-08d820465398 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2020 18:16:09.4007 (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: mNknt6myKPCwgvHVoFLFaWsS43rl5a8sWLLPKOw4q4Ic1lOF6+H/Mh1YLWAnAt/Fp9VzSs32BUwIrs5XNK2/+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3568 Subject: Re: [dpdk-dev] [dpdk-dev v4 1/4] cryptodev: add symmetric crypto data-path APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Hi Fan, > + > +/** > + * Asynchronous operation job descriptor. > + * Used by HW crypto devices direct API call that supports such activity > + **/ > +struct rte_crypto_sym_job { > + union { > + /** > + * When RTE_CRYPTO_HW_ENQ_FLAG_IS_SGL bit is set in flags, > sgl > + * field is used as input data. Otherwise data_iova is > + * used. > + **/ > + rte_iova_t data_iova; > + struct rte_crypto_sgl *sgl; > + }; > + union { > + /** > + * Different than cryptodev ops, all ofs and len fields have > + * the unit of bytes (including Snow3G/Kasumi/Zuc. > + **/ > + struct { > + uint32_t cipher_ofs; > + uint32_t cipher_len; > + } cipher_only; > + struct { > + uint32_t auth_ofs; > + uint32_t auth_len; > + rte_iova_t digest_iova; > + } auth_only; > + struct { > + uint32_t aead_ofs; > + uint32_t aead_len; > + rte_iova_t tag_iova; > + uint8_t *aad; > + rte_iova_t aad_iova; > + } aead; > + struct { > + uint32_t cipher_ofs; > + uint32_t cipher_len; > + uint32_t auth_ofs; > + uint32_t auth_len; > + rte_iova_t digest_iova; > + } chain; > + }; > + uint8_t *iv; > + rte_iova_t iv_iova; > +}; NACK, Why do you need this structure definitions again when you have similar ones (the ones used in CPU crypto) available for the same purpose. In case of CPU crypto, there were 2 main requirements - synchronous API instead of enq +deq - raw buffers. Now for this patchset, the requirement is=20 - raw buffers=20 - asynchronous APIs The data structure for raw buffers and crypto related offsets are already d= efined So they should be reused. And I believe with some changes in rte_crypto_op and rte_crypto_sym_op, We can support raw buffers with the same APIs. Instead of m_src and m_dst, raw buffer data structures can be combined in a Union and some of the fields in the rte_crypto_op can be left NULL in case = of raw buffers. > +/* Struct for user to perform HW specific enqueue/dequeue function calls= */ > +struct rte_crypto_hw_ops { > + /* Driver written queue pair data pointer, should NOT be alterred by > + * the user. > + */ > + void *qp; > + /* Function handler to enqueue AEAD job */ > + rte_crypto_hw_enq_cb_fn enqueue_aead; > + /* Function handler to enqueue cipher only job */ > + rte_crypto_hw_enq_cb_fn enqueue_cipher; > + /* Function handler to enqueue auth only job */ > + rte_crypto_hw_enq_cb_fn enqueue_auth; > + /* Function handler to enqueue cipher + hash chaining job */ > + rte_crypto_hw_enq_cb_fn enqueue_chain; > + /* Function handler to query processed jobs */ > + rte_crypto_hw_query_processed query_processed; > + /* Function handler to dequeue one job and return opaque data stored > */ > + rte_crypto_hw_deq_one_cb_fn dequeue_one; > + /* Function handler to dequeue many jobs */ > + rte_crypto_hw_deq_many_cb_fn dequeue_many; > + /* Reserved */ > + void *reserved[8]; > +}; Why do we need such callbacks in the library? These should be inside the drivers, or else we do the same for Legacy case as well. The pain of finding the correct enq function for=20 Appropriate crypto operation is already handled by all the drivers And we can reuse that or else we modify it there as well. We should not add a lot of data paths for the user, otherwise the APIs will become centric to a particular vendor and it will be very difficu= lt For the user to migrate from one vendor to another and would defeat the Purpose of DPDK which provide uniform abstraction layer for all the hardwar= e Vendors. Adding other vendors to comment. Regards, Akhil