get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 94792,
    "url": "https://patches.dpdk.org/api/patches/94792/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210624102848.3878788-2-gakhil@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210624102848.3878788-2-gakhil@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210624102848.3878788-2-gakhil@marvell.com",
    "date": "2021-06-24T10:28:48",
    "name": "[2/2] examples/ipsec-secgw: modify event mode inline path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "faf137d891cf7f3ee90bf5ebe288f502c2930e2f",
    "submitter": {
        "id": 2094,
        "url": "https://patches.dpdk.org/api/people/2094/?format=api",
        "name": "Akhil Goyal",
        "email": "gakhil@marvell.com"
    },
    "delegate": {
        "id": 6690,
        "url": "https://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210624102848.3878788-2-gakhil@marvell.com/mbox/",
    "series": [
        {
            "id": 17470,
            "url": "https://patches.dpdk.org/api/series/17470/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17470",
            "date": "2021-06-24T10:28:47",
            "name": "[1/2] security: enforce semantics for Tx inline processing",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/17470/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/94792/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/94792/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 EC883A0547;\n\tThu, 24 Jun 2021 12:29:22 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2EF5240DDE;\n\tThu, 24 Jun 2021 12:29:18 +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 3144B410DD\n for <dev@dpdk.org>; Thu, 24 Jun 2021 12:29:17 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 15OAAM6N011087; Thu, 24 Jun 2021 03:29:16 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 39cg2n9q2k-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 24 Jun 2021 03:29:15 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Thu, 24 Jun 2021 03:29:13 -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; Thu, 24 Jun 2021 03:29:13 -0700",
            "from localhost.localdomain (unknown [10.28.36.185])\n by maili.marvell.com (Postfix) with ESMTP id D475C5B6954;\n Thu, 24 Jun 2021 03:29:10 -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=QlfrsWRStjqmRl+LbQjn9SPp9/z/xVQV4ThDDvZ13zU=;\n b=j46UFS8EA25RWXnfIiJ/TslUQHcwLu4zclUgVPqe3RX7xv9urvcS/dBRuK1R3rSIcMRQ\n A0mMggEAvEvqRbV0dqi6zd0JQHR+lTrWNU3qnsLzuwtCbrWqE/0KKQA7mwLu1rhkrlTu\n lWvEvK/UrC7ZVHoyTqZEhpGfrOV+jYhAMyyIZoybV344lAxdTTfg1wRR2f5m/TJQNKi5\n 9oUqnLRKxqGCcDp4BOnhWf3/lRBoqOmTnbHfD2+mpJH6nk7qNHq+g0O9t37+6jN8qmbK\n E1o73nbvSFsbWlM6FM+hj7D78m6R9kSgfDpb6NbvKZwLWhtQQwOKjLPWj8sDL8+W0/YN SA==",
        "From": "Akhil Goyal <gakhil@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<hemant.agrawal@nxp.com>, <thomas@monjalon.net>, <g.singh@nxp.com>,\n <ferruh.yigit@intel.com>, <roy.fan.zhang@intel.com>,\n <konstantin.ananyev@intel.com>, <olivier.matz@6wind.com>,\n <jerinj@marvell.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>, \"Akhil\n Goyal\" <gakhil@marvell.com>",
        "Date": "Thu, 24 Jun 2021 15:58:48 +0530",
        "Message-ID": "<20210624102848.3878788-2-gakhil@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210624102848.3878788-1-gakhil@marvell.com>",
        "References": "<20210624102848.3878788-1-gakhil@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "UKqUCewX1F_utkTAsVZoLD3stJ2r0CXu",
        "X-Proofpoint-GUID": "UKqUCewX1F_utkTAsVZoLD3stJ2r0CXu",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790\n definitions=2021-06-24_06:2021-06-24,\n 2021-06-24 signatures=0",
        "Subject": "[dpdk-dev] [PATCH 2/2] examples/ipsec-secgw: modify event mode\n inline path",
        "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: Nithin Dabilpuram <ndabilpuram@marvell.com>\n\nAlign event mode path for Tx inline IPsec processing to adhere to\nsecurity spec. Call rte_security_set_pkt_metadata() only with\nmbuf containing L3 header and above. Also update mbuf.l2_len\nwith L2 header size.\n\nThis patch also fixes a bug in arg parsing.\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\nReviewed-by: Akhil Goyal <gakhil@marvell.com>\n---\n examples/ipsec-secgw/ipsec-secgw.c  |  2 ++\n examples/ipsec-secgw/ipsec_worker.c | 50 +++++++++++++++++++++--------\n 2 files changed, 38 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c\nindex f252d3498..7ad94cb82 100644\n--- a/examples/ipsec-secgw/ipsec-secgw.c\n+++ b/examples/ipsec-secgw/ipsec-secgw.c\n@@ -1495,6 +1495,8 @@ parse_portmask(const char *portmask)\n \tchar *end = NULL;\n \tunsigned long pm;\n \n+\terrno = 0;\n+\n \t/* parse hexadecimal string */\n \tpm = strtoul(portmask, &end, 16);\n \tif ((portmask[0] == '\\0') || (end == NULL) || (*end != '\\0'))\ndiff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c\nindex 647e22df5..401fd6186 100644\n--- a/examples/ipsec-secgw/ipsec_worker.c\n+++ b/examples/ipsec-secgw/ipsec_worker.c\n@@ -12,6 +12,11 @@\n #include \"ipsec-secgw.h\"\n #include \"ipsec_worker.h\"\n \n+struct port_drv_mode_data {\n+\tstruct rte_security_session *sess;\n+\tstruct rte_security_ctx *ctx;\n+};\n+\n static inline enum pkt_type\n process_ipsec_get_pkt_type(struct rte_mbuf *pkt, uint8_t **nlp)\n {\n@@ -43,6 +48,8 @@ update_mac_addrs(struct rte_mbuf *pkt, uint16_t portid)\n {\n \tstruct rte_ether_hdr *ethhdr;\n \n+\tpkt->l2_len = RTE_ETHER_HDR_LEN;\n+\n \tethhdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);\n \tmemcpy(&ethhdr->s_addr, &ethaddr_tbl[portid].src, RTE_ETHER_ADDR_LEN);\n \tmemcpy(&ethhdr->d_addr, &ethaddr_tbl[portid].dst, RTE_ETHER_ADDR_LEN);\n@@ -60,7 +67,8 @@ ipsec_event_pre_forward(struct rte_mbuf *m, unsigned int port_id)\n \n static inline void\n prepare_out_sessions_tbl(struct sa_ctx *sa_out,\n-\t\tstruct rte_security_session **sess_tbl, uint16_t size)\n+\t\t\t struct port_drv_mode_data *data,\n+\t\t\t uint16_t size)\n {\n \tstruct rte_ipsec_session *pri_sess;\n \tstruct ipsec_sa *sa;\n@@ -95,9 +103,10 @@ prepare_out_sessions_tbl(struct sa_ctx *sa_out,\n \t\t}\n \n \t\t/* Use only first inline session found for a given port */\n-\t\tif (sess_tbl[sa->portid])\n+\t\tif (data[sa->portid].sess)\n \t\t\tcontinue;\n-\t\tsess_tbl[sa->portid] = pri_sess->security.ses;\n+\t\tdata[sa->portid].sess = pri_sess->security.ses;\n+\t\tdata[sa->portid].ctx = pri_sess->security.ctx;\n \t}\n }\n \n@@ -356,9 +365,11 @@ process_ipsec_ev_outbound(struct ipsec_ctx *ctx, struct route_table *rt,\n \t\tgoto drop_pkt_and_exit;\n \t}\n \n-\tif (sess->security.ol_flags & RTE_SECURITY_TX_OLOAD_NEED_MDATA)\n-\t\t*(struct rte_security_session **)rte_security_dynfield(pkt) =\n-\t\t\t\tsess->security.ses;\n+\t/* Remove L2 header before metadata set */\n+\trte_pktmbuf_adj(pkt, RTE_ETHER_HDR_LEN);\n+\n+\trte_security_set_pkt_metadata(sess->security.ctx,\n+\t\t\t\t      sess->security.ses, pkt, NULL);\n \n \t/* Mark the packet for Tx security offload */\n \tpkt->ol_flags |= PKT_TX_SEC_OFFLOAD;\n@@ -366,6 +377,9 @@ process_ipsec_ev_outbound(struct ipsec_ctx *ctx, struct route_table *rt,\n \t/* Get the port to which this pkt need to be submitted */\n \tport_id = sa->portid;\n \n+\t/* Add L2 header for processing */\n+\trte_pktmbuf_prepend(pkt, RTE_ETHER_HDR_LEN);\n+\n send_pkt:\n \t/* Update mac addresses */\n \tupdate_mac_addrs(pkt, port_id);\n@@ -398,7 +412,7 @@ static void\n ipsec_wrkr_non_burst_int_port_drv_mode(struct eh_event_link_info *links,\n \t\tuint8_t nb_links)\n {\n-\tstruct rte_security_session *sess_tbl[RTE_MAX_ETHPORTS] = { NULL };\n+\tstruct port_drv_mode_data data[RTE_MAX_ETHPORTS];\n \tunsigned int nb_rx = 0;\n \tstruct rte_mbuf *pkt;\n \tstruct rte_event ev;\n@@ -412,6 +426,8 @@ ipsec_wrkr_non_burst_int_port_drv_mode(struct eh_event_link_info *links,\n \t\treturn;\n \t}\n \n+\tmemset(&data, 0, sizeof(struct port_drv_mode_data));\n+\n \t/* Get core ID */\n \tlcore_id = rte_lcore_id();\n \n@@ -422,8 +438,8 @@ ipsec_wrkr_non_burst_int_port_drv_mode(struct eh_event_link_info *links,\n \t * Prepare security sessions table. In outbound driver mode\n \t * we always use first session configured for a given port\n \t */\n-\tprepare_out_sessions_tbl(socket_ctx[socket_id].sa_out, sess_tbl,\n-\t\t\tRTE_MAX_ETHPORTS);\n+\tprepare_out_sessions_tbl(socket_ctx[socket_id].sa_out, data,\n+\t\t\t\t RTE_MAX_ETHPORTS);\n \n \tRTE_LOG(INFO, IPSEC,\n \t\t\"Launching event mode worker (non-burst - Tx internal port - \"\n@@ -460,19 +476,25 @@ ipsec_wrkr_non_burst_int_port_drv_mode(struct eh_event_link_info *links,\n \n \t\tif (!is_unprotected_port(port_id)) {\n \n-\t\t\tif (unlikely(!sess_tbl[port_id])) {\n+\t\t\tif (unlikely(!data[port_id].sess)) {\n \t\t\t\trte_pktmbuf_free(pkt);\n \t\t\t\tcontinue;\n \t\t\t}\n \n+\t\t\t/* Remove L2 header before metadata set */\n+\t\t\trte_pktmbuf_adj(pkt, RTE_ETHER_HDR_LEN);\n+\n \t\t\t/* Save security session */\n-\t\t\tif (rte_security_dynfield_is_registered())\n-\t\t\t\t*(struct rte_security_session **)\n-\t\t\t\t\trte_security_dynfield(pkt) =\n-\t\t\t\t\t\tsess_tbl[port_id];\n+\t\t\trte_security_set_pkt_metadata(data[port_id].ctx,\n+\t\t\t\t\t\t      data[port_id].sess, pkt,\n+\t\t\t\t\t\t      NULL);\n \n \t\t\t/* Mark the packet for Tx security offload */\n \t\t\tpkt->ol_flags |= PKT_TX_SEC_OFFLOAD;\n+\n+\t\t\t/* Add L2 header for processing */\n+\t\t\trte_pktmbuf_prepend(pkt, RTE_ETHER_HDR_LEN);\n+\t\t\tpkt->l2_len = RTE_ETHER_HDR_LEN;\n \t\t}\n \n \t\t/*\n",
    "prefixes": [
        "2/2"
    ]
}