get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63654,
    "url": "http://patches.dpdk.org/api/patches/63654/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1575808249-31135-14-git-send-email-anoobj@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": "<1575808249-31135-14-git-send-email-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1575808249-31135-14-git-send-email-anoobj@marvell.com",
    "date": "2019-12-08T12:30:48",
    "name": "[13/14] examples/ipsec-secgw: add app outbound worker",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cbbc48664bc8eb2277a29c6f64db27671a51f57e",
    "submitter": {
        "id": 1205,
        "url": "http://patches.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@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/1575808249-31135-14-git-send-email-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 7750,
            "url": "http://patches.dpdk.org/api/series/7750/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7750",
            "date": "2019-12-08T12:30:35",
            "name": "add eventmode to ipsec-secgw",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/7750/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63654/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/63654/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 32013A04F1;\n\tSun,  8 Dec 2019 13:33:41 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 365051BFD5;\n\tSun,  8 Dec 2019 13:32:29 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id BB7C71BFD5\n for <dev@dpdk.org>; Sun,  8 Dec 2019 13:32:27 +0100 (CET)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n xB8CVHXD021943; Sun, 8 Dec 2019 04:32:27 -0800",
            "from sc-exch03.marvell.com ([199.233.58.183])\n by mx0a-0016f401.pphosted.com with ESMTP id 2wrbawjm8s-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Sun, 08 Dec 2019 04:32:26 -0800",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 8 Dec\n 2019 04:32:25 -0800",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n Transport; Sun, 8 Dec 2019 04:32:25 -0800",
            "from ajoseph83.caveonetworks.com.com (unknown [10.29.45.60])\n by maili.marvell.com (Postfix) with ESMTP id 6A6703F703F;\n Sun,  8 Dec 2019 04:32:21 -0800 (PST)"
        ],
        "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=pfpt0818;\n bh=x5lyPZ0b/+GMXuICmQZ1pbBegy6ZWY9dUKxz/cOZCL0=;\n b=IchmP6w0PvlOUB7wJZsuwG50qXJGmLCqu2FTJLErkFYDUK+li+7bcJeZpoodAKfbE2eB\n XCj/DiQGJy7Cb2S99Dly6wTl79piBd1XExaPFarYM6KOEGBgqLj8DH3CBhVgffxkQdUz\n tQawa/ru7f4Z9lxvKfRYsCUK9c40P02m4lEkbgwwX20DVbhqmkfhG5m0OamxRLUlRxDi\n DCRnHPxmygp7hLECwDraVLM9Y2q9uTHIfrLhIJ0acpgXVMzZkJ/09WVtEL4vMVJJkvHB\n FB7A8ikIeJy3JMfeg7scw3GGniYXEHyPcrBJfqB4P0RAcwMmknW+n/msn5BSAmdmkb8I Eg==",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Akhil Goyal <akhil.goyal@nxp.com>, Radu Nicolau <radu.nicolau@intel.com>,\n Thomas Monjalon <thomas@monjalon.net>",
        "CC": "Ankur Dwivedi <adwivedi@marvell.com>, Jerin Jacob <jerinj@marvell.com>,\n Narayana Prasad <pathreya@marvell.com>, Anoob Joseph <anoobj@marvell.com>,\n Archana Muniganti <marchana@marvell.com>, Tejasree Kondoj\n <ktejasree@marvell.com>, Vamsi Attunuru <vattunuru@marvell.com>, \"Lukasz\n Bartosik\" <lbartosik@marvell.com>, Konstantin Ananyev\n <konstantin.ananyev@intel.com>, <dev@dpdk.org>",
        "Date": "Sun, 8 Dec 2019 18:00:48 +0530",
        "Message-ID": "<1575808249-31135-14-git-send-email-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1575808249-31135-1-git-send-email-anoobj@marvell.com>",
        "References": "<1575808249-31135-1-git-send-email-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.95,18.0.572\n definitions=2019-12-08_03:2019-12-05,2019-12-08 signatures=0",
        "Subject": "[dpdk-dev] [PATCH 13/14] examples/ipsec-secgw: add app outbound\n\tworker",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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: Ankur Dwivedi <adwivedi@marvell.com>\n\nThis patch adds the app outbound worker thread.\n\nSigned-off-by: Ankur Dwivedi <adwivedi@marvell.com>\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Lukasz Bartosik <lbartosik@marvell.com>\n---\n examples/ipsec-secgw/ipsec_worker.c | 193 +++++++++++++++++++++++++++++++++++-\n 1 file changed, 192 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c\nindex e202277..41d2264 100644\n--- a/examples/ipsec-secgw/ipsec_worker.c\n+++ b/examples/ipsec-secgw/ipsec_worker.c\n@@ -256,6 +256,101 @@ process_ipsec_ev_inbound(struct ipsec_ctx *ctx, struct route_table *rt,\n \treturn 0;\n }\n \n+static inline int\n+process_ipsec_ev_outbound(struct ipsec_ctx *ctx, struct route_table *rt,\n+\t\tstruct rte_event *ev)\n+{\n+\tstruct rte_ipsec_session *sess;\n+\tstruct sa_ctx *sa_ctx;\n+\tstruct rte_mbuf *pkt;\n+\tuint16_t port_id = 0;\n+\tstruct ipsec_sa *sa;\n+\tenum pkt_type type;\n+\tuint32_t sa_idx;\n+\tuint8_t *nlp;\n+\n+\t/* Get pkt from event */\n+\tpkt = ev->mbuf;\n+\n+\t/* Check the packet type */\n+\ttype = process_ipsec_get_pkt_type(pkt, &nlp);\n+\n+\tswitch (type) {\n+\tcase PKT_TYPE_PLAIN_IPV4:\n+\t\t/* Check if we have a match */\n+\t\tif (check_sp(ctx->sp4_ctx, nlp, &sa_idx) == 0) {\n+\t\t\t/* No valid match */\n+\t\t\tgoto drop_pkt_and_exit;\n+\t\t}\n+\t\tbreak;\n+\tcase PKT_TYPE_PLAIN_IPV6:\n+\t\t/* Check if we have a match */\n+\t\tif (check_sp(ctx->sp6_ctx, nlp, &sa_idx) == 0) {\n+\t\t\t/* No valid match */\n+\t\t\tgoto drop_pkt_and_exit;\n+\t\t}\n+\t\tbreak;\n+\tdefault:\n+\t\t/*\n+\t\t * Only plain IPv4 & IPv6 packets are allowed\n+\t\t * on protected port. Drop the rest.\n+\t\t */\n+\t\tRTE_LOG(ERR, IPSEC, \"Unsupported packet type = %d\\n\", type);\n+\t\tgoto drop_pkt_and_exit;\n+\t}\n+\n+\t/* Check if the packet has to be bypassed */\n+\tif (sa_idx == 0) {\n+\t\tport_id = get_route(pkt, rt, type);\n+\t\tif (unlikely(port_id == RTE_MAX_ETHPORTS)) {\n+\t\t\t/* no match */\n+\t\t\tgoto drop_pkt_and_exit;\n+\t\t}\n+\t\t/* else, we have a matching route */\n+\t\tgoto send_pkt;\n+\t}\n+\n+\t/* Else the packet has to be protected */\n+\n+\t/* Get SA ctx*/\n+\tsa_ctx = ctx->sa_ctx;\n+\n+\t/* Get SA */\n+\tsa = &(sa_ctx->sa[sa_idx]);\n+\n+\t/* Get IPsec session */\n+\tsess = ipsec_get_primary_session(sa);\n+\n+\t/* Allow only inline protocol for now */\n+\tif (sess->type != RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) {\n+\t\tRTE_LOG(ERR, IPSEC, \"SA type not supported\\n\");\n+\t\tgoto drop_pkt_and_exit;\n+\t}\n+\n+\tif (sess->security.ol_flags & RTE_SECURITY_TX_OLOAD_NEED_MDATA)\n+\t\tpkt->udata64 = (uint64_t) sess->security.ses;\n+\n+\t/* Mark the packet for Tx security offload */\n+\tpkt->ol_flags |= PKT_TX_SEC_OFFLOAD;\n+\n+\t/* Get the port to which this pkt need to be submitted */\n+\tport_id = sa->portid;\n+\n+send_pkt:\n+\t/* Update mac addresses */\n+\tupdate_mac_addrs(pkt, port_id);\n+\n+\t/* Update the event with the dest port */\n+\tipsec_event_pre_forward(pkt, port_id);\n+\treturn 1;\n+\n+drop_pkt_and_exit:\n+\tRTE_LOG(ERR, IPSEC, \"Outbound packet dropped\\n\");\n+\trte_pktmbuf_free(pkt);\n+\tev->mbuf = NULL;\n+\treturn 0;\n+}\n+\n /*\n  * Event mode exposes various operating modes depending on the\n  * capabilities of the event device and the operating mode\n@@ -263,7 +358,7 @@ process_ipsec_ev_inbound(struct ipsec_ctx *ctx, struct route_table *rt,\n  */\n \n /* Workers registered */\n-#define IPSEC_EVENTMODE_WORKERS\t\t3\n+#define IPSEC_EVENTMODE_WORKERS\t\t4\n \n /*\n  * Event mode worker\n@@ -501,6 +596,92 @@ ipsec_wrkr_non_burst_int_port_drvr_mode_outb(struct eh_event_link_info *links,\n \treturn;\n }\n \n+/*\n+ * Event mode worker\n+ * Operating parameters : non-burst - Tx internal port - app mode - outbound\n+ */\n+static void\n+ipsec_wrkr_non_burst_int_port_app_mode_outb(struct eh_event_link_info *links,\n+\t\tuint8_t nb_links)\n+{\n+\tstruct lcore_conf_ev_tx_int_port_wrkr lconf;\n+\tunsigned int nb_rx = 0;\n+\tstruct rte_event ev;\n+\tuint32_t lcore_id;\n+\tint32_t socket_id;\n+\n+\t/* Check if we have links registered for this lcore */\n+\tif (nb_links == 0) {\n+\t\t/* No links registered - exit */\n+\t\tgoto exit;\n+\t}\n+\n+\t/* We have valid links */\n+\n+\t/* Get core ID */\n+\tlcore_id = rte_lcore_id();\n+\n+\t/* Get socket ID */\n+\tsocket_id = rte_lcore_to_socket_id(lcore_id);\n+\n+\t/* Save routing table */\n+\tlconf.rt.rt4_ctx = socket_ctx[socket_id].rt_ip4;\n+\tlconf.rt.rt6_ctx = socket_ctx[socket_id].rt_ip6;\n+\tlconf.inbound.sp4_ctx = socket_ctx[socket_id].sp_ip4_in;\n+\tlconf.inbound.sp6_ctx = socket_ctx[socket_id].sp_ip6_in;\n+\tlconf.inbound.sa_ctx = socket_ctx[socket_id].sa_in;\n+\tlconf.inbound.session_pool = socket_ctx[socket_id].session_pool;\n+\tlconf.outbound.sp4_ctx = socket_ctx[socket_id].sp_ip4_out;\n+\tlconf.outbound.sp6_ctx = socket_ctx[socket_id].sp_ip6_out;\n+\tlconf.outbound.sa_ctx = socket_ctx[socket_id].sa_out;\n+\tlconf.outbound.session_pool = socket_ctx[socket_id].session_pool;\n+\n+\tRTE_LOG(INFO, IPSEC,\n+\t\t\"Launching event mode worker (non-burst - Tx internal port - \"\n+\t\t\"app mode - outbound) on lcore %d\\n\", lcore_id);\n+\n+\t/* Check if it's single link */\n+\tif (nb_links != 1) {\n+\t\tRTE_LOG(INFO, IPSEC,\n+\t\t\t\"Multiple links not supported. Using first link\\n\");\n+\t}\n+\n+\tRTE_LOG(INFO, IPSEC, \" -- lcoreid=%u event_port_id=%u\\n\", lcore_id,\n+\t\tlinks[0].event_port_id);\n+\n+\twhile (!force_quit) {\n+\t\t/* Read packet from event queues */\n+\t\tnb_rx = rte_event_dequeue_burst(links[0].eventdev_id,\n+\t\t\t\tlinks[0].event_port_id,\n+\t\t\t\t&ev,     /* events */\n+\t\t\t\t1,       /* nb_events */\n+\t\t\t\t0        /* timeout_ticks */);\n+\n+\t\tif (nb_rx == 0)\n+\t\t\tcontinue;\n+\n+\t\tif (process_ipsec_ev_outbound(&lconf.outbound,\n+\t\t\t\t&lconf.rt, &ev) != 1) {\n+\t\t\t/* The pkt has been dropped */\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\t/*\n+\t\t * Since tx internal port is available, events can be\n+\t\t * directly enqueued to the adapter and it would be\n+\t\t * internally submitted to the eth device.\n+\t\t */\n+\t\trte_event_eth_tx_adapter_enqueue(links[0].eventdev_id,\n+\t\t\t\tlinks[0].event_port_id,\n+\t\t\t\t&ev,\t/* events */\n+\t\t\t\t1,\t/* nb_events */\n+\t\t\t\t0\t/* flags */);\n+\t}\n+\n+exit:\n+\treturn;\n+}\n+\n static uint8_t\n ipsec_eventmode_populate_wrkr_params(struct eh_app_worker_params *wrkrs)\n {\n@@ -537,6 +718,16 @@ ipsec_eventmode_populate_wrkr_params(struct eh_app_worker_params *wrkrs)\n \twrkr->cap.ipsec_dir = EH_IPSEC_DIR_TYPE_OUTBOUND;\n \twrkr->worker_thread = ipsec_wrkr_non_burst_int_port_drvr_mode_outb;\n \n+\twrkr++;\n+\tnb_wrkr_param++;\n+\n+\t/* Non-burst - Tx internal port - app mode - outbound */\n+\twrkr->cap.burst = EH_RX_TYPE_NON_BURST;\n+\twrkr->cap.tx_internal_port = EH_TX_TYPE_INTERNAL_PORT;\n+\twrkr->cap.ipsec_mode = EH_IPSEC_MODE_TYPE_APP;\n+\twrkr->cap.ipsec_dir = EH_IPSEC_DIR_TYPE_OUTBOUND;\n+\twrkr->worker_thread = ipsec_wrkr_non_burst_int_port_app_mode_outb;\n+\n \tnb_wrkr_param++;\n \treturn nb_wrkr_param;\n }\n",
    "prefixes": [
        "13/14"
    ]
}