get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139226,
    "url": "http://patches.dpdk.org/api/patches/139226/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240411082735.3496021-1-gakhil@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": "<20240411082735.3496021-1-gakhil@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240411082735.3496021-1-gakhil@marvell.com",
    "date": "2024-04-11T08:27:35",
    "name": "app/crypto-perf: support IPsec/TLS segmented buffers",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d1f2d67ad573ba0d890ce8a3bacfeaaeb0a1af76",
    "submitter": {
        "id": 2094,
        "url": "http://patches.dpdk.org/api/people/2094/?format=api",
        "name": "Akhil Goyal",
        "email": "gakhil@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/20240411082735.3496021-1-gakhil@marvell.com/mbox/",
    "series": [
        {
            "id": 31720,
            "url": "http://patches.dpdk.org/api/series/31720/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31720",
            "date": "2024-04-11T08:27:35",
            "name": "app/crypto-perf: support IPsec/TLS segmented buffers",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/31720/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/139226/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/139226/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 1E73A43E42;\n\tThu, 11 Apr 2024 10:30:13 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D76E040268;\n\tThu, 11 Apr 2024 10:30:12 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 0F29140262\n for <dev@dpdk.org>; Thu, 11 Apr 2024 10:30:11 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id\n 43AJ3Lag022437; Thu, 11 Apr 2024 01:30:11 -0700",
            "from dc6wp-exch02.marvell.com ([4.21.29.225])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3xdqc2txfn-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 11 Apr 2024 01:29:59 -0700 (PDT)",
            "from DC6WP-EXCH02.marvell.com (10.76.176.209) by\n DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1544.4; Thu, 11 Apr 2024 01:27:41 -0700",
            "from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com\n (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend\n Transport; Thu, 11 Apr 2024 01:27:41 -0700",
            "from localhost.localdomain (unknown [10.28.36.102])\n by maili.marvell.com (Postfix) with ESMTP id 60F403F706A;\n Thu, 11 Apr 2024 01:27:39 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=\n from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding:content-type; s=pfpt0220; bh=siOLW0mB\n wzh2hwYQyR8BNgPx+uAp1ZBPMc+UIo91vGg=; b=KBz4wgKQdfbkB2R35F/NNvhi\n /bX9IBGAqcfvkaLExuJPvoKOGubPklTyFqV6Yf0Let+2/RQTArmreP5Crck1b/Lh\n ZLE3yk1iDFhiocTnA28B+2OrrbdwOFN9juNFDVgdKyPAQ1Hlg5lyhI651NcafJXJ\n oVZ9Pf5c3/U0lTJS8zaV5jf9WEaEQbWr0Rno7Bbe4Bq274wOHFSOjDq/UMOlWsV8\n MHOk+5WC33IFOzrnwB6fpuilnDPKUyv4wCKp4kl0TbKKsXcLYDkbx6wq1P+8gUl9\n l6bxR3ckaStxMNtUc2ljhzpAWI1X/EMQVdt+l9vauxh2YXkBtHQp5fumbyzJXg==",
        "From": "Akhil Goyal <gakhil@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ciara.power@intel.com>, <anoobj@marvell.com>, Akhil Goyal\n <gakhil@marvell.com>",
        "Subject": "[PATCH] app/crypto-perf: support IPsec/TLS segmented buffers",
        "Date": "Thu, 11 Apr 2024 13:57:35 +0530",
        "Message-ID": "<20240411082735.3496021-1-gakhil@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "0V8pC3dm4qNBi2ioJauQlElHCbLJuk_-",
        "X-Proofpoint-GUID": "0V8pC3dm4qNBi2ioJauQlElHCbLJuk_-",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2024-04-11_02,2024-04-09_01,2023-05-22_02",
        "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": "Added support to allow segmented buffers for IPsec\nand tls-record security offload cases.\n\nSigned-off-by: Akhil Goyal <gakhil@marvell.com>\n---\n app/test-crypto-perf/cperf_ops.c | 55 ++++++++++++++++++++------------\n 1 file changed, 34 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c\nindex d3fd115bc0..4ca001b721 100644\n--- a/app/test-crypto-perf/cperf_ops.c\n+++ b/app/test-crypto-perf/cperf_ops.c\n@@ -43,10 +43,8 @@ test_ipsec_vec_populate(struct rte_mbuf *m, const struct cperf_options *options,\n \tstruct rte_ipv4_hdr *ip = rte_pktmbuf_mtod(m, struct rte_ipv4_hdr *);\n \n \tif (options->is_outbound) {\n-\t\tmemcpy(ip, test_vector->plaintext.data,\n-\t\t       sizeof(struct rte_ipv4_hdr));\n-\n-\t\tip->total_length = rte_cpu_to_be_16(m->data_len);\n+\t\tmemcpy(ip, test_vector->plaintext.data, sizeof(struct rte_ipv4_hdr));\n+\t\tip->total_length = rte_cpu_to_be_16(m->pkt_len);\n \t}\n }\n \n@@ -131,8 +129,6 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,\n {\n \tvoid *sec_sess = sess;\n \tconst uint32_t test_buffer_size = options->test_buffer_size;\n-\tconst uint32_t headroom_sz = options->headroom_sz;\n-\tconst uint32_t segment_sz = options->segment_sz;\n \tuint64_t tsc_start_temp, tsc_end_temp;\n \tuint16_t i = 0;\n \n@@ -141,20 +137,27 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,\n \tfor (i = 0; i < nb_ops; i++) {\n \t\tstruct rte_crypto_sym_op *sym_op = ops[i]->sym;\n \t\tstruct rte_mbuf *m = sym_op->m_src;\n+\t\tuint32_t offset = test_buffer_size;\n \n \t\tops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;\n \t\trte_security_attach_session(ops[i], sec_sess);\n-\t\tsym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +\n-\t\t\t\t\t\t\tsrc_buf_offset);\n+\t\tsym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] + src_buf_offset);\n+\t\tsym_op->m_src->pkt_len = test_buffer_size;\n \n-\t\t/* In case of IPsec, headroom is consumed by PMD,\n-\t\t * hence resetting it.\n+\t\twhile ((m->next != NULL) && (offset >= m->data_len)) {\n+\t\t\toffset -= m->data_len;\n+\t\t\tm = m->next;\n+\t\t}\n+\t\tm->data_len = offset;\n+\t\t/*\n+\t\t * If there is not enough room in segment,\n+\t\t * place the digest in the next segment\n \t\t */\n-\t\tm->data_off = headroom_sz;\n-\n-\t\tm->buf_len = segment_sz;\n-\t\tm->data_len = test_buffer_size;\n-\t\tm->pkt_len = test_buffer_size;\n+\t\tif (rte_pktmbuf_tailroom(m) < options->digest_sz) {\n+\t\t\tm = m->next;\n+\t\t\toffset = 0;\n+\t\t}\n+\t\tm->next = NULL;\n \n \t\tsym_op->m_dst = NULL;\n \t}\n@@ -186,8 +189,6 @@ cperf_set_ops_security_tls(struct rte_crypto_op **ops,\n \t\tuint64_t *tsc_start)\n {\n \tconst uint32_t test_buffer_size = options->test_buffer_size;\n-\tconst uint32_t headroom_sz = options->headroom_sz;\n-\tconst uint32_t segment_sz = options->segment_sz;\n \tuint16_t i = 0;\n \n \tRTE_SET_USED(imix_idx);\n@@ -197,16 +198,28 @@ cperf_set_ops_security_tls(struct rte_crypto_op **ops,\n \tfor (i = 0; i < nb_ops; i++) {\n \t\tstruct rte_crypto_sym_op *sym_op = ops[i]->sym;\n \t\tstruct rte_mbuf *m = sym_op->m_src;\n+\t\tuint32_t offset = test_buffer_size;\n \n \t\tops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;\n \t\tops[i]->param1.tls_record.content_type = 0x17;\n \t\trte_security_attach_session(ops[i], sess);\n \t\tsym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] + src_buf_offset);\n+\t\tsym_op->m_src->pkt_len = test_buffer_size;\n \n-\t\tm->data_off = headroom_sz;\n-\t\tm->buf_len = segment_sz;\n-\t\tm->data_len = test_buffer_size;\n-\t\tm->pkt_len = test_buffer_size;\n+\t\twhile ((m->next != NULL) && (offset >= m->data_len)) {\n+\t\t\toffset -= m->data_len;\n+\t\t\tm = m->next;\n+\t\t}\n+\t\tm->data_len = offset;\n+\t\t/*\n+\t\t * If there is not enough room in segment,\n+\t\t * place the digest in the next segment\n+\t\t */\n+\t\tif ((rte_pktmbuf_tailroom(m)) < options->digest_sz) {\n+\t\t\tm = m->next;\n+\t\t\tm->data_len = 0;\n+\t\t}\n+\t\tm->next = NULL;\n \n \t\tsym_op->m_dst = NULL;\n \t}\n",
    "prefixes": []
}