get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 60493,
    "url": "https://patches.dpdk.org/api/patches/60493/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191003131918.30970-3-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-3-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191003131918.30970-3-bruce.richardson@intel.com",
    "date": "2019-10-03T13:19:14",
    "name": "[2/6] examples/l3fwd-vf: remove example from DPDK",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ac959058565d80e3fc2c3e1a63537dc8db707e95",
    "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-3-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/60493/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/60493/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 CA5B51C10E;\n\tThu,  3 Oct 2019 15:19:36 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 518471C0D8;\n\tThu,  3 Oct 2019 15:19:33 +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:32 -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:30 -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=\"185910485\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "techboard@dpdk.org,\n\tBruce Richardson <bruce.richardson@intel.com>",
        "Date": "Thu,  3 Oct 2019 14:19:14 +0100",
        "Message-Id": "<20191003131918.30970-3-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 2/6] examples/l3fwd-vf: remove example from 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": "The main l3fwd app should work with both PF and VF devices, so remove the\nVF-only l3fwd example.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n MAINTAINERS                                   |    3 -\n doc/guides/sample_app_ug/index.rst            |    1 -\n .../sample_app_ug/l3_forward_virtual.rst      |   98 --\n examples/Makefile                             |    1 -\n examples/l3fwd-vf/Makefile                    |   62 -\n examples/l3fwd-vf/main.c                      | 1072 -----------------\n examples/l3fwd-vf/meson.build                 |   12 -\n examples/meson.build                          |    2 +-\n 8 files changed, 1 insertion(+), 1250 deletions(-)\n delete mode 100644 doc/guides/sample_app_ug/l3_forward_virtual.rst\n delete mode 100644 examples/l3fwd-vf/Makefile\n delete mode 100644 examples/l3fwd-vf/main.c\n delete mode 100644 examples/l3fwd-vf/meson.build",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 330a4d77d..92c3f6af4 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1458,9 +1458,6 @@ F: examples/l2fwd-cat/\n F: examples/l3fwd/\n F: doc/guides/sample_app_ug/l3_forward.rst\n \n-F: examples/l3fwd-vf/\n-F: doc/guides/sample_app_ug/l3_forward_virtual.rst\n-\n F: examples/link_status_interrupt/\n F: doc/guides/sample_app_ug/link_status_intr.rst\n \ndiff --git a/doc/guides/sample_app_ug/index.rst b/doc/guides/sample_app_ug/index.rst\nindex 076346a60..d212f81fe 100644\n--- a/doc/guides/sample_app_ug/index.rst\n+++ b/doc/guides/sample_app_ug/index.rst\n@@ -29,7 +29,6 @@ Sample Applications User Guides\n     l3_forward\n     l3_forward_power_man\n     l3_forward_access_ctrl\n-    l3_forward_virtual\n     link_status_intr\n     load_balancer\n     server_node_efd\ndiff --git a/doc/guides/sample_app_ug/l3_forward_virtual.rst b/doc/guides/sample_app_ug/l3_forward_virtual.rst\ndeleted file mode 100644\nindex 21eab8da3..000000000\n--- a/doc/guides/sample_app_ug/l3_forward_virtual.rst\n+++ /dev/null\n@@ -1,98 +0,0 @@\n-..  SPDX-License-Identifier: BSD-3-Clause\n-    Copyright(c) 2010-2014 Intel Corporation.\n-\n-L3 Forwarding in a Virtualization Environment Sample Application\n-================================================================\n-\n-The L3 Forwarding in a Virtualization Environment sample application is a simple example of packet processing using the DPDK.\n-The application performs L3 forwarding that takes advantage of Single Root I/O Virtualization (SR-IOV) features\n-in a virtualized environment.\n-\n-Overview\n---------\n-\n-The application demonstrates the use of the hash and LPM libraries in the DPDK to implement packet forwarding.\n-The initialization and run-time paths are very similar to those of the :doc:`l3_forward`.\n-The forwarding decision is taken based on information read from the input packet.\n-\n-The lookup method is either hash-based or LPM-based and is selected at compile time.\n-When the selected lookup method is hash-based, a hash object is used to emulate the flow classification stage.\n-The hash object is used in correlation with the flow table to map each input packet to its flow at runtime.\n-\n-The hash lookup key is represented by the DiffServ 5-tuple composed of the following fields read from the input packet:\n-Source IP Address, Destination IP Address, Protocol, Source Port and Destination Port.\n-The ID of the output interface for the input packet is read from the identified flow table entry.\n-The set of flows used by the application is statically configured and loaded into the hash at initialization time.\n-When the selected lookup method is LPM based, an LPM object is used to emulate the forwarding stage for IPv4 packets.\n-The LPM object is used as the routing table to identify the next hop for each input packet at runtime.\n-\n-The LPM lookup key is represented by the Destination IP Address field read from the input packet.\n-The ID of the output interface for the input packet is the next hop returned by the LPM lookup.\n-The set of LPM rules used by the application is statically configured and loaded into the LPM object at the initialization time.\n-\n-.. note::\n-\n-    Please refer to :ref:`l2_fwd_vf_setup` for virtualized test case 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 ``l3fwd-vf`` sub-directory.\n-\n-Running the Application\n------------------------\n-\n-The application has a number of command line options:\n-\n-.. code-block:: console\n-\n-    ./build/l3fwd-vf [EAL options] -- -p PORTMASK  --config(port,queue,lcore)[,(port,queue,lcore)] [--no-numa]\n-\n-where,\n-\n-*   --p PORTMASK: Hexadecimal bitmask of ports to configure\n-\n-*   --config (port,queue,lcore)[,(port,queue,lcore]: determines which queues from which ports are mapped to which cores\n-\n-*   --no-numa: optional, disables numa awareness\n-\n-For example, consider a dual processor socket platform with 8 physical cores, where cores 0-7 and 16-23 appear on socket 0,\n-while cores 8-15 and 24-31 appear on socket 1.\n-\n-To enable L3 forwarding between two ports, assuming that both ports are in the same socket, using two cores, cores 1 and 2,\n-(which are in the same socket too), use the following command:\n-\n-.. code-block:: console\n-\n-   ./build/l3fwd-vf -l 1,2 -n 4 -- -p 0x3 --config=\"(0,0,1),(1,0,2)\"\n-\n-In this command:\n-\n-*   The -l option enables cores 1 and 2\n-\n-*   The -p option enables ports 0 and 1\n-\n-*   The --config option enables one queue on each port and maps each (port,queue) pair to a specific core.\n-    The following table shows the mapping in this example:\n-\n-    +----------+-----------+-----------+------------------------------------+\n-    | **Port** | **Queue** | **lcore** | **Description**                    |\n-    |          |           |           |                                    |\n-    +==========+===========+===========+====================================+\n-    | 0        | 0         | 1         | Map queue 0 from port 0 to lcore 1 |\n-    |          |           |           |                                    |\n-    +----------+-----------+-----------+------------------------------------+\n-    | 1        | 0         | 2         | Map queue 0 from port 1 to lcore 2 |\n-    |          |           |           |                                    |\n-    +----------+-----------+-----------+------------------------------------+\n-\n-Refer to the *DPDK Getting Started Guide* for general information on running applications\n-and the Environment Abstraction Layer (EAL) options.\n-\n-Explanation\n------------\n-\n-The operation of this application is similar to that of the basic L3 Forwarding Sample Application.\n-See :ref:`l3_fwd_explanation` for more information.\ndiff --git a/examples/Makefile b/examples/Makefile\nindex c756497d1..5dd8a72e5 100644\n--- a/examples/Makefile\n+++ b/examples/Makefile\n@@ -46,7 +46,6 @@ endif\n DIRS-$(CONFIG_RTE_LIBRTE_ACL) += l3fwd-acl\n ifeq ($(CONFIG_RTE_LIBRTE_LPM)$(CONFIG_RTE_LIBRTE_HASH),yy)\n DIRS-$(CONFIG_RTE_LIBRTE_POWER) += l3fwd-power\n-DIRS-y += l3fwd-vf\n endif\n DIRS-y += link_status_interrupt\n DIRS-$(CONFIG_RTE_LIBRTE_LPM) += load_balancer\ndiff --git a/examples/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile\ndeleted file mode 100644\nindex 7b186a23c..000000000\n--- a/examples/l3fwd-vf/Makefile\n+++ /dev/null\n@@ -1,62 +0,0 @@\n-# SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2010-2014 Intel Corporation\n-\n-# binary name\n-APP = l3fwd-vf\n-\n-# all source are stored in SRCS-y\n-SRCS-y := main.c\n-\n-# Build using pkg-config variables if possible\n-ifeq ($(shell pkg-config --exists libdpdk && echo 0),0)\n-\n-all: shared\n-.PHONY: shared static\n-shared: build/$(APP)-shared\n-\tln -sf $(APP)-shared build/$(APP)\n-static: build/$(APP)-static\n-\tln -sf $(APP)-static build/$(APP)\n-\n-PKGCONF=pkg-config --define-prefix\n-\n-PC_FILE := $(shell $(PKGCONF) --path libdpdk)\n-CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)\n-LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)\n-LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)\n-\n-build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build\n-\t$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)\n-\n-build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build\n-\t$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)\n-\n-build:\n-\t@mkdir -p $@\n-\n-.PHONY: clean\n-clean:\n-\trm -f build/$(APP) build/$(APP)-static build/$(APP)-shared\n-\ttest -d build && rmdir -p build || true\n-\n-else # Build using legacy build system\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-CFLAGS += -O3 $(USER_FLAGS)\n-CFLAGS += $(WERROR_FLAGS)\n-\n-# workaround for a gcc bug with noreturn attribute\n-# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603\n-ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)\n-CFLAGS_main.o += -Wno-return-type\n-endif\n-\n-include $(RTE_SDK)/mk/rte.extapp.mk\n-endif\ndiff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c\ndeleted file mode 100644\nindex 572e74cf5..000000000\n--- a/examples/l3fwd-vf/main.c\n+++ /dev/null\n@@ -1,1072 +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 <stdint.h>\n-#include <inttypes.h>\n-#include <sys/types.h>\n-#include <string.h>\n-#include <sys/queue.h>\n-#include <stdarg.h>\n-#include <errno.h>\n-#include <getopt.h>\n-#include <signal.h>\n-\n-#include <rte_common.h>\n-#include <rte_byteorder.h>\n-#include <rte_log.h>\n-#include <rte_memory.h>\n-#include <rte_memcpy.h>\n-#include <rte_eal.h>\n-#include <rte_launch.h>\n-#include <rte_atomic.h>\n-#include <rte_spinlock.h>\n-#include <rte_cycles.h>\n-#include <rte_prefetch.h>\n-#include <rte_lcore.h>\n-#include <rte_per_lcore.h>\n-#include <rte_branch_prediction.h>\n-#include <rte_interrupts.h>\n-#include <rte_random.h>\n-#include <rte_debug.h>\n-#include <rte_ether.h>\n-#include <rte_ethdev.h>\n-#include <rte_mempool.h>\n-#include <rte_mbuf.h>\n-#include <rte_ip.h>\n-#include <rte_tcp.h>\n-#include <rte_udp.h>\n-#include <rte_string_fns.h>\n-\n-#define APP_LOOKUP_EXACT_MATCH          0\n-#define APP_LOOKUP_LPM                  1\n-#define DO_RFC_1812_CHECKS\n-\n-//#define APP_LOOKUP_METHOD             APP_LOOKUP_EXACT_MATCH\n-#ifndef APP_LOOKUP_METHOD\n-#define APP_LOOKUP_METHOD             APP_LOOKUP_LPM\n-#endif\n-\n-#if (APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH)\n-#include <rte_hash.h>\n-#elif (APP_LOOKUP_METHOD == APP_LOOKUP_LPM)\n-#include <rte_lpm.h>\n-#else\n-#error \"APP_LOOKUP_METHOD set to incorrect value\"\n-#endif\n-\n-#define RTE_LOGTYPE_L3FWD RTE_LOGTYPE_USER1\n-\n-#define MEMPOOL_CACHE_SIZE 256\n-\n-/*\n- * This expression is used to calculate the number of mbufs needed depending on user input, taking\n- *  into account memory for rx and tx hardware rings, cache per lcore and mtable per port per lcore.\n- *  RTE_MAX is used to ensure that NB_MBUF never goes below a minimum value of 8192\n- */\n-\n-#define NB_MBUF RTE_MAX\t(\t\t\t\t\t\t\\\n-\t\t\t\t(nb_ports*nb_rx_queue*nb_rxd +\t\t\\\n-\t\t\t\tnb_ports*nb_lcores*MAX_PKT_BURST +\t\\\n-\t\t\t\tnb_ports*n_tx_queue*nb_txd +\t\t\\\n-\t\t\t\tnb_lcores*MEMPOOL_CACHE_SIZE),\t\t\\\n-\t\t\t\t(unsigned)8192)\n-\n-#define MAX_PKT_BURST 32\n-#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */\n-\n-#define NB_SOCKETS 8\n-\n-#define SOCKET0 0\n-\n-/* Configure how many packets ahead to prefetch, when reading packets */\n-#define PREFETCH_OFFSET\t3\n-\n-/*\n- * Configurable number of RX/TX ring descriptors\n- */\n-#define RTE_TEST_RX_DESC_DEFAULT 1024\n-#define RTE_TEST_TX_DESC_DEFAULT 1024\n-static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;\n-static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;\n-\n-/* ethernet addresses of ports */\n-static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];\n-\n-/* mask of enabled ports */\n-static uint32_t enabled_port_mask = 0;\n-static int numa_on = 1; /**< NUMA is enabled by default. */\n-\n-struct mbuf_table {\n-\tuint16_t len;\n-\tstruct rte_mbuf *m_table[MAX_PKT_BURST];\n-};\n-\n-struct lcore_rx_queue {\n-\tuint16_t port_id;\n-\tuint8_t queue_id;\n-} __rte_cache_aligned;\n-\n-#define MAX_RX_QUEUE_PER_LCORE 16\n-#define MAX_TX_QUEUE_PER_PORT 1\n-#define MAX_RX_QUEUE_PER_PORT 1\n-\n-#define MAX_LCORE_PARAMS 1024\n-struct lcore_params {\n-\tuint16_t port_id;\n-\tuint8_t queue_id;\n-\tuint8_t lcore_id;\n-} __rte_cache_aligned;\n-\n-static struct lcore_params lcore_params_array[MAX_LCORE_PARAMS];\n-static struct lcore_params lcore_params_array_default[] = {\n-\t{0, 0, 2},\n-\t{0, 1, 2},\n-\t{0, 2, 2},\n-\t{1, 0, 2},\n-\t{1, 1, 2},\n-\t{1, 2, 2},\n-\t{2, 0, 2},\n-\t{3, 0, 3},\n-\t{3, 1, 3},\n-};\n-\n-static struct lcore_params * lcore_params = lcore_params_array_default;\n-static uint16_t nb_lcore_params = sizeof(lcore_params_array_default) /\n-\t\t\t\tsizeof(lcore_params_array_default[0]);\n-\n-static struct rte_eth_conf port_conf = {\n-\t.rxmode = {\n-\t\t.mq_mode\t= ETH_MQ_RX_RSS,\n-\t\t.max_rx_pkt_len = RTE_ETHER_MAX_LEN,\n-\t\t.split_hdr_size = 0,\n-\t\t.offloads = DEV_RX_OFFLOAD_CHECKSUM,\n-\t},\n-\t.rx_adv_conf = {\n-\t\t.rss_conf = {\n-\t\t\t.rss_key = NULL,\n-\t\t\t.rss_hf = ETH_RSS_IP,\n-\t\t},\n-\t},\n-\t.txmode = {\n-\t\t.mq_mode = ETH_MQ_TX_NONE,\n-\t},\n-};\n-\n-static struct rte_mempool * pktmbuf_pool[NB_SOCKETS];\n-\n-\n-#if (APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH)\n-\n-#ifdef RTE_ARCH_X86\n-#include <rte_hash_crc.h>\n-#define DEFAULT_HASH_FUNC       rte_hash_crc\n-#else\n-#include <rte_jhash.h>\n-#define DEFAULT_HASH_FUNC       rte_jhash\n-#endif\n-\n-struct ipv4_5tuple {\n-\tuint32_t ip_dst;\n-\tuint32_t ip_src;\n-\tuint16_t port_dst;\n-\tuint16_t port_src;\n-\tuint8_t proto;\n-} __attribute__((__packed__));\n-\n-struct l3fwd_route {\n-\tstruct ipv4_5tuple key;\n-\tuint8_t if_out;\n-};\n-\n-static struct l3fwd_route l3fwd_route_array[] = {\n-\t{{RTE_IPV4(100,10,0,1), RTE_IPV4(200,10,0,1), 101, 11, IPPROTO_TCP}, 0},\n-\t{{RTE_IPV4(100,20,0,2), RTE_IPV4(200,20,0,2), 102, 12, IPPROTO_TCP}, 1},\n-\t{{RTE_IPV4(100,30,0,3), RTE_IPV4(200,30,0,3), 103, 13, IPPROTO_TCP}, 2},\n-\t{{RTE_IPV4(100,40,0,4), RTE_IPV4(200,40,0,4), 104, 14, IPPROTO_TCP}, 3},\n-};\n-\n-typedef struct rte_hash lookup_struct_t;\n-static lookup_struct_t *l3fwd_lookup_struct[NB_SOCKETS];\n-\n-#define L3FWD_HASH_ENTRIES\t1024\n-struct rte_hash_parameters l3fwd_hash_params = {\n-\t.name = \"l3fwd_hash_0\",\n-\t.entries = L3FWD_HASH_ENTRIES,\n-\t.key_len = sizeof(struct ipv4_5tuple),\n-\t.hash_func = DEFAULT_HASH_FUNC,\n-\t.hash_func_init_val = 0,\n-\t.socket_id = SOCKET0,\n-};\n-\n-#define L3FWD_NUM_ROUTES \\\n-\t(sizeof(l3fwd_route_array) / sizeof(l3fwd_route_array[0]))\n-\n-static uint8_t l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned;\n-#endif\n-\n-#if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM)\n-struct l3fwd_route {\n-\tuint32_t ip;\n-\tuint8_t  depth;\n-\tuint8_t  if_out;\n-};\n-\n-static struct l3fwd_route l3fwd_route_array[] = {\n-\t{RTE_IPV4(1,1,1,0), 24, 0},\n-\t{RTE_IPV4(2,1,1,0), 24, 1},\n-\t{RTE_IPV4(3,1,1,0), 24, 2},\n-\t{RTE_IPV4(4,1,1,0), 24, 3},\n-\t{RTE_IPV4(5,1,1,0), 24, 4},\n-\t{RTE_IPV4(6,1,1,0), 24, 5},\n-\t{RTE_IPV4(7,1,1,0), 24, 6},\n-\t{RTE_IPV4(8,1,1,0), 24, 7},\n-};\n-\n-#define L3FWD_NUM_ROUTES \\\n-\t(sizeof(l3fwd_route_array) / sizeof(l3fwd_route_array[0]))\n-\n-#define L3FWD_LPM_MAX_RULES     1024\n-\n-typedef struct rte_lpm lookup_struct_t;\n-static lookup_struct_t *l3fwd_lookup_struct[NB_SOCKETS];\n-#endif\n-\n-struct lcore_conf {\n-\tuint16_t n_rx_queue;\n-\tstruct lcore_rx_queue rx_queue_list[MAX_RX_QUEUE_PER_LCORE];\n-\tuint16_t tx_queue_id;\n-\tstruct mbuf_table tx_mbufs[RTE_MAX_ETHPORTS];\n-\tlookup_struct_t * lookup_struct;\n-} __rte_cache_aligned;\n-\n-static struct lcore_conf lcore_conf[RTE_MAX_LCORE];\n-static rte_spinlock_t spinlock_conf[RTE_MAX_ETHPORTS] = {RTE_SPINLOCK_INITIALIZER};\n-/* Send burst of packets on an output interface */\n-static inline int\n-send_burst(struct lcore_conf *qconf, uint16_t n, uint16_t port)\n-{\n-\tstruct rte_mbuf **m_table;\n-\tint ret;\n-\tuint16_t queueid;\n-\n-\tqueueid = qconf->tx_queue_id;\n-\tm_table = (struct rte_mbuf **)qconf->tx_mbufs[port].m_table;\n-\n-\trte_spinlock_lock(&spinlock_conf[port]);\n-\tret = rte_eth_tx_burst(port, queueid, m_table, n);\n-\trte_spinlock_unlock(&spinlock_conf[port]);\n-\n-\tif (unlikely(ret < n)) {\n-\t\tdo {\n-\t\t\trte_pktmbuf_free(m_table[ret]);\n-\t\t} while (++ret < n);\n-\t}\n-\n-\treturn 0;\n-}\n-\n-/* Enqueue a single packet, and send burst if queue is filled */\n-static inline int\n-send_single_packet(struct rte_mbuf *m, uint16_t port)\n-{\n-\tuint32_t lcore_id;\n-\tuint16_t len;\n-\tstruct lcore_conf *qconf;\n-\n-\tlcore_id = rte_lcore_id();\n-\n-\tqconf = &lcore_conf[lcore_id];\n-\tlen = qconf->tx_mbufs[port].len;\n-\tqconf->tx_mbufs[port].m_table[len] = m;\n-\tlen++;\n-\n-\t/* enough pkts to be sent */\n-\tif (unlikely(len == MAX_PKT_BURST)) {\n-\t\tsend_burst(qconf, MAX_PKT_BURST, port);\n-\t\tlen = 0;\n-\t}\n-\n-\tqconf->tx_mbufs[port].len = len;\n-\treturn 0;\n-}\n-\n-#ifdef DO_RFC_1812_CHECKS\n-static inline int\n-is_valid_ipv4_pkt(struct rte_ipv4_hdr *pkt, uint32_t link_len)\n-{\n-\t/* From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2 */\n-\t/*\n-\t * 1. The packet length reported by the Link Layer must be large\n-\t * enough to hold the minimum length legal IP datagram (20 bytes).\n-\t */\n-\tif (link_len < sizeof(struct rte_ipv4_hdr))\n-\t\treturn -1;\n-\n-\t/* 2. The IP checksum must be correct. */\n-\t/* this is checked in H/W */\n-\n-\t/*\n-\t * 3. The IP version number must be 4. If the version number is not 4\n-\t * then the packet may be another version of IP, such as IPng or\n-\t * ST-II.\n-\t */\n-\tif (((pkt->version_ihl) >> 4) != 4)\n-\t\treturn -3;\n-\t/*\n-\t * 4. The IP header length field must be large enough to hold the\n-\t * minimum length legal IP datagram (20 bytes = 5 words).\n-\t */\n-\tif ((pkt->version_ihl & 0xf) < 5)\n-\t\treturn -4;\n-\n-\t/*\n-\t * 5. The IP total length field must be large enough to hold the IP\n-\t * datagram header, whose length is specified in the IP header length\n-\t * field.\n-\t */\n-\tif (rte_cpu_to_be_16(pkt->total_length) < sizeof(struct rte_ipv4_hdr))\n-\t\treturn -5;\n-\n-\treturn 0;\n-}\n-#endif\n-\n-#if (APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH)\n-static void\n-print_key(struct ipv4_5tuple key)\n-{\n-\tprintf(\"IP dst = %08x, IP src = %08x, port dst = %d, port src = %d, proto = %d\\n\",\n-\t       (unsigned)key.ip_dst, (unsigned)key.ip_src, key.port_dst, key.port_src, key.proto);\n-}\n-\n-static inline uint16_t\n-get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,\n-\t      lookup_struct_t *l3fwd_lookup_struct)\n-{\n-\tstruct ipv4_5tuple key;\n-\tstruct rte_tcp_hdr *tcp;\n-\tstruct rte_udp_hdr *udp;\n-\tint ret = 0;\n-\n-\tkey.ip_dst = rte_be_to_cpu_32(ipv4_hdr->dst_addr);\n-\tkey.ip_src = rte_be_to_cpu_32(ipv4_hdr->src_addr);\n-\tkey.proto = ipv4_hdr->next_proto_id;\n-\n-\tswitch (ipv4_hdr->next_proto_id) {\n-\tcase IPPROTO_TCP:\n-\t\ttcp = (struct rte_tcp_hdr *)((unsigned char *) ipv4_hdr +\n-\t\t\t\t\tsizeof(struct rte_ipv4_hdr));\n-\t\tkey.port_dst = rte_be_to_cpu_16(tcp->dst_port);\n-\t\tkey.port_src = rte_be_to_cpu_16(tcp->src_port);\n-\t\tbreak;\n-\n-\tcase IPPROTO_UDP:\n-\t\tudp = (struct rte_udp_hdr *)((unsigned char *) ipv4_hdr +\n-\t\t\t\t\tsizeof(struct rte_ipv4_hdr));\n-\t\tkey.port_dst = rte_be_to_cpu_16(udp->dst_port);\n-\t\tkey.port_src = rte_be_to_cpu_16(udp->src_port);\n-\t\tbreak;\n-\n-\tdefault:\n-\t\tkey.port_dst = 0;\n-\t\tkey.port_src = 0;\n-\t}\n-\n-\t/* Find destination port */\n-\tret = rte_hash_lookup(l3fwd_lookup_struct, (const void *)&key);\n-\treturn ((ret < 0) ? portid : l3fwd_out_if[ret]);\n-}\n-#endif\n-\n-#if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM)\n-static inline uint32_t\n-get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,\n-\t      lookup_struct_t *l3fwd_lookup_struct)\n-{\n-\tuint32_t next_hop;\n-\n-\treturn ((rte_lpm_lookup(l3fwd_lookup_struct,\n-\t\trte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0) ?\n-\t\tnext_hop : portid);\n-}\n-#endif\n-\n-static inline void\n-l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,\n-\t\t      lookup_struct_t *l3fwd_lookup_struct)\n-{\n-\tstruct rte_ether_hdr *eth_hdr;\n-\tstruct rte_ipv4_hdr *ipv4_hdr;\n-\tvoid *tmp;\n-\tuint16_t dst_port;\n-\n-\teth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);\n-\n-\tipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,\n-\t\t\t\t\t   sizeof(struct rte_ether_hdr));\n-\n-#ifdef DO_RFC_1812_CHECKS\n-\t/* Check to make sure the packet is valid (RFC1812) */\n-\tif (is_valid_ipv4_pkt(ipv4_hdr, m->pkt_len) < 0) {\n-\t\trte_pktmbuf_free(m);\n-\t\treturn;\n-\t}\n-#endif\n-\n-\tdst_port = get_dst_port(ipv4_hdr, portid, l3fwd_lookup_struct);\n-\tif (dst_port >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port) == 0)\n-\t\tdst_port = portid;\n-\n-\t/* 02:00:00:00:00:xx */\n-\ttmp = &eth_hdr->d_addr.addr_bytes[0];\n-\t*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);\n-\n-#ifdef DO_RFC_1812_CHECKS\n-\t/* Update time to live and header checksum */\n-\t--(ipv4_hdr->time_to_live);\n-\t++(ipv4_hdr->hdr_checksum);\n-#endif\n-\n-\t/* src addr */\n-\trte_ether_addr_copy(&ports_eth_addr[dst_port], &eth_hdr->s_addr);\n-\n-\tsend_single_packet(m, dst_port);\n-\n-}\n-\n-/* main processing loop */\n-static int\n-main_loop(__attribute__((unused)) void *dummy)\n-{\n-\tstruct rte_mbuf *pkts_burst[MAX_PKT_BURST];\n-\tunsigned lcore_id;\n-\tuint64_t prev_tsc, diff_tsc, cur_tsc;\n-\tint i, j, nb_rx;\n-\tuint8_t queueid;\n-\tuint16_t portid;\n-\tstruct lcore_conf *qconf;\n-\tconst uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US;\n-\n-\tprev_tsc = 0;\n-\n-\tlcore_id = rte_lcore_id();\n-\tqconf = &lcore_conf[lcore_id];\n-\n-\tif (qconf->n_rx_queue == 0) {\n-\t\tRTE_LOG(INFO, L3FWD, \"lcore %u has nothing to do\\n\", lcore_id);\n-\t\treturn 0;\n-\t}\n-\n-\tRTE_LOG(INFO, L3FWD, \"entering main loop on lcore %u\\n\", lcore_id);\n-\n-\tfor (i = 0; i < qconf->n_rx_queue; i++) {\n-\n-\t\tportid = qconf->rx_queue_list[i].port_id;\n-\t\tqueueid = qconf->rx_queue_list[i].queue_id;\n-\t\tRTE_LOG(INFO, L3FWD, \" --lcoreid=%u portid=%u rxqueueid=%hhu\\n\",\n-\t\tlcore_id, portid, queueid);\n-\t}\n-\n-\twhile (1) {\n-\n-\t\tcur_tsc = rte_rdtsc();\n-\n-\t\t/*\n-\t\t * TX burst queue drain\n-\t\t */\n-\t\tdiff_tsc = cur_tsc - prev_tsc;\n-\t\tif (unlikely(diff_tsc > drain_tsc)) {\n-\n-\t\t\t/*\n-\t\t\t * This could be optimized (use queueid instead of\n-\t\t\t * portid), but it is not called so often\n-\t\t\t */\n-\t\t\tfor (portid = 0; portid < RTE_MAX_ETHPORTS; portid++) {\n-\t\t\t\tif (qconf->tx_mbufs[portid].len == 0)\n-\t\t\t\t\tcontinue;\n-\t\t\t\tsend_burst(&lcore_conf[lcore_id],\n-\t\t\t\t\tqconf->tx_mbufs[portid].len,\n-\t\t\t\t\tportid);\n-\t\t\t\tqconf->tx_mbufs[portid].len = 0;\n-\t\t\t}\n-\n-\t\t\tprev_tsc = cur_tsc;\n-\t\t}\n-\n-\t\t/*\n-\t\t * Read packet from RX queues\n-\t\t */\n-\t\tfor (i = 0; i < qconf->n_rx_queue; ++i) {\n-\n-\t\t\tportid = qconf->rx_queue_list[i].port_id;\n-\t\t\tqueueid = qconf->rx_queue_list[i].queue_id;\n-\t\t\tnb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst, MAX_PKT_BURST);\n-\n-\t\t\t/* Prefetch first packets */\n-\t\t\tfor (j = 0; j < PREFETCH_OFFSET && j < nb_rx; j++) {\n-\t\t\t\trte_prefetch0(rte_pktmbuf_mtod(\n-\t\t\t\t\t\tpkts_burst[j], void *));\n-\t\t\t}\n-\n-\t\t\t/* Prefetch and forward already prefetched packets */\n-\t\t\tfor (j = 0; j < (nb_rx - PREFETCH_OFFSET); j++) {\n-\t\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts_burst[\n-\t\t\t\t\t\tj + PREFETCH_OFFSET], void *));\n-\t\t\t\tl3fwd_simple_forward(pkts_burst[j], portid, qconf->lookup_struct);\n-\t\t\t}\n-\n-\t\t\t/* Forward remaining prefetched packets */\n-\t\t\tfor (; j < nb_rx; j++) {\n-\t\t\t\tl3fwd_simple_forward(pkts_burst[j], portid, qconf->lookup_struct);\n-\t\t\t}\n-\t\t}\n-\t}\n-}\n-\n-static int\n-check_lcore_params(void)\n-{\n-\tuint8_t queue, lcore;\n-\tuint16_t i;\n-\tint socketid;\n-\n-\tfor (i = 0; i < nb_lcore_params; ++i) {\n-\t\tqueue = lcore_params[i].queue_id;\n-\t\tif (queue >= MAX_RX_QUEUE_PER_PORT) {\n-\t\t\tprintf(\"invalid queue number: %hhu\\n\", queue);\n-\t\t\treturn -1;\n-\t\t}\n-\t\tlcore = lcore_params[i].lcore_id;\n-\t\tif (!rte_lcore_is_enabled(lcore)) {\n-\t\t\tprintf(\"error: lcore %hhu is not enabled in lcore mask\\n\", lcore);\n-\t\t\treturn -1;\n-\t\t}\n-\t\tif ((socketid = rte_lcore_to_socket_id(lcore) != 0) &&\n-\t\t\t(numa_on == 0)) {\n-\t\t\tprintf(\"warning: lcore %hhu is on socket %d with numa off \\n\",\n-\t\t\t\tlcore, socketid);\n-\t\t}\n-\t}\n-\treturn 0;\n-}\n-\n-static int\n-check_port_config(void)\n-{\n-\tunsigned portid;\n-\tuint16_t i;\n-\n-\tfor (i = 0; i < nb_lcore_params; ++i) {\n-\t\tportid = lcore_params[i].port_id;\n-\t\tif ((enabled_port_mask & (1 << portid)) == 0) {\n-\t\t\tprintf(\"port %u is not enabled in port mask\\n\", portid);\n-\t\t\treturn -1;\n-\t\t}\n-\t\tif (!rte_eth_dev_is_valid_port(portid)) {\n-\t\t\tprintf(\"port %u is not present on the board\\n\", portid);\n-\t\t\treturn -1;\n-\t\t}\n-\t}\n-\treturn 0;\n-}\n-\n-static uint8_t\n-get_port_n_rx_queues(const uint16_t port)\n-{\n-\tint queue = -1;\n-\tuint16_t i;\n-\n-\tfor (i = 0; i < nb_lcore_params; ++i) {\n-\t\tif (lcore_params[i].port_id == port && lcore_params[i].queue_id > queue)\n-\t\t\tqueue = lcore_params[i].queue_id;\n-\t}\n-\treturn (uint8_t)(++queue);\n-}\n-\n-static int\n-init_lcore_rx_queues(void)\n-{\n-\tuint16_t i, nb_rx_queue;\n-\tuint8_t lcore;\n-\n-\tfor (i = 0; i < nb_lcore_params; ++i) {\n-\t\tlcore = lcore_params[i].lcore_id;\n-\t\tnb_rx_queue = lcore_conf[lcore].n_rx_queue;\n-\t\tif (nb_rx_queue >= MAX_RX_QUEUE_PER_LCORE) {\n-\t\t\tprintf(\"error: too many queues (%u) for lcore: %u\\n\",\n-\t\t\t\t(unsigned)nb_rx_queue + 1, (unsigned)lcore);\n-\t\t\treturn -1;\n-\t\t} else {\n-\t\t\tlcore_conf[lcore].rx_queue_list[nb_rx_queue].port_id =\n-\t\t\t\tlcore_params[i].port_id;\n-\t\t\tlcore_conf[lcore].rx_queue_list[nb_rx_queue].queue_id =\n-\t\t\t\tlcore_params[i].queue_id;\n-\t\t\tlcore_conf[lcore].n_rx_queue++;\n-\t\t}\n-\t}\n-\treturn 0;\n-}\n-\n-/* display usage */\n-static void\n-print_usage(const char *prgname)\n-{\n-\tprintf (\"%s [EAL options] -- -p PORTMASK\"\n-\t\t\"  [--config (port,queue,lcore)[,(port,queue,lcore]]\\n\"\n-\t\t\"  -p PORTMASK: hexadecimal bitmask of ports to configure\\n\"\n-\t\t\"  --config (port,queue,lcore): rx queues configuration\\n\"\n-\t\t\"  --no-numa: optional, disable numa awareness\\n\",\n-\t\tprgname);\n-}\n-\n-/* Custom handling of signals to handle process terminal */\n-static void\n-signal_handler(int signum)\n-{\n-\tuint16_t portid;\n-\n-\t/* When we receive a SIGINT signal */\n-\tif (signum == SIGINT) {\n-\t\tRTE_ETH_FOREACH_DEV(portid) {\n-\t\t\t/* skip ports that are not enabled */\n-\t\t\tif ((enabled_port_mask & (1 << portid)) == 0)\n-\t\t\t\tcontinue;\n-\t\t\trte_eth_dev_close(portid);\n-\t\t}\n-\t}\n-\trte_exit(EXIT_SUCCESS, \"\\n User forced exit\\n\");\n-}\n-static int\n-parse_portmask(const char *portmask)\n-{\n-\tchar *end = NULL;\n-\tunsigned long pm;\n-\n-\t/* parse hexadecimal string */\n-\tpm = strtoul(portmask, &end, 16);\n-\tif ((portmask[0] == '\\0') || (end == NULL) || (*end != '\\0'))\n-\t\treturn -1;\n-\n-\tif (pm == 0)\n-\t\treturn -1;\n-\n-\treturn pm;\n-}\n-\n-static int\n-parse_config(const char *q_arg)\n-{\n-\tchar s[256];\n-\tconst char *p, *p0 = q_arg;\n-\tchar *end;\n-\tenum fieldnames {\n-\t\tFLD_PORT = 0,\n-\t\tFLD_QUEUE,\n-\t\tFLD_LCORE,\n-\t\t_NUM_FLD\n-\t};\n-\tunsigned long int_fld[_NUM_FLD];\n-\tchar *str_fld[_NUM_FLD];\n-\tint i;\n-\tunsigned size;\n-\n-\tnb_lcore_params = 0;\n-\n-\twhile ((p = strchr(p0,'(')) != NULL) {\n-\t\t++p;\n-\t\tif((p0 = strchr(p,')')) == NULL)\n-\t\t\treturn -1;\n-\n-\t\tsize = p0 - p;\n-\t\tif(size >= sizeof(s))\n-\t\t\treturn -1;\n-\n-\t\tsnprintf(s, sizeof(s), \"%.*s\", size, p);\n-\t\tif (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != _NUM_FLD)\n-\t\t\treturn -1;\n-\t\tfor (i = 0; i < _NUM_FLD; i++){\n-\t\t\terrno = 0;\n-\t\t\tint_fld[i] = strtoul(str_fld[i], &end, 0);\n-\t\t\tif (errno != 0 || end == str_fld[i] || int_fld[i] > 255)\n-\t\t\t\treturn -1;\n-\t\t}\n-\t\tif (nb_lcore_params >= MAX_LCORE_PARAMS) {\n-\t\t\tprintf(\"exceeded max number of lcore params: %hu\\n\",\n-\t\t\t\tnb_lcore_params);\n-\t\t\treturn -1;\n-\t\t}\n-\t\tlcore_params_array[nb_lcore_params].port_id = int_fld[FLD_PORT];\n-\t\tlcore_params_array[nb_lcore_params].queue_id = (uint8_t)int_fld[FLD_QUEUE];\n-\t\tlcore_params_array[nb_lcore_params].lcore_id = (uint8_t)int_fld[FLD_LCORE];\n-\t\t++nb_lcore_params;\n-\t}\n-\tlcore_params = lcore_params_array;\n-\treturn 0;\n-}\n-\n-/* Parse the argument given in the command line of the application */\n-static int\n-parse_args(int argc, char **argv)\n-{\n-\tint opt, ret;\n-\tchar **argvopt;\n-\tint option_index;\n-\tchar *prgname = argv[0];\n-\tstatic struct option lgopts[] = {\n-\t\t{\"config\", 1, 0, 0},\n-\t\t{\"no-numa\", 0, 0, 0},\n-\t\t{NULL, 0, 0, 0}\n-\t};\n-\n-\targvopt = argv;\n-\n-\twhile ((opt = getopt_long(argc, argvopt, \"p:\",\n-\t\t\t\tlgopts, &option_index)) != EOF) {\n-\n-\t\tswitch (opt) {\n-\t\t/* portmask */\n-\t\tcase 'p':\n-\t\t\tenabled_port_mask = parse_portmask(optarg);\n-\t\t\tif (enabled_port_mask == 0) {\n-\t\t\t\tprintf(\"invalid portmask\\n\");\n-\t\t\t\tprint_usage(prgname);\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\t\t\tbreak;\n-\n-\t\t/* long options */\n-\t\tcase 0:\n-\t\t\tif (!strcmp(lgopts[option_index].name, \"config\")) {\n-\t\t\t\tret = parse_config(optarg);\n-\t\t\t\tif (ret) {\n-\t\t\t\t\tprintf(\"invalid config\\n\");\n-\t\t\t\t\tprint_usage(prgname);\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\tif (!strcmp(lgopts[option_index].name, \"no-numa\")) {\n-\t\t\t\tprintf(\"numa is disabled \\n\");\n-\t\t\t\tnuma_on = 0;\n-\t\t\t}\n-\t\t\tbreak;\n-\n-\t\tdefault:\n-\t\t\tprint_usage(prgname);\n-\t\t\treturn -1;\n-\t\t}\n-\t}\n-\n-\tif (optind >= 0)\n-\t\targv[optind-1] = prgname;\n-\n-\tret = optind-1;\n-\toptind = 1; /* reset getopt lib */\n-\treturn ret;\n-}\n-\n-static void\n-print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)\n-{\n-\tchar buf[RTE_ETHER_ADDR_FMT_SIZE];\n-\trte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, eth_addr);\n-\tprintf(\"%s%s\", name, buf);\n-}\n-\n-#if (APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH)\n-static void\n-setup_hash(int socketid)\n-{\n-\tunsigned i;\n-\tint ret;\n-\tchar s[64];\n-\n-\t/* create  hashes */\n-\tsnprintf(s, sizeof(s), \"l3fwd_hash_%d\", socketid);\n-\tl3fwd_hash_params.name = s;\n-\tl3fwd_hash_params.socket_id = socketid;\n-\tl3fwd_lookup_struct[socketid] = rte_hash_create(&l3fwd_hash_params);\n-\tif (l3fwd_lookup_struct[socketid] == NULL)\n-\t\trte_exit(EXIT_FAILURE, \"Unable to create the l3fwd hash on \"\n-\t\t\t\t\"socket %d\\n\", socketid);\n-\n-\t/* populate the hash */\n-\tfor (i = 0; i < L3FWD_NUM_ROUTES; i++) {\n-\t\tret = rte_hash_add_key (l3fwd_lookup_struct[socketid],\n-\t\t\t\t(void *) &l3fwd_route_array[i].key);\n-\t\tif (ret < 0) {\n-\t\t\trte_exit(EXIT_FAILURE, \"Unable to add entry %u to the\"\n-\t\t\t\t\"l3fwd hash on socket %d\\n\", i, socketid);\n-\t\t}\n-\t\tl3fwd_out_if[ret] = l3fwd_route_array[i].if_out;\n-\t\tprintf(\"Hash: Adding key\\n\");\n-\t\tprint_key(l3fwd_route_array[i].key);\n-\t}\n-}\n-#endif\n-\n-#if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM)\n-static void\n-setup_lpm(int socketid)\n-{\n-\tunsigned i;\n-\tint ret;\n-\tchar s[64];\n-\n-\tstruct rte_lpm_config lpm_ipv4_config;\n-\n-\tlpm_ipv4_config.max_rules = L3FWD_LPM_MAX_RULES;\n-\tlpm_ipv4_config.number_tbl8s = 256;\n-\tlpm_ipv4_config.flags = 0;\n-\n-\t/* create the LPM table */\n-\tsnprintf(s, sizeof(s), \"L3FWD_LPM_%d\", socketid);\n-\tl3fwd_lookup_struct[socketid] =\n-\t\t\trte_lpm_create(s, socketid, &lpm_ipv4_config);\n-\tif (l3fwd_lookup_struct[socketid] == NULL)\n-\t\trte_exit(EXIT_FAILURE, \"Unable to create the l3fwd LPM table\"\n-\t\t\t\t\" on socket %d\\n\", socketid);\n-\n-\t/* populate the LPM table */\n-\tfor (i = 0; i < L3FWD_NUM_ROUTES; i++) {\n-\t\tret = rte_lpm_add(l3fwd_lookup_struct[socketid],\n-\t\t\tl3fwd_route_array[i].ip,\n-\t\t\tl3fwd_route_array[i].depth,\n-\t\t\tl3fwd_route_array[i].if_out);\n-\n-\t\tif (ret < 0) {\n-\t\t\trte_exit(EXIT_FAILURE, \"Unable to add entry %u to the \"\n-\t\t\t\t\"l3fwd LPM table on socket %d\\n\",\n-\t\t\t\ti, socketid);\n-\t\t}\n-\n-\t\tprintf(\"LPM: Adding route 0x%08x / %d (%d)\\n\",\n-\t\t\t(unsigned)l3fwd_route_array[i].ip,\n-\t\t\tl3fwd_route_array[i].depth,\n-\t\t\tl3fwd_route_array[i].if_out);\n-\t}\n-}\n-#endif\n-\n-static int\n-init_mem(unsigned nb_mbuf)\n-{\n-\tstruct lcore_conf *qconf;\n-\tint socketid;\n-\tunsigned lcore_id;\n-\tchar s[64];\n-\n-\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n-\t\tif (rte_lcore_is_enabled(lcore_id) == 0)\n-\t\t\tcontinue;\n-\n-\t\tif (numa_on)\n-\t\t\tsocketid = rte_lcore_to_socket_id(lcore_id);\n-\t\telse\n-\t\t\tsocketid = 0;\n-\n-\t\tif (socketid >= NB_SOCKETS) {\n-\t\t\trte_exit(EXIT_FAILURE, \"Socket %d of lcore %u is out of range %d\\n\",\n-\t\t\t\tsocketid, lcore_id, NB_SOCKETS);\n-\t\t}\n-\t\tif (pktmbuf_pool[socketid] == NULL) {\n-\t\t\tsnprintf(s, sizeof(s), \"mbuf_pool_%d\", socketid);\n-\t\t\tpktmbuf_pool[socketid] = rte_pktmbuf_pool_create(s,\n-\t\t\t\tnb_mbuf, MEMPOOL_CACHE_SIZE, 0,\n-\t\t\t\tRTE_MBUF_DEFAULT_BUF_SIZE, socketid);\n-\t\t\tif (pktmbuf_pool[socketid] == NULL)\n-\t\t\t\trte_exit(EXIT_FAILURE, \"Cannot init mbuf pool on socket %d\\n\", socketid);\n-\t\t\telse\n-\t\t\t\tprintf(\"Allocated mbuf pool on socket %d\\n\", socketid);\n-\n-#if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM)\n-\t\t\tsetup_lpm(socketid);\n-#else\n-\t\t\tsetup_hash(socketid);\n-#endif\n-\t\t}\n-\t\tqconf = &lcore_conf[lcore_id];\n-\t\tqconf->lookup_struct = l3fwd_lookup_struct[socketid];\n-\t}\n-\treturn 0;\n-}\n-\n-int\n-main(int argc, char **argv)\n-{\n-\tstruct lcore_conf *qconf;\n-\tstruct rte_eth_dev_info dev_info;\n-\tstruct rte_eth_txconf *txconf;\n-\tint ret;\n-\tunsigned nb_ports;\n-\tuint16_t queueid, portid;\n-\tunsigned lcore_id;\n-\tuint32_t nb_lcores;\n-\tuint16_t n_tx_queue;\n-\tuint8_t nb_rx_queue, queue, socketid;\n-\n-\tsignal(SIGINT, signal_handler);\n-\t/* init EAL */\n-\tret = rte_eal_init(argc, argv);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE, \"Invalid EAL parameters\\n\");\n-\targc -= ret;\n-\targv += ret;\n-\n-\t/* parse application arguments (after the EAL ones) */\n-\tret = parse_args(argc, argv);\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE, \"Invalid L3FWD-VF parameters\\n\");\n-\n-\tif (check_lcore_params() < 0)\n-\t\trte_exit(EXIT_FAILURE, \"check_lcore_params failed\\n\");\n-\n-\tret = init_lcore_rx_queues();\n-\tif (ret < 0)\n-\t\trte_exit(EXIT_FAILURE, \"init_lcore_rx_queues failed\\n\");\n-\n-\tnb_ports = rte_eth_dev_count_avail();\n-\n-\tif (check_port_config() < 0)\n-\t\trte_exit(EXIT_FAILURE, \"check_port_config failed\\n\");\n-\n-\tnb_lcores = rte_lcore_count();\n-\n-\t/* initialize all ports */\n-\tRTE_ETH_FOREACH_DEV(portid) {\n-\t\tstruct rte_eth_conf local_port_conf = port_conf;\n-\n-\t\t/* skip ports that are not enabled */\n-\t\tif ((enabled_port_mask & (1 << portid)) == 0) {\n-\t\t\tprintf(\"\\nSkipping disabled port %d\\n\", portid);\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\t/* init port */\n-\t\tprintf(\"Initializing port %d ... \", portid );\n-\t\tfflush(stdout);\n-\n-\t\t/* must always equal(=1) */\n-\t\tnb_rx_queue = get_port_n_rx_queues(portid);\n-\t\tn_tx_queue = MAX_TX_QUEUE_PER_PORT;\n-\n-\t\tprintf(\"Creating queues: nb_rxq=%d nb_txq=%u... \",\n-\t\t\tnb_rx_queue, (unsigned)1 );\n-\n-\t\trte_eth_dev_info_get(portid, &dev_info);\n-\t\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)\n-\t\t\tlocal_port_conf.txmode.offloads |=\n-\t\t\t\tDEV_TX_OFFLOAD_MBUF_FAST_FREE;\n-\n-\t\tlocal_port_conf.rx_adv_conf.rss_conf.rss_hf &=\n-\t\t\tdev_info.flow_type_rss_offloads;\n-\t\tif (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=\n-\t\t\t\tport_conf.rx_adv_conf.rss_conf.rss_hf) {\n-\t\t\tprintf(\"Port %u modified RSS hash function based on hardware support,\"\n-\t\t\t\t\"requested:%#\"PRIx64\" configured:%#\"PRIx64\"\\n\",\n-\t\t\t\tportid,\n-\t\t\t\tport_conf.rx_adv_conf.rss_conf.rss_hf,\n-\t\t\t\tlocal_port_conf.rx_adv_conf.rss_conf.rss_hf);\n-\t\t}\n-\n-\t\tret = rte_eth_dev_configure(portid, nb_rx_queue,\n-\t\t\t\t\t    n_tx_queue, &local_port_conf);\n-\t\tif (ret < 0)\n-\t\t\trte_exit(EXIT_FAILURE, \"Cannot configure device: err=%d, port=%d\\n\",\n-\t\t\t\tret, portid);\n-\n-\t\tret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd,\n-\t\t\t\t\t\t       &nb_txd);\n-\t\tif (ret < 0)\n-\t\t\trte_exit(EXIT_FAILURE,\n-\t\t\t\t \"Cannot adjust number of descriptors: err=%d, port=%d\\n\",\n-\t\t\t\t ret, portid);\n-\n-\t\trte_eth_macaddr_get(portid, &ports_eth_addr[portid]);\n-\t\tprint_ethaddr(\" Address:\", &ports_eth_addr[portid]);\n-\t\tprintf(\", \");\n-\n-\t\tret = init_mem(NB_MBUF);\n-\t\tif (ret < 0)\n-\t\t\trte_exit(EXIT_FAILURE, \"init_mem failed\\n\");\n-\n-\t\t/* init one TX queue */\n-\t\tsocketid = (uint8_t)rte_lcore_to_socket_id(rte_get_master_lcore());\n-\n-\t\tprintf(\"txq=%d,%d,%d \", portid, 0, socketid);\n-\t\tfflush(stdout);\n-\n-\t\ttxconf = &dev_info.default_txconf;\n-\t\ttxconf->offloads = local_port_conf.txmode.offloads;\n-\t\tret = rte_eth_tx_queue_setup(portid, 0, nb_txd,\n-\t\t\t\t\t\t socketid, txconf);\n-\t\tif (ret < 0)\n-\t\t\trte_exit(EXIT_FAILURE, \"rte_eth_tx_queue_setup: err=%d, \"\n-\t\t\t\t\"port=%d\\n\", ret, portid);\n-\n-\t\tprintf(\"\\n\");\n-\t}\n-\n-\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n-\t\tstruct rte_eth_rxconf rxq_conf;\n-\n-\t\tif (rte_lcore_is_enabled(lcore_id) == 0)\n-\t\t\tcontinue;\n-\t\tqconf = &lcore_conf[lcore_id];\n-\t\tqconf->tx_queue_id = 0;\n-\n-\t\tprintf(\"\\nInitializing rx queues on lcore %u ... \", lcore_id );\n-\t\tfflush(stdout);\n-\t\t/* init RX queues */\n-\t\tfor(queue = 0; queue < qconf->n_rx_queue; ++queue) {\n-\t\t\tportid = qconf->rx_queue_list[queue].port_id;\n-\t\t\tqueueid = qconf->rx_queue_list[queue].queue_id;\n-\n-\t\t\tif (numa_on)\n-\t\t\t\tsocketid = (uint8_t)rte_lcore_to_socket_id(lcore_id);\n-\t\t\telse\n-\t\t\t\tsocketid = 0;\n-\n-\t\t\tprintf(\"rxq=%d,%d,%d \", portid, queueid, socketid);\n-\t\t\tfflush(stdout);\n-\n-\t\t\trte_eth_dev_info_get(portid, &dev_info);\n-\t\t\trxq_conf = dev_info.default_rxconf;\n-\t\t\trxq_conf.offloads = port_conf.rxmode.offloads;\n-\t\t\tret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,\n-\t\t\t\t\t\tsocketid, &rxq_conf,\n-\t\t\t\t\t\tpktmbuf_pool[socketid]);\n-\t\t\tif (ret < 0)\n-\t\t\t\trte_exit(EXIT_FAILURE, \"rte_eth_rx_queue_setup: err=%d,\"\n-\t\t\t\t\t\t\"port=%d\\n\", ret, portid);\n-\t\t}\n-\t}\n-\tprintf(\"\\n\");\n-\n-\t/* start ports */\n-\tRTE_ETH_FOREACH_DEV(portid) {\n-\t\tif ((enabled_port_mask & (1 << portid)) == 0) {\n-\t\t\tcontinue;\n-\t\t}\n-\t\t/* Start device */\n-\t\tret = rte_eth_dev_start(portid);\n-\t\tif (ret < 0)\n-\t\t\trte_exit(EXIT_FAILURE, \"rte_eth_dev_start: err=%d, port=%d\\n\",\n-\t\t\t\tret, portid);\n-\n-\t\tprintf(\"done: Port %d\\n\", portid);\n-\n-\t}\n-\n-\t/* launch per-lcore init on every lcore */\n-\trte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);\n-\tRTE_LCORE_FOREACH_SLAVE(lcore_id) {\n-\t\tif (rte_eal_wait_lcore(lcore_id) < 0)\n-\t\t\treturn -1;\n-\t}\n-\n-\treturn 0;\n-}\ndiff --git a/examples/l3fwd-vf/meson.build b/examples/l3fwd-vf/meson.build\ndeleted file mode 100644\nindex 226286e74..000000000\n--- a/examples/l3fwd-vf/meson.build\n+++ /dev/null\n@@ -1,12 +0,0 @@\n-# SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2017 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-deps += ['lpm', 'hash']\n-sources = files(\n-\t'main.c'\n-)\ndiff --git a/examples/meson.build b/examples/meson.build\nindex 4663d9dea..81ac8199a 100644\n--- a/examples/meson.build\n+++ b/examples/meson.build\n@@ -23,7 +23,7 @@ all_examples = [\n \t'l2fwd-crypto', 'l2fwd-jobstats',\n \t'l2fwd-keepalive', 'l3fwd',\n \t'l3fwd-acl', 'l3fwd-power',\n-\t'l3fwd-vf', 'link_status_interrupt',\n+\t'link_status_interrupt',\n \t'load_balancer',\n \t'multi_process/client_server_mp/mp_client',\n \t'multi_process/client_server_mp/mp_server',\n",
    "prefixes": [
        "2/6"
    ]
}