get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96939,
    "url": "http://patchwork.dpdk.org/api/patches/96939/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1629093590-115-3-git-send-email-anoobj@marvell.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": "<1629093590-115-3-git-send-email-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1629093590-115-3-git-send-email-anoobj@marvell.com",
    "date": "2021-08-16T05:59:49",
    "name": "[2/3] crypto/cnxk: add IV in SA in lookaside IPsec debug mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5a1314a2b9dccadfc2c73920e702f604dc7c0219",
    "submitter": {
        "id": 1205,
        "url": "http://patchwork.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@marvell.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/1629093590-115-3-git-send-email-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 18292,
            "url": "http://patchwork.dpdk.org/api/series/18292/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=18292",
            "date": "2021-08-16T05:59:47",
            "name": "Add user specified IV with lookaside IPsec",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/18292/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/96939/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/96939/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 70B60A0C46;\n\tMon, 16 Aug 2021 08:00:44 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E939841145;\n\tMon, 16 Aug 2021 08:00:41 +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 43F0F40686\n for <dev@dpdk.org>; Mon, 16 Aug 2021 08:00:40 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id\n 17FMSmSl017193;\n Sun, 15 Aug 2021 23:00:39 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com with ESMTP id 3af0pthwjc-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Sun, 15 Aug 2021 23:00:39 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Sun, 15 Aug 2021 23:00:37 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Sun, 15 Aug 2021 23:00:37 -0700",
            "from HY-LT1002.marvell.com (unknown [10.193.36.215])\n by maili.marvell.com (Postfix) with ESMTP id E698C5B6957;\n Sun, 15 Aug 2021 23:00:31 -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=nm5mS42xZHDFG4ABPQMRSCh8kzb9F1eW7Onqv2N3bbo=;\n b=DOCh7VgMUI3TdIWWm3mswxYtCoeYVjhiIb/SAedv+NXac08Sbc2FEc19rm89hGQfqmgq\n jUWxQf8WgCFmA3oqpoN2BKIEsunvupaScOEvn9f0VLqjTEuhgX+m7bLZjyksFcnBqgLj\n TygH13GvP9aMIfmflN+juJbUBwpqDpiLEBsuni8PACJFxcD62uat2u/OxR0mCAE0pr6i\n jW87/XTq23OgJubiohI5zq23jfEQblN+G4KxLPmo0G7KQ2uZDVyEV05C7PGTXNZo4unp\n pE3xXU2/xifwHHwiNP/PZS2S0v0wcnDUOTbWNX7rudLf/7XdLN8fB6mIguj7VboXFOcS JQ==",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Akhil Goyal <gakhil@marvell.com>, Declan Doherty\n <declan.doherty@intel.com>, Fan Zhang <roy.fan.zhang@intel.com>,\n \"Konstantin Ananyev\" <konstantin.ananyev@intel.com>",
        "CC": "Tejasree Kondoj <ktejasree@marvell.com>, Jerin Jacob <jerinj@marvell.com>,\n Archana Muniganti <marchana@marvell.com>, Hemant Agrawal\n <hemant.agrawal@nxp.com>, Radu Nicolau <radu.nicolau@intel.com>,\n Ciara Power <ciara.power@intel.com>, <dev@dpdk.org>,\n Anoob Joseph <anoobj@marvell.com>",
        "Date": "Mon, 16 Aug 2021 11:29:49 +0530",
        "Message-ID": "<1629093590-115-3-git-send-email-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1629093590-115-1-git-send-email-anoobj@marvell.com>",
        "References": "<1629093590-115-1-git-send-email-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "OsV7AoOh9Fu8A-LcvyKAtH63JmTdGuFH",
        "X-Proofpoint-ORIG-GUID": "OsV7AoOh9Fu8A-LcvyKAtH63JmTdGuFH",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475\n definitions=2021-08-16_02,2021-08-13_02,2020-04-07_01",
        "Subject": "[dpdk-dev] [PATCH 2/3] crypto/cnxk: add IV in SA in lookaside IPsec\n debug mode",
        "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: Tejasree Kondoj <ktejasree@marvell.com>\n\nAdding IV in SA in lookaside IPsec debug mode. It helps\nto verify lookaside PMD using known outbound vectors in\nlookaside autotest.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Tejasree Kondoj <ktejasree@marvell.com>\n---\n drivers/crypto/cnxk/cn10k_ipsec.c                 | 16 +++++++++++++++\n drivers/crypto/cnxk/cn10k_ipsec.h                 |  2 ++\n drivers/crypto/cnxk/cn10k_ipsec_la_ops.h          | 24 +++++++++++++++++++++++\n drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c | 16 ++++++++++++++-\n drivers/crypto/cnxk/meson.build                   |  6 ++++++\n 5 files changed, 63 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/crypto/cnxk/cn10k_ipsec.c b/drivers/crypto/cnxk/cn10k_ipsec.c\nindex 1d567bf..3ce25f2 100644\n--- a/drivers/crypto/cnxk/cn10k_ipsec.c\n+++ b/drivers/crypto/cnxk/cn10k_ipsec.c\n@@ -110,6 +110,22 @@ cn10k_ipsec_outb_sa_create(struct roc_cpt *roc_cpt,\n \n \tsa->inst.w7 = ipsec_cpt_inst_w7_get(roc_cpt, sa);\n \n+#ifdef LA_IPSEC_DEBUG\n+\t/* Use IV from application in debug mode */\n+\tif (ipsec_xfrm->options.iv_gen_disable == 1) {\n+\t\tout_sa->w2.s.iv_src = ROC_IE_OT_SA_IV_SRC_FROM_SA;\n+\t\tif (crypto_xfrm->type == RTE_CRYPTO_SYM_XFORM_AEAD) {\n+\t\t\tsa->iv_offset = crypto_xfrm->aead.iv.offset;\n+\t\t\tsa->iv_length = crypto_xfrm->aead.iv.length;\n+\t\t}\n+\t}\n+#else\n+\tif (ipsec_xfrm->options.iv_gen_disable != 0) {\n+\t\tplt_err(\"Application provided IV not supported\");\n+\t\treturn -ENOTSUP;\n+\t}\n+#endif\n+\n \t/* Get Rlen calculation data */\n \tret = cnxk_ipsec_outb_rlens_get(&rlens, ipsec_xfrm, crypto_xfrm);\n \tif (ret)\ndiff --git a/drivers/crypto/cnxk/cn10k_ipsec.h b/drivers/crypto/cnxk/cn10k_ipsec.h\nindex 668282f..25fc2ee 100644\n--- a/drivers/crypto/cnxk/cn10k_ipsec.h\n+++ b/drivers/crypto/cnxk/cn10k_ipsec.h\n@@ -20,6 +20,8 @@ struct cn10k_ipsec_sa {\n \t};\n \t/** Pre-populated CPT inst words */\n \tstruct cnxk_cpt_inst_tmpl inst;\n+\tuint16_t iv_offset;\n+\tuint8_t iv_length;\n \tuint8_t partial_len;\n \tuint8_t roundup_len;\n \tuint8_t roundup_byte;\ndiff --git a/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h b/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h\nindex 1e9ebb5..1c142d2 100644\n--- a/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h\n+++ b/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h\n@@ -23,6 +23,25 @@ ipsec_po_out_rlen_get(struct cn10k_ipsec_sa *sess, uint32_t plen)\n \treturn sess->partial_len + enc_payload_len;\n }\n \n+static inline void\n+ipsec_po_sa_iv_set(struct cn10k_ipsec_sa *sess, struct rte_crypto_op *cop)\n+{\n+\tuint8_t *iv = &sess->out_sa.iv.s.iv_dbg1[0];\n+\tuint32_t *tmp_iv;\n+\n+\tmemcpy(iv, rte_crypto_op_ctod_offset(cop, uint8_t *, sess->iv_offset),\n+\t       4);\n+\ttmp_iv = (uint32_t *)iv;\n+\t*tmp_iv = rte_be_to_cpu_32(*tmp_iv);\n+\n+\tiv = &sess->out_sa.iv.s.iv_dbg2[0];\n+\tmemcpy(iv,\n+\t       rte_crypto_op_ctod_offset(cop, uint8_t *, sess->iv_offset + 4),\n+\t       4);\n+\ttmp_iv = (uint32_t *)iv;\n+\t*tmp_iv = rte_be_to_cpu_32(*tmp_iv);\n+}\n+\n static __rte_always_inline int\n process_outb_sa(struct rte_crypto_op *cop, struct cn10k_ipsec_sa *sess,\n \t\tstruct cpt_inst_s *inst)\n@@ -43,6 +62,11 @@ process_outb_sa(struct rte_crypto_op *cop, struct cn10k_ipsec_sa *sess,\n \t\treturn -ENOMEM;\n \t}\n \n+#ifdef LA_IPSEC_DEBUG\n+\tif (sess->out_sa.w2.s.iv_src == ROC_IE_OT_SA_IV_SRC_FROM_SA)\n+\t\tipsec_po_sa_iv_set(sess, cop);\n+#endif\n+\n \t/* Prepare CPT instruction */\n \tinst->w4.u64 = sess->inst.w4;\n \tinst->w4.s.dlen = dlen;\ndiff --git a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c\nindex ab37f9c..8ec1e9d 100644\n--- a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c\n+++ b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c\n@@ -776,7 +776,21 @@ static const struct rte_security_capability sec_caps_templ[] = {\n \t\t\t.proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,\n \t\t\t.mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,\n \t\t\t.direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS,\n-\t\t\t.options = { 0 }\n+\t\t\t.options = {\n+\t\t\t\t.esn = 0,\n+\t\t\t\t.udp_encap = 0,\n+\t\t\t\t.copy_dscp = 0,\n+\t\t\t\t.copy_flabel = 0,\n+\t\t\t\t.copy_df = 0,\n+\t\t\t\t.dec_ttl = 0,\n+\t\t\t\t.ecn = 0,\n+\t\t\t\t.stats = 0,\n+#ifdef LA_IPSEC_DEBUG\n+\t\t\t\t.iv_gen_disable = 1,\n+#else\n+\t\t\t\t.iv_gen_disable = 0,\n+#endif\n+\t\t\t}\n \t\t},\n \t\t.crypto_capabilities = NULL,\n \t\t.ol_flags = RTE_SECURITY_TX_OLOAD_NEED_MDATA\ndiff --git a/drivers/crypto/cnxk/meson.build b/drivers/crypto/cnxk/meson.build\nindex c56d6cf..1694e05 100644\n--- a/drivers/crypto/cnxk/meson.build\n+++ b/drivers/crypto/cnxk/meson.build\n@@ -23,3 +23,9 @@ sources = files(\n deps += ['bus_pci', 'common_cnxk', 'security']\n \n includes += include_directories('../../../lib/net')\n+\n+if get_option('buildtype').contains('debug')\n+    cflags += [ '-DLA_IPSEC_DEBUG' ]\n+else\n+    cflags += [ '-ULA_IPSEC_DEBUG' ]\n+endif\n",
    "prefixes": [
        "2/3"
    ]
}