get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/91298/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 91298,
    "url": "https://patches.dpdk.org/api/patches/91298/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210413181907.3828454-1-thomas@monjalon.net/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210413181907.3828454-1-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210413181907.3828454-1-thomas@monjalon.net",
    "date": "2021-04-13T18:19:07",
    "name": "[v3] cryptodev: support multiple cipher data-units",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "740585c111aa47839b4fe7e94de8211ae9af884b",
    "submitter": {
        "id": 685,
        "url": "https://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "delegate": {
        "id": 6690,
        "url": "https://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210413181907.3828454-1-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 16344,
            "url": "https://patches.dpdk.org/api/series/16344/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16344",
            "date": "2021-04-13T18:19:07",
            "name": "[v3] cryptodev: support multiple cipher data-units",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/16344/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/91298/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/91298/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 24FBCA0524;\n\tTue, 13 Apr 2021 20:19:23 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0CBCA160AC1;\n\tTue, 13 Apr 2021 20:19:23 +0200 (CEST)",
            "from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com\n [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 3DCC216083D\n for <dev@dpdk.org>; Tue, 13 Apr 2021 20:19:21 +0200 (CEST)",
            "from compute2.internal (compute2.nyi.internal [10.202.2.42])\n by mailout.nyi.internal (Postfix) with ESMTP id 977C85C0158;\n Tue, 13 Apr 2021 14:19:20 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n by compute2.internal (MEProxy); Tue, 13 Apr 2021 14:19:20 -0400",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n by mail.messagingengine.com (Postfix) with ESMTPA id ACC971080067;\n Tue, 13 Apr 2021 14:19:18 -0400 (EDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding; s=fm3; bh=ohzE2FLhXlygI\n PQpXeZvT7vas2uMXOcz9KSn4MONL08=; b=0EB7swX7V81HK1PU3WRsgiwqg0ENa\n EzZ7W9o9PXV8XmCmmGgEbvdE0PkSV5oQEPNLKXibRxMt/v83Qnkio6MOOqNoDH+y\n ay+zbhweykfLRWLMg/s9AcqOUMMNFDGIH0et3+sqO6xKJqj9PvGgJKGILjXS00SN\n uuMrQpfdW+JBqQGNpfnWlCIUV2d+yPyOntICWhoMVliqcx969DWTkAwNaW70LzID\n 5EzlKyXi3G2SeCICS2+QiJrW+3rKE2HAdeDSqsBbZss+ehka1vwHbN4ZQI00DEAR\n deeH9lpv6MEp1YYYwUDAtDUbCiP+sM/D47I+0hMQa1GYMtEl/3aN+Mm9w==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:date:from\n :in-reply-to:message-id:mime-version:references:subject:to\n :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n fm2; bh=ohzE2FLhXlygIPQpXeZvT7vas2uMXOcz9KSn4MONL08=; b=FsECXgv8\n 1AuWYYLDtopZX5PJlEsN+kn+kbf+zZADBCXHb4uVhfQVk6AUfpNJ2CFGguakEBhQ\n D2wym3I/V6qY7wY2tIJVXxszdNv+dMkfPxhnAVb7cTeYs3BlZuzKKlRXx99Nh9V9\n M/+yJZj9FaLf/Es/Quk7X0OquxF+AjzjzhEXFe/fYxv/eA/gjUh0cCEDI6raYkKk\n RPKtCxsQ2Z3aIs3r70QAjcD1+4J6KmJqzxvo8I2O6DHgUwkEsC8LL9r3+1L2iMVO\n gcoVgrzHsJHlTietw9Q844KG0ZUXxkoAt3wNT3unkf87P33UoCsU9fAmtVktX+wE\n t2IQEQ+Bb1i8Tg=="
        ],
        "X-ME-Sender": "<xms:p-B1YGzGgyW2MZnfz-oMH5TLP82kpUMU2DY5f7TTLOQUsKHwR2N5UA>\n <xme:p-B1YCSg5jjFbNNcQ4uhUGsfXE5cPuiOxrK7DAsTXSrWIon4FopAabqd4a-qbdygh\n -GmHMgFrVrVjzJctQ>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgeduledrudekledguddvfecutefuodetggdotefrod\n ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh\n necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd\n enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm\n rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc\n ggtffrrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedt\n gfeutdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh\n fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr\n lhhonhdrnhgvth",
        "X-ME-Proxy": "<xmx:p-B1YIXfoj4byFVZSrJOPG-9LcWMWOdqkka76zGvaY68DjqJ8s_T-g>\n <xmx:p-B1YMgVqqkb9zU86K1GrClVTg6Jh7E9zmXcLjnwQru2DH2lpuvhIg>\n <xmx:p-B1YIC6oM2icpQwmPWmKBkCP4E6eXGwIIzBwJYnsCbKZm6uAK9cOw>\n <xmx:qOB1YH4cmCi-UMp9B_1xni4aSIiyzABHgdfnXYxTNrxDy138Abc_Hg>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "dev@dpdk.org",
        "Cc": "akhil.goyal@nxp.com, arkadiuszx.kusztal@intel.com, anoobj@marvell.com,\n Matan Azrad <matan@nvidia.com>, Ray Kinsella <mdr@ashroe.eu>,\n Neil Horman <nhorman@tuxdriver.com>,\n Declan Doherty <declan.doherty@intel.com>",
        "Date": "Tue, 13 Apr 2021 20:19:07 +0200",
        "Message-Id": "<20210413181907.3828454-1-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<1612449252-395208-1-git-send-email-matan@nvidia.com>",
        "References": "<1612449252-395208-1-git-send-email-matan@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3] cryptodev: support multiple cipher data-units",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Matan Azrad <matan@nvidia.com>\n\nIn cryptography, a block cipher is a deterministic algorithm operating\non fixed-length groups of bits, called blocks.\n\nA block cipher consists of two paired algorithms, one for encryption\nand the other for decryption. Both algorithms accept two inputs:\nan input block of size n bits and a key of size k bits; and both yield\nan n-bit output block. The decryption algorithm is defined to be the\ninverse function of the encryption.\n\nFor AES standard the block size is 16 bytes.\nFor AES in XTS mode, the data to be encrypted\\decrypted does not have to\nbe multiple of 16B size, the unit of data is called data-unit.\nThe data-unit size can be any size in range [16B, 2^24B], so, in this\ncase, a data stream is divided into N amount of equal data-units and\nmust be encrypted\\decrypted in the same data-unit resolution.\n\nFor ABI compatibility reason, the size is limited to 64K (16-bit field).\nThe new field dataunit_len is inserted in a struct padding hole,\nwhich is only 2 bytes long in 32-bit build.\nIt could be extended later during an ABI-breakage window.\n\nThe current cryptodev API doesn't allow the user to select a specific\ndata-unit length supported by the devices.\nIn addition, there is no definition how the IV is detected per data-unit\nwhen single operation includes more than one data-unit.\n\nThat causes applications to use single operation per data-unit even though\nall the data is continuous in memory what reduces datapath performance.\n\nAdd a new feature flag to support multiple data-unit sizes, called\nRTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS.\nAdd a new field in cipher capability, called dataunit_set,\nwhere the devices can report the range of the supported data-unit sizes.\nAdd a new cipher transformation field, called dataunit_len, where the user\ncan select the data-unit length for all the operations.\n\nAll the new fields do not change the size of their structures,\nby filling some struct padding holes.\nThey are added as exceptions in the ABI check file libabigail.abignore.\n\nUsing a bitmap to report the supported data-unit sizes capability allows\nthe devices to report a range simply as same as the user to read it\nsimply. also, thus sizes are usually common and probably will be shared\namong different devices.\n\nSigned-off-by: Matan Azrad <matan@nvidia.com>\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\nv1:\n- Use data-unit term instead of block.\n- Update cipher length description in OP.\n- Improve descriptions on xform and capability.\n- Improve commit log.\n\nv2:\n- Fix typo: MULITPLE->MULTIPLE.\n- Remain only planned supported sizes for data-unit capability.\n\nv3:\n- Improve some comments.\n- Fix ABI breakage.\n\nNote: the suppression rules work in libabigail for this patch,\nbut not sure it is really considering the offsets defined in the file.\n\n---\n devtools/libabigail.abignore               | 12 +++++++++++-\n doc/guides/cryptodevs/features/default.ini |  1 +\n doc/guides/cryptodevs/overview.rst         |  3 +++\n doc/guides/rel_notes/release_21_05.rst     |  6 ++++++\n lib/librte_cryptodev/rte_crypto_sym.h      | 18 ++++++++++++++++--\n lib/librte_cryptodev/rte_cryptodev.c       |  2 ++\n lib/librte_cryptodev/rte_cryptodev.h       | 16 ++++++++++++++++\n 7 files changed, 55 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore\nindex 6c0b38984e..bce940f2df 100644\n--- a/devtools/libabigail.abignore\n+++ b/devtools/libabigail.abignore\n@@ -19,4 +19,14 @@\n ; Ignore fields inserted in cacheline boundary of rte_cryptodev\n [suppress_type]\n         name = rte_cryptodev\n-        has_data_member_inserted_between = {offset_after(attached), end}\n\\ No newline at end of file\n+        has_data_member_inserted_between = {offset_after(attached), end}\n+\n+; Ignore fields inserted in union boundary of rte_cryptodev_symmetric_capability\n+[suppress_type]\n+        name = rte_cryptodev_symmetric_capability\n+        has_data_member_inserted_between = {offset_after(cipher.iv_size), end}\n+\n+; Ignore fields inserted in middle padding of rte_crypto_cipher_xform\n+[suppress_type]\n+        name = rte_crypto_cipher_xform\n+        has_data_member_inserted_between = {offset_after(key), offset_of(iv)}\ndiff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini\nindex 17b177fc45..978bb30cc1 100644\n--- a/doc/guides/cryptodevs/features/default.ini\n+++ b/doc/guides/cryptodevs/features/default.ini\n@@ -31,6 +31,7 @@ CPU crypto             =\n Symmetric sessionless  =\n Non-Byte aligned data  =\n Sym raw data path API  =\n+Cipher multiple data units =\n \n ;\n ; Supported crypto algorithms of a default crypto driver.\ndiff --git a/doc/guides/cryptodevs/overview.rst b/doc/guides/cryptodevs/overview.rst\nindex e2a1e08ec1..e24e3e1993 100644\n--- a/doc/guides/cryptodevs/overview.rst\n+++ b/doc/guides/cryptodevs/overview.rst\n@@ -46,6 +46,9 @@ Supported Feature Flags\n    - \"Digest encrypted\" feature flag means PMD support hash-cipher cases,\n      where generated digest is appended to and encrypted with the data.\n \n+   - \"CIPHER_MULTIPLE_DATA_UNITS\" feature flag means PMD support operations\n+      on multiple data-units message.\n+\n \n Supported Cipher Algorithms\n ---------------------------\ndiff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst\nindex 9a666b629d..2dc776c35e 100644\n--- a/doc/guides/rel_notes/release_21_05.rst\n+++ b/doc/guides/rel_notes/release_21_05.rst\n@@ -145,6 +145,12 @@ New Features\n \n   * Added support for preferred busy polling.\n \n+* **Added support of multiple data-units in cryptodev API.**\n+\n+  The cryptodev library has been enhanced to allow operations on multiple\n+  data-units for AES-XTS algorithm, the data-unit length should be set in the\n+  transformation. A capability for it was added too.\n+\n * **Updated Mellanox RegEx PMD.**\n \n   * Added support for multi-segments mbuf.\ndiff --git a/lib/librte_cryptodev/rte_crypto_sym.h b/lib/librte_cryptodev/rte_crypto_sym.h\nindex 9d572ec057..ec45714fc3 100644\n--- a/lib/librte_cryptodev/rte_crypto_sym.h\n+++ b/lib/librte_cryptodev/rte_crypto_sym.h\n@@ -222,6 +222,19 @@ struct rte_crypto_cipher_xform {\n \t *  - Each key can be either 128 bits (16 bytes) or 256 bits (32 bytes).\n \t *  - Both keys must have the same size.\n \t **/\n+\n+\tuint16_t dataunit_len;\n+\t/**< When RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS is enabled,\n+\t * this is the data-unit length of the algorithm,\n+\t * otherwise or when the value is 0, use the operation length.\n+\t * The value should be in the range defined by the dataunit_set field\n+\t * in the cipher capability.\n+\t *\n+\t * - For AES-XTS it is the size of data-unit, from IEEE Std 1619-2007.\n+\t * For-each data-unit in the operation, the tweak (IV) value is\n+\t * assigned consecutively starting from the operation assigned IV.\n+\t */\n+\n \tstruct {\n \t\tuint16_t offset;\n \t\t/**< Starting point for Initialisation Vector or Counter,\n@@ -701,9 +714,10 @@ struct rte_crypto_sym_op {\n \t\t\t\t\t /**< The message length, in bytes, of the\n \t\t\t\t\t  * source buffer on which the cryptographic\n \t\t\t\t\t  * operation will be computed.\n+\t\t\t\t\t  * This is also the same as the result length.\n \t\t\t\t\t  * This must be a multiple of the block size\n-\t\t\t\t\t  * if a block cipher is being used. This is\n-\t\t\t\t\t  * also the same as the result length.\n+\t\t\t\t\t  * or a multiple of data-unit length\n+\t\t\t\t\t  * as described in xform.\n \t\t\t\t\t  *\n \t\t\t\t\t  * @note\n \t\t\t\t\t  * For SNOW 3G @ RTE_CRYPTO_AUTH_SNOW3G_UEA2,\ndiff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c\nindex 40f55a3cd0..e02e001325 100644\n--- a/lib/librte_cryptodev/rte_cryptodev.c\n+++ b/lib/librte_cryptodev/rte_cryptodev.c\n@@ -617,6 +617,8 @@ rte_cryptodev_get_feature_name(uint64_t flag)\n \t\treturn \"SYM_SESSIONLESS\";\n \tcase RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA:\n \t\treturn \"NON_BYTE_ALIGNED_DATA\";\n+\tcase RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS:\n+\t\treturn \"CIPHER_MULTIPLE_DATA_UNITS\";\n \tdefault:\n \t\treturn NULL;\n \t}\ndiff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h\nindex ae34f33f69..f6972a7d19 100644\n--- a/lib/librte_cryptodev/rte_cryptodev.h\n+++ b/lib/librte_cryptodev/rte_cryptodev.h\n@@ -95,6 +95,15 @@ struct rte_crypto_param_range {\n \t */\n };\n \n+/**\n+ * Data-unit supported lengths of cipher algorithms.\n+ * A bit can represent any set of data-unit sizes\n+ * (single size, multiple size, range, etc).\n+ */\n+#define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_512_BYTES\t(1 << 0)\n+#define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES\t(1 << 1)\n+#define RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_1M_BYTES\t(1 << 2)\n+\n /**\n  * Symmetric Crypto Capability\n  */\n@@ -127,6 +136,11 @@ struct rte_cryptodev_symmetric_capability {\n \t\t\t/**< cipher key size range */\n \t\t\tstruct rte_crypto_param_range iv_size;\n \t\t\t/**< Initialisation vector data size range */\n+\t\t\tuint32_t dataunit_set;\n+\t\t\t/**<\n+\t\t\t * A bitmap for a set of the supported data-unit lengths.\n+\t\t\t * 0 for any length defined in the algorithm standard.\n+\t\t\t */\n \t\t} cipher;\n \t\t/**< Symmetric Cipher transform capabilities */\n \t\tstruct {\n@@ -461,6 +475,8 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,\n /**< Support operations on data which is not byte aligned */\n #define RTE_CRYPTODEV_FF_SYM_RAW_DP\t\t\t(1ULL << 24)\n /**< Support accelerator specific symmetric raw data-path APIs */\n+#define RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS\t(1ULL << 25)\n+/**< Support operations on multiple data-units message */\n \n /**\n  * Get the name of a crypto device feature flag\n",
    "prefixes": [
        "v3"
    ]
}