get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 108818,
    "url": "http://patches.dpdk.org/api/patches/108818/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220322175902.363520-5-ndabilpuram@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": "<20220322175902.363520-5-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220322175902.363520-5-ndabilpuram@marvell.com",
    "date": "2022-03-22T17:58:43",
    "name": "[5/7] examples/ipsec-secgw: get security context from lcore conf",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c3ef4451c9e30ccee1d27e72890dc868f4cab966",
    "submitter": {
        "id": 1202,
        "url": "http://patches.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@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/20220322175902.363520-5-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 22213,
            "url": "http://patches.dpdk.org/api/series/22213/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22213",
            "date": "2022-03-22T17:58:39",
            "name": "[1/7] examples/ipsec-secgw: disable Tx chksum offload for inline",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/22213/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/108818/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/108818/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 BD37CA04FF;\n\tTue, 22 Mar 2022 18:59:44 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5FE3842807;\n\tTue, 22 Mar 2022 18:59:26 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id AC4B6427FA\n for <dev@dpdk.org>; Tue, 22 Mar 2022 18:59:24 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id\n 22MG9rZv022265;\n Tue, 22 Mar 2022 10:59:23 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3eyhqw0j6c-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 22 Mar 2022 10:59:23 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Tue, 22 Mar 2022 10:59:22 -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; Tue, 22 Mar 2022 10:59:22 -0700",
            "from localhost.localdomain (unknown [10.28.34.24])\n by maili.marvell.com (Postfix) with ESMTP id 64B823F704A;\n Tue, 22 Mar 2022 10:59:20 -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=N6E6jheVAT5hQN1LMSWsQ6vVQbv4NixeQXlwnUQQj+E=;\n b=RsifufJNGIgfvYEYNmocr7eVsFs9j4yEvE38b5wfc3uTsW7joHo8GB3Xu6VhoUxwdWZ6\n BrJAqqIWpr3KgSg47BNZLlvuKJk4lyPDgzun4s8/cYIQhslFLH4AGxVCA1FUq1pMwdH4\n 0k+xnzVktAlnmr4eRw2ea8TWBNjUcZ8/J/OTNI8XTNtMVMNi42s0mbh42RonB07GyGCv\n c35BCAspgUkcdEIDfbTFx87payG6YTvSYz2hHaLM4jHEHl2MzY6DOQEXlunidDfWwnCG\n y1ITpoAc8E/xUv+pXDkX2D1q0Vo8DohKwSkPdW+lQQxNr4jg5PctXp5FXTzxNweYNMKM Ag==",
        "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "To": "<jerinj@marvell.com>, Radu Nicolau <radu.nicolau@intel.com>, Akhil Goyal\n <gakhil@marvell.com>",
        "CC": "<dev@dpdk.org>, <anoobj@marvell.com>, Nithin Dabilpuram\n <ndabilpuram@marvell.com>",
        "Subject": "[PATCH 5/7] examples/ipsec-secgw: get security context from lcore\n conf",
        "Date": "Tue, 22 Mar 2022 23:28:43 +0530",
        "Message-ID": "<20220322175902.363520-5-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220322175902.363520-1-ndabilpuram@marvell.com>",
        "References": "<20220322175902.363520-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "myyF0IBIjkyi29Vd7KiWNnT6cU72vkD_",
        "X-Proofpoint-ORIG-GUID": "myyF0IBIjkyi29Vd7KiWNnT6cU72vkD_",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514\n definitions=2022-03-22_07,2022-03-22_01,2022-02-23_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": "Store security context pointer in lcore Rx queue config and\nget it from there in fast path for better performance.\nCurrently rte_eth_dev_get_sec_ctx() which is meant to be control\npath API is called per packet basis. For every call to that\nAPI, ethdev port status is checked.\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\n---\n examples/ipsec-secgw/ipsec-secgw.c  | 22 +++++++++++++++++++---\n examples/ipsec-secgw/ipsec.h        |  1 +\n examples/ipsec-secgw/ipsec_worker.h | 17 +++++++----------\n 3 files changed, 27 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c\nindex 1d0ce3a..a04b5e8 100644\n--- a/examples/ipsec-secgw/ipsec-secgw.c\n+++ b/examples/ipsec-secgw/ipsec-secgw.c\n@@ -544,11 +544,11 @@ process_pkts_outbound_nosp(struct ipsec_ctx *ipsec_ctx,\n \n static inline void\n process_pkts(struct lcore_conf *qconf, struct rte_mbuf **pkts,\n-\t\tuint8_t nb_pkts, uint16_t portid)\n+\t     uint8_t nb_pkts, uint16_t portid, struct rte_security_ctx *ctx)\n {\n \tstruct ipsec_traffic traffic;\n \n-\tprepare_traffic(pkts, &traffic, nb_pkts);\n+\tprepare_traffic(ctx, pkts, &traffic, nb_pkts);\n \n \tif (unlikely(single_sa)) {\n \t\tif (is_unprotected_port(portid))\n@@ -740,7 +740,8 @@ ipsec_poll_mode_worker(void)\n \n \t\t\tif (nb_rx > 0) {\n \t\t\t\tcore_stats_update_rx(nb_rx);\n-\t\t\t\tprocess_pkts(qconf, pkts, nb_rx, portid);\n+\t\t\t\tprocess_pkts(qconf, pkts, nb_rx, portid,\n+\t\t\t\t\t     rxql->sec_ctx);\n \t\t\t}\n \n \t\t\t/* dequeue and process completed crypto-ops */\n@@ -3060,6 +3061,21 @@ main(int32_t argc, char **argv)\n \n \tflow_init();\n \n+\t/* Get security context if available and only if dynamic field is\n+\t * registered for fast path access.\n+\t */\n+\tif (!rte_security_dynfield_is_registered())\n+\t\tgoto skip_sec_ctx;\n+\n+\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n+\t\tfor (i = 0; i < lcore_conf[lcore_id].nb_rx_queue; i++) {\n+\t\t\tportid = lcore_conf[lcore_id].rx_queue_list[i].port_id;\n+\t\t\tlcore_conf[lcore_id].rx_queue_list[i].sec_ctx =\n+\t\t\t\trte_eth_dev_get_sec_ctx(portid);\n+\t\t}\n+\t}\n+skip_sec_ctx:\n+\n \tcheck_all_ports_link_status(enabled_port_mask);\n \n \tif (stats_interval > 0)\ndiff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h\nindex 9a4e7ea..ecad262 100644\n--- a/examples/ipsec-secgw/ipsec.h\n+++ b/examples/ipsec-secgw/ipsec.h\n@@ -269,6 +269,7 @@ struct cnt_blk {\n struct lcore_rx_queue {\n \tuint16_t port_id;\n \tuint8_t queue_id;\n+\tstruct rte_security_ctx *sec_ctx;\n } __rte_cache_aligned;\n \n struct buffer {\ndiff --git a/examples/ipsec-secgw/ipsec_worker.h b/examples/ipsec-secgw/ipsec_worker.h\nindex eb966a6..838b3f6 100644\n--- a/examples/ipsec-secgw/ipsec_worker.h\n+++ b/examples/ipsec-secgw/ipsec_worker.h\n@@ -115,7 +115,8 @@ adjust_ipv6_pktlen(struct rte_mbuf *m, const struct rte_ipv6_hdr *iph,\n }\n \n static __rte_always_inline void\n-prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t)\n+prepare_one_packet(struct rte_security_ctx *ctx, struct rte_mbuf *pkt,\n+\t\t   struct ipsec_traffic *t)\n {\n \tuint32_t ptype = pkt->packet_type;\n \tconst struct rte_ether_hdr *eth;\n@@ -201,13 +202,9 @@ prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t)\n \t * with the security session.\n \t */\n \n-\tif (pkt->ol_flags & RTE_MBUF_F_RX_SEC_OFFLOAD &&\n-\t\t\trte_security_dynfield_is_registered()) {\n+\tif (ctx && pkt->ol_flags & RTE_MBUF_F_RX_SEC_OFFLOAD) {\n \t\tstruct ipsec_sa *sa;\n \t\tstruct ipsec_mbuf_metadata *priv;\n-\t\tstruct rte_security_ctx *ctx = (struct rte_security_ctx *)\n-\t\t\t\t\t\trte_eth_dev_get_sec_ctx(\n-\t\t\t\t\t\tpkt->port);\n \n \t\t/* Retrieve the userdata registered. Here, the userdata\n \t\t * registered is the SA pointer.\n@@ -229,8 +226,8 @@ prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t)\n }\n \n static __rte_always_inline void\n-prepare_traffic(struct rte_mbuf **pkts, struct ipsec_traffic *t,\n-\t\tuint16_t nb_pkts)\n+prepare_traffic(struct rte_security_ctx *ctx, struct rte_mbuf **pkts,\n+\t\tstruct ipsec_traffic *t, uint16_t nb_pkts)\n {\n \tint32_t i;\n \n@@ -241,11 +238,11 @@ prepare_traffic(struct rte_mbuf **pkts, struct ipsec_traffic *t,\n \tfor (i = 0; i < (nb_pkts - PREFETCH_OFFSET); i++) {\n \t\trte_prefetch0(rte_pktmbuf_mtod(pkts[i + PREFETCH_OFFSET],\n \t\t\t\t\tvoid *));\n-\t\tprepare_one_packet(pkts[i], t);\n+\t\tprepare_one_packet(ctx, pkts[i], t);\n \t}\n \t/* Process left packets */\n \tfor (; i < nb_pkts; i++)\n-\t\tprepare_one_packet(pkts[i], t);\n+\t\tprepare_one_packet(ctx, pkts[i], t);\n }\n \n static __rte_always_inline void\n",
    "prefixes": [
        "5/7"
    ]
}