get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 114708,
    "url": "http://patches.dpdk.org/api/patches/114708/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220808080606.220-19-anoobj@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20220808080606.220-19-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220808080606.220-19-anoobj@marvell.com",
    "date": "2022-08-08T08:06:06",
    "name": "[18/18] crypto/cnxk: add support for DOCSIS algorithm",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "df685acf68a9e944dfeb17f1db973bc06fa0fc6f",
    "submitter": {
        "id": 1205,
        "url": "http://patches.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220808080606.220-19-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 24219,
            "url": "http://patches.dpdk.org/api/series/24219/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24219",
            "date": "2022-08-08T08:05:48",
            "name": "Fixes and improvements in cnxk crypto PMDs",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/24219/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/114708/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/114708/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 DD064A0540;\n\tMon,  8 Aug 2022 10:08:08 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2F66F40A79;\n\tMon,  8 Aug 2022 10:06:56 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 60A364067B\n for <dev@dpdk.org>; Mon,  8 Aug 2022 10:06:55 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id\n 277NrifB014579\n for <dev@dpdk.org>; Mon, 8 Aug 2022 01:06:54 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3hsnnqnf9e-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Mon, 08 Aug 2022 01:06:54 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Mon, 8 Aug 2022 01:06:52 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Mon, 8 Aug 2022 01:06:53 -0700",
            "from BG-LT92004.corp.innovium.com (unknown [10.28.160.62])\n by maili.marvell.com (Postfix) with ESMTP id BD8263F7051;\n Mon,  8 Aug 2022 01:06:50 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=3KlGUUUdcOZf1DIrad0yrIKI+MclmtvGATrYZHUBNwQ=;\n b=kReXVTCkd5gFsjUwgQ/xkiN45r5ltf4KAs/fu0HmBQ6gQd2inLqRhdtuIpktWBtI8Oob\n gRWr//0xD8MIAkRKgN75s1b0fZ2+6zedacQape0VIbK6BkqyqPz7WkzXLl6pQAZZhd2k\n +ynl1ip+EmKCTecfm0+gW1U+9BiCKO1IPigBfq2d+sbH76Nra+7u5zrZEX4fHAl215Vu\n Tb2nIjbXfO0xzKnGdUbHe+7krd6irZSiZzZjweNYzMFXwv8Pmt5OjSaixNTVlD9op51p\n Dua5FFCvhg6vlR9oV5+OwxQUyiGJnEbmQgubXN1pfccL1jUWm8uVtq9yrFgG8N2UsHoQ QA==",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Akhil Goyal <gakhil@marvell.com>, Jerin Jacob <jerinj@marvell.com>",
        "CC": "Volodymyr Fialko <vfialko@marvell.com>, Archana Muniganti\n <marchana@marvell.com>,\n Tejasree Kondoj <ktejasree@marvell.com>, <dev@dpdk.org>",
        "Subject": "[PATCH 18/18] crypto/cnxk: add support for DOCSIS algorithm",
        "Date": "Mon, 8 Aug 2022 13:36:06 +0530",
        "Message-ID": "<20220808080606.220-19-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220808080606.220-1-anoobj@marvell.com>",
        "References": "<20220808080606.220-1-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "8tIMgiISKDLCgIQPFgGN-yaj1aquokPZ",
        "X-Proofpoint-GUID": "8tIMgiISKDLCgIQPFgGN-yaj1aquokPZ",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1\n definitions=2022-08-08_05,2022-08-05_01,2022-06-22_01",
        "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"
    },
    "content": "From: Volodymyr Fialko <vfialko@marvell.com>\n\nAdd support for offloading RTE_CRYPTO_CIPHER_AES_DOCSISBPI and\nRTE_CRYPTO_CIPHER_DES_DOCSISBPI algorithms to symmetric crypto session.\n\nSigned-off-by: Volodymyr Fialko <vfialko@marvell.com>\n---\n doc/guides/cryptodevs/features/cn9k.ini       |  2 +\n doc/guides/rel_notes/release_22_11.rst        |  1 +\n drivers/common/cnxk/roc_se.c                  | 25 ++++++++-\n drivers/common/cnxk/roc_se.h                  | 11 ++--\n drivers/crypto/cnxk/cnxk_cryptodev.h          |  2 +-\n .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 52 +++++++++++++++++++\n drivers/crypto/cnxk/cnxk_se.h                 | 12 +++++\n 7 files changed, 99 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/doc/guides/cryptodevs/features/cn9k.ini b/doc/guides/cryptodevs/features/cn9k.ini\nindex 98ad7cf10a..c3d131db1a 100644\n--- a/doc/guides/cryptodevs/features/cn9k.ini\n+++ b/doc/guides/cryptodevs/features/cn9k.ini\n@@ -35,6 +35,8 @@ DES CBC        = Y\n KASUMI F8      = Y\n SNOW3G UEA2    = Y\n ZUC EEA3       = Y\n+AES DOCSIS BPI = Y\n+DES DOCSIS BPI = Y\n \n ;\n ; Supported authentication algorithms of 'cn9k' crypto driver.\ndiff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst\nindex 333f66bef3..7fab9d6550 100644\n--- a/doc/guides/rel_notes/release_22_11.rst\n+++ b/doc/guides/rel_notes/release_22_11.rst\n@@ -58,6 +58,7 @@ New Features\n * **Updated Marvell cnxk crypto driver.**\n \n   * Added AES-CCM support in lookaside protocol (IPsec) for CN9K & CN10K.\n+  * Added AES & DES DOCSIS algorithm support in lookaside crypto for CN9K.\n \n \n Removed Items\ndiff --git a/drivers/common/cnxk/roc_se.c b/drivers/common/cnxk/roc_se.c\nindex 8d6446c3a0..2663480099 100644\n--- a/drivers/common/cnxk/roc_se.c\n+++ b/drivers/common/cnxk/roc_se.c\n@@ -63,6 +63,7 @@ cpt_ciph_type_set(roc_se_cipher_type type, struct roc_se_ctx *ctx,\n \t\tbreak;\n \tcase ROC_SE_DES3_CBC:\n \tcase ROC_SE_DES3_ECB:\n+\tcase ROC_SE_DES_DOCSISBPI:\n \t\tfc_type = ROC_SE_FC_GEN;\n \t\tbreak;\n \tcase ROC_SE_AES_CBC:\n@@ -70,6 +71,7 @@ cpt_ciph_type_set(roc_se_cipher_type type, struct roc_se_ctx *ctx,\n \tcase ROC_SE_AES_CFB:\n \tcase ROC_SE_AES_CTR:\n \tcase ROC_SE_AES_GCM:\n+\tcase ROC_SE_AES_DOCSISBPI:\n \t\tif (unlikely(cpt_ciph_aes_key_validate(key_len) != 0))\n \t\t\treturn -1;\n \t\tfc_type = ROC_SE_FC_GEN;\n@@ -451,7 +453,7 @@ roc_se_ciph_key_set(struct roc_se_ctx *se_ctx, roc_se_cipher_type type,\n \tuint8_t *zuc_const;\n \tuint32_t keyx[4];\n \tuint8_t *ci_key;\n-\tint ret;\n+\tint i, ret;\n \n \tzs_ch_ctx = &se_ctx->se_ctx.zs_ch_ctx;\n \n@@ -531,6 +533,27 @@ roc_se_ciph_key_set(struct roc_se_ctx *se_ctx, roc_se_cipher_type type,\n \t\tmemset(fctx->hmac.ipad, 0, sizeof(fctx->hmac.ipad));\n \t\tmemcpy(fctx->hmac.ipad, &key[key_len], key_len);\n \t\tbreak;\n+\tcase ROC_SE_AES_DOCSISBPI:\n+\t\t/*\n+\t\t * DOCSIS uses the combination of AES-CBC and residual termination blocks that are\n+\t\t * less than 128. Pass it as regular AES-CBC cipher to CPT, but keep type in\n+\t\t * se_ctx as AES_DOCSISBPI to skip block size checks in instruction preparation.\n+\t\t */\n+\t\tcpt_ciph_aes_key_type_set(fctx, key_len);\n+\t\tfctx->enc.enc_cipher = ROC_SE_AES_CBC;\n+\t\tmemcpy(fctx->enc.encr_key, key, key_len);\n+\t\tgoto success;\n+\tcase ROC_SE_DES_DOCSISBPI:\n+\t\t/* See case ROC_SE_DES3_CBC: for explanation */\n+\t\tfor (i = 0; i < 3; i++)\n+\t\t\tmemcpy(fctx->enc.encr_key + key_len * i, key, key_len);\n+\t\t/*\n+\t\t * DOCSIS uses DES-CBC mode with special handling of residual termination blocks\n+\t\t * that are less than 64 bits. Pass it as regular DES-CBC, but keep type in\n+\t\t * se_ctx as DES_DOCSISBPI to skip block size checks in instruction preparation.\n+\t\t */\n+\t\tfctx->enc.enc_cipher = ROC_SE_DES3_CBC;\n+\t\tgoto success;\n \tcase ROC_SE_SNOW3G_UEA2:\n \t\tif (chained_op == true) {\n \t\t\tstruct roc_se_onk_zuc_chain_ctx *ctx =\ndiff --git a/drivers/common/cnxk/roc_se.h b/drivers/common/cnxk/roc_se.h\nindex d1a87a96da..e70a197d4f 100644\n--- a/drivers/common/cnxk/roc_se.h\n+++ b/drivers/common/cnxk/roc_se.h\n@@ -10,6 +10,7 @@\n #define ROC_SE_FC_MINOR_OP_ENCRYPT    0x0\n #define ROC_SE_FC_MINOR_OP_DECRYPT    0x1\n #define ROC_SE_FC_MINOR_OP_HMAC_FIRST 0x10\n+#define ROC_SE_FC_MINOR_OP_DOCSIS     0x40\n \n #define ROC_SE_MAJOR_OP_HASH\t   0x34\n #define ROC_SE_MAJOR_OP_HMAC\t   0x35\n@@ -17,10 +18,10 @@\n #define ROC_SE_MAJOR_OP_KASUMI\t   0x38\n #define ROC_SE_MAJOR_OP_PDCP_CHAIN 0x3C\n \n-#define ROC_SE_MAJOR_OP_MISC\t\t 0x01\n-#define ROC_SE_MISC_MINOR_OP_PASSTHROUGH 0x03\n-#define ROC_SE_MISC_MINOR_OP_DUMMY\t 0x04\n-#define ROC_SE_MISC_MINOR_OP_HW_SUPPORT\t 0x08\n+#define ROC_SE_MAJOR_OP_MISC\t\t 0x01ULL\n+#define ROC_SE_MISC_MINOR_OP_PASSTHROUGH 0x03ULL\n+#define ROC_SE_MISC_MINOR_OP_DUMMY\t 0x04ULL\n+#define ROC_SE_MISC_MINOR_OP_HW_SUPPORT\t 0x08ULL\n \n #define ROC_SE_MAX_AAD_SIZE 64\n #define ROC_SE_MAX_MAC_LEN  64\n@@ -125,6 +126,8 @@ typedef enum {\n \tROC_SE_AES_CTR_EEA2 = 0x92,\n \tROC_SE_KASUMI_F8_CBC = 0x93,\n \tROC_SE_KASUMI_F8_ECB = 0x94,\n+\tROC_SE_AES_DOCSISBPI = 0x95,\n+\tROC_SE_DES_DOCSISBPI = 0x96,\n } roc_se_cipher_type;\n \n typedef enum {\ndiff --git a/drivers/crypto/cnxk/cnxk_cryptodev.h b/drivers/crypto/cnxk/cnxk_cryptodev.h\nindex a3dcfbfa6d..588760cfb0 100644\n--- a/drivers/crypto/cnxk/cnxk_cryptodev.h\n+++ b/drivers/crypto/cnxk/cnxk_cryptodev.h\n@@ -10,7 +10,7 @@\n \n #include \"roc_cpt.h\"\n \n-#define CNXK_CPT_MAX_CAPS\t 35\n+#define CNXK_CPT_MAX_CAPS\t 37\n #define CNXK_SEC_CRYPTO_MAX_CAPS 14\n #define CNXK_SEC_MAX_CAPS\t 9\n #define CNXK_AE_EC_ID_MAX\t 8\ndiff --git a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c\nindex ffb0c289a0..1fb35f54cd 100644\n--- a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c\n+++ b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c\n@@ -697,6 +697,49 @@ static const struct rte_cryptodev_capabilities caps_des[] = {\n \t},\n };\n \n+static const struct rte_cryptodev_capabilities caps_docsis[] = {\n+\t{\t/* AES DOCSIS BPI */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,\n+\t\t\t{.cipher = {\n+\t\t\t\t.algo = RTE_CRYPTO_CIPHER_AES_DOCSISBPI,\n+\t\t\t\t.block_size = 16,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 16,\n+\t\t\t\t\t.max = 32,\n+\t\t\t\t\t.increment = 16\n+\t\t\t\t},\n+\t\t\t\t.iv_size = {\n+\t\t\t\t\t.min = 16,\n+\t\t\t\t\t.max = 16,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t}\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+\t{\t/* DES DOCSIS BPI */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,\n+\t\t\t{.cipher = {\n+\t\t\t\t.algo = RTE_CRYPTO_CIPHER_DES_DOCSISBPI,\n+\t\t\t\t.block_size = 8,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 8,\n+\t\t\t\t\t.max = 8,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t\t.iv_size = {\n+\t\t\t\t\t.min = 8,\n+\t\t\t\t\t.max = 8,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t}\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+};\n+\n static const struct rte_cryptodev_capabilities caps_null[] = {\n \t{\t/* NULL (AUTH) */\n \t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n@@ -1158,6 +1201,12 @@ cn10k_crypto_caps_update(struct rte_cryptodev_capabilities cnxk_caps[])\n \t}\n }\n \n+static void\n+cn9k_crypto_caps_add(struct rte_cryptodev_capabilities cnxk_caps[], int *cur_pos)\n+{\n+\t    cpt_caps_add(cnxk_caps, cur_pos, caps_docsis, RTE_DIM(caps_docsis));\n+}\n+\n static void\n crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[],\n \t\t     union cpt_eng_caps *hw_caps)\n@@ -1172,6 +1221,9 @@ crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[],\n \tCPT_CAPS_ADD(cnxk_caps, &cur_pos, hw_caps, kasumi);\n \tCPT_CAPS_ADD(cnxk_caps, &cur_pos, hw_caps, des);\n \n+\tif (!roc_model_is_cn10k())\n+\t\tcn9k_crypto_caps_add(cnxk_caps, &cur_pos);\n+\n \tcpt_caps_add(cnxk_caps, &cur_pos, caps_null, RTE_DIM(caps_null));\n \tcpt_caps_add(cnxk_caps, &cur_pos, caps_end, RTE_DIM(caps_end));\n \ndiff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h\nindex 44b31bfe97..b7d4b19d01 100644\n--- a/drivers/crypto/cnxk/cnxk_se.h\n+++ b/drivers/crypto/cnxk/cnxk_se.h\n@@ -2032,6 +2032,18 @@ fill_sess_cipher(struct rte_crypto_sym_xform *xform, struct cnxk_se_sess *sess)\n \t\tenc_type = ROC_SE_AES_ECB;\n \t\tcipher_key_len = 16;\n \t\tbreak;\n+\tcase RTE_CRYPTO_CIPHER_AES_DOCSISBPI:\n+\t\t/* Set DOCSIS flag */\n+\t\tsess->roc_se_ctx.template_w4.s.opcode_minor |= ROC_SE_FC_MINOR_OP_DOCSIS;\n+\t\tenc_type = ROC_SE_AES_DOCSISBPI;\n+\t\tcipher_key_len = 16;\n+\t\tbreak;\n+\tcase RTE_CRYPTO_CIPHER_DES_DOCSISBPI:\n+\t\t/* Set DOCSIS flag */\n+\t\tsess->roc_se_ctx.template_w4.s.opcode_minor |= ROC_SE_FC_MINOR_OP_DOCSIS;\n+\t\tenc_type = ROC_SE_DES_DOCSISBPI;\n+\t\tcipher_key_len = 8;\n+\t\tbreak;\n \tcase RTE_CRYPTO_CIPHER_3DES_CTR:\n \tcase RTE_CRYPTO_CIPHER_AES_F8:\n \tcase RTE_CRYPTO_CIPHER_ARC4:\n",
    "prefixes": [
        "18/18"
    ]
}