get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 60494,
    "url": "https://patches.dpdk.org/api/patches/60494/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191003131918.30970-4-bruce.richardson@intel.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": "<20191003131918.30970-4-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191003131918.30970-4-bruce.richardson@intel.com",
    "date": "2019-10-03T13:19:15",
    "name": "[3/6] examples/quota-watermark: remove example from DPDK",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5d0b9b1147074b7535a82fff25a5ceb43e0779fa",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20191003131918.30970-4-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 6683,
            "url": "https://patches.dpdk.org/api/series/6683/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6683",
            "date": "2019-10-03T13:19:12",
            "name": "remove a few example applications",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/6683/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/60494/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/60494/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0D6A51C10F;\n\tThu,  3 Oct 2019 15:19:53 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 447F11C10F;\n\tThu,  3 Oct 2019 15:19:51 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t03 Oct 2019 06:19:50 -0700",
            "from silpixa00399126.ir.intel.com (HELO\n\tsilpixa00399126.ger.corp.intel.com) ([10.237.223.2])\n\tby orsmga008.jf.intel.com with ESMTP; 03 Oct 2019 06:19:47 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.67,252,1566889200\"; d=\"scan'208\";a=\"185910562\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "techboard@dpdk.org,\n\tCiara Power <ciara.power@intel.com>",
        "Date": "Thu,  3 Oct 2019 14:19:15 +0100",
        "Message-Id": "<20191003131918.30970-4-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20191003131918.30970-1-bruce.richardson@intel.com>",
        "References": "<20191003131918.30970-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 3/6] examples/quota-watermark: remove example\n\tfrom DPDK",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Ciara Power <ciara.power@intel.com>\n\nOriginal DPDK rings code had explicit support for a single watermark\nper-ring, but more recent releases of DPDK had a more general mechanism\nwhere each enqueue or dequeue call could return the remaining\nelements/free-slots in the ring.  Therefore, this example is not as\nrelevant as before and can be removed.\n\nSigned-off-by: Ciara Power <ciara.power@intel.com>\n---\n MAINTAINERS                                  |   3 -\n doc/guides/sample_app_ug/index.rst           |   1 -\n doc/guides/sample_app_ug/intro.rst           |   2 +-\n doc/guides/sample_app_ug/quota_watermark.rst | 465 -------------------\n examples/Makefile                            |   1 -\n examples/meson.build                         |   2 +-\n examples/quota_watermark/Makefile            |  16 -\n examples/quota_watermark/include/conf.h      |  19 -\n examples/quota_watermark/meson.build         |  10 -\n examples/quota_watermark/qw/Makefile         |  22 -\n examples/quota_watermark/qw/args.c           |  78 ----\n examples/quota_watermark/qw/args.h           |  12 -\n examples/quota_watermark/qw/init.c           | 164 -------\n examples/quota_watermark/qw/init.h           |  14 -\n examples/quota_watermark/qw/main.c           | 365 ---------------\n examples/quota_watermark/qw/main.h           |  31 --\n examples/quota_watermark/qwctl/Makefile      |  22 -\n examples/quota_watermark/qwctl/commands.c    | 196 --------\n examples/quota_watermark/qwctl/commands.h    |  12 -\n examples/quota_watermark/qwctl/qwctl.c       |  67 ---\n examples/quota_watermark/qwctl/qwctl.h       |  12 -\n 21 files changed, 2 insertions(+), 1512 deletions(-)\n delete mode 100644 doc/guides/sample_app_ug/quota_watermark.rst\n delete mode 100644 examples/quota_watermark/Makefile\n delete mode 100644 examples/quota_watermark/include/conf.h\n delete mode 100644 examples/quota_watermark/meson.build\n delete mode 100644 examples/quota_watermark/qw/Makefile\n delete mode 100644 examples/quota_watermark/qw/args.c\n delete mode 100644 examples/quota_watermark/qw/args.h\n delete mode 100644 examples/quota_watermark/qw/init.c\n delete mode 100644 examples/quota_watermark/qw/init.h\n delete mode 100644 examples/quota_watermark/qw/main.c\n delete mode 100644 examples/quota_watermark/qw/main.h\n delete mode 100644 examples/quota_watermark/qwctl/Makefile\n delete mode 100644 examples/quota_watermark/qwctl/commands.c\n delete mode 100644 examples/quota_watermark/qwctl/commands.h\n delete mode 100644 examples/quota_watermark/qwctl/qwctl.c\n delete mode 100644 examples/quota_watermark/qwctl/qwctl.h",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 92c3f6af4..7be363327 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1474,9 +1474,6 @@ F: doc/guides/sample_app_ug/performance_thread.rst\n \n F: examples/ptpclient/\n \n-F: examples/quota_watermark/\n-F: doc/guides/sample_app_ug/quota_watermark.rst\n-\n M: Bruce Richardson <bruce.richardson@intel.com>\n M: John McNamara <john.mcnamara@intel.com>\n F: examples/rxtx_callbacks/\ndiff --git a/doc/guides/sample_app_ug/index.rst b/doc/guides/sample_app_ug/index.rst\nindex d212f81fe..dafe8553f 100644\n--- a/doc/guides/sample_app_ug/index.rst\n+++ b/doc/guides/sample_app_ug/index.rst\n@@ -36,7 +36,6 @@ Sample Applications User Guides\n     multi_process\n     qos_metering\n     qos_scheduler\n-    quota_watermark\n     timer\n     packet_ordering\n     vmdq_dcb_forwarding\ndiff --git a/doc/guides/sample_app_ug/intro.rst b/doc/guides/sample_app_ug/intro.rst\nindex 7299253bf..6e0af6301 100644\n--- a/doc/guides/sample_app_ug/intro.rst\n+++ b/doc/guides/sample_app_ug/intro.rst\n@@ -43,7 +43,7 @@ applications that are available in the examples directory of DPDK:\n     +---------------------------------------+--------------------------------------+\n     | Hello World                           | QoS Scheduler                        |\n     +---------------------------------------+--------------------------------------+\n-    | Internet Protocol (IP) Fragmentation  | Quota and Watermark                  |\n+    | Internet Protocol (IP) Fragmentation  |                                      |\n     +---------------------------------------+--------------------------------------+\n     | IP Pipeline                           | RX/TX Callbacks                      |\n     +---------------------------------------+--------------------------------------+\ndiff --git a/doc/guides/sample_app_ug/quota_watermark.rst b/doc/guides/sample_app_ug/quota_watermark.rst\ndeleted file mode 100644\nindex 125e6fb73..000000000\n--- a/doc/guides/sample_app_ug/quota_watermark.rst\n+++ /dev/null\n@@ -1,465 +0,0 @@\n-..  SPDX-License-Identifier: BSD-3-Clause\n-    Copyright(c) 2010-2017 Intel Corporation.\n-\n-Quota and Watermark Sample Application\n-======================================\n-\n-The Quota and Watermark sample application is a simple example of packet\n-processing using Data Plane Development Kit (DPDK) that showcases the use\n-of a quota as the maximum number of packets enqueue/dequeue at a time and\n-low and high thresholds, or watermarks, to signal low and high ring usage\n-respectively.\n-\n-Additionally, it shows how the thresholds can be used to feedback congestion notifications to data producers by\n-temporarily stopping processing overloaded rings and sending Ethernet flow control frames.\n-\n-This sample application is split in two parts:\n-\n-*   qw - The core quota and watermark sample application\n-\n-*   qwctl - A command line tool to alter quota and watermarks while qw is running\n-\n-Overview\n---------\n-\n-The Quota and Watermark sample application performs forwarding for each packet that is received on a given port.\n-The destination port is the adjacent port from the enabled port mask, that is,\n-if the first four ports are enabled (port mask 0xf), ports 0 and 1 forward into each other,\n-and ports 2 and 3 forward into each other.\n-The MAC addresses of the forwarded Ethernet frames are not affected.\n-\n-Internally, packets are pulled from the ports by the master logical core and put on a variable length processing pipeline,\n-each stage of which being connected by rings, as shown in :numref:`figure_pipeline_overview`.\n-\n-.. _figure_pipeline_overview:\n-\n-.. figure:: img/pipeline_overview.*\n-\n-   Pipeline Overview\n-\n-\n-An adjustable quota value controls how many packets are being moved through the pipeline per enqueue and dequeue.\n-Adjustable threshold values associated with the rings control a back-off mechanism that\n-tries to prevent the pipeline from being overloaded by:\n-\n-*   Stopping enqueuing on rings for which the usage has crossed the high watermark threshold\n-\n-*   Sending Ethernet pause frames\n-\n-*   Only resuming enqueuing on a ring once its usage goes below a global low watermark threshold\n-\n-This mechanism allows congestion notifications to go up the ring pipeline and\n-eventually lead to an Ethernet flow control frame being send to the source.\n-\n-On top of serving as an example of quota and watermark usage,\n-this application can be used to benchmark ring based processing pipelines performance using a traffic- generator,\n-as shown in :numref:`figure_ring_pipeline_perf_setup`.\n-\n-.. _figure_ring_pipeline_perf_setup:\n-\n-.. figure:: img/ring_pipeline_perf_setup.*\n-\n-   Ring-based Processing Pipeline Performance Setup\n-\n-Compiling the Application\n--------------------------\n-\n-To compile the sample application see :doc:`compiling`.\n-\n-The application is located in the ``quota_watermark`` sub-directory.\n-\n-Running the Application\n------------------------\n-\n-The core application, qw, has to be started first.\n-\n-Once it is up and running, one can alter quota and watermarks while it runs using the control application, qwctl.\n-\n-Running the Core Application\n-~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n-\n-The application requires a single command line option:\n-\n-.. code-block:: console\n-\n-    ./qw/build/qw [EAL options] -- -p PORTMASK\n-\n-where,\n-\n--p PORTMASK: A hexadecimal bitmask of the ports to configure\n-\n-To run the application in a linux environment with four logical cores and ports 0 and 2,\n-issue the following command:\n-\n-.. code-block:: console\n-\n-    ./qw/build/qw -l 0-3 -n 4 -- -p 5\n-\n-Refer to the *DPDK Getting Started Guide* for general information on running applications and\n-the Environment Abstraction Layer (EAL) options.\n-\n-Running the Control Application\n-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n-\n-The control application requires a number of command line options:\n-\n-.. code-block:: console\n-\n-    ./qwctl/build/qwctl [EAL options] --proc-type=secondary\n-\n-The --proc-type=secondary option is necessary for the EAL to properly initialize the control application to\n-use the same huge pages as the core application and  thus be able to access its rings.\n-\n-To run the application in a linux environment on logical core 0, issue the following command:\n-\n-.. code-block:: console\n-\n-    ./qwctl/build/qwctl -l 0 -n 4 --proc-type=secondary\n-\n-Refer to the *DPDK Getting Started* Guide for general information on running applications and\n-the Environment Abstraction Layer (EAL) options.\n-\n-qwctl is an interactive command line that let the user change variables in a running instance of qw.\n-The help command gives a list of available commands:\n-\n-.. code-block:: console\n-\n-    $ qwctl > help\n-\n-Code Overview\n--------------\n-\n-The following sections provide a quick guide to the application's source code.\n-\n-Core Application - qw\n-~~~~~~~~~~~~~~~~~~~~~\n-\n-EAL and Drivers Setup\n-^^^^^^^^^^^^^^^^^^^^^\n-\n-The EAL arguments are parsed at the beginning of the main() function:\n-\n-.. code-block:: c\n-\n-    ret = rte_eal_init(argc, argv);\n-    if (ret < 0)\n-        rte_exit(EXIT_FAILURE, \"Cannot initialize EAL\\n\");\n-\n-    argc -= ret;\n-    argv += ret;\n-\n-Then, a call to init_dpdk(), defined in init.c, is made to initialize the poll mode drivers:\n-\n-.. code-block:: c\n-\n-    void\n-    init_dpdk(void)\n-    {\n-        int ret;\n-\n-        /* Bind the drivers to usable devices */\n-\n-        ret = rte_pci_probe();\n-        if (ret < 0)\n-            rte_exit(EXIT_FAILURE, \"rte_pci_probe(): error %d\\n\", ret);\n-\n-        if (rte_eth_dev_count_avail() < 2)\n-            rte_exit(EXIT_FAILURE, \"Not enough Ethernet port available\\n\");\n-    }\n-\n-To fully understand this code, it is recommended to study the chapters that relate to the *Poll Mode Driver*\n-in the *DPDK Getting Started Guide* and the *DPDK API Reference*.\n-\n-Shared Variables Setup\n-^^^^^^^^^^^^^^^^^^^^^^\n-\n-The quota and high and low watermark shared variables are put into an rte_memzone using a call to setup_shared_variables():\n-\n-.. code-block:: c\n-\n-    void\n-    setup_shared_variables(void)\n-    {\n-           const struct rte_memzone *qw_memzone;\n-\n-           qw_memzone = rte_memzone_reserve(QUOTA_WATERMARK_MEMZONE_NAME,\n-                          3 * sizeof(int), rte_socket_id(), 0);\n-           if (qw_memzone == NULL)\n-                   rte_exit(EXIT_FAILURE, \"%s\\n\", rte_strerror(rte_errno));\n-\n-           quota = qw_memzone->addr;\n-           low_watermark = (unsigned int *) qw_memzone->addr + 1;\n-           high_watermark = (unsigned int *) qw_memzone->addr + 2;\n-    }\n-\n-These three variables are initialized to a default value in main() and\n-can be changed while qw is running using the qwctl control program.\n-\n-Application Arguments\n-^^^^^^^^^^^^^^^^^^^^^\n-\n-The qw application only takes one argument: a port mask that specifies which ports should be used by the application.\n-At least two ports are needed to run the application and there should be an even number of ports given in the port mask.\n-\n-The port mask parsing is done in parse_qw_args(), defined in args.c.\n-\n-Mbuf Pool Initialization\n-^^^^^^^^^^^^^^^^^^^^^^^^\n-\n-Once the application's arguments are parsed, an mbuf pool is created.\n-It contains a set of mbuf objects that are used by the driver and the application to store network packets:\n-\n-.. code-block:: c\n-\n-    /* Create a pool of mbuf to store packets */\n-    mbuf_pool = rte_pktmbuf_pool_create(\"mbuf_pool\", MBUF_PER_POOL, 32, 0,\n-\t\t\t\t\t MBUF_DATA_SIZE, rte_socket_id());\n-\n-    if (mbuf_pool == NULL)\n-        rte_panic(\"%s\\n\", rte_strerror(rte_errno));\n-\n-The rte_mempool is a generic structure used to handle pools of objects.\n-In this case, it is necessary to create a pool that will be used by the driver.\n-\n-The number of allocated pkt mbufs is MBUF_PER_POOL, with a data room size\n-of MBUF_DATA_SIZE each.\n-A per-lcore cache of 32 mbufs is kept.\n-The memory is allocated in on the master lcore's socket, but it is possible to extend this code to allocate one mbuf pool per socket.\n-\n-The rte_pktmbuf_pool_create() function uses the default mbuf pool and mbuf\n-initializers, respectively rte_pktmbuf_pool_init() and rte_pktmbuf_init().\n-An advanced application may want to use the mempool API to create the\n-mbuf pool with more control.\n-\n-Ports Configuration and Pairing\n-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n-\n-Each port in the port mask is configured and a corresponding ring is created in the master lcore's array of rings.\n-This ring is the first in the pipeline and will hold the packets directly coming from the port.\n-\n-.. code-block:: c\n-\n-    for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++)\n-        if (is_bit_set(port_id, portmask)) {\n-            configure_eth_port(port_id);\n-            init_ring(master_lcore_id, port_id);\n-        }\n-\n-    pair_ports();\n-\n-The configure_eth_port() and init_ring() functions are used to configure a port and a ring respectively and are defined in init.c.\n-They make use of the DPDK APIs defined in rte_eth.h and rte_ring.h.\n-\n-pair_ports() builds the port_pairs[] array so that its key-value pairs are a mapping between reception and transmission ports.\n-It is defined in init.c.\n-\n-Logical Cores Assignment\n-^^^^^^^^^^^^^^^^^^^^^^^^\n-\n-The application uses the master logical core to poll all the ports for new packets and enqueue them on a ring associated with the port.\n-\n-Each logical core except the last runs pipeline_stage() after a ring for each used port is initialized on that core.\n-pipeline_stage() on core X dequeues packets from core X-1's rings and enqueue them on its own rings. See :numref:`figure_threads_pipelines`.\n-\n-.. code-block:: c\n-\n-    /* Start pipeline_stage() on all the available slave lcore but the last */\n-\n-    for (lcore_id = 0 ; lcore_id < last_lcore_id; lcore_id++) {\n-        if (rte_lcore_is_enabled(lcore_id) && lcore_id != master_lcore_id) {\n-            for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++)\n-                if (is_bit_set(port_id, portmask))\n-                    init_ring(lcore_id, port_id);\n-\n-                rte_eal_remote_launch(pipeline_stage, NULL, lcore_id);\n-        }\n-    }\n-\n-The last available logical core runs send_stage(),\n-which is the last stage of the pipeline dequeuing packets from the last ring in the pipeline and\n-sending them out on the destination port setup by pair_ports().\n-\n-.. code-block:: c\n-\n-    /* Start send_stage() on the last slave core */\n-\n-    rte_eal_remote_launch(send_stage, NULL, last_lcore_id);\n-\n-Receive, Process and Transmit Packets\n-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n-\n-.. _figure_threads_pipelines:\n-\n-.. figure:: img/threads_pipelines.*\n-\n-   Threads and Pipelines\n-\n-\n-In the receive_stage() function running on the master logical core,\n-the main task is to read ingress packets from the RX ports and enqueue them\n-on the port's corresponding first ring in the pipeline.\n-This is done using the following code:\n-\n-.. code-block:: c\n-\n-    lcore_id = rte_lcore_id();\n-\n-    /* Process each port round robin style */\n-\n-    for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) {\n-            if (!is_bit_set(port_id, portmask))\n-                    continue;\n-\n-            ring = rings[lcore_id][port_id];\n-\n-            if (ring_state[port_id] != RING_READY) {\n-                    if (rte_ring_count(ring) > *low_watermark)\n-                            continue;\n-                    else\n-                            ring_state[port_id] = RING_READY;\n-            }\n-\n-            /* Enqueue received packets on the RX ring */\n-            nb_rx_pkts = rte_eth_rx_burst(port_id, 0, pkts,\n-                            (uint16_t) *quota);\n-            ret = rte_ring_enqueue_bulk(ring, (void *) pkts,\n-                            nb_rx_pkts, &free);\n-            if (RING_SIZE - free > *high_watermark) {\n-                    ring_state[port_id] = RING_OVERLOADED;\n-                    send_pause_frame(port_id, 1337);\n-            }\n-\n-            if (ret == 0) {\n-\n-                    /*\n-                     * Return  mbufs to the pool,\n-                     * effectively dropping packets\n-                     */\n-                    for (i = 0; i < nb_rx_pkts; i++)\n-                            rte_pktmbuf_free(pkts[i]);\n-            }\n-    }\n-\n-For each port in the port mask, the corresponding ring's pointer is fetched into ring and that ring's state is checked:\n-\n-*   If it is in the RING_READY state, \\*quota packets are grabbed from the port and put on the ring.\n-    Should this operation make the ring's usage cross its high watermark,\n-    the ring is marked as overloaded and an Ethernet flow control frame is sent to the source.\n-\n-*   If it is not in the RING_READY state, this port is ignored until the ring's usage crosses the \\*low_watermark  value.\n-\n-The pipeline_stage() function's task is to process and move packets from the preceding pipeline stage.\n-This thread is running on most of the logical cores to create and arbitrarily long pipeline.\n-\n-.. code-block:: c\n-\n-    lcore_id = rte_lcore_id();\n-\n-    previous_lcore_id = get_previous_lcore_id(lcore_id);\n-\n-    for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) {\n-            if (!is_bit_set(port_id, portmask))\n-                    continue;\n-\n-            tx = rings[lcore_id][port_id];\n-            rx = rings[previous_lcore_id][port_id];\n-\n-            if (ring_state[port_id] != RING_READY) {\n-                    if (rte_ring_count(tx) > *low_watermark)\n-                            continue;\n-                    else\n-                            ring_state[port_id] = RING_READY;\n-            }\n-\n-            /* Dequeue up to quota mbuf from rx */\n-            nb_dq_pkts = rte_ring_dequeue_burst(rx, pkts,\n-                            *quota, NULL);\n-            if (unlikely(nb_dq_pkts < 0))\n-                    continue;\n-\n-            /* Enqueue them on tx */\n-            ret = rte_ring_enqueue_bulk(tx, pkts,\n-                            nb_dq_pkts, &free);\n-            if (RING_SIZE - free > *high_watermark)\n-                    ring_state[port_id] = RING_OVERLOADED;\n-\n-            if (ret == 0) {\n-\n-                    /*\n-                     * Return  mbufs to the pool,\n-                     * effectively dropping packets\n-                     */\n-                    for (i = 0; i < nb_dq_pkts; i++)\n-                            rte_pktmbuf_free(pkts[i]);\n-            }\n-    }\n-\n-The thread's logic works mostly like receive_stage(),\n-except that packets are moved from ring to ring instead of port to ring.\n-\n-In this example, no actual processing is done on the packets,\n-but pipeline_stage() is an ideal place to perform any processing required by the application.\n-\n-Finally, the send_stage() function's task is to read packets from the last ring in a pipeline and\n-send them on the destination port defined in the port_pairs[] array.\n-It is running on the last available logical core only.\n-\n-.. code-block:: c\n-\n-    lcore_id = rte_lcore_id();\n-\n-    previous_lcore_id = get_previous_lcore_id(lcore_id);\n-\n-    for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) {\n-        if (!is_bit_set(port_id, portmask)) continue;\n-\n-        dest_port_id = port_pairs[port_id];\n-        tx = rings[previous_lcore_id][port_id];\n-\n-        if (rte_ring_empty(tx)) continue;\n-\n-        /* Dequeue packets from tx and send them */\n-\n-        nb_dq_pkts = rte_ring_dequeue_burst(tx, (void *) tx_pkts, *quota);\n-        nb_tx_pkts = rte_eth_tx_burst(dest_port_id, 0, tx_pkts, nb_dq_pkts);\n-    }\n-\n-For each port in the port mask, up to \\*quota packets are pulled from the last ring in its pipeline and\n-sent on the destination port paired with the current port.\n-\n-Control Application - qwctl\n-~~~~~~~~~~~~~~~~~~~~~~~~~~~\n-\n-The qwctl application uses the rte_cmdline library to provide the user with an interactive command line that\n-can be used to modify and inspect parameters in a running qw application.\n-Those parameters are the global quota and low_watermark value as well as each ring's built-in high watermark.\n-\n-Command Definitions\n-^^^^^^^^^^^^^^^^^^^\n-\n-The available commands are defined in commands.c.\n-\n-It is advised to use the cmdline sample application user guide as a reference for everything related to the rte_cmdline library.\n-\n-Accessing Shared Variables\n-^^^^^^^^^^^^^^^^^^^^^^^^^^\n-\n-The setup_shared_variables() function retrieves the shared variables quota and\n-low_watermark from the rte_memzone previously created by qw.\n-\n-.. code-block:: c\n-\n-    static void\n-    setup_shared_variables(void)\n-    {\n-        const struct rte_memzone *qw_memzone;\n-\n-        qw_memzone = rte_memzone_lookup(QUOTA_WATERMARK_MEMZONE_NAME);\n-        if (qw_memzone == NULL)\n-            rte_exit(EXIT_FAILURE, \"Couldn't find memzone\\n\");\n-\n-        quota = qw_memzone->addr;\n-\n-        low_watermark = (unsigned int *) qw_memzone->addr + 1;\n-        high_watermark = (unsigned int *) qw_memzone->addr + 2;\n-    }\ndiff --git a/examples/Makefile b/examples/Makefile\nindex 5dd8a72e5..02ff86534 100644\n--- a/examples/Makefile\n+++ b/examples/Makefile\n@@ -59,7 +59,6 @@ endif\n DIRS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ptpclient\n DIRS-$(CONFIG_RTE_LIBRTE_METER) += qos_meter\n DIRS-$(CONFIG_RTE_LIBRTE_SCHED) += qos_sched\n-DIRS-y += quota_watermark\n DIRS-$(CONFIG_RTE_ETHDEV_RXTX_CALLBACKS) += rxtx_callbacks\n DIRS-y += service_cores\n DIRS-y += skeleton\ndiff --git a/examples/meson.build b/examples/meson.build\nindex 81ac8199a..6c26fffb4 100644\n--- a/examples/meson.build\n+++ b/examples/meson.build\n@@ -33,7 +33,7 @@ all_examples = [\n \t'netmap_compat', 'ntb', 'packet_ordering',\n \t'performance-thread', 'ptpclient',\n \t'qos_meter', 'qos_sched',\n-\t'quota_watermark', 'rxtx_callbacks',\n+\t'rxtx_callbacks',\n \t'server_node_efd', 'service_cores',\n \t'skeleton', 'tep_termination',\n \t'timer', 'vdpa',\ndiff --git a/examples/quota_watermark/Makefile b/examples/quota_watermark/Makefile\ndeleted file mode 100644\nindex 8ef053198..000000000\n--- a/examples/quota_watermark/Makefile\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-# SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2010-2014 Intel Corporation\n-\n-ifeq ($(RTE_SDK),)\n-$(error \"Please define RTE_SDK environment variable\")\n-endif\n-\n-# Default target, detect a build directory, by looking for a path with a .config\n-RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))\n-\n-include $(RTE_SDK)/mk/rte.vars.mk\n-\n-DIRS-$(CONFIG_RTE_EXEC_ENV_LINUX) += qw\n-DIRS-$(CONFIG_RTE_EXEC_ENV_LINUX) += qwctl\n-\n-include $(RTE_SDK)/mk/rte.extsubdir.mk\ndiff --git a/examples/quota_watermark/include/conf.h b/examples/quota_watermark/include/conf.h\ndeleted file mode 100644\nindex 4f29aa64b..000000000\n--- a/examples/quota_watermark/include/conf.h\n+++ /dev/null\n@@ -1,19 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#ifndef _CONF_H_\n-#define _CONF_H_\n-\n-#define RING_SIZE 1024\n-#define MAX_PKT_QUOTA 64\n-\n-#define RX_DESC_PER_QUEUE   1024\n-#define TX_DESC_PER_QUEUE   1024\n-\n-#define MBUF_DATA_SIZE     RTE_MBUF_DEFAULT_BUF_SIZE\n-#define MBUF_PER_POOL 8192\n-\n-#define QUOTA_WATERMARK_MEMZONE_NAME \"qw_global_vars\"\n-\n-#endif /* _CONF_H_ */\ndiff --git a/examples/quota_watermark/meson.build b/examples/quota_watermark/meson.build\ndeleted file mode 100644\nindex c370d7476..000000000\n--- a/examples/quota_watermark/meson.build\n+++ /dev/null\n@@ -1,10 +0,0 @@\n-# SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2018 Intel Corporation\n-\n-# meson file, for building this example as part of a main DPDK build.\n-#\n-# To build this example as a standalone application with an already-installed\n-# DPDK instance, use 'make'\n-\n-# Example app currently unsupported by meson build\n-build = false\ndiff --git a/examples/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile\ndeleted file mode 100644\nindex 3f10f01c3..000000000\n--- a/examples/quota_watermark/qw/Makefile\n+++ /dev/null\n@@ -1,22 +0,0 @@\n-# SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2010-2014 Intel Corporation\n-\n-ifeq ($(RTE_SDK),)\n-$(error \"Please define RTE_SDK environment variable\")\n-endif\n-\n-# Default target, detect a build directory, by looking for a path with a .config\n-RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))\n-\n-include $(RTE_SDK)/mk/rte.vars.mk\n-\n-# binary name\n-APP = qw\n-\n-# all source are stored in SRCS-y\n-SRCS-y := args.c init.c main.c\n-\n-CFLAGS += -O3 -DQW_SOFTWARE_FC\n-CFLAGS += $(WERROR_FLAGS)\n-\n-include $(RTE_SDK)/mk/rte.extapp.mk\ndiff --git a/examples/quota_watermark/qw/args.c b/examples/quota_watermark/qw/args.c\ndeleted file mode 100644\nindex a750ec258..000000000\n--- a/examples/quota_watermark/qw/args.c\n+++ /dev/null\n@@ -1,78 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <unistd.h>\n-\n-#include <rte_common.h>\n-#include <rte_lcore.h>\n-\n-#include \"args.h\"\n-\n-\n-unsigned int portmask = 0;\n-\n-\n-static void\n-usage(const char *prgname)\n-{\n-\tfprintf(stderr, \"Usage: %s [EAL args] -- -p <portmask>\\n\"\n-\t\t\t\"-p PORTMASK: hexadecimal bitmask of NIC ports to configure\\n\",\n-\t\t\tprgname);\n-}\n-\n-static unsigned long\n-parse_portmask(const char *portmask_str)\n-{\n-\treturn strtoul(portmask_str, NULL, 16);\n-}\n-\n-static void\n-check_core_count(void)\n-{\n-\tif (rte_lcore_count() < 3)\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t\"At least 3 cores need to be passed in the coremask\\n\");\n-}\n-\n-static void\n-check_portmask_value(unsigned int portmask)\n-{\n-\tunsigned int port_nb = 0;\n-\n-\tport_nb = __builtin_popcount(portmask);\n-\n-\tif (port_nb == 0)\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t\"At least 2 ports need to be passed in the portmask\\n\");\n-\n-\tif (port_nb % 2 != 0)\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t\"An even number of ports is required in the portmask\\n\");\n-}\n-\n-int\n-parse_qw_args(int argc, char **argv)\n-{\n-\tint opt;\n-\n-\twhile ((opt = getopt(argc, argv, \"h:p:\")) != -1) {\n-\t\tswitch (opt) {\n-\t\tcase 'h':\n-\t\t\tusage(argv[0]);\n-\t\t\tbreak;\n-\t\tcase 'p':\n-\t\t\tportmask = parse_portmask(optarg);\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tusage(argv[0]);\n-\t\t}\n-\t}\n-\n-\tcheck_core_count();\n-\tcheck_portmask_value(portmask);\n-\n-\treturn 0;\n-}\ndiff --git a/examples/quota_watermark/qw/args.h b/examples/quota_watermark/qw/args.h\ndeleted file mode 100644\nindex ab777db01..000000000\n--- a/examples/quota_watermark/qw/args.h\n+++ /dev/null\n@@ -1,12 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#ifndef _ARGS_H_\n-#define _ARGS_H_\n-\n-extern unsigned int portmask;\n-\n-int parse_qw_args(int argc, char **argv);\n-\n-#endif /* _ARGS_H_ */\ndiff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c\ndeleted file mode 100644\nindex 5a0f64f45..000000000\n--- a/examples/quota_watermark/qw/init.c\n+++ /dev/null\n@@ -1,164 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#include <fcntl.h>\n-#include <unistd.h>\n-#include <sys/mman.h>\n-\n-#include <rte_eal.h>\n-\n-#include <rte_common.h>\n-#include <rte_errno.h>\n-#include <rte_ethdev.h>\n-#include <rte_memzone.h>\n-#include <rte_ring.h>\n-#include <rte_string_fns.h>\n-\n-#include \"args.h\"\n-#include \"init.h\"\n-#include \"main.h\"\n-#include \"../include/conf.h\"\n-\n-\n-static struct rte_eth_conf port_conf = {\n-\t\t.rxmode = {\n-\t\t\t.split_hdr_size = 0,\n-\t\t},\n-\t\t.txmode = {\n-\t\t\t.mq_mode = ETH_DCB_NONE,\n-\t\t},\n-};\n-\n-static struct rte_eth_fc_conf fc_conf = {\n-\t\t.mode       = RTE_FC_TX_PAUSE,\n-\t\t.high_water = 80 * 510 / 100,\n-\t\t.low_water  = 60 * 510 / 100,\n-\t\t.pause_time = 1337,\n-\t\t.send_xon   = 0,\n-};\n-\n-\n-void configure_eth_port(uint16_t port_id)\n-{\n-\tint ret;\n-\tuint16_t nb_rxd = RX_DESC_PER_QUEUE;\n-\tuint16_t nb_txd = TX_DESC_PER_QUEUE;\n-\tstruct rte_eth_rxconf rxq_conf;\n-\tstruct rte_eth_txconf txq_conf;\n-\tstruct rte_eth_dev_info dev_info;\n-\tstruct rte_eth_conf local_port_conf = port_conf;\n-\n-\trte_eth_dev_stop(port_id);\n-\n-\trte_eth_dev_info_get(port_id, &dev_info);\n-\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)\n-\t\tlocal_port_conf.txmode.offloads |=\n-\t\t\tDEV_TX_OFFLOAD_MBUF_FAST_FREE;\n-\tret = rte_eth_dev_configure(port_id, 1, 1, &local_port_conf);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE, \"Cannot configure port %u (error %d)\\n\",\n-\t\t\t\t(unsigned int) port_id, ret);\n-\n-\tret = rte_eth_dev_adjust_nb_rx_tx_desc(port_id, &nb_rxd, &nb_txd);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t\"Cannot adjust number of descriptors for port %u (error %d)\\n\",\n-\t\t\t\t(unsigned int) port_id, ret);\n-\n-\t/* Initialize the port's RX queue */\n-\trxq_conf = dev_info.default_rxconf;\n-\trxq_conf.offloads = local_port_conf.rxmode.offloads;\n-\tret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd,\n-\t\t\trte_eth_dev_socket_id(port_id),\n-\t\t\t&rxq_conf,\n-\t\t\tmbuf_pool);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t\"Failed to setup RX queue on port %u (error %d)\\n\",\n-\t\t\t\t(unsigned int) port_id, ret);\n-\n-\t/* Initialize the port's TX queue */\n-\ttxq_conf = dev_info.default_txconf;\n-\ttxq_conf.offloads = local_port_conf.txmode.offloads;\n-\tret = rte_eth_tx_queue_setup(port_id, 0, nb_txd,\n-\t\t\trte_eth_dev_socket_id(port_id),\n-\t\t\t&txq_conf);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t\"Failed to setup TX queue on port %u (error %d)\\n\",\n-\t\t\t\t(unsigned int) port_id, ret);\n-\n-\t/* Initialize the port's flow control */\n-\tret = rte_eth_dev_flow_ctrl_set(port_id, &fc_conf);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t\"Failed to setup hardware flow control on port %u (error %d)\\n\",\n-\t\t\t\t(unsigned int) port_id, ret);\n-\n-\t/* Start the port */\n-\tret = rte_eth_dev_start(port_id);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE, \"Failed to start port %u (error %d)\\n\",\n-\t\t\t\t(unsigned int) port_id, ret);\n-\n-\t/* Put it in promiscuous mode */\n-\trte_eth_promiscuous_enable(port_id);\n-}\n-\n-void\n-init_dpdk(void)\n-{\n-\tif (rte_eth_dev_count_avail() < 2)\n-\t\trte_exit(EXIT_FAILURE, \"Not enough ethernet port available\\n\");\n-}\n-\n-void init_ring(int lcore_id, uint16_t port_id)\n-{\n-\tstruct rte_ring *ring;\n-\tchar ring_name[RTE_RING_NAMESIZE];\n-\n-\tsnprintf(ring_name, RTE_RING_NAMESIZE,\n-\t\t\t\"core%d_port%d\", lcore_id, port_id);\n-\tring = rte_ring_create(ring_name, RING_SIZE, rte_socket_id(),\n-\t\t\tRING_F_SP_ENQ | RING_F_SC_DEQ);\n-\n-\tif (ring == NULL)\n-\t\trte_exit(EXIT_FAILURE, \"%s\\n\", rte_strerror(rte_errno));\n-\n-\t*high_watermark = 80 * RING_SIZE / 100;\n-\n-\trings[lcore_id][port_id] = ring;\n-}\n-\n-void\n-pair_ports(void)\n-{\n-\tuint16_t i, j;\n-\n-\t/* Pair ports with their \"closest neighbour\" in the portmask */\n-\tfor (i = 0; i < RTE_MAX_ETHPORTS; i++)\n-\t\tif (is_bit_set(i, portmask))\n-\t\t\tfor (j = i + 1; j < RTE_MAX_ETHPORTS; j++)\n-\t\t\t\tif (is_bit_set(j, portmask)) {\n-\t\t\t\t\tport_pairs[i] = j;\n-\t\t\t\t\tport_pairs[j] = i;\n-\t\t\t\t\ti = j;\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-}\n-\n-void\n-setup_shared_variables(void)\n-{\n-\tconst struct rte_memzone *qw_memzone;\n-\n-\tqw_memzone = rte_memzone_reserve(QUOTA_WATERMARK_MEMZONE_NAME,\n-\t\t\t3 * sizeof(int), rte_socket_id(), 0);\n-\tif (qw_memzone == NULL)\n-\t\trte_exit(EXIT_FAILURE, \"%s\\n\", rte_strerror(rte_errno));\n-\n-\tquota = qw_memzone->addr;\n-\tlow_watermark = (unsigned int *) qw_memzone->addr + 1;\n-\thigh_watermark = (unsigned int *) qw_memzone->addr + 2;\n-}\ndiff --git a/examples/quota_watermark/qw/init.h b/examples/quota_watermark/qw/init.h\ndeleted file mode 100644\nindex e0c90df72..000000000\n--- a/examples/quota_watermark/qw/init.h\n+++ /dev/null\n@@ -1,14 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#ifndef _INIT_H_\n-#define _INIT_H_\n-\n-void configure_eth_port(uint16_t port_id);\n-void init_dpdk(void);\n-void init_ring(int lcore_id, uint16_t port_id);\n-void pair_ports(void);\n-void setup_shared_variables(void);\n-\n-#endif /* _INIT_H_ */\ndiff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c\ndeleted file mode 100644\nindex a61360b99..000000000\n--- a/examples/quota_watermark/qw/main.c\n+++ /dev/null\n@@ -1,365 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#include <rte_eal.h>\n-\n-#include <rte_common.h>\n-#include <rte_debug.h>\n-#include <rte_errno.h>\n-#include <rte_ethdev.h>\n-#include <rte_launch.h>\n-#include <rte_lcore.h>\n-#include <rte_log.h>\n-#include <rte_mbuf.h>\n-#include <rte_ring.h>\n-\n-#include <rte_byteorder.h>\n-\n-#include \"args.h\"\n-#include \"main.h\"\n-#include \"init.h\"\n-#include \"../include/conf.h\"\n-\n-\n-#ifdef QW_SOFTWARE_FC\n-#define SEND_PAUSE_FRAME(port_id, duration) send_pause_frame(port_id, duration)\n-#else\n-#define SEND_PAUSE_FRAME(port_id, duration) do { } while(0)\n-#endif\n-\n-#define ETHER_TYPE_FLOW_CONTROL 0x8808\n-\n-struct ether_fc_frame {\n-\tuint16_t opcode;\n-\tuint16_t param;\n-} __attribute__((__packed__));\n-\n-\n-int *quota;\n-unsigned int *low_watermark;\n-unsigned int *high_watermark;\n-\n-uint16_t port_pairs[RTE_MAX_ETHPORTS];\n-\n-struct rte_ring *rings[RTE_MAX_LCORE][RTE_MAX_ETHPORTS];\n-struct rte_mempool *mbuf_pool;\n-\n-\n-static void send_pause_frame(uint16_t port_id, uint16_t duration)\n-{\n-\tstruct rte_mbuf *mbuf;\n-\tstruct ether_fc_frame *pause_frame;\n-\tstruct rte_ether_hdr *hdr;\n-\tstruct rte_ether_addr mac_addr;\n-\n-\tRTE_LOG_DP(DEBUG, USER1,\n-\t\t\t\"Sending PAUSE frame (duration=%d) on port %d\\n\",\n-\t\t\tduration, port_id);\n-\n-\t/* Get a mbuf from the pool */\n-\tmbuf = rte_pktmbuf_alloc(mbuf_pool);\n-\tif (unlikely(mbuf == NULL))\n-\t\treturn;\n-\n-\t/* Prepare a PAUSE frame */\n-\thdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *);\n-\tpause_frame = (struct ether_fc_frame *) &hdr[1];\n-\n-\trte_eth_macaddr_get(port_id, &mac_addr);\n-\trte_ether_addr_copy(&mac_addr, &hdr->s_addr);\n-\n-\tvoid *tmp = &hdr->d_addr.addr_bytes[0];\n-\t*((uint64_t *)tmp) = 0x010000C28001ULL;\n-\n-\thdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_FLOW_CONTROL);\n-\n-\tpause_frame->opcode = rte_cpu_to_be_16(0x0001);\n-\tpause_frame->param  = rte_cpu_to_be_16(duration);\n-\n-\tmbuf->pkt_len  = 60;\n-\tmbuf->data_len = 60;\n-\n-\trte_eth_tx_burst(port_id, 0, &mbuf, 1);\n-}\n-\n-/**\n- * Get the previous enabled lcore ID\n- *\n- * @param lcore_id\n- *   The current lcore ID.\n- * @return\n- *   The previous enabled lcore_id or -1 if not found.\n- */\n-static unsigned int\n-get_previous_lcore_id(unsigned int lcore_id)\n-{\n-\tint i;\n-\n-\tfor (i = lcore_id - 1; i >= 0; i--)\n-\t\tif (rte_lcore_is_enabled(i))\n-\t\t\treturn i;\n-\n-\treturn -1;\n-}\n-\n-/**\n- * Get the last enabled lcore ID\n- *\n- * @return\n- *   The last enabled lcore_id.\n- */\n-static unsigned int\n-get_last_lcore_id(void)\n-{\n-\tint i;\n-\n-\tfor (i = RTE_MAX_LCORE; i >= 0; i--)\n-\t\tif (rte_lcore_is_enabled(i))\n-\t\t\treturn i;\n-\n-\treturn 0;\n-}\n-\n-static void\n-receive_stage(__attribute__((unused)) void *args)\n-{\n-\tint i, ret;\n-\n-\tuint16_t port_id;\n-\tuint16_t nb_rx_pkts;\n-\n-\tunsigned int lcore_id;\n-\tunsigned int free;\n-\n-\tstruct rte_mbuf *pkts[MAX_PKT_QUOTA];\n-\tstruct rte_ring *ring;\n-\tenum ring_state ring_state[RTE_MAX_ETHPORTS] = { RING_READY };\n-\n-\tlcore_id = rte_lcore_id();\n-\n-\tRTE_LOG(INFO, USER1,\n-\t\t\t\"%s() started on core %u\\n\", __func__, lcore_id);\n-\n-\twhile (1) {\n-\n-\t\t/* Process each port round robin style */\n-\t\tfor (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) {\n-\n-\t\t\tif (!is_bit_set(port_id, portmask))\n-\t\t\t\tcontinue;\n-\n-\t\t\tring = rings[lcore_id][port_id];\n-\n-\t\t\tif (ring_state[port_id] != RING_READY) {\n-\t\t\t\tif (rte_ring_count(ring) > *low_watermark)\n-\t\t\t\t\tcontinue;\n-\t\t\t\telse\n-\t\t\t\t\tring_state[port_id] = RING_READY;\n-\t\t\t}\n-\n-\t\t\t/* Enqueue received packets on the RX ring */\n-\t\t\tnb_rx_pkts = rte_eth_rx_burst(port_id, 0, pkts,\n-\t\t\t\t\t(uint16_t) *quota);\n-\t\t\tret = rte_ring_enqueue_bulk(ring, (void *) pkts,\n-\t\t\t\t\tnb_rx_pkts, &free);\n-\t\t\tif (RING_SIZE - free > *high_watermark) {\n-\t\t\t\tring_state[port_id] = RING_OVERLOADED;\n-\t\t\t\tsend_pause_frame(port_id, 1337);\n-\t\t\t}\n-\n-\t\t\tif (ret == 0) {\n-\n-\t\t\t\t/*\n-\t\t\t\t * Return  mbufs to the pool,\n-\t\t\t\t * effectively dropping packets\n-\t\t\t\t */\n-\t\t\t\tfor (i = 0; i < nb_rx_pkts; i++)\n-\t\t\t\t\trte_pktmbuf_free(pkts[i]);\n-\t\t\t}\n-\t\t}\n-\t}\n-}\n-\n-static int\n-pipeline_stage(__attribute__((unused)) void *args)\n-{\n-\tint i, ret;\n-\tint nb_dq_pkts;\n-\n-\tuint16_t port_id;\n-\n-\tunsigned int lcore_id, previous_lcore_id;\n-\tunsigned int free;\n-\n-\tvoid *pkts[MAX_PKT_QUOTA];\n-\tstruct rte_ring *rx, *tx;\n-\tenum ring_state ring_state[RTE_MAX_ETHPORTS] = { RING_READY };\n-\n-\tlcore_id = rte_lcore_id();\n-\tprevious_lcore_id = get_previous_lcore_id(lcore_id);\n-\n-\tRTE_LOG(INFO, USER1,\n-\t\t\t\"%s() started on core %u - processing packets from core %u\\n\",\n-\t\t\t__func__, lcore_id, previous_lcore_id);\n-\n-\twhile (1) {\n-\n-\t\tfor (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) {\n-\n-\t\t\tif (!is_bit_set(port_id, portmask))\n-\t\t\t\tcontinue;\n-\n-\t\t\ttx = rings[lcore_id][port_id];\n-\t\t\trx = rings[previous_lcore_id][port_id];\n-\n-\t\t\tif (ring_state[port_id] != RING_READY) {\n-\t\t\t\tif (rte_ring_count(tx) > *low_watermark)\n-\t\t\t\t\tcontinue;\n-\t\t\t\telse\n-\t\t\t\t\tring_state[port_id] = RING_READY;\n-\t\t\t}\n-\n-\t\t\t/* Dequeue up to quota mbuf from rx */\n-\t\t\tnb_dq_pkts = rte_ring_dequeue_burst(rx, pkts,\n-\t\t\t\t\t*quota, NULL);\n-\t\t\tif (unlikely(nb_dq_pkts < 0))\n-\t\t\t\tcontinue;\n-\n-\t\t\t/* Enqueue them on tx */\n-\t\t\tret = rte_ring_enqueue_bulk(tx, pkts,\n-\t\t\t\t\tnb_dq_pkts, &free);\n-\t\t\tif (RING_SIZE - free > *high_watermark)\n-\t\t\t\tring_state[port_id] = RING_OVERLOADED;\n-\n-\t\t\tif (ret == 0) {\n-\n-\t\t\t\t/*\n-\t\t\t\t * Return  mbufs to the pool,\n-\t\t\t\t * effectively dropping packets\n-\t\t\t\t */\n-\t\t\t\tfor (i = 0; i < nb_dq_pkts; i++)\n-\t\t\t\t\trte_pktmbuf_free(pkts[i]);\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\treturn 0;\n-}\n-\n-static int\n-send_stage(__attribute__((unused)) void *args)\n-{\n-\tuint16_t nb_dq_pkts;\n-\n-\tuint16_t port_id;\n-\tuint16_t dest_port_id;\n-\n-\tunsigned int lcore_id, previous_lcore_id;\n-\n-\tstruct rte_ring *tx;\n-\tstruct rte_mbuf *tx_pkts[MAX_PKT_QUOTA];\n-\n-\tlcore_id = rte_lcore_id();\n-\tprevious_lcore_id = get_previous_lcore_id(lcore_id);\n-\n-\tRTE_LOG(INFO, USER1,\n-\t\t\t\"%s() started on core %u - processing packets from core %u\\n\",\n-\t\t\t__func__, lcore_id, previous_lcore_id);\n-\n-\twhile (1) {\n-\n-\t\t/* Process each ring round robin style */\n-\t\tfor (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) {\n-\n-\t\t\tif (!is_bit_set(port_id, portmask))\n-\t\t\t\tcontinue;\n-\n-\t\t\tdest_port_id = port_pairs[port_id];\n-\t\t\ttx = rings[previous_lcore_id][port_id];\n-\n-\t\t\tif (rte_ring_empty(tx))\n-\t\t\t\tcontinue;\n-\n-\t\t\t/* Dequeue packets from tx and send them */\n-\t\t\tnb_dq_pkts = (uint16_t) rte_ring_dequeue_burst(tx,\n-\t\t\t\t\t(void *) tx_pkts, *quota, NULL);\n-\t\t\trte_eth_tx_burst(dest_port_id, 0, tx_pkts, nb_dq_pkts);\n-\n-\t\t\t/* TODO: Check if nb_dq_pkts == nb_tx_pkts? */\n-\t\t}\n-\t}\n-\n-\treturn 0;\n-}\n-\n-int\n-main(int argc, char **argv)\n-{\n-\tint ret;\n-\tunsigned int lcore_id, master_lcore_id, last_lcore_id;\n-\n-\tuint16_t port_id;\n-\n-\trte_log_set_global_level(RTE_LOG_INFO);\n-\n-\tret = rte_eal_init(argc, argv);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE, \"Cannot initialize EAL\\n\");\n-\n-\targc -= ret;\n-\targv += ret;\n-\n-\tinit_dpdk();\n-\tsetup_shared_variables();\n-\n-\t*quota = 32;\n-\t*low_watermark = 60 * RING_SIZE / 100;\n-\n-\tlast_lcore_id   = get_last_lcore_id();\n-\tmaster_lcore_id = rte_get_master_lcore();\n-\n-\t/* Parse the application's arguments */\n-\tret = parse_qw_args(argc, argv);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE, \"Invalid quota/watermark argument(s)\\n\");\n-\n-\t/* Create a pool of mbuf to store packets */\n-\tmbuf_pool = rte_pktmbuf_pool_create(\"mbuf_pool\", MBUF_PER_POOL, 32, 0,\n-\t\t\tMBUF_DATA_SIZE, rte_socket_id());\n-\tif (mbuf_pool == NULL)\n-\t\trte_panic(\"%s\\n\", rte_strerror(rte_errno));\n-\n-\tfor (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++)\n-\t\tif (is_bit_set(port_id, portmask)) {\n-\t\t\tconfigure_eth_port(port_id);\n-\t\t\tinit_ring(master_lcore_id, port_id);\n-\t\t}\n-\n-\tpair_ports();\n-\n-\t/*\n-\t * Start pipeline_connect() on all the available slave lcores\n-\t * but the last\n-\t */\n-\tfor (lcore_id = 0 ; lcore_id < last_lcore_id; lcore_id++) {\n-\t\tif (rte_lcore_is_enabled(lcore_id) &&\n-\t\t\t\tlcore_id != master_lcore_id) {\n-\n-\t\t\tfor (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++)\n-\t\t\t\tif (is_bit_set(port_id, portmask))\n-\t\t\t\t\tinit_ring(lcore_id, port_id);\n-\n-\t\t\trte_eal_remote_launch(pipeline_stage,\n-\t\t\t\t\tNULL, lcore_id);\n-\t\t}\n-\t}\n-\n-\t/* Start send_stage() on the last slave core */\n-\trte_eal_remote_launch(send_stage, NULL, last_lcore_id);\n-\n-\t/* Start receive_stage() on the master core */\n-\treceive_stage(NULL);\n-\n-\treturn 0;\n-}\ndiff --git a/examples/quota_watermark/qw/main.h b/examples/quota_watermark/qw/main.h\ndeleted file mode 100644\nindex 9903ddc8c..000000000\n--- a/examples/quota_watermark/qw/main.h\n+++ /dev/null\n@@ -1,31 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#ifndef _MAIN_H_\n-#define _MAIN_H_\n-\n-#include \"../include/conf.h\"\n-\n-enum ring_state {\n-\tRING_READY,\n-\tRING_OVERLOADED,\n-};\n-\n-extern int *quota;\n-extern unsigned int *low_watermark;\n-extern unsigned int *high_watermark;\n-\n-extern uint16_t port_pairs[RTE_MAX_ETHPORTS];\n-\n-extern struct rte_ring *rings[RTE_MAX_LCORE][RTE_MAX_ETHPORTS];\n-extern struct rte_mempool *mbuf_pool;\n-\n-\n-static inline int\n-is_bit_set(int i, unsigned int mask)\n-{\n-\treturn (1 << i) & mask;\n-}\n-\n-#endif /* _MAIN_H_ */\ndiff --git a/examples/quota_watermark/qwctl/Makefile b/examples/quota_watermark/qwctl/Makefile\ndeleted file mode 100644\nindex a40f28025..000000000\n--- a/examples/quota_watermark/qwctl/Makefile\n+++ /dev/null\n@@ -1,22 +0,0 @@\n-# SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2010-2014 Intel Corporation\n-\n-ifeq ($(RTE_SDK),)\n-$(error \"Please define RTE_SDK environment variable\")\n-endif\n-\n-# Default target, detect a build directory, by looking for a path with a .config\n-RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))\n-\n-include $(RTE_SDK)/mk/rte.vars.mk\n-\n-# binary name\n-APP = qwctl\n-\n-# all source are stored in SRCS-y\n-SRCS-y := commands.c qwctl.c\n-\n-CFLAGS += -O3\n-CFLAGS += $(WERROR_FLAGS)\n-\n-include $(RTE_SDK)/mk/rte.extapp.mk\ndiff --git a/examples/quota_watermark/qwctl/commands.c b/examples/quota_watermark/qwctl/commands.c\ndeleted file mode 100644\nindex a1c646b9f..000000000\n--- a/examples/quota_watermark/qwctl/commands.c\n+++ /dev/null\n@@ -1,196 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#include <stdio.h>\n-#include <stdint.h>\n-#include <string.h>\n-#include <termios.h>\n-\n-#include <cmdline_rdline.h>\n-#include <cmdline_parse.h>\n-#include <cmdline_parse_num.h>\n-#include <cmdline_parse_string.h>\n-#include <cmdline.h>\n-\n-#include <rte_ring.h>\n-\n-#include \"qwctl.h\"\n-#include \"../include/conf.h\"\n-\n-\n-/**\n- * help command\n- */\n-\n-struct cmd_help_tokens {\n-\tcmdline_fixed_string_t verb;\n-};\n-\n-cmdline_parse_token_string_t cmd_help_verb =\n-\t\tTOKEN_STRING_INITIALIZER(struct cmd_help_tokens, verb, \"help\");\n-\n-static void\n-cmd_help_handler(__attribute__((unused)) void *parsed_result,\n-\t\tstruct cmdline *cl,\n-\t\t__attribute__((unused)) void *data)\n-{\n-\tcmdline_printf(cl, \"Available commands:\\n\"\n-\t\t\t\"- help\\n\"\n-\t\t\t\"- set  [ring_name|variable] <value>\\n\"\n-\t\t\t\"- show [ring_name|variable]\\n\"\n-\t\t\t\"\\n\"\n-\t\t\t\"Available variables:\\n\"\n-\t\t\t\"- low_watermark\\n\"\n-\t\t\t\"- quota\\n\"\n-\t\t\t\"- ring names follow the core%%u_port%%u format\\n\");\n-}\n-\n-cmdline_parse_inst_t cmd_help = {\n-\t\t.f = cmd_help_handler,\n-\t\t.data = NULL,\n-\t\t.help_str = \"show help\",\n-\t\t.tokens = {\n-\t\t\t\t(void *) &cmd_help_verb,\n-\t\t\t\tNULL,\n-\t\t},\n-};\n-\n-\n-/**\n- * set command\n- */\n-\n-struct cmd_set_tokens {\n-\tcmdline_fixed_string_t verb;\n-\tcmdline_fixed_string_t variable;\n-\tuint32_t value;\n-};\n-\n-cmdline_parse_token_string_t cmd_set_verb =\n-\t\tTOKEN_STRING_INITIALIZER(struct cmd_set_tokens, verb, \"set\");\n-\n-cmdline_parse_token_string_t cmd_set_variable =\n-\t\tTOKEN_STRING_INITIALIZER(struct cmd_set_tokens, variable, NULL);\n-\n-cmdline_parse_token_num_t cmd_set_value =\n-\t\tTOKEN_NUM_INITIALIZER(struct cmd_set_tokens, value, UINT32);\n-\n-static void\n-cmd_set_handler(__attribute__((unused)) void *parsed_result,\n-\t\tstruct cmdline *cl,\n-\t\t__attribute__((unused)) void *data)\n-{\n-\tstruct cmd_set_tokens *tokens = parsed_result;\n-\tstruct rte_ring *ring;\n-\n-\tif (!strcmp(tokens->variable, \"quota\")) {\n-\n-\t\tif (tokens->value > 0 && tokens->value <= MAX_PKT_QUOTA)\n-\t\t\t*quota = tokens->value;\n-\t\telse\n-\t\t\tcmdline_printf(cl, \"quota must be between 1 and %u\\n\",\n-\t\t\t\t\tMAX_PKT_QUOTA);\n-\t}\n-\n-\telse if (!strcmp(tokens->variable, \"low_watermark\")) {\n-\n-\t\tif (tokens->value <= 100)\n-\t\t\t*low_watermark = tokens->value * RING_SIZE / 100;\n-\t\telse\n-\t\t\tcmdline_printf(cl,\n-\t\t\t\t\t\"low_watermark must be between 0%% and 100%%\\n\");\n-\t}\n-\n-\telse {\n-\n-\t\tring = rte_ring_lookup(tokens->variable);\n-\t\tif (ring == NULL)\n-\t\t\tcmdline_printf(cl, \"Cannot find ring \\\"%s\\\"\\n\",\n-\t\t\t\t\ttokens->variable);\n-\t\telse\n-\t\t\tif (tokens->value >= *low_watermark * 100 / RING_SIZE\n-\t\t\t\t\t&& tokens->value <= 100)\n-\t\t\t\t*high_watermark = tokens->value *\n-\t\t\t\t\t\tRING_SIZE / 100;\n-\t\t\telse\n-\t\t\t\tcmdline_printf(cl,\n-\t\t\t\t\t\"ring high watermark must be between %u%% and 100%%\\n\",\n-\t\t\t\t\t*low_watermark * 100 / RING_SIZE);\n-\t}\n-}\n-\n-cmdline_parse_inst_t cmd_set = {\n-\t\t.f = cmd_set_handler,\n-\t\t.data = NULL,\n-\t\t.help_str = \"Set a variable value\",\n-\t\t.tokens = {\n-\t\t\t\t(void *) &cmd_set_verb,\n-\t\t\t\t(void *) &cmd_set_variable,\n-\t\t\t\t(void *) &cmd_set_value,\n-\t\t\t\tNULL,\n-\t\t},\n-};\n-\n-\n-/**\n- * show command\n- */\n-\n-struct cmd_show_tokens {\n-\tcmdline_fixed_string_t verb;\n-\tcmdline_fixed_string_t variable;\n-};\n-\n-cmdline_parse_token_string_t cmd_show_verb =\n-\t\tTOKEN_STRING_INITIALIZER(struct cmd_show_tokens, verb, \"show\");\n-\n-cmdline_parse_token_string_t cmd_show_variable =\n-\t\tTOKEN_STRING_INITIALIZER(struct cmd_show_tokens,\n-\t\t\t\tvariable, NULL);\n-\n-\n-static void\n-cmd_show_handler(__attribute__((unused)) void *parsed_result,\n-\t\tstruct cmdline *cl,\n-\t\t__attribute__((unused)) void *data)\n-{\n-\tstruct cmd_show_tokens *tokens = parsed_result;\n-\tstruct rte_ring *ring;\n-\n-\tif (!strcmp(tokens->variable, \"quota\"))\n-\t\tcmdline_printf(cl, \"Global quota: %d\\n\", *quota);\n-\n-\telse if (!strcmp(tokens->variable, \"low_watermark\"))\n-\t\tcmdline_printf(cl, \"Global low_watermark: %u\\n\",\n-\t\t\t\t*low_watermark);\n-\n-\telse {\n-\n-\t\tring = rte_ring_lookup(tokens->variable);\n-\t\tif (ring == NULL)\n-\t\t\tcmdline_printf(cl, \"Cannot find ring \\\"%s\\\"\\n\",\n-\t\t\t\t\ttokens->variable);\n-\t\telse\n-\t\t\trte_ring_dump(stdout, ring);\n-\t}\n-}\n-\n-cmdline_parse_inst_t cmd_show = {\n-\t\t.f = cmd_show_handler,\n-\t\t.data = NULL,\n-\t\t.help_str = \"Show a variable value\",\n-\t\t.tokens = {\n-\t\t\t\t(void *) &cmd_show_verb,\n-\t\t\t\t(void *) &cmd_show_variable,\n-\t\t\t\tNULL,\n-\t\t},\n-};\n-\n-\n-cmdline_parse_ctx_t qwctl_ctx[] = {\n-\t\t(cmdline_parse_inst_t *)&cmd_help,\n-\t\t(cmdline_parse_inst_t *)&cmd_set,\n-\t\t(cmdline_parse_inst_t *)&cmd_show,\n-\t\tNULL,\n-};\ndiff --git a/examples/quota_watermark/qwctl/commands.h b/examples/quota_watermark/qwctl/commands.h\ndeleted file mode 100644\nindex 4a4e97475..000000000\n--- a/examples/quota_watermark/qwctl/commands.h\n+++ /dev/null\n@@ -1,12 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#ifndef _COMMANDS_H_\n-#define _COMMANDS_H_\n-\n-#include <cmdline_parse.h>\n-\n-extern cmdline_parse_ctx_t qwctl_ctx[];\n-\n-#endif /* _COMMANDS_H_ */\ndiff --git a/examples/quota_watermark/qwctl/qwctl.c b/examples/quota_watermark/qwctl/qwctl.c\ndeleted file mode 100644\nindex 2f7914c80..000000000\n--- a/examples/quota_watermark/qwctl/qwctl.c\n+++ /dev/null\n@@ -1,67 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#include <fcntl.h>\n-#include <stdio.h>\n-#include <termios.h>\n-#include <unistd.h>\n-#include <sys/mman.h>\n-\n-#include <rte_eal.h>\n-\n-#include <rte_log.h>\n-#include <rte_memzone.h>\n-\n-#include <cmdline_rdline.h>\n-#include <cmdline_parse.h>\n-#include <cmdline_socket.h>\n-#include <cmdline.h>\n-\n-\n-#include \"qwctl.h\"\n-#include \"commands.h\"\n-#include \"../include/conf.h\"\n-\n-\n-int *quota;\n-unsigned int *low_watermark;\n-unsigned int *high_watermark;\n-\n-\n-static void\n-setup_shared_variables(void)\n-{\n-\tconst struct rte_memzone *qw_memzone;\n-\n-\tqw_memzone = rte_memzone_lookup(QUOTA_WATERMARK_MEMZONE_NAME);\n-\tif (qw_memzone == NULL)\n-\t\trte_exit(EXIT_FAILURE, \"Couldn't find memzone\\n\");\n-\n-\tquota = qw_memzone->addr;\n-\tlow_watermark = (unsigned int *) qw_memzone->addr + 1;\n-\thigh_watermark = (unsigned int *) qw_memzone->addr + 2;\n-}\n-\n-int main(int argc, char **argv)\n-{\n-\tint ret;\n-\tstruct cmdline *cl;\n-\n-\trte_log_set_global_level(RTE_LOG_INFO);\n-\n-\tret = rte_eal_init(argc, argv);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE, \"Cannot initialize EAL\\n\");\n-\n-\tsetup_shared_variables();\n-\n-\tcl = cmdline_stdin_new(qwctl_ctx, \"qwctl> \");\n-\tif (cl == NULL)\n-\t\trte_exit(EXIT_FAILURE, \"Cannot create cmdline instance\\n\");\n-\n-\tcmdline_interact(cl);\n-\tcmdline_stdin_exit(cl);\n-\n-\treturn 0;\n-}\ndiff --git a/examples/quota_watermark/qwctl/qwctl.h b/examples/quota_watermark/qwctl/qwctl.h\ndeleted file mode 100644\nindex 2a4559388..000000000\n--- a/examples/quota_watermark/qwctl/qwctl.h\n+++ /dev/null\n@@ -1,12 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#ifndef _MAIN_H_\n-#define _MAIN_H_\n-\n-extern int *quota;\n-extern unsigned int *low_watermark;\n-extern unsigned int *high_watermark;\n-\n-#endif /* _MAIN_H_ */\n",
    "prefixes": [
        "3/6"
    ]
}