get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77037,
    "url": "http://patches.dpdk.org/api/patches/77037/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200909120853.11715-3-guyk@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": "<20200909120853.11715-3-guyk@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200909120853.11715-3-guyk@marvell.com",
    "date": "2020-09-09T12:08:53",
    "name": "[v2,2/2] doc: add l3fwd-regex application user guide",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7288cb78c0b36210960e5f00d31bf0e3ad73f836",
    "submitter": {
        "id": 1636,
        "url": "http://patches.dpdk.org/api/people/1636/?format=api",
        "name": "Guy Kaneti",
        "email": "guyk@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200909120853.11715-3-guyk@marvell.com/mbox/",
    "series": [
        {
            "id": 12054,
            "url": "http://patches.dpdk.org/api/series/12054/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12054",
            "date": "2020-09-09T12:08:51",
            "name": "Add example l3fwd-regex",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/12054/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77037/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/77037/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 623ACA04B1;\n\tWed,  9 Sep 2020 14:10:46 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C2F261C0DC;\n\tWed,  9 Sep 2020 14:10:28 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id D28981C0D1\n for <dev@dpdk.org>; Wed,  9 Sep 2020 14:10:26 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 089C5LBr013786; Wed, 9 Sep 2020 05:10:26 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 33ccvr6b71-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 09 Sep 2020 05:10:26 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Wed, 9 Sep 2020 05:10:24 -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.2 via Frontend\n Transport; Wed, 9 Sep 2020 05:10:24 -0700",
            "from vvenus124.il.marvell.com (unknown [10.5.116.64])\n by maili.marvell.com (Postfix) with ESMTP id F1D8F3F7043;\n Wed,  9 Sep 2020 05:10:21 -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=RLifTR2QEu8WsydTUIhmXGxxuN7BqmQjhM8z/E9D3kM=;\n b=hRfr1epTnwEiSB+rKtPwIXUyffHTK+hg7DPVAILk3JCzFigLHCNJHO4JveSDgVvGPXDA\n xNgMz04TjZGfYWEWOIpb09sX7FqfcMqkWVhv1h1KOah2WUwG76+qTL5qwqZKHhfR4LoG\n YoH8Xfs45Ipm3EGmPgP1rQiTxaU2IqHdahWVgbusrB/ev2RDg0eJTmwVq4O3MBR95+u6\n 541juwtjLCB5TWD2zHQ5vH90IGB44j5gHxnYMIVL5e2g34AQ7WDY5zVbpwvrdxHGiP2v\n EkGe0BJ61acjxNzCynODvWZnshAol5b+pcXRgDjc9d0fSmfT6kTVhR6OhFc88Xj36FlH iQ==",
        "From": "<guyk@marvell.com>",
        "To": "<thomas@monjalon.net>, <orika@mellanox.com>, <john.mcnamara@intel.com>,\n <marko.kovacevic@intel.com>",
        "CC": "<dev@dpdk.org>, <guyk@marvell.com>, <jerinj@marvell.com>,\n <smadarf@marvell.com>, <dovrat@marvell.com>",
        "Date": "Wed, 9 Sep 2020 15:08:53 +0300",
        "Message-ID": "<20200909120853.11715-3-guyk@marvell.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20200909120853.11715-1-guyk@marvell.com>",
        "References": "<20200908123144.26444-3-guyk@marvell.com>\n <20200909120853.11715-1-guyk@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.235, 18.0.687\n definitions=2020-09-09_06:2020-09-09,\n 2020-09-09 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v2 2/2] doc: add l3fwd-regex application user\n\tguide",
        "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: Guy Kaneti <guyk@marvell.com>\n\nAdding the user guide for l3fwd regex application.\n\nSigned-off-by: Guy Kaneti <guyk@marvell.com>\n---\n MAINTAINERS                                   |   1 +\n doc/guides/rel_notes/release_20_11.rst        |   4 +\n doc/guides/sample_app_ug/index.rst            |   1 +\n doc/guides/sample_app_ug/intro.rst            |   4 +\n doc/guides/sample_app_ug/l3_forward_regex.rst | 235 ++++++++++++++++++\n 5 files changed, 245 insertions(+)\n create mode 100644 doc/guides/sample_app_ug/l3_forward_regex.rst",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex e30b1ad56..f35f8bc01 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -435,6 +435,7 @@ F: doc/guides/prog_guide/regexdev.rst\n F: doc/guides/regexdevs/features/default.ini\n M: Guy Kaneti <guyk@marvell.com>\n F: examples/l3fwd-regex/\n+F: doc/guides/sample_app_ug/l3_forward_regex.rst\n \n Eventdev API\n M: Jerin Jacob <jerinj@marvell.com>\ndiff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex df227a177..8c27ba6fd 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -55,6 +55,10 @@ New Features\n      Also, make sure to start the actual text at the margin.\n      =======================================================\n \n+* **Added new l3fwd-regex sample application.**\n+\n+  Added an example application ``l3fwd-regex``. This demonstrates the usage of\n+  packet processing using DPDK Regex libraries.\n \n Removed Items\n -------------\ndiff --git a/doc/guides/sample_app_ug/index.rst b/doc/guides/sample_app_ug/index.rst\nindex affa9c574..dc67580af 100644\n--- a/doc/guides/sample_app_ug/index.rst\n+++ b/doc/guides/sample_app_ug/index.rst\n@@ -32,6 +32,7 @@ Sample Applications User Guides\n     l3_forward_graph\n     l3_forward_power_man\n     l3_forward_access_ctrl\n+    l3_forward_regex\n     link_status_intr\n     server_node_efd\n     service_cores\ndiff --git a/doc/guides/sample_app_ug/intro.rst b/doc/guides/sample_app_ug/intro.rst\nindex 8ff223b16..94070933b 100644\n--- a/doc/guides/sample_app_ug/intro.rst\n+++ b/doc/guides/sample_app_ug/intro.rst\n@@ -58,6 +58,10 @@ examples are highlighted below.\n   forwarding Graph, or ``l3fwd_graph`` application does forwarding based on IPv4\n   like a simple router with DPDK Graph framework.\n \n+* :doc:`Network Layer 3 forwarding Regex<l3_forward_regex>`: The Network Layer3\n+  forwarding Regex, or ``l3fwd-regex`` application does forwarding based on IPv4\n+  like a simple router with DPDK Regex framework.\n+\n * :doc:`Hardware packet copying<ioat>`: The Hardware packet copying,\n   or ``ioatfwd`` application demonstrates how to use IOAT rawdev driver for\n   copying packets between two threads.\ndiff --git a/doc/guides/sample_app_ug/l3_forward_regex.rst b/doc/guides/sample_app_ug/l3_forward_regex.rst\nnew file mode 100644\nindex 000000000..276cabdf4\n--- /dev/null\n+++ b/doc/guides/sample_app_ug/l3_forward_regex.rst\n@@ -0,0 +1,235 @@\n+..  SPDX-License-Identifier: BSD-3-Clause\n+    Copyright(C) 2020 Marvell International Ltd.\n+\n+L3 Forwarding Regex Sample Application\n+======================================\n+\n+The L3 Forwarding with Regex application is a simple example of packet processing using DPDK Regex framework.\n+The application performs L3 LPM based forwarding while using Regex framework for pre-filtering decision.\n+\n+Overview\n+--------\n+\n+The application demonstrates the use of the Regex libraries in DPDK to implement packet forwarding.\n+The initialization is very similar to those of the :doc:`l3_forward`.\n+There is also additional initialization of Regex device and configuration per lcore.\n+The main difference from the L3 Forwarding sample application is that this application introduces\n+Regex based pre-filtering decision done before LPM lookup.\n+Thus, packet can be dropped or flagged before the forwarding decision.\n+\n+In the sample application, only IPv4 forwarding is supported as of now.\n+\n+Compiling the Application\n+-------------------------\n+\n+To compile the sample application see :doc:`compiling`.\n+\n+The application is located in the ``l3fwd-regex`` sub-directory.\n+\n+Running the Application\n+-----------------------\n+\n+The application has a number of command line options similar to l3fwd::\n+\n+    ./l3fwd-graph [EAL options] -- -p PORTMASK\n+                                   [-P]\n+                                   --config (port,queue,lcore,regex-dev,regex-q)[,(port,queue,lcore,regex-dev,regex-q)]\n+                                   [--regex-rule-db-file FILENAME\n+                                   [--regex-drop]\n+                                   [--eth-dest=X,MM:MM:MM:MM:MM:MM]\n+                                   [--enable-jumbo [--max-pkt-len PKTLEN]]\n+                                   [--no-numa]\n+                                   [--parse-ptype]\n+                                   [--per-port-pool]\n+                                   [--regex-drop]\n+                                   [--regex-debug]\n+\n+Where,\n+\n+* ``-p PORTMASK:`` Hexadecimal bitmask of ports to configure\n+\n+* ``-P:`` Optional, sets all ports to promiscuous mode so that packets are accepted regardless of the packet's Ethernet MAC destination address.\n+  Without this option, only packets with the Ethernet MAC destination address set to the Ethernet address of the port are accepted.\n+\n+* ``--config (port,queue,lcore,regex-dev,regex-q)[,(port,queue,lcore,regex-dev,regex-q)]:`` Determines which queues from which ports are mapped\n+  to which cores, and which Regex device and queues to use.\n+\n+* ``--regex-rule-db-file FILENAME:`` prebuilt rule database to configure Regex device with.\n+\n+* ``--eth-dest=X,MM:MM:MM:MM:MM:MM:`` Optional, ethernet destination for port X.\n+\n+* ``--enable-jumbo:`` Optional, enables jumbo frames.\n+\n+*   --max-pkt-len: Optional, under the premise of enabling jumbo, maximum packet length in decimal (64-9600).\n+\n+* ``--no-numa:`` Optional, disables numa awareness.\n+\n+* ``--parse-ptype:`` Set to use software to analyze packet type.\n+\n+* ``--per-port-pool:`` Optional, set to use independent buffer pools per port. Without this option, single buffer pool is used for all ports.\n+\n+* ``--regex-drop:`` Enable Regex decision drop on match.\n+\n+* ``--regex-debug:`` Enable Regex debug printing.\n+\n+See :doc:`l3_forward` for details.\n+The L3fwd-regex example reuses the L3fwd command line options.\n+\n+Refer to the *DPDK Getting Started Guide* for general information on running applications and the Environment Abstraction Layer (EAL) options.\n+\n+.. _l3_fwd_regex_explanation:\n+\n+Explanation\n+-----------\n+\n+The following sections provide some explanation of the sample application code.\n+As mentioned in the overview section, the initialization is similar to that of the :doc:`l3_forward`.\n+Run-time path though similar in functionality to that of :doc:`l3_forward`, includes a Regex based pre-filtering stage before forwarding.\n+The following sections describe aspects that are specific to the L3 Forwarding Regex sample application.\n+\n+Regex Library Initialization\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+The Regex library is initialized during the l3fwd poll resource setup.\n+The Regex device is configured with the input rule data base and each queue\n+that was mapped with ``--config`` is setup.\n+\n+.. code-block:: c\n+\n+    /* ... */\n+    ret = rte_regexdev_info_get(dev_id, &dev_info);\n+    /* ... */\n+\n+    cfg.dev_cfg_flags = 0;\n+    cfg.nb_max_matches = dev_info.max_matches;\n+    cfg.nb_queue_pairs = nb_queue_pairs;\n+    cfg.nb_rules_per_group = dev_info.max_rules_per_group;\n+    cfg.nb_groups = dev_info.max_groups;\n+    cfg.rule_db = conf->rule_db;\n+    cfg.rule_db_len = conf->rule_db_len;\n+    ret = rte_regexdev_configure(dev_id, &cfg);\n+    /* ... */\n+\n+    qp_conf.qp_conf_flags = 0;\n+    qp_conf.nb_desc = 8192;\n+    qp_conf.cb = NULL;\n+    for (i = 0; i < nb_queue_pairs; i++) {\n+        ret = rte_regexdev_queue_pair_setup(dev_id, i, &qp_conf);\n+        /* ... */\n+        }\n+    }\n+\n+After device and queue configuration there is a per lcore configuration,\n+where a ``rte_regex_ops`` pool is created and initialized.\n+\n+.. code-block:: c\n+\n+    /* ... */\n+    for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n+        if (rte_lcore_is_enabled(lcore_id) == 0)\n+            continue;\n+            /* ... */\n+        ret = regex_lcore_init(lcore_id, qconf->regex_dev_id,\n+                qconf->regex_qp_id);\n+        /* ... */\n+    }\n+\n+.. code-block:: c\n+\n+    int\n+    regex_lcore_init(uint32_t lcore_id, uint32_t dev_id, uint32_t qp_id)\n+    {\n+        uint32_t i;\n+\n+        regex_lcore_conf[lcore_id].qp_id = qp_id;\n+        regex_lcore_conf[lcore_id].dev_id = dev_id;\n+\n+        memset(&regex_lcore_params[lcore_id].stats, 0,\n+                sizeof(struct regex_stats));\n+\n+        regex_lcore_conf[lcore_id].ops = rte_malloc(\"regex_ops\",\n+                REGEX_NB_OPS*sizeof(struct rte_regex_ops *),\n+                0);\n+        /* ... */\n+        regex_lcore_conf[lcore_id].ops_pool = rte_malloc(\"regex_ops_pool\",\n+                REGEX_NB_OPS*sizeof(struct rte_regex_ops *),\n+                0);\n+        /* ... */\n+        for (i = 0; i < REGEX_NB_OPS; i++) {\n+            regex_lcore_conf[lcore_id].ops_pool[i] = rte_malloc(\"\",\n+                    REGEX_OPS_DATA_SIZE, 0);\n+            /* ... */\n+        }\n+        regex_lcore_params[lcore_id].ops_head = 0;\n+        regex_lcore_params[lcore_id].ops_tail = 0;\n+        regex_lcore_params[lcore_id].ops_avail = REGEX_NB_OPS;\n+\n+        return 0;\n+    }\n+\n+Packet Forwarding with Regex\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+As part of slave lcores main loop, after packets are received from network port,\n+they are sent to the Regex device to be matched against the programmed Regex rules.\n+After that the REgex device is polled for responses during which the finished ops are checked for matches and an ops that had a match is counted.\n+The finished Regex ops are sent to the forwarding decision.\n+\n+.. note::\n+\n+    packets that had a match will be dropped during the forwarding decision\n+    if ``--regex-drop`` was given as an input to the application.\n+\n+.. code-block:: c\n+\n+    /* Main processing loop */\n+\n+    /* ... */\n+\n+     * Read packet from RX queues\n+     */\n+    for (i = 0; i < qconf->n_rx_queue; ++i) {\n+        portid = qconf->rx_queue_list[i].port_id;\n+        queueid = qconf->rx_queue_list[i].queue_id;\n+        nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst,\n+            MAX_PKT_BURST);\n+        if (nb_rx == 0)\n+            continue;\n+        nb_ops = regex_enqueue_burst_ops(regex_dev_id,\n+                lcore_id, regex_qp_id,\n+                pkts_burst, nb_rx);\n+        /* ... */\n+\n+        regex_nb_ops += nb_ops;\n+\n+        deq_cnt = regex_dequeue_burst_ops(regex_dev_id,\n+                lcore_id, regex_qp_id,\n+                pkts_burst, REGEX_NB_OPS);\n+        if (deq_cnt) {\n+            l3fwd_lpm_no_opt_send_packets(deq_cnt,\n+                    pkts_burst,\n+                    portid, qconf);\n+            regex_nb_ops -= deq_cnt;\n+        }\n+\n+    }\n+\n+During the Regex ops response processing, if ``--regex-drop`` was given as an input to the application,\n+the packet is marked to be dropped, by setting ``mbuf->packet_type = RTE_PTYPE_UNKNOWN``.\n+Because during the forwarding decision non-IP packets are dropped.\n+\n+.. code-block:: c\n+\n+    l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,\n+            struct lcore_conf *qconf)\n+    {\n+        /* ... */\n+        if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {\n+            /* ... */\n+        } else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {\n+            /* ... */\n+        } else {\n+            /* Free the mbuf that contains non-IPV4/IPV6 packet */\n+            rte_pktmbuf_free(m);\n+        }\n+    }\n",
    "prefixes": [
        "v2",
        "2/2"
    ]
}