get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 107815,
    "url": "http://patchwork.dpdk.org/api/patches/107815/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220218163443.3520756-5-pablo.de.lara.guarch@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20220218163443.3520756-5-pablo.de.lara.guarch@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220218163443.3520756-5-pablo.de.lara.guarch@intel.com",
    "date": "2022-02-18T16:34:43",
    "name": "[4/4] crypto/ipsec_mb: fix length and offset settings",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "461ec05f77f8ce5677f171d521c6a24764a30ba2",
    "submitter": {
        "id": 9,
        "url": "http://patchwork.dpdk.org/api/people/9/?format=api",
        "name": "De Lara Guarch, Pablo",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patchwork.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20220218163443.3520756-5-pablo.de.lara.guarch@intel.com/mbox/",
    "series": [
        {
            "id": 21739,
            "url": "http://patchwork.dpdk.org/api/series/21739/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=21739",
            "date": "2022-02-18T16:34:39",
            "name": "ipsec_mb fixes for ZUC algorithm",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/21739/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/107815/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/107815/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 C1C62A0032;\n\tFri, 18 Feb 2022 17:35:22 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 057CF41156;\n\tFri, 18 Feb 2022 17:35:21 +0100 (CET)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id 76C8941150;\n Fri, 18 Feb 2022 17:35:18 +0100 (CET)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 Feb 2022 08:35:18 -0800",
            "from silpixa00400493.ir.intel.com ([10.237.213.136])\n by orsmga008.jf.intel.com with ESMTP; 18 Feb 2022 08:35:16 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1645202118; x=1676738118;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=pbKi4CFCfWocbEVt+clOsKpywCbHE20qP8XC+DLh+4U=;\n b=OvaySl3qycZh7Xwqe4HXG0Jb3CX7PG4wTlb/KkzRmHqGMGEhUY5LMb06\n ciwpKH5/wOsKmfSXSs7aORXcDhQEuBfcP5oobOe+JCpypJ+pbAVZbXMz9\n dGRUtGxwTDV7unPiwQ/6xxxoU9flAfRzJb4QM3MXhIjl5tM0WxgvjJwuc\n vEjZ5rGyMrUV35kfiICv59YW8lqZed63fwHhhpzNBQ6wbfdwkHFnuzRnb\n QhlaLBonGJX+etO3UxUJYrYnm2UOxvnL7r168wZpbxjc+Ed3SRzuNT0+i\n dGJGvS5Uhu603QF1AJR1FHXVZg5q8TKBT3pDMe3COqOUXrkcgXFrpwxay Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10261\"; a=\"314423643\"",
            "E=Sophos;i=\"5.88,379,1635231600\"; d=\"scan'208\";a=\"314423643\"",
            "E=Sophos;i=\"5.88,379,1635231600\"; d=\"scan'208\";a=\"546344200\""
        ],
        "X-ExtLoop1": "1",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "To": "roy.fan.zhang@intel.com",
        "Cc": "dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>,\n stable@dpdk.org",
        "Subject": "[PATCH 4/4] crypto/ipsec_mb: fix length and offset settings",
        "Date": "Fri, 18 Feb 2022 16:34:43 +0000",
        "Message-Id": "<20220218163443.3520756-5-pablo.de.lara.guarch@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220218163443.3520756-1-pablo.de.lara.guarch@intel.com>",
        "References": "<20220218163443.3520756-1-pablo.de.lara.guarch@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "KASUMI, SNOW3G and ZUC require lengths and offsets to\nbe set in bits or bytes depending on the algorithm.\nThere were some algorithms that were mixing these two,\nso this commit is fixing this issue.\n\nFixes: ae8e085c608d (\"crypto/aesni_mb: support KASUMI F8/F9\")\nFixes: 6c42e0cf4d12 (\"crypto/aesni_mb: support SNOW3G-UEA2/UIA2\")\nFixes: fd8df85487c4 (\"crypto/aesni_mb: support ZUC-EEA3/EIA3\")\nFixes: 8c835018de84 (\"crypto/ipsec_mb: support ZUC-256 for aesni_mb\")\nCc: pablo.de.lara.guarch@intel.com\nCc: stable@dpdk.org\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 120 +++++++++++++++++--------\n 1 file changed, 85 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c\nindex a308d42ffa..eac8f1bd28 100644\n--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c\n+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c\n@@ -918,7 +918,9 @@ aesni_mb_set_docsis_sec_session_parameters(\n \n static inline uint64_t\n auth_start_offset(struct rte_crypto_op *op, struct aesni_mb_session *session,\n-\t\tuint32_t oop)\n+\t\tuint32_t oop, const uint32_t auth_offset,\n+\t\tconst uint32_t cipher_offset, const uint32_t auth_length,\n+\t\tconst uint32_t cipher_length)\n {\n \tstruct rte_mbuf *m_src, *m_dst;\n \tuint8_t *p_src, *p_dst;\n@@ -927,7 +929,7 @@ auth_start_offset(struct rte_crypto_op *op, struct aesni_mb_session *session,\n \n \t/* Only cipher then hash needs special calculation. */\n \tif (!oop || session->chain_order != IMB_ORDER_CIPHER_HASH)\n-\t\treturn op->sym->auth.data.offset;\n+\t\treturn auth_offset;\n \n \tm_src = op->sym->m_src;\n \tm_dst = op->sym->m_dst;\n@@ -935,24 +937,24 @@ auth_start_offset(struct rte_crypto_op *op, struct aesni_mb_session *session,\n \tp_src = rte_pktmbuf_mtod(m_src, uint8_t *);\n \tp_dst = rte_pktmbuf_mtod(m_dst, uint8_t *);\n \tu_src = (uintptr_t)p_src;\n-\tu_dst = (uintptr_t)p_dst + op->sym->auth.data.offset;\n+\tu_dst = (uintptr_t)p_dst + auth_offset;\n \n \t/**\n \t * Copy the content between cipher offset and auth offset for generating\n \t * correct digest.\n \t */\n-\tif (op->sym->cipher.data.offset > op->sym->auth.data.offset)\n-\t\tmemcpy(p_dst + op->sym->auth.data.offset,\n-\t\t\t\tp_src + op->sym->auth.data.offset,\n-\t\t\t\top->sym->cipher.data.offset -\n-\t\t\t\top->sym->auth.data.offset);\n+\tif (cipher_offset > auth_offset)\n+\t\tmemcpy(p_dst + auth_offset,\n+\t\t\t\tp_src + auth_offset,\n+\t\t\t\tcipher_offset -\n+\t\t\t\tauth_offset);\n \n \t/**\n \t * Copy the content between (cipher offset + length) and (auth offset +\n \t * length) for generating correct digest\n \t */\n-\tcipher_end = op->sym->cipher.data.offset + op->sym->cipher.data.length;\n-\tauth_end = op->sym->auth.data.offset + op->sym->auth.data.length;\n+\tcipher_end = cipher_offset + cipher_length;\n+\tauth_end = auth_offset + auth_length;\n \tif (cipher_end < auth_end)\n \t\tmemcpy(p_dst + cipher_end, p_src + cipher_end,\n \t\t\t\tauth_end - cipher_end);\n@@ -1099,6 +1101,10 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,\n \tstruct aesni_mb_qp_data *qp_data = ipsec_mb_get_qp_private_data(qp);\n \tstruct aesni_mb_session *session;\n \tuint32_t m_offset, oop;\n+\tuint32_t auth_off_in_bytes;\n+\tuint32_t ciph_off_in_bytes;\n+\tuint32_t auth_len_in_bytes;\n+\tuint32_t ciph_len_in_bytes;\n \n \tsession = ipsec_mb_get_session_private(qp, op);\n \tif (session == NULL) {\n@@ -1207,6 +1213,7 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,\n \tif (job->cipher_mode == IMB_CIPHER_ZUC_EEA3) {\n \t\tjob->enc_keys = session->cipher.zuc_cipher_key;\n \t\tjob->dec_keys = session->cipher.zuc_cipher_key;\n+\t\tm_offset >>= 3;\n \t} else if (job->cipher_mode == IMB_CIPHER_SNOW3G_UEA2_BITLEN) {\n \t\tjob->enc_keys = &session->cipher.pKeySched_snow3g_cipher;\n \t\tm_offset = 0;\n@@ -1264,9 +1271,6 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,\n \n \tswitch (job->hash_alg) {\n \tcase IMB_AUTH_AES_CCM:\n-\t\tjob->cipher_start_src_offset_in_bytes =\n-\t\t\t\top->sym->aead.data.offset;\n-\t\tjob->msg_len_to_cipher_in_bytes = op->sym->aead.data.length;\n \t\tjob->hash_start_src_offset_in_bytes = op->sym->aead.data.offset;\n \t\tjob->msg_len_to_hash_in_bytes = op->sym->aead.data.length;\n \n@@ -1276,19 +1280,11 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,\n \n \tcase IMB_AUTH_AES_GMAC:\n \t\tif (session->cipher.mode == IMB_CIPHER_GCM) {\n-\t\t\tjob->cipher_start_src_offset_in_bytes =\n-\t\t\t\t\top->sym->aead.data.offset;\n \t\t\tjob->hash_start_src_offset_in_bytes =\n \t\t\t\t\top->sym->aead.data.offset;\n-\t\t\tjob->msg_len_to_cipher_in_bytes =\n-\t\t\t\t\top->sym->aead.data.length;\n \t\t\tjob->msg_len_to_hash_in_bytes =\n \t\t\t\t\top->sym->aead.data.length;\n \t\t} else {\n-\t\t\tjob->cipher_start_src_offset_in_bytes =\n-\t\t\t\t\top->sym->auth.data.offset;\n-\t\t\tjob->hash_start_src_offset_in_bytes =\n-\t\t\t\t\top->sym->auth.data.offset;\n \t\t\tjob->msg_len_to_cipher_in_bytes = 0;\n \t\t\tjob->msg_len_to_hash_in_bytes = 0;\n \t\t}\n@@ -1298,36 +1294,90 @@ set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp,\n \t\tbreak;\n \n \tcase IMB_AUTH_CHACHA20_POLY1305:\n-\t\tjob->cipher_start_src_offset_in_bytes =\n-\t\t\top->sym->aead.data.offset;\n \t\tjob->hash_start_src_offset_in_bytes =\n \t\t\top->sym->aead.data.offset;\n-\t\tjob->msg_len_to_cipher_in_bytes =\n-\t\t\t\top->sym->aead.data.length;\n \t\tjob->msg_len_to_hash_in_bytes =\n \t\t\t\t\top->sym->aead.data.length;\n \n \t\tjob->iv = rte_crypto_op_ctod_offset(op, uint8_t *,\n \t\t\t\tsession->iv.offset);\n \t\tbreak;\n-\tdefault:\n-\t\t/* For SNOW3G, length and offsets are already in bits */\n-\t\tjob->cipher_start_src_offset_in_bytes =\n-\t\t\t\top->sym->cipher.data.offset;\n-\t\tjob->msg_len_to_cipher_in_bytes = op->sym->cipher.data.length;\n \n+\t/* ZUC and SNOW3G require length in bits and offset in bytes */\n+\tcase IMB_AUTH_ZUC_EIA3_BITLEN:\n+\tcase IMB_AUTH_ZUC256_EIA3_BITLEN:\n+\tcase IMB_AUTH_SNOW3G_UIA2_BITLEN:\n+\t\tauth_off_in_bytes = op->sym->auth.data.offset >> 3;\n+\t\tciph_off_in_bytes = op->sym->cipher.data.offset >> 3;\n+\t\tauth_len_in_bytes = op->sym->auth.data.length >> 3;\n+\t\tciph_len_in_bytes = op->sym->cipher.data.length >> 3;\n+\n+\t\tjob->hash_start_src_offset_in_bytes = auth_start_offset(op,\n+\t\t\t\tsession, oop, auth_off_in_bytes,\n+\t\t\t\tciph_off_in_bytes, auth_len_in_bytes,\n+\t\t\t\tciph_len_in_bytes);\n+\t\tjob->msg_len_to_hash_in_bits = op->sym->auth.data.length;\n+\n+\t\tjob->iv = rte_crypto_op_ctod_offset(op, uint8_t *,\n+\t\t\tsession->iv.offset);\n+\t\tbreak;\n+\n+\t/* KASUMI requires lengths and offset in bytes */\n+\tcase IMB_AUTH_KASUMI_UIA1:\n+\t\tauth_off_in_bytes = op->sym->auth.data.offset >> 3;\n+\t\tciph_off_in_bytes = op->sym->cipher.data.offset >> 3;\n+\t\tauth_len_in_bytes = op->sym->auth.data.length >> 3;\n+\t\tciph_len_in_bytes = op->sym->cipher.data.length >> 3;\n+\n+\t\tjob->hash_start_src_offset_in_bytes = auth_start_offset(op,\n+\t\t\t\tsession, oop, auth_off_in_bytes,\n+\t\t\t\tciph_off_in_bytes, auth_len_in_bytes,\n+\t\t\t\tciph_len_in_bytes);\n+\t\tjob->msg_len_to_hash_in_bytes = auth_len_in_bytes;\n+\n+\t\tjob->iv = rte_crypto_op_ctod_offset(op, uint8_t *,\n+\t\t\tsession->iv.offset);\n+\tbreak;\n+\n+\tdefault:\n \t\tjob->hash_start_src_offset_in_bytes = auth_start_offset(op,\n-\t\t\t\tsession, oop);\n+\t\t\t\tsession, oop, op->sym->auth.data.offset,\n+\t\top->sym->cipher.data.offset,\n+\t\top->sym->auth.data.length, op->sym->cipher.data.length);\n \t\tjob->msg_len_to_hash_in_bytes = op->sym->auth.data.length;\n \n \t\tjob->iv = rte_crypto_op_ctod_offset(op, uint8_t *,\n \t\t\tsession->iv.offset);\n \t}\n \n-\tif (job->cipher_mode == IMB_CIPHER_ZUC_EEA3)\n-\t\tjob->msg_len_to_cipher_in_bytes >>= 3;\n-\telse if (job->hash_alg == IMB_AUTH_KASUMI_UIA1)\n-\t\tjob->msg_len_to_hash_in_bytes >>= 3;\n+\tswitch (job->cipher_mode) {\n+\t/* ZUC requires length and offset in bytes */\n+\tcase IMB_CIPHER_ZUC_EEA3:\n+\t\tjob->cipher_start_src_offset_in_bytes =\n+\t\t\t\t\top->sym->cipher.data.offset >> 3;\n+\t\tjob->msg_len_to_cipher_in_bytes =\n+\t\t\t\t\top->sym->cipher.data.length >> 3;\n+\tbreak;\n+\t/* ZUC and SNOW3G require length and offset in bits */\n+\tcase IMB_CIPHER_SNOW3G_UEA2_BITLEN:\n+\tcase IMB_CIPHER_KASUMI_UEA1_BITLEN:\n+\t\tjob->cipher_start_src_offset_in_bits =\n+\t\t\t\t\top->sym->cipher.data.offset;\n+\t\tjob->msg_len_to_cipher_in_bits =\n+\t\t\t\t\top->sym->cipher.data.length;\n+\tbreak;\n+\tcase IMB_CIPHER_CCM:\n+\tcase IMB_CIPHER_GCM:\n+\tcase IMB_CIPHER_CHACHA20_POLY1305:\n+\t\tjob->cipher_start_src_offset_in_bytes =\n+\t\t\t\top->sym->aead.data.offset;\n+\t\tjob->msg_len_to_cipher_in_bytes = op->sym->aead.data.length;\n+\tbreak;\n+\tdefault:\n+\t\tjob->cipher_start_src_offset_in_bits =\n+\t\t\t\t\top->sym->cipher.data.offset;\n+\t\tjob->msg_len_to_cipher_in_bits = op->sym->cipher.data.length;\n+\t}\n \n \t/* Set user data to be crypto operation data struct */\n \tjob->user_data = op;\n",
    "prefixes": [
        "4/4"
    ]
}