From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Thomas Monjalon <thomas@monjalon.net>
Subject: [PATCH v4 2/7] app/test-pipeline: remove application
Date: Tue, 28 Jul 2026 09:35:10 -0700 [thread overview]
Message-ID: <20260728163713.364168-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20260724164520.192203-1-stephen@networkplumber.org>
The test-pipeline application is built on the legacy pipeline
library API (rte_pipeline_*), which was announced for removal
in the 24.11 release. Remove it before removing the library.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
MAINTAINERS | 2 -
app/meson.build | 1 -
app/test-pipeline/config.c | 230 ----------
app/test-pipeline/init.c | 273 ------------
app/test-pipeline/main.c | 188 --------
app/test-pipeline/main.h | 132 ------
app/test-pipeline/meson.build | 21 -
app/test-pipeline/pipeline_acl.c | 251 -----------
app/test-pipeline/pipeline_hash.c | 471 ---------------------
app/test-pipeline/pipeline_lpm.c | 175 --------
app/test-pipeline/pipeline_lpm_ipv6.c | 168 --------
app/test-pipeline/pipeline_stub.c | 137 ------
app/test-pipeline/runtime.c | 160 -------
doc/guides/rel_notes/release_26_11.rst | 3 +
doc/guides/sample_app_ug/index.rst | 1 -
doc/guides/sample_app_ug/test_pipeline.rst | 237 -----------
16 files changed, 3 insertions(+), 2447 deletions(-)
delete mode 100644 app/test-pipeline/config.c
delete mode 100644 app/test-pipeline/init.c
delete mode 100644 app/test-pipeline/main.c
delete mode 100644 app/test-pipeline/main.h
delete mode 100644 app/test-pipeline/meson.build
delete mode 100644 app/test-pipeline/pipeline_acl.c
delete mode 100644 app/test-pipeline/pipeline_hash.c
delete mode 100644 app/test-pipeline/pipeline_lpm.c
delete mode 100644 app/test-pipeline/pipeline_lpm_ipv6.c
delete mode 100644 app/test-pipeline/pipeline_stub.c
delete mode 100644 app/test-pipeline/runtime.c
delete mode 100644 doc/guides/sample_app_ug/test_pipeline.rst
diff --git a/MAINTAINERS b/MAINTAINERS
index 77a41b3fcf4110042ef69b7ee53351dd3cadb208..4c06f85706ca9204cab6a655a58b6b7b1457160d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1739,8 +1739,6 @@ F: lib/pipeline/
F: lib/port/
F: lib/table/
F: doc/guides/prog_guide/packet_framework.rst
-F: app/test-pipeline/
-F: doc/guides/sample_app_ug/test_pipeline.rst
F: examples/ip_pipeline/
F: examples/pipeline/
F: doc/guides/sample_app_ug/ip_pipeline.rst
diff --git a/app/meson.build b/app/meson.build
index 1798db3ae43f685d776533329546e4609d9eb565..4515688471328d2ab315f626c4865c4ba372eaad 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -28,7 +28,6 @@ apps = [
'test-flow-perf',
'test-gpudev',
'test-mldev',
- 'test-pipeline',
'test-pmd',
'test-regex',
'test-sad',
diff --git a/app/test-pipeline/config.c b/app/test-pipeline/config.c
deleted file mode 100644
index daf838948b21075dd108798897cf2c24c30fc471..0000000000000000000000000000000000000000
--- a/app/test-pipeline/config.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2016 Intel Corporation
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <string.h>
-#include <sys/queue.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <getopt.h>
-
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memcpy.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_launch.h>
-#include <rte_cycles.h>
-#include <rte_prefetch.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
-#include <rte_interrupts.h>
-#include <rte_pci.h>
-#include <rte_random.h>
-#include <rte_debug.h>
-#include <rte_ether.h>
-#include <rte_ethdev.h>
-#include <rte_mempool.h>
-#include <rte_mbuf.h>
-#include <rte_ip.h>
-#include <rte_tcp.h>
-#include <rte_lpm.h>
-#include <rte_lpm6.h>
-#include <rte_string_fns.h>
-
-#include "main.h"
-
-static const char usage[] = "\n";
-
-void
-app_print_usage(void)
-{
- printf(usage);
-}
-
-static int
-app_parse_port_mask(const char *arg)
-{
- char *end = NULL;
- uint64_t port_mask;
- uint32_t i;
-
- if (arg[0] == '\0')
- return -1;
-
- port_mask = strtoul(arg, &end, 16);
- if ((end == NULL) || (*end != '\0'))
- return -2;
-
- if (port_mask == 0)
- return -3;
-
- app.n_ports = 0;
- for (i = 0; i < 64; i++) {
- if ((port_mask & (1LLU << i)) == 0)
- continue;
-
- if (app.n_ports >= APP_MAX_PORTS)
- return -4;
-
- app.ports[app.n_ports] = i;
- app.n_ports++;
- }
-
- if (!rte_is_power_of_2(app.n_ports))
- return -5;
-
- return 0;
-}
-
-struct {
- const char *name;
- uint32_t value;
-} app_args_table[] = {
- {"none", e_APP_PIPELINE_NONE},
- {"stub", e_APP_PIPELINE_STUB},
- {"hash-8-ext", e_APP_PIPELINE_HASH_KEY8_EXT},
- {"hash-8-lru", e_APP_PIPELINE_HASH_KEY8_LRU},
- {"hash-16-ext", e_APP_PIPELINE_HASH_KEY16_EXT},
- {"hash-16-lru", e_APP_PIPELINE_HASH_KEY16_LRU},
- {"hash-32-ext", e_APP_PIPELINE_HASH_KEY32_EXT},
- {"hash-32-lru", e_APP_PIPELINE_HASH_KEY32_LRU},
- {"hash-spec-8-ext", e_APP_PIPELINE_HASH_SPEC_KEY8_EXT},
- {"hash-spec-8-lru", e_APP_PIPELINE_HASH_SPEC_KEY8_LRU},
- {"hash-spec-16-ext", e_APP_PIPELINE_HASH_SPEC_KEY16_EXT},
- {"hash-spec-16-lru", e_APP_PIPELINE_HASH_SPEC_KEY16_LRU},
- {"hash-spec-32-ext", e_APP_PIPELINE_HASH_SPEC_KEY32_EXT},
- {"hash-spec-32-lru", e_APP_PIPELINE_HASH_SPEC_KEY32_LRU},
- {"acl", e_APP_PIPELINE_ACL},
- {"lpm", e_APP_PIPELINE_LPM},
- {"lpm-ipv6", e_APP_PIPELINE_LPM_IPV6},
- {"hash-cuckoo-8", e_APP_PIPELINE_HASH_CUCKOO_KEY8},
- {"hash-cuckoo-16", e_APP_PIPELINE_HASH_CUCKOO_KEY16},
- {"hash-cuckoo-32", e_APP_PIPELINE_HASH_CUCKOO_KEY32},
- {"hash-cuckoo-48", e_APP_PIPELINE_HASH_CUCKOO_KEY48},
- {"hash-cuckoo-64", e_APP_PIPELINE_HASH_CUCKOO_KEY64},
- {"hash-cuckoo-80", e_APP_PIPELINE_HASH_CUCKOO_KEY80},
- {"hash-cuckoo-96", e_APP_PIPELINE_HASH_CUCKOO_KEY96},
- {"hash-cuckoo-112", e_APP_PIPELINE_HASH_CUCKOO_KEY112},
- {"hash-cuckoo-128", e_APP_PIPELINE_HASH_CUCKOO_KEY128},
-};
-
-int
-app_parse_args(int argc, char **argv)
-{
- int opt, ret;
- char **argvopt;
- int option_index;
- char *prgname = argv[0];
- static struct option lgopts[] = {
- {"none", 0, 0, 0},
- {"stub", 0, 0, 0},
- {"hash-8-ext", 0, 0, 0},
- {"hash-8-lru", 0, 0, 0},
- {"hash-16-ext", 0, 0, 0},
- {"hash-16-lru", 0, 0, 0},
- {"hash-32-ext", 0, 0, 0},
- {"hash-32-lru", 0, 0, 0},
- {"hash-spec-8-ext", 0, 0, 0},
- {"hash-spec-8-lru", 0, 0, 0},
- {"hash-spec-16-ext", 0, 0, 0},
- {"hash-spec-16-lru", 0, 0, 0},
- {"hash-spec-32-ext", 0, 0, 0},
- {"hash-spec-32-lru", 0, 0, 0},
- {"acl", 0, 0, 0},
- {"lpm", 0, 0, 0},
- {"lpm-ipv6", 0, 0, 0},
- {"hash-cuckoo-8", 0, 0, 0},
- {"hash-cuckoo-16", 0, 0, 0},
- {"hash-cuckoo-32", 0, 0, 0},
- {"hash-cuckoo-48", 0, 0, 0},
- {"hash-cuckoo-64", 0, 0, 0},
- {"hash-cuckoo-80", 0, 0, 0},
- {"hash-cuckoo-96", 0, 0, 0},
- {"hash-cuckoo-112", 0, 0, 0},
- {"hash-cuckoo-128", 0, 0, 0},
- {NULL, 0, 0, 0}
- };
- uint32_t lcores[3], n_lcores, lcore_id, pipeline_type_provided;
-
- /* EAL args */
- n_lcores = 0;
- for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
- if (rte_lcore_is_enabled(lcore_id) == 0)
- continue;
-
- if (n_lcores >= 3) {
- RTE_LOG(ERR, USER1, "Number of cores must be 3\n");
- app_print_usage();
- return -1;
- }
-
- lcores[n_lcores] = lcore_id;
- n_lcores++;
- }
-
- if (n_lcores != 3) {
- RTE_LOG(ERR, USER1, "Number of cores must be 3\n");
- app_print_usage();
- return -1;
- }
-
- app.core_rx = lcores[0];
- app.core_worker = lcores[1];
- app.core_tx = lcores[2];
-
- /* Non-EAL args */
- argvopt = argv;
-
- app.pipeline_type = e_APP_PIPELINE_HASH_KEY16_LRU;
- pipeline_type_provided = 0;
-
- while ((opt = getopt_long(argc, argvopt, "p:",
- lgopts, &option_index)) != EOF) {
- switch (opt) {
- case 'p':
- if (app_parse_port_mask(optarg) < 0) {
- app_print_usage();
- return -1;
- }
- break;
-
- case 0: /* long options */
- if (!pipeline_type_provided) {
- uint32_t i;
-
- for (i = 0; i < e_APP_PIPELINES; i++) {
- if (!strcmp(lgopts[option_index].name,
- app_args_table[i].name)) {
- app.pipeline_type =
- app_args_table[i].value;
- pipeline_type_provided = 1;
- break;
- }
- }
-
- break;
- }
-
- app_print_usage();
- return -1;
-
- default:
- return -1;
- }
- }
-
- if (optind >= 0)
- argv[optind - 1] = prgname;
-
- ret = optind - 1;
- optind = 1; /* reset getopt lib */
- return ret;
-}
diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c
deleted file mode 100644
index 558f0e428d1c4749a625d30a21acccfad672f61c..0000000000000000000000000000000000000000
--- a/app/test-pipeline/init.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <string.h>
-#include <sys/queue.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <getopt.h>
-
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memcpy.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_launch.h>
-#include <rte_cycles.h>
-#include <rte_prefetch.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
-#include <rte_interrupts.h>
-#include <rte_pci.h>
-#include <rte_random.h>
-#include <rte_debug.h>
-#include <rte_ether.h>
-#include <rte_ethdev.h>
-#include <rte_ring.h>
-#include <rte_mempool.h>
-#include <rte_mbuf.h>
-#include <rte_string_fns.h>
-#include <rte_ip.h>
-#include <rte_tcp.h>
-#include <rte_lpm.h>
-#include <rte_lpm6.h>
-
-#include "main.h"
-
-struct app_params app = {
- /* Ports*/
- .n_ports = APP_MAX_PORTS,
- .port_rx_ring_size = 128,
- .port_tx_ring_size = 512,
-
- /* Rings */
- .ring_rx_size = 128,
- .ring_tx_size = 128,
-
- /* Buffer pool */
- .pool_buffer_size = 2048 + RTE_PKTMBUF_HEADROOM,
- .pool_size = 32 * 1024,
- .pool_cache_size = 256,
-
- /* Burst sizes */
- .burst_size_rx_read = 64,
- .burst_size_rx_write = 64,
- .burst_size_worker_read = 64,
- .burst_size_worker_write = 64,
- .burst_size_tx_read = 64,
- .burst_size_tx_write = 64,
-};
-
-static struct rte_eth_conf port_conf = {
- .rxmode = {
- .offloads = RTE_ETH_RX_OFFLOAD_CHECKSUM,
- },
- .rx_adv_conf = {
- .rss_conf = {
- .rss_key = NULL,
- .rss_hf = RTE_ETH_RSS_IP,
- },
- },
- .txmode = {
- .mq_mode = RTE_ETH_MQ_TX_NONE,
- },
-};
-
-static struct rte_eth_rxconf rx_conf = {
- .rx_thresh = {
- .pthresh = 8,
- .hthresh = 8,
- .wthresh = 4,
- },
- .rx_free_thresh = 64,
- .rx_drop_en = 0,
-};
-
-static struct rte_eth_txconf tx_conf = {
- .tx_thresh = {
- .pthresh = 36,
- .hthresh = 0,
- .wthresh = 0,
- },
- .tx_free_thresh = 0,
- .tx_rs_thresh = 0,
-};
-
-static void
-app_init_mbuf_pools(void)
-{
- /* Init the buffer pool */
- RTE_LOG(INFO, USER1, "Creating the mbuf pool ...\n");
- app.pool = rte_pktmbuf_pool_create("mempool", app.pool_size,
- app.pool_cache_size, 0, app.pool_buffer_size, rte_socket_id());
- if (app.pool == NULL)
- rte_panic("Cannot create mbuf pool\n");
-}
-
-static void
-app_init_rings(void)
-{
- uint32_t i;
-
- for (i = 0; i < app.n_ports; i++) {
- char name[32];
-
- snprintf(name, sizeof(name), "app_ring_rx_%u", i);
-
- app.rings_rx[i] = rte_ring_create(
- name,
- app.ring_rx_size,
- rte_socket_id(),
- RING_F_SP_ENQ | RING_F_SC_DEQ);
-
- if (app.rings_rx[i] == NULL)
- rte_panic("Cannot create RX ring %u\n", i);
- }
-
- for (i = 0; i < app.n_ports; i++) {
- char name[32];
-
- snprintf(name, sizeof(name), "app_ring_tx_%u", i);
-
- app.rings_tx[i] = rte_ring_create(
- name,
- app.ring_tx_size,
- rte_socket_id(),
- RING_F_SP_ENQ | RING_F_SC_DEQ);
-
- if (app.rings_tx[i] == NULL)
- rte_panic("Cannot create TX ring %u\n", i);
- }
-
-}
-
-static void
-app_ports_check_link(void)
-{
- uint32_t all_ports_up, i;
- char link_status_text[RTE_ETH_LINK_MAX_STR_LEN];
- all_ports_up = 1;
-
- for (i = 0; i < app.n_ports; i++) {
- struct rte_eth_link link;
- uint16_t port;
- int ret;
-
- port = app.ports[i];
- memset(&link, 0, sizeof(link));
- ret = rte_eth_link_get_nowait(port, &link);
- if (ret < 0) {
- RTE_LOG(INFO, USER1,
- "Failed to get port %u link status: %s\n",
- port, rte_strerror(-ret));
- all_ports_up = 0;
- continue;
- }
- rte_eth_link_to_str(link_status_text, sizeof(link_status_text),
- &link);
- RTE_LOG(INFO, USER1, "Port %u %s\n",
- port,
- link_status_text);
- if (link.link_status == RTE_ETH_LINK_DOWN)
- all_ports_up = 0;
- }
-
- if (all_ports_up == 0)
- rte_panic("Some NIC ports are DOWN\n");
-}
-
-static void
-app_init_ports(void)
-{
- uint32_t i;
- struct rte_eth_dev_info dev_info;
-
- /* Init NIC ports, then start the ports */
- for (i = 0; i < app.n_ports; i++) {
- uint16_t port;
- int ret;
- struct rte_eth_conf local_port_conf = port_conf;
-
- port = app.ports[i];
- RTE_LOG(INFO, USER1, "Initializing NIC port %u ...\n", port);
-
- ret = rte_eth_dev_info_get(port, &dev_info);
- if (ret != 0)
- rte_panic("Error during getting device (port %u) info: %s\n",
- port, rte_strerror(-ret));
-
- /* Init port */
- local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
- dev_info.flow_type_rss_offloads;
- if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
- port_conf.rx_adv_conf.rss_conf.rss_hf) {
- printf("Warning:"
- "Port %u modified RSS hash function based on hardware support,"
- "requested:%#"PRIx64" configured:%#"PRIx64"\n",
- port,
- port_conf.rx_adv_conf.rss_conf.rss_hf,
- local_port_conf.rx_adv_conf.rss_conf.rss_hf);
- }
-
- ret = rte_eth_dev_configure(
- port,
- 1,
- 1,
- &local_port_conf);
- if (ret < 0)
- rte_panic("Cannot init NIC port %u (%d)\n", port, ret);
-
- ret = rte_eth_promiscuous_enable(port);
- if (ret != 0)
- rte_panic("Cannot enable promiscuous mode for port %u: %s\n",
- port, rte_strerror(-ret));
-
- /* Init RX queues */
- ret = rte_eth_rx_queue_setup(
- port,
- 0,
- app.port_rx_ring_size,
- rte_eth_dev_socket_id(port),
- &rx_conf,
- app.pool);
- if (ret < 0)
- rte_panic("Cannot init RX for port %u (%d)\n",
- (uint32_t) port, ret);
-
- /* Init TX queues */
- ret = rte_eth_tx_queue_setup(
- port,
- 0,
- app.port_tx_ring_size,
- rte_eth_dev_socket_id(port),
- &tx_conf);
- if (ret < 0)
- rte_panic("Cannot init TX for port %u (%d)\n",
- (uint32_t) port, ret);
-
- /* Start port */
- ret = rte_eth_dev_start(port);
- if (ret < 0)
- rte_panic("Cannot start port %u (%d)\n", port, ret);
- }
-
- app_ports_check_link();
-}
-
-void
-app_init(void)
-{
- app_init_mbuf_pools();
- app_init_rings();
- app_init_ports();
-
- RTE_LOG(INFO, USER1, "Initialization completed\n");
-}
diff --git a/app/test-pipeline/main.c b/app/test-pipeline/main.c
deleted file mode 100644
index e5efafdf28a087cc2d8668b0f478710fe1d66e2f..0000000000000000000000000000000000000000
--- a/app/test-pipeline/main.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2016 Intel Corporation
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <string.h>
-#include <sys/queue.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <errno.h>
-#include <getopt.h>
-#include <unistd.h>
-
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memcpy.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_launch.h>
-#include <rte_cycles.h>
-#include <rte_prefetch.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
-#include <rte_interrupts.h>
-#include <rte_pci.h>
-#include <rte_random.h>
-#include <rte_debug.h>
-#include <rte_ether.h>
-#include <rte_ethdev.h>
-#include <rte_mempool.h>
-#include <rte_mbuf.h>
-#include <rte_ip.h>
-#include <rte_tcp.h>
-#include <rte_lpm.h>
-#include <rte_lpm6.h>
-
-#include "main.h"
-
-bool force_quit;
-
-static void
-signal_handler(int signum)
-{
- if (signum == SIGINT || signum == SIGTERM)
- force_quit = true;
-}
-
-int
-main(int argc, char **argv)
-{
- uint32_t lcore;
- uint32_t i;
- int ret;
-
- /* Init EAL */
- ret = rte_eal_init(argc, argv);
- if (ret < 0)
- return -1;
- argc -= ret;
- argv += ret;
-
- force_quit = false;
- signal(SIGINT, signal_handler);
- signal(SIGTERM, signal_handler);
-
- /* Parse application arguments (after the EAL ones) */
- ret = app_parse_args(argc, argv);
- if (ret < 0) {
- app_print_usage();
- return -1;
- }
-
- /* Init */
- app_init();
-
- /* Launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(app_lcore_main_loop, NULL, CALL_MAIN);
- RTE_LCORE_FOREACH_WORKER(lcore) {
- if (rte_eal_wait_lcore(lcore) < 0)
- return -1;
- }
-
- /* Close ports */
- for (i = 0; i < app.n_ports; i++) {
- uint16_t port;
-
- port = app.ports[i];
- printf("Closing port %d...", port);
- ret = rte_eth_dev_stop(port);
- if (ret != 0)
- printf("rte_eth_dev_stop: err=%d, port=%u\n",
- ret, port);
- rte_eth_dev_close(port);
- printf("Done\n");
- }
-
- /* Clean up the EAL */
- rte_eal_cleanup();
-
- return 0;
-}
-
-int
-app_lcore_main_loop(__rte_unused void *arg)
-{
- unsigned lcore;
-
- lcore = rte_lcore_id();
-
- if (lcore == app.core_rx) {
- switch (app.pipeline_type) {
- case e_APP_PIPELINE_ACL:
- app_main_loop_rx();
- return 0;
-
- default:
- app_main_loop_rx_metadata();
- return 0;
- }
- }
-
- if (lcore == app.core_worker) {
- switch (app.pipeline_type) {
- case e_APP_PIPELINE_STUB:
- app_main_loop_worker_pipeline_stub();
- return 0;
-
- case e_APP_PIPELINE_HASH_KEY8_EXT:
- case e_APP_PIPELINE_HASH_KEY8_LRU:
- case e_APP_PIPELINE_HASH_KEY16_EXT:
- case e_APP_PIPELINE_HASH_KEY16_LRU:
- case e_APP_PIPELINE_HASH_KEY32_EXT:
- case e_APP_PIPELINE_HASH_KEY32_LRU:
- case e_APP_PIPELINE_HASH_SPEC_KEY8_EXT:
- case e_APP_PIPELINE_HASH_SPEC_KEY8_LRU:
- case e_APP_PIPELINE_HASH_SPEC_KEY16_EXT:
- case e_APP_PIPELINE_HASH_SPEC_KEY16_LRU:
- case e_APP_PIPELINE_HASH_SPEC_KEY32_EXT:
- case e_APP_PIPELINE_HASH_SPEC_KEY32_LRU:
- /* cases for cuckoo hash table types */
- case e_APP_PIPELINE_HASH_CUCKOO_KEY8:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY16:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY32:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY48:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY64:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY80:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY96:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY112:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY128:
- app_main_loop_worker_pipeline_hash();
- return 0;
-
- case e_APP_PIPELINE_ACL:
-#ifndef RTE_LIB_ACL
- rte_exit(EXIT_FAILURE, "ACL not present in build\n");
-#else
- app_main_loop_worker_pipeline_acl();
- return 0;
-#endif
-
- case e_APP_PIPELINE_LPM:
- app_main_loop_worker_pipeline_lpm();
- return 0;
-
- case e_APP_PIPELINE_LPM_IPV6:
- app_main_loop_worker_pipeline_lpm_ipv6();
- return 0;
-
- case e_APP_PIPELINE_NONE:
- default:
- app_main_loop_worker();
- return 0;
- }
- }
-
- if (lcore == app.core_tx) {
- app_main_loop_tx();
- return 0;
- }
-
- return 0;
-}
diff --git a/app/test-pipeline/main.h b/app/test-pipeline/main.h
deleted file mode 100644
index ee9c58ac4ca90a810f800043c55a53e8f32ce5f1..0000000000000000000000000000000000000000
--- a/app/test-pipeline/main.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2016 Intel Corporation
- */
-
-#ifndef _MAIN_H_
-#define _MAIN_H_
-
-#ifndef APP_MBUF_ARRAY_SIZE
-#define APP_MBUF_ARRAY_SIZE 256
-#endif
-
-struct app_mbuf_array {
- struct rte_mbuf *array[APP_MBUF_ARRAY_SIZE];
- uint16_t n_mbufs;
-};
-
-#ifndef APP_MAX_PORTS
-#define APP_MAX_PORTS 4
-#endif
-
-struct __rte_cache_aligned app_params {
- /* CPU cores */
- uint32_t core_rx;
- uint32_t core_worker;
- uint32_t core_tx;
-
- /* Ports*/
- uint32_t ports[APP_MAX_PORTS];
- uint32_t n_ports;
- uint32_t port_rx_ring_size;
- uint32_t port_tx_ring_size;
-
- /* Rings */
- struct rte_ring *rings_rx[APP_MAX_PORTS];
- struct rte_ring *rings_tx[APP_MAX_PORTS];
- uint32_t ring_rx_size;
- uint32_t ring_tx_size;
-
- /* Internal buffers */
- struct app_mbuf_array mbuf_rx;
- struct app_mbuf_array mbuf_tx[APP_MAX_PORTS];
-
- /* Buffer pool */
- struct rte_mempool *pool;
- uint32_t pool_buffer_size;
- uint32_t pool_size;
- uint32_t pool_cache_size;
-
- /* Burst sizes */
- uint32_t burst_size_rx_read;
- uint32_t burst_size_rx_write;
- uint32_t burst_size_worker_read;
- uint32_t burst_size_worker_write;
- uint32_t burst_size_tx_read;
- uint32_t burst_size_tx_write;
-
- /* App behavior */
- uint32_t pipeline_type;
-};
-
-extern struct app_params app;
-
-extern bool force_quit;
-
-int app_parse_args(int argc, char **argv);
-void app_print_usage(void);
-void app_init(void);
-int app_lcore_main_loop(void *arg);
-
-/* Pipeline */
-enum {
- e_APP_PIPELINE_NONE = 0,
- e_APP_PIPELINE_STUB,
-
- e_APP_PIPELINE_HASH_KEY8_EXT,
- e_APP_PIPELINE_HASH_KEY8_LRU,
- e_APP_PIPELINE_HASH_KEY16_EXT,
- e_APP_PIPELINE_HASH_KEY16_LRU,
- e_APP_PIPELINE_HASH_KEY32_EXT,
- e_APP_PIPELINE_HASH_KEY32_LRU,
-
- e_APP_PIPELINE_HASH_SPEC_KEY8_EXT,
- e_APP_PIPELINE_HASH_SPEC_KEY8_LRU,
- e_APP_PIPELINE_HASH_SPEC_KEY16_EXT,
- e_APP_PIPELINE_HASH_SPEC_KEY16_LRU,
- e_APP_PIPELINE_HASH_SPEC_KEY32_EXT,
- e_APP_PIPELINE_HASH_SPEC_KEY32_LRU,
-
- e_APP_PIPELINE_ACL,
- e_APP_PIPELINE_LPM,
- e_APP_PIPELINE_LPM_IPV6,
-
- e_APP_PIPELINE_HASH_CUCKOO_KEY8,
- e_APP_PIPELINE_HASH_CUCKOO_KEY16,
- e_APP_PIPELINE_HASH_CUCKOO_KEY32,
- e_APP_PIPELINE_HASH_CUCKOO_KEY48,
- e_APP_PIPELINE_HASH_CUCKOO_KEY64,
- e_APP_PIPELINE_HASH_CUCKOO_KEY80,
- e_APP_PIPELINE_HASH_CUCKOO_KEY96,
- e_APP_PIPELINE_HASH_CUCKOO_KEY112,
- e_APP_PIPELINE_HASH_CUCKOO_KEY128,
- e_APP_PIPELINES
-};
-
-void app_main_loop_rx(void);
-void app_main_loop_rx_metadata(void);
-uint64_t test_hash(void *key,
- void *key_mask,
- uint32_t key_size,
- uint64_t seed);
-
-uint32_t test_hash_cuckoo(const void *key,
- uint32_t key_size,
- uint32_t seed);
-
-void app_main_loop_worker(void);
-void app_main_loop_worker_pipeline_stub(void);
-void app_main_loop_worker_pipeline_hash(void);
-void app_main_loop_worker_pipeline_acl(void);
-void app_main_loop_worker_pipeline_lpm(void);
-void app_main_loop_worker_pipeline_lpm_ipv6(void);
-
-void app_main_loop_tx(void);
-
-#define APP_FLUSH 0
-#ifndef APP_FLUSH
-#define APP_FLUSH 0x3FF
-#endif
-
-#define APP_METADATA_OFFSET(offset) (sizeof(struct rte_mbuf) + (offset))
-
-#endif /* _MAIN_H_ */
diff --git a/app/test-pipeline/meson.build b/app/test-pipeline/meson.build
deleted file mode 100644
index 3add6b637bdb5ec81013140a2011b95b22b7eaaf..0000000000000000000000000000000000000000
--- a/app/test-pipeline/meson.build
+++ /dev/null
@@ -1,21 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2019 Intel Corporation
-
-if is_windows
- build = false
- reason = 'not supported on Windows'
- subdir_done()
-endif
-
-sources = files(
- 'config.c',
- 'init.c',
- 'main.c',
- 'pipeline_acl.c',
- 'pipeline_hash.c',
- 'pipeline_lpm.c',
- 'pipeline_lpm_ipv6.c',
- 'pipeline_stub.c',
- 'runtime.c',
-)
-deps += ['pipeline', 'pci']
diff --git a/app/test-pipeline/pipeline_acl.c b/app/test-pipeline/pipeline_acl.c
deleted file mode 100644
index 9eb4053e23a0b7ebb38b9dfa19de15f4aaa12662..0000000000000000000000000000000000000000
--- a/app/test-pipeline/pipeline_acl.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2016 Intel Corporation
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <rte_log.h>
-#include <rte_ethdev.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
-#include <rte_byteorder.h>
-
-#include <rte_port_ring.h>
-#include <rte_table_acl.h>
-#include <rte_pipeline.h>
-
-#include "main.h"
-
-enum {
- PROTO_FIELD_IPV4,
- SRC_FIELD_IPV4,
- DST_FIELD_IPV4,
- SRCP_FIELD_IPV4,
- DSTP_FIELD_IPV4,
- NUM_FIELDS_IPV4
-};
-
-/*
- * Here we define the 'shape' of the data we're searching for,
- * by defining the meta-data of the ACL rules.
- * in this case, we're defining 5 tuples. IP addresses, ports,
- * and protocol.
- */
-struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = {
- {
- .type = RTE_ACL_FIELD_TYPE_BITMASK,
- .size = sizeof(uint8_t),
- .field_index = PROTO_FIELD_IPV4,
- .input_index = PROTO_FIELD_IPV4,
- .offset = sizeof(struct rte_ether_hdr) +
- offsetof(struct rte_ipv4_hdr, next_proto_id),
- },
- {
- .type = RTE_ACL_FIELD_TYPE_MASK,
- .size = sizeof(uint32_t),
- .field_index = SRC_FIELD_IPV4,
- .input_index = SRC_FIELD_IPV4,
- .offset = sizeof(struct rte_ether_hdr) +
- offsetof(struct rte_ipv4_hdr, src_addr),
- },
- {
- .type = RTE_ACL_FIELD_TYPE_MASK,
- .size = sizeof(uint32_t),
- .field_index = DST_FIELD_IPV4,
- .input_index = DST_FIELD_IPV4,
- .offset = sizeof(struct rte_ether_hdr) +
- offsetof(struct rte_ipv4_hdr, dst_addr),
- },
- {
- .type = RTE_ACL_FIELD_TYPE_RANGE,
- .size = sizeof(uint16_t),
- .field_index = SRCP_FIELD_IPV4,
- .input_index = SRCP_FIELD_IPV4,
- .offset = sizeof(struct rte_ether_hdr) +
- sizeof(struct rte_ipv4_hdr),
- },
- {
- .type = RTE_ACL_FIELD_TYPE_RANGE,
- .size = sizeof(uint16_t),
- .field_index = DSTP_FIELD_IPV4,
- .input_index = SRCP_FIELD_IPV4,
- .offset = sizeof(struct rte_ether_hdr) +
- sizeof(struct rte_ipv4_hdr) + sizeof(uint16_t),
- },
-};
-
-
-
-void
-app_main_loop_worker_pipeline_acl(void) {
- struct rte_pipeline_params pipeline_params = {
- .name = "pipeline",
- .socket_id = rte_socket_id(),
- };
-
- struct rte_pipeline *p;
- uint32_t port_in_id[APP_MAX_PORTS];
- uint32_t port_out_id[APP_MAX_PORTS];
- uint32_t table_id;
- uint32_t i;
-
- RTE_LOG(INFO, USER1,
- "Core %u is doing work (pipeline with ACL table)\n",
- rte_lcore_id());
-
- /* Pipeline configuration */
- p = rte_pipeline_create(&pipeline_params);
- if (p == NULL)
- rte_panic("Unable to configure the pipeline\n");
-
- /* Input port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_reader_params port_ring_params = {
- .ring = app.rings_rx[i],
- };
-
- struct rte_pipeline_port_in_params port_params = {
- .ops = &rte_port_ring_reader_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- .burst_size = app.burst_size_worker_read,
- };
-
- if (rte_pipeline_port_in_create(p, &port_params,
- &port_in_id[i]))
- rte_panic("Unable to configure input port for "
- "ring %d\n", i);
- }
-
- /* Output port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_writer_params port_ring_params = {
- .ring = app.rings_tx[i],
- .tx_burst_sz = app.burst_size_worker_write,
- };
-
- struct rte_pipeline_port_out_params port_params = {
- .ops = &rte_port_ring_writer_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- };
-
- if (rte_pipeline_port_out_create(p, &port_params,
- &port_out_id[i]))
- rte_panic("Unable to configure output port for "
- "ring %d\n", i);
- }
-
- /* Table configuration */
- {
- struct rte_table_acl_params table_acl_params = {
- .name = "test", /* unique identifier for acl contexts */
- .n_rules = 1 << 5,
- .n_rule_fields = DIM(ipv4_field_formats),
- };
-
- /* Copy in the rule meta-data defined above into the params */
- memcpy(table_acl_params.field_format, ipv4_field_formats,
- sizeof(ipv4_field_formats));
-
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_acl_ops,
- .arg_create = &table_acl_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the ACL table\n");
- }
-
- /* Interconnecting ports and tables */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_connect_to_table(p, port_in_id[i],
- table_id))
- rte_panic("Unable to connect input port %u to "
- "table %u\n", port_in_id[i], table_id);
-
- /* Add entries to tables */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_pipeline_table_entry table_entry = {
- .action = RTE_PIPELINE_ACTION_PORT,
- {.port_id = port_out_id[i & (app.n_ports - 1)]},
- };
- struct rte_table_acl_rule_add_params rule_params;
- struct rte_pipeline_table_entry *entry_ptr;
- int key_found, ret;
-
- memset(&rule_params, 0, sizeof(rule_params));
-
- /* Set the rule values */
- rule_params.field_value[SRC_FIELD_IPV4].value.u32 = 0;
- rule_params.field_value[SRC_FIELD_IPV4].mask_range.u32 = 0;
- rule_params.field_value[DST_FIELD_IPV4].value.u32 =
- i << (24 - rte_popcount32(app.n_ports - 1));
- rule_params.field_value[DST_FIELD_IPV4].mask_range.u32 =
- 8 + rte_popcount32(app.n_ports - 1);
- rule_params.field_value[SRCP_FIELD_IPV4].value.u16 = 0;
- rule_params.field_value[SRCP_FIELD_IPV4].mask_range.u16 =
- UINT16_MAX;
- rule_params.field_value[DSTP_FIELD_IPV4].value.u16 = 0;
- rule_params.field_value[DSTP_FIELD_IPV4].mask_range.u16 =
- UINT16_MAX;
- rule_params.field_value[PROTO_FIELD_IPV4].value.u8 = 0;
- rule_params.field_value[PROTO_FIELD_IPV4].mask_range.u8 = 0;
-
- rule_params.priority = 0;
-
- uint32_t dst_addr = rule_params.field_value[DST_FIELD_IPV4].
- value.u32;
- uint32_t dst_mask =
- rule_params.field_value[DST_FIELD_IPV4].mask_range.u32;
-
- printf("Adding rule to ACL table (IPv4 destination = "
- "%u.%u.%u.%u/%u => port out = %u)\n",
- (dst_addr & 0xFF000000) >> 24,
- (dst_addr & 0x00FF0000) >> 16,
- (dst_addr & 0x0000FF00) >> 8,
- dst_addr & 0x000000FF,
- dst_mask,
- table_entry.port_id);
-
- /* For ACL, add needs an rte_table_acl_rule_add_params struct */
- ret = rte_pipeline_table_entry_add(p, table_id, &rule_params,
- &table_entry, &key_found, &entry_ptr);
- if (ret < 0)
- rte_panic("Unable to add entry to table %u (%d)\n",
- table_id, ret);
- }
-
- /* Enable input ports */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_enable(p, port_in_id[i]))
- rte_panic("Unable to enable input port %u\n",
- port_in_id[i]);
-
- /* Check pipeline consistency */
- if (rte_pipeline_check(p) < 0)
- rte_panic("Pipeline consistency check failed\n");
-
- /* Run-time */
-#if APP_FLUSH == 0
- while (!force_quit)
- rte_pipeline_run(p);
-#else
- i = 0;
- while (!force_quit) {
- rte_pipeline_run(p);
-
- if ((i & APP_FLUSH) == 0)
- rte_pipeline_flush(p);
- i++;
- }
-#endif
-}
diff --git a/app/test-pipeline/pipeline_hash.c b/app/test-pipeline/pipeline_hash.c
deleted file mode 100644
index 194e5c5dcc53e5d83f8f70fc8325e4820c8a2c66..0000000000000000000000000000000000000000
--- a/app/test-pipeline/pipeline_hash.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2016 Intel Corporation
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <rte_log.h>
-#include <rte_ethdev.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
-#include <rte_byteorder.h>
-
-#include <rte_port_ring.h>
-#include <rte_table_hash.h>
-#include <rte_hash.h>
-#include <rte_table_hash_cuckoo.h>
-#include <rte_pipeline.h>
-
-#include "main.h"
-
-static void
-translate_options(uint32_t *special, uint32_t *ext, uint32_t *key_size)
-{
- switch (app.pipeline_type) {
- case e_APP_PIPELINE_HASH_KEY8_EXT:
- *special = 0; *ext = 1; *key_size = 8; return;
- case e_APP_PIPELINE_HASH_KEY8_LRU:
- *special = 0; *ext = 0; *key_size = 8; return;
- case e_APP_PIPELINE_HASH_KEY16_EXT:
- *special = 0; *ext = 1; *key_size = 16; return;
- case e_APP_PIPELINE_HASH_KEY16_LRU:
- *special = 0; *ext = 0; *key_size = 16; return;
- case e_APP_PIPELINE_HASH_KEY32_EXT:
- *special = 0; *ext = 1; *key_size = 32; return;
- case e_APP_PIPELINE_HASH_KEY32_LRU:
- *special = 0; *ext = 0; *key_size = 32; return;
-
- case e_APP_PIPELINE_HASH_SPEC_KEY8_EXT:
- *special = 1; *ext = 1; *key_size = 8; return;
- case e_APP_PIPELINE_HASH_SPEC_KEY8_LRU:
- *special = 1; *ext = 0; *key_size = 8; return;
- case e_APP_PIPELINE_HASH_SPEC_KEY16_EXT:
- *special = 1; *ext = 1; *key_size = 16; return;
- case e_APP_PIPELINE_HASH_SPEC_KEY16_LRU:
- *special = 1; *ext = 0; *key_size = 16; return;
- case e_APP_PIPELINE_HASH_SPEC_KEY32_EXT:
- *special = 1; *ext = 1; *key_size = 32; return;
- case e_APP_PIPELINE_HASH_SPEC_KEY32_LRU:
- *special = 1; *ext = 0; *key_size = 32; return;
-
- case e_APP_PIPELINE_HASH_CUCKOO_KEY8:
- *special = 0; *ext = 0; *key_size = 8; return;
- case e_APP_PIPELINE_HASH_CUCKOO_KEY16:
- *special = 0; *ext = 0; *key_size = 16; return;
- case e_APP_PIPELINE_HASH_CUCKOO_KEY32:
- *special = 0; *ext = 0; *key_size = 32; return;
- case e_APP_PIPELINE_HASH_CUCKOO_KEY48:
- *special = 0; *ext = 0; *key_size = 48; return;
- case e_APP_PIPELINE_HASH_CUCKOO_KEY64:
- *special = 0; *ext = 0; *key_size = 64; return;
- case e_APP_PIPELINE_HASH_CUCKOO_KEY80:
- *special = 0; *ext = 0; *key_size = 80; return;
- case e_APP_PIPELINE_HASH_CUCKOO_KEY96:
- *special = 0; *ext = 0; *key_size = 96; return;
- case e_APP_PIPELINE_HASH_CUCKOO_KEY112:
- *special = 0; *ext = 0; *key_size = 112; return;
- case e_APP_PIPELINE_HASH_CUCKOO_KEY128:
- *special = 0; *ext = 0; *key_size = 128; return;
-
- default:
- rte_panic("Invalid hash table type or key size\n");
- }
-}
-void
-app_main_loop_worker_pipeline_hash(void) {
- struct rte_pipeline_params pipeline_params = {
- .name = "pipeline",
- .socket_id = rte_socket_id(),
- };
-
- struct rte_pipeline *p;
- uint32_t port_in_id[APP_MAX_PORTS];
- uint32_t port_out_id[APP_MAX_PORTS];
- uint32_t table_id;
- uint32_t i;
- uint32_t special, ext, key_size;
-
- translate_options(&special, &ext, &key_size);
-
- RTE_LOG(INFO, USER1, "Core %u is doing work "
- "(pipeline with hash table, %s, %s, %d-byte key)\n",
- rte_lcore_id(),
- special ? "specialized" : "non-specialized",
- ext ? "extendible bucket" : "LRU",
- key_size);
-
- /* Pipeline configuration */
- p = rte_pipeline_create(&pipeline_params);
- if (p == NULL)
- rte_panic("Unable to configure the pipeline\n");
-
- /* Input port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_reader_params port_ring_params = {
- .ring = app.rings_rx[i],
- };
-
- struct rte_pipeline_port_in_params port_params = {
- .ops = &rte_port_ring_reader_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- .burst_size = app.burst_size_worker_read,
- };
-
- if (rte_pipeline_port_in_create(p, &port_params,
- &port_in_id[i]))
- rte_panic("Unable to configure input port for "
- "ring %d\n", i);
- }
-
- /* Output port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_writer_params port_ring_params = {
- .ring = app.rings_tx[i],
- .tx_burst_sz = app.burst_size_worker_write,
- };
-
- struct rte_pipeline_port_out_params port_params = {
- .ops = &rte_port_ring_writer_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- };
-
- if (rte_pipeline_port_out_create(p, &port_params,
- &port_out_id[i]))
- rte_panic("Unable to configure output port for "
- "ring %d\n", i);
- }
-
- struct rte_table_hash_params table_hash_params = {
- .name = "TABLE",
- .key_size = key_size,
- .key_offset = APP_METADATA_OFFSET(32),
- .key_mask = NULL,
- .n_keys = 1 << 24,
- .n_buckets = 1 << 22,
- .f_hash = test_hash,
- .seed = 0,
- };
-
- struct rte_table_hash_cuckoo_params table_hash_cuckoo_params = {
- .name = "TABLE",
- .key_size = key_size,
- .key_offset = APP_METADATA_OFFSET(32),
- .key_mask = NULL,
- .n_keys = 1 << 24,
- .n_buckets = 1 << 22,
- .f_hash = test_hash_cuckoo,
- .seed = 0,
- };
-
- /* Table configuration */
- switch (app.pipeline_type) {
- case e_APP_PIPELINE_HASH_KEY8_EXT:
- case e_APP_PIPELINE_HASH_KEY16_EXT:
- case e_APP_PIPELINE_HASH_KEY32_EXT:
- {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_ext_ops,
- .arg_create = &table_hash_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the hash table\n");
- }
- break;
-
- case e_APP_PIPELINE_HASH_KEY8_LRU:
- case e_APP_PIPELINE_HASH_KEY16_LRU:
- case e_APP_PIPELINE_HASH_KEY32_LRU:
- {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_lru_ops,
- .arg_create = &table_hash_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the hash table\n");
- }
- break;
-
- case e_APP_PIPELINE_HASH_SPEC_KEY8_EXT:
- {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_key8_ext_ops,
- .arg_create = &table_hash_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the hash table\n");
- }
- break;
-
- case e_APP_PIPELINE_HASH_SPEC_KEY8_LRU:
- {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_key8_lru_ops,
- .arg_create = &table_hash_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the hash table\n");
- }
- break;
-
- case e_APP_PIPELINE_HASH_SPEC_KEY16_EXT:
- {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_key16_ext_ops,
- .arg_create = &table_hash_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the hash table)\n");
- }
- break;
-
- case e_APP_PIPELINE_HASH_SPEC_KEY16_LRU:
- {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_key16_lru_ops,
- .arg_create = &table_hash_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the hash table\n");
- }
- break;
-
- case e_APP_PIPELINE_HASH_SPEC_KEY32_EXT:
- {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_key32_ext_ops,
- .arg_create = &table_hash_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the hash table\n");
- }
- break;
-
-
- case e_APP_PIPELINE_HASH_SPEC_KEY32_LRU:
- {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_key32_lru_ops,
- .arg_create = &table_hash_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the hash table\n");
- }
- break;
-
- case e_APP_PIPELINE_HASH_CUCKOO_KEY8:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY16:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY32:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY48:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY64:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY80:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY96:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY112:
- case e_APP_PIPELINE_HASH_CUCKOO_KEY128:
- {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_hash_cuckoo_ops,
- .arg_create = &table_hash_cuckoo_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the hash table\n");
- }
- break;
-
- default:
- rte_panic("Invalid hash table type or key size\n");
- }
-
- /* Interconnecting ports and tables */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_connect_to_table(p, port_in_id[i],
- table_id))
- rte_panic("Unable to connect input port %u to "
- "table %u\n", port_in_id[i], table_id);
-
- /* Add entries to tables */
- for (i = 0; i < (1 << 24); i++) {
- struct rte_pipeline_table_entry entry = {
- .action = RTE_PIPELINE_ACTION_PORT,
- {.port_id = port_out_id[i & (app.n_ports - 1)]},
- };
- struct rte_pipeline_table_entry *entry_ptr;
- uint8_t key[32];
- uint32_t *k32 = (uint32_t *) key;
- int key_found, status;
-
- memset(key, 0, sizeof(key));
- k32[0] = rte_be_to_cpu_32(i);
-
- status = rte_pipeline_table_entry_add(p, table_id, key, &entry,
- &key_found, &entry_ptr);
- if (status < 0)
- rte_panic("Unable to add entry to table %u (%d)\n",
- table_id, status);
- }
-
- /* Enable input ports */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_enable(p, port_in_id[i]))
- rte_panic("Unable to enable input port %u\n",
- port_in_id[i]);
-
- /* Check pipeline consistency */
- if (rte_pipeline_check(p) < 0)
- rte_panic("Pipeline consistency check failed\n");
-
- /* Run-time */
-#if APP_FLUSH == 0
- while (!force_quit)
- rte_pipeline_run(p);
-#else
- i = 0;
- while (!force_quit) {
- rte_pipeline_run(p);
-
- if ((i & APP_FLUSH) == 0)
- rte_pipeline_flush(p);
- i++;
- }
-#endif
-}
-
-uint64_t test_hash(
- void *key,
- __rte_unused void *key_mask,
- __rte_unused uint32_t key_size,
- __rte_unused uint64_t seed)
-{
- uint32_t *k32 = key;
- uint32_t ip_dst = rte_be_to_cpu_32(k32[0]);
- uint64_t signature = (ip_dst >> 2) | ((ip_dst & 0x3) << 30);
-
- return signature;
-}
-
-uint32_t test_hash_cuckoo(
- const void *key,
- __rte_unused uint32_t key_size,
- __rte_unused uint32_t seed)
-{
- const uint32_t *k32 = key;
- uint32_t ip_dst = rte_be_to_cpu_32(k32[0]);
- uint32_t signature = (ip_dst >> 2) | ((ip_dst & 0x3) << 30);
-
- return signature;
-}
-
-void
-app_main_loop_rx_metadata(void) {
- uint32_t i, j;
- int ret;
-
- RTE_LOG(INFO, USER1, "Core %u is doing RX (with meta-data)\n",
- rte_lcore_id());
-
- while (!force_quit) {
- for (i = 0; i < app.n_ports; i++) {
- uint16_t n_mbufs;
-
- n_mbufs = rte_eth_rx_burst(
- app.ports[i],
- 0,
- app.mbuf_rx.array,
- app.burst_size_rx_read);
-
- if (n_mbufs == 0)
- continue;
-
- for (j = 0; j < n_mbufs; j++) {
- struct rte_mbuf *m;
- uint8_t *m_data, *key;
- struct rte_ipv4_hdr *ip_hdr;
- struct rte_ipv6_hdr *ipv6_hdr;
- uint32_t ip_dst;
- uint32_t *signature, *k32;
-
- m = app.mbuf_rx.array[j];
- m_data = rte_pktmbuf_mtod(m, uint8_t *);
- signature = RTE_MBUF_METADATA_UINT32_PTR(m,
- APP_METADATA_OFFSET(0));
- key = RTE_MBUF_METADATA_UINT8_PTR(m,
- APP_METADATA_OFFSET(32));
-
- if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
- ip_hdr = (struct rte_ipv4_hdr *)
- &m_data[sizeof(struct rte_ether_hdr)];
- ip_dst = ip_hdr->dst_addr;
-
- k32 = (uint32_t *) key;
- k32[0] = ip_dst & 0xFFFFFF00;
- } else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
- ipv6_hdr = (struct rte_ipv6_hdr *)
- &m_data[sizeof(struct rte_ether_hdr)];
-
- memcpy(key, &ipv6_hdr->dst_addr, 16);
- } else
- continue;
-
- *signature = test_hash(key, NULL, 0, 0);
- }
-
- do {
- ret = rte_ring_sp_enqueue_bulk(
- app.rings_rx[i],
- (void **) app.mbuf_rx.array,
- n_mbufs,
- NULL);
- } while (ret == 0 && !force_quit);
- }
- }
-}
diff --git a/app/test-pipeline/pipeline_lpm.c b/app/test-pipeline/pipeline_lpm.c
deleted file mode 100644
index 8a59bd00420685d5c577f9b9fa39fe4cbd4f31ca..0000000000000000000000000000000000000000
--- a/app/test-pipeline/pipeline_lpm.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2016 Intel Corporation
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <rte_log.h>
-#include <rte_ethdev.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
-#include <rte_byteorder.h>
-
-#include <rte_port_ring.h>
-#include <rte_table_lpm.h>
-#include <rte_pipeline.h>
-
-#include "main.h"
-
-#ifndef PIPELINE_LPM_TABLE_NUMBER_TABLE8s
-#define PIPELINE_LPM_TABLE_NUMBER_TABLE8s 256
-#endif
-
-void
-app_main_loop_worker_pipeline_lpm(void) {
- struct rte_pipeline_params pipeline_params = {
- .name = "pipeline",
- .socket_id = rte_socket_id(),
- };
-
- struct rte_pipeline *p;
- uint32_t port_in_id[APP_MAX_PORTS];
- uint32_t port_out_id[APP_MAX_PORTS];
- uint32_t table_id;
- uint32_t i;
-
- RTE_LOG(INFO, USER1, "Core %u is doing work (pipeline with "
- "LPM table)\n", rte_lcore_id());
-
- /* Pipeline configuration */
- p = rte_pipeline_create(&pipeline_params);
- if (p == NULL)
- rte_panic("Unable to configure the pipeline\n");
-
- /* Input port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_reader_params port_ring_params = {
- .ring = app.rings_rx[i],
- };
-
- struct rte_pipeline_port_in_params port_params = {
- .ops = &rte_port_ring_reader_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- .burst_size = app.burst_size_worker_read,
- };
-
- if (rte_pipeline_port_in_create(p, &port_params,
- &port_in_id[i]))
- rte_panic("Unable to configure input port for "
- "ring %d\n", i);
- }
-
- /* Output port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_writer_params port_ring_params = {
- .ring = app.rings_tx[i],
- .tx_burst_sz = app.burst_size_worker_write,
- };
-
- struct rte_pipeline_port_out_params port_params = {
- .ops = &rte_port_ring_writer_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- };
-
- if (rte_pipeline_port_out_create(p, &port_params,
- &port_out_id[i]))
- rte_panic("Unable to configure output port for "
- "ring %d\n", i);
- }
-
- /* Table configuration */
- {
- struct rte_table_lpm_params table_lpm_params = {
- .name = "LPM",
- .n_rules = 1 << 24,
- .number_tbl8s = PIPELINE_LPM_TABLE_NUMBER_TABLE8s,
- .flags = 0,
- .entry_unique_size =
- sizeof(struct rte_pipeline_table_entry),
- .offset = APP_METADATA_OFFSET(32),
- };
-
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_lpm_ops,
- .arg_create = &table_lpm_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the LPM table\n");
- }
-
- /* Interconnecting ports and tables */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_connect_to_table(p, port_in_id[i],
- table_id))
- rte_panic("Unable to connect input port %u to "
- "table %u\n", port_in_id[i], table_id);
-
- /* Add entries to tables */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_pipeline_table_entry entry = {
- .action = RTE_PIPELINE_ACTION_PORT,
- {.port_id = port_out_id[i & (app.n_ports - 1)]},
- };
-
- struct rte_table_lpm_key key = {
- .ip = i << (24 - rte_popcount32(app.n_ports - 1)),
- .depth = 8 + rte_popcount32(app.n_ports - 1),
- };
-
- struct rte_pipeline_table_entry *entry_ptr;
-
- int key_found, status;
-
- printf("Adding rule to LPM table (IPv4 destination = %"
- PRIu32 ".%" PRIu32 ".%" PRIu32 ".%" PRIu32 "/%" PRIu8
- " => port out = %" PRIu32 ")\n",
- (key.ip & 0xFF000000) >> 24,
- (key.ip & 0x00FF0000) >> 16,
- (key.ip & 0x0000FF00) >> 8,
- key.ip & 0x000000FF,
- key.depth,
- i);
-
- status = rte_pipeline_table_entry_add(p, table_id, &key, &entry,
- &key_found, &entry_ptr);
- if (status < 0)
- rte_panic("Unable to add entry to table %u (%d)\n",
- table_id, status);
- }
-
- /* Enable input ports */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_enable(p, port_in_id[i]))
- rte_panic("Unable to enable input port %u\n",
- port_in_id[i]);
-
- /* Check pipeline consistency */
- if (rte_pipeline_check(p) < 0)
- rte_panic("Pipeline consistency check failed\n");
-
- /* Run-time */
-#if APP_FLUSH == 0
- while (!force_quit)
- rte_pipeline_run(p);
-#else
- i = 0;
- while (!force_quit) {
- rte_pipeline_run(p);
-
- if ((i & APP_FLUSH) == 0)
- rte_pipeline_flush(p);
- i++;
- }
-#endif
-}
diff --git a/app/test-pipeline/pipeline_lpm_ipv6.c b/app/test-pipeline/pipeline_lpm_ipv6.c
deleted file mode 100644
index 6558e887c85929d859cc94289c4e63f46d5e1c12..0000000000000000000000000000000000000000
--- a/app/test-pipeline/pipeline_lpm_ipv6.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2016 Intel Corporation
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <rte_log.h>
-#include <rte_ethdev.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
-#include <rte_byteorder.h>
-
-#include <rte_port_ring.h>
-#include <rte_table_lpm_ipv6.h>
-#include <rte_pipeline.h>
-
-#include "main.h"
-
-void
-app_main_loop_worker_pipeline_lpm_ipv6(void) {
- struct rte_pipeline_params pipeline_params = {
- .name = "pipeline",
- .socket_id = rte_socket_id(),
- };
-
- struct rte_pipeline *p;
- uint32_t port_in_id[APP_MAX_PORTS];
- uint32_t port_out_id[APP_MAX_PORTS];
- uint32_t table_id;
- uint32_t i;
-
- RTE_LOG(INFO, USER1,
- "Core %u is doing work (pipeline with IPv6 LPM table)\n",
- rte_lcore_id());
-
- /* Pipeline configuration */
- p = rte_pipeline_create(&pipeline_params);
- if (p == NULL)
- rte_panic("Unable to configure the pipeline\n");
-
- /* Input port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_reader_params port_ring_params = {
- .ring = app.rings_rx[i],
- };
-
- struct rte_pipeline_port_in_params port_params = {
- .ops = &rte_port_ring_reader_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- .burst_size = app.burst_size_worker_read,
- };
-
- if (rte_pipeline_port_in_create(p, &port_params,
- &port_in_id[i]))
- rte_panic("Unable to configure input port for "
- "ring %d\n", i);
- }
-
- /* Output port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_writer_params port_ring_params = {
- .ring = app.rings_tx[i],
- .tx_burst_sz = app.burst_size_worker_write,
- };
-
- struct rte_pipeline_port_out_params port_params = {
- .ops = &rte_port_ring_writer_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- };
-
- if (rte_pipeline_port_out_create(p, &port_params,
- &port_out_id[i]))
- rte_panic("Unable to configure output port for "
- "ring %d\n", i);
- }
-
- /* Table configuration */
- {
- struct rte_table_lpm_ipv6_params table_lpm_ipv6_params = {
- .name = "LPM",
- .n_rules = 1 << 24,
- .number_tbl8s = 1 << 21,
- .entry_unique_size =
- sizeof(struct rte_pipeline_table_entry),
- .offset = APP_METADATA_OFFSET(32),
- };
-
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_lpm_ipv6_ops,
- .arg_create = &table_lpm_ipv6_params,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id))
- rte_panic("Unable to configure the IPv6 LPM table\n");
- }
-
- /* Interconnecting ports and tables */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_connect_to_table(p, port_in_id[i],
- table_id))
- rte_panic("Unable to connect input port %u to "
- "table %u\n", port_in_id[i], table_id);
-
- /* Add entries to tables */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_pipeline_table_entry entry = {
- .action = RTE_PIPELINE_ACTION_PORT,
- {.port_id = port_out_id[i & (app.n_ports - 1)]},
- };
-
- struct rte_table_lpm_ipv6_key key;
- struct rte_pipeline_table_entry *entry_ptr;
- uint32_t ip;
- int key_found, status;
-
- key.depth = 8 + rte_popcount32(app.n_ports - 1);
-
- ip = rte_bswap32(i << (24 -
- rte_popcount32(app.n_ports - 1)));
- memcpy(&key.ip, &ip, sizeof(uint32_t));
-
- printf("Adding rule to IPv6 LPM table (IPv6 destination = "
- RTE_IPV6_ADDR_FMT "/%u => port out = %u)\n",
- RTE_IPV6_ADDR_SPLIT(&key.ip),
- key.depth, i);
-
- status = rte_pipeline_table_entry_add(p, table_id, &key, &entry,
- &key_found, &entry_ptr);
- if (status < 0)
- rte_panic("Unable to add entry to table %u (%d)\n",
- table_id, status);
- }
-
- /* Enable input ports */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_enable(p, port_in_id[i]))
- rte_panic("Unable to enable input port %u\n",
- port_in_id[i]);
-
- /* Check pipeline consistency */
- if (rte_pipeline_check(p) < 0)
- rte_panic("Pipeline consistency check failed\n");
-
- /* Run-time */
-#if APP_FLUSH == 0
- while (!force_quit)
- rte_pipeline_run(p);
-#else
- i = 0;
- while (!force_quit) {
- rte_pipeline_run(p);
-
- if ((i & APP_FLUSH) == 0)
- rte_pipeline_flush(p);
- i++;
- }
-#endif
-}
diff --git a/app/test-pipeline/pipeline_stub.c b/app/test-pipeline/pipeline_stub.c
deleted file mode 100644
index 48a638aad76ebd2a4fd4c2b2350764a43753bb80..0000000000000000000000000000000000000000
--- a/app/test-pipeline/pipeline_stub.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2016 Intel Corporation
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <rte_log.h>
-#include <rte_port_ring.h>
-#include <rte_table_stub.h>
-#include <rte_pipeline.h>
-
-#include "main.h"
-
-void
-app_main_loop_worker_pipeline_stub(void) {
- struct rte_pipeline_params pipeline_params = {
- .name = "pipeline",
- .socket_id = rte_socket_id(),
- };
-
- struct rte_pipeline *p;
- uint32_t port_in_id[APP_MAX_PORTS];
- uint32_t port_out_id[APP_MAX_PORTS];
- uint32_t table_id[APP_MAX_PORTS];
- uint32_t i;
-
- RTE_LOG(INFO, USER1, "Core %u is doing work (pipeline with stub "
- "tables)\n", rte_lcore_id());
-
- /* Pipeline configuration */
- p = rte_pipeline_create(&pipeline_params);
- if (p == NULL)
- rte_panic("Unable to configure the pipeline\n");
-
- /* Input port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_reader_params port_ring_params = {
- .ring = app.rings_rx[i],
- };
-
- struct rte_pipeline_port_in_params port_params = {
- .ops = &rte_port_ring_reader_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- .burst_size = app.burst_size_worker_read,
- };
-
- if (rte_pipeline_port_in_create(p, &port_params,
- &port_in_id[i]))
- rte_panic("Unable to configure input port for "
- "ring %d\n", i);
- }
-
- /* Output port configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_port_ring_writer_params port_ring_params = {
- .ring = app.rings_tx[i],
- .tx_burst_sz = app.burst_size_worker_write,
- };
-
- struct rte_pipeline_port_out_params port_params = {
- .ops = &rte_port_ring_writer_ops,
- .arg_create = (void *) &port_ring_params,
- .f_action = NULL,
- .arg_ah = NULL,
- };
-
- if (rte_pipeline_port_out_create(p, &port_params,
- &port_out_id[i]))
- rte_panic("Unable to configure output port for "
- "ring %d\n", i);
- }
-
- /* Table configuration */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_pipeline_table_params table_params = {
- .ops = &rte_table_stub_ops,
- .arg_create = NULL,
- .f_action_hit = NULL,
- .f_action_miss = NULL,
- .arg_ah = NULL,
- .action_data_size = 0,
- };
-
- if (rte_pipeline_table_create(p, &table_params, &table_id[i]))
- rte_panic("Unable to configure table %u\n", i);
- }
-
- /* Interconnecting ports and tables */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_connect_to_table(p, port_in_id[i],
- table_id[i]))
- rte_panic("Unable to connect input port %u to "
- "table %u\n", port_in_id[i], table_id[i]);
-
- /* Add entries to tables */
- for (i = 0; i < app.n_ports; i++) {
- struct rte_pipeline_table_entry entry = {
- .action = RTE_PIPELINE_ACTION_PORT,
- {.port_id = port_out_id[i ^ 1]},
- };
- struct rte_pipeline_table_entry *default_entry_ptr;
-
- if (rte_pipeline_table_default_entry_add(p, table_id[i], &entry,
- &default_entry_ptr))
- rte_panic("Unable to add default entry to table %u\n",
- table_id[i]);
- }
-
- /* Enable input ports */
- for (i = 0; i < app.n_ports; i++)
- if (rte_pipeline_port_in_enable(p, port_in_id[i]))
- rte_panic("Unable to enable input port %u\n",
- port_in_id[i]);
-
- /* Check pipeline consistency */
- if (rte_pipeline_check(p) < 0)
- rte_panic("Pipeline consistency check failed\n");
-
- /* Run-time */
-#if APP_FLUSH == 0
- while (!force_quit)
- rte_pipeline_run(p);
-#else
- i = 0;
- while (!force_quit) {
- rte_pipeline_run(p);
-
- if ((i & APP_FLUSH) == 0)
- rte_pipeline_flush(p);
- i++;
- }
-#endif
-}
diff --git a/app/test-pipeline/runtime.c b/app/test-pipeline/runtime.c
deleted file mode 100644
index 752f78337031d4f7ddc94d63047b6d5de56a00cb..0000000000000000000000000000000000000000
--- a/app/test-pipeline/runtime.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <string.h>
-#include <sys/queue.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <getopt.h>
-
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memcpy.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_launch.h>
-#include <rte_cycles.h>
-#include <rte_prefetch.h>
-#include <rte_branch_prediction.h>
-#include <rte_interrupts.h>
-#include <rte_pci.h>
-#include <rte_random.h>
-#include <rte_debug.h>
-#include <rte_ether.h>
-#include <rte_ethdev.h>
-#include <rte_ring.h>
-#include <rte_mempool.h>
-#include <rte_mbuf.h>
-#include <rte_ip.h>
-#include <rte_tcp.h>
-#include <rte_lpm.h>
-#include <rte_lpm6.h>
-#include <rte_malloc.h>
-
-#include "main.h"
-
-void
-app_main_loop_rx(void) {
- uint32_t i;
- int ret;
-
- RTE_LOG(INFO, USER1, "Core %u is doing RX\n", rte_lcore_id());
-
- while (!force_quit) {
- for (i = 0; i < app.n_ports; i++) {
- uint16_t n_mbufs;
-
- n_mbufs = rte_eth_rx_burst(
- app.ports[i],
- 0,
- app.mbuf_rx.array,
- app.burst_size_rx_read);
-
- if (n_mbufs == 0)
- continue;
-
- do {
- ret = rte_ring_sp_enqueue_bulk(
- app.rings_rx[i],
- (void **) app.mbuf_rx.array,
- n_mbufs, NULL);
- } while (ret == 0 && !force_quit);
- }
- }
-}
-
-void
-app_main_loop_worker(void) {
- struct app_mbuf_array *worker_mbuf;
- uint32_t i;
-
- RTE_LOG(INFO, USER1, "Core %u is doing work (no pipeline)\n",
- rte_lcore_id());
-
- worker_mbuf = rte_malloc_socket(NULL, sizeof(struct app_mbuf_array),
- RTE_CACHE_LINE_SIZE, rte_socket_id());
- if (worker_mbuf == NULL)
- rte_panic("Worker thread: cannot allocate buffer space\n");
-
- while (!force_quit) {
- for (i = 0; i < app.n_ports; i++) {
- int ret;
-
- ret = rte_ring_sc_dequeue_bulk(
- app.rings_rx[i],
- (void **) worker_mbuf->array,
- app.burst_size_worker_read,
- NULL);
-
- if (ret == 0)
- continue;
-
- do {
- ret = rte_ring_sp_enqueue_bulk(
- app.rings_tx[i ^ 1],
- (void **) worker_mbuf->array,
- app.burst_size_worker_write,
- NULL);
- } while (ret == 0 && !force_quit);
- }
- }
-}
-
-void
-app_main_loop_tx(void) {
- uint32_t i;
-
- RTE_LOG(INFO, USER1, "Core %u is doing TX\n", rte_lcore_id());
-
- while (!force_quit) {
- for (i = 0; i < app.n_ports; i++) {
- uint16_t n_mbufs, n_pkts;
- int ret;
-
- n_mbufs = app.mbuf_tx[i].n_mbufs;
-
- ret = rte_ring_sc_dequeue_bulk(
- app.rings_tx[i],
- (void **) &app.mbuf_tx[i].array[n_mbufs],
- app.burst_size_tx_read,
- NULL);
-
- if (ret == 0)
- continue;
-
- n_mbufs += app.burst_size_tx_read;
-
- if (n_mbufs < app.burst_size_tx_write) {
- app.mbuf_tx[i].n_mbufs = n_mbufs;
- continue;
- }
-
- n_pkts = rte_eth_tx_burst(
- app.ports[i],
- 0,
- app.mbuf_tx[i].array,
- n_mbufs);
-
- if (n_pkts < n_mbufs) {
- uint16_t k;
-
- for (k = n_pkts; k < n_mbufs; k++) {
- struct rte_mbuf *pkt_to_free;
-
- pkt_to_free = app.mbuf_tx[i].array[k];
- rte_pktmbuf_free(pkt_to_free);
- }
- }
-
- app.mbuf_tx[i].n_mbufs = 0;
- }
- }
-}
diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst
index c8cc86295da2d08b56e1464ca4a3122bbb599068..6ad0cf6eeca19f32429e60c2637b06274d43754a 100644
--- a/doc/guides/rel_notes/release_26_11.rst
+++ b/doc/guides/rel_notes/release_26_11.rst
@@ -77,6 +77,9 @@ Removed Items
``rte_rib6_is_equal``
* table: ``RTE_LPM_IPV6_ADDR_SIZE``
+* Removed the ``dpdk-test-pipeline`` application, which was based on
+ the legacy pipeline library API.
+
API Changes
-----------
diff --git a/doc/guides/sample_app_ug/index.rst b/doc/guides/sample_app_ug/index.rst
index f12623bb669b75c39117f65dad781fe00e4534e9..c8b50b801c5ca317c8107b182a4633a4918fb199 100644
--- a/doc/guides/sample_app_ug/index.rst
+++ b/doc/guides/sample_app_ug/index.rst
@@ -45,7 +45,6 @@ Sample Applications User Guides
vhost_crypto
vdpa
ip_pipeline
- test_pipeline
pipeline
eventdev_pipeline
dist_app
diff --git a/doc/guides/sample_app_ug/test_pipeline.rst b/doc/guides/sample_app_ug/test_pipeline.rst
deleted file mode 100644
index e53d77a170f1155743b8cb082cfd129848a0a4fa..0000000000000000000000000000000000000000
--- a/doc/guides/sample_app_ug/test_pipeline.rst
+++ /dev/null
@@ -1,237 +0,0 @@
-.. SPDX-License-Identifier: BSD-3-Clause
- Copyright(c) 2010-2014 Intel Corporation.
-
-Test Pipeline Application
-=========================
-
-The Test Pipeline application illustrates the use of the DPDK Packet Framework tool suite.
-Its purpose is to demonstrate the performance of single-table DPDK pipelines.
-
-Overview
---------
-
-The application uses three CPU cores:
-
-* Core A ("RX core") receives traffic from the NIC ports and feeds core B with traffic through SW queues.
-
-* Core B ("Pipeline core") implements a single-table DPDK pipeline
- whose type is selectable through specific command line parameter.
- Core B receives traffic from core A through software queues,
- processes it according to the actions configured in the table entries that
- are hit by the input packets and feeds it to core C through another set of software queues.
-
-* Core C ("TX core") receives traffic from core B through software queues and sends it to the NIC ports for transmission.
-
-.. figure:: img/test_pipeline_app.*
-
- Test Pipeline Application
-
-Compiling the Application
--------------------------
-To compile the sample application see :doc:`compiling`
-
-The application is located in the ``dpdk/<build_dir>/app`` directory.
-
-
-Running the Application
------------------------
-
-Application Command Line
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-The application execution command line is:
-
-.. code-block:: console
-
- ./dpdk-test-pipeline [EAL options] -- -p PORTMASK --TABLE_TYPE
-
-The ``-l/--lcores`` EAL CPU corelist option has to contain exactly 3 CPU cores.
-The first CPU core in the core mask is assigned for core A, the second for core B and the third for core C.
-
-The PORTMASK parameter must contain 2 or 4 ports.
-
-Table Types and Behavior
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-:numref:`test_pipeline_table_1` describes the table types used and how they are populated.
-
-The hash tables are pre-populated with 16 million keys.
-For hash tables, the following parameters can be selected:
-
-* **Configurable key size implementation or fixed (specialized) key size implementation (e.g. hash-8-ext or hash-spec-8-ext).**
- The key size specialized implementations are expected to provide better performance for 8-byte and 16-byte key sizes,
- while the key-size-non-specialized implementation is expected to provide better performance for larger key sizes;
-
-* **Key size (e.g. hash-spec-8-ext or hash-spec-16-ext).**
- The available options are 8, 16 and 32 bytes;
-
-* **Table type (e.g. hash-spec-16-ext or hash-spec-16-lru).**
- The available options are ext (extendable bucket) or lru (least recently used).
-
-.. _test_pipeline_table_1:
-
-.. table:: Table Types
-
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | **#** | **TABLE_TYPE** | **Description of Core B Table** | **Pre-added Table Entries** |
- | | | | |
- +=======+========================+==========================================================+=======================================================+
- | 1 | none | Core B is not implementing a DPDK pipeline. | N/A |
- | | | Core B is implementing a pass-through from its input set | |
- | | | of software queues to its output set of software queues. | |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | 2 | stub | Stub table. Core B is implementing the same pass-through | N/A |
- | | | functionality as described for the "none" option by | |
- | | | using the DPDK Packet Framework by using one | |
- | | | stub table for each input NIC port. | |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | 3 | hash-[spec]-8-lru | LRU hash table with 8-byte key size and 16 million | 16 million entries are successfully added to the |
- | | | entries. | hash table with the following key format: |
- | | | | |
- | | | | [4-byte index, 4 bytes of 0] |
- | | | | |
- | | | | The action configured for all table entries is |
- | | | | "Sendto output port", with the output port index |
- | | | | uniformly distributed for the range of output ports. |
- | | | | |
- | | | | The default table rule (used in the case of a lookup |
- | | | | miss) is to drop the packet. |
- | | | | |
- | | | | At run time, core A is creating the following lookup |
- | | | | key and storing it into the packet meta data for |
- | | | | core B to use for table lookup: |
- | | | | |
- | | | | [destination IPv4 address, 4 bytes of 0] |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | 4 | hash-[spec]-8-ext | Extendable bucket hash table with 8-byte key size | Same as hash-[spec]-8-lru table entries, above. |
- | | | and 16 million entries. | |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | 5 | hash-[spec]-16-lru | LRU hash table with 16-byte key size and 16 million | 16 million entries are successfully added to the hash |
- | | | entries. | table with the following key format: |
- | | | | |
- | | | | [4-byte index, 12 bytes of 0] |
- | | | | |
- | | | | The action configured for all table entries is |
- | | | | "Send to output port", with the output port index |
- | | | | uniformly distributed for the range of output ports. |
- | | | | |
- | | | | The default table rule (used in the case of a lookup |
- | | | | miss) is to drop the packet. |
- | | | | |
- | | | | At run time, core A is creating the following lookup |
- | | | | key and storing it into the packet meta data for core |
- | | | | B to use for table lookup: |
- | | | | |
- | | | | [destination IPv4 address, 12 bytes of 0] |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | 6 | hash-[spec]-16-ext | Extendable bucket hash table with 16-byte key size | Same as hash-[spec]-16-lru table entries, above. |
- | | | and 16 million entries. | |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | 7 | hash-[spec]-32-lru | LRU hash table with 32-byte key size and 16 million | 16 million entries are successfully added to the hash |
- | | | entries. | table with the following key format: |
- | | | | |
- | | | | [4-byte index, 28 bytes of 0]. |
- | | | | |
- | | | | The action configured for all table entries is |
- | | | | "Send to output port", with the output port index |
- | | | | uniformly distributed for the range of output ports. |
- | | | | |
- | | | | The default table rule (used in the case of a lookup |
- | | | | miss) is to drop the packet. |
- | | | | |
- | | | | At run time, core A is creating the following lookup |
- | | | | key and storing it into the packet meta data for |
- | | | | Lpmcore B to use for table lookup: |
- | | | | |
- | | | | [destination IPv4 address, 28 bytes of 0] |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | 8 | hash-[spec]-32-ext | Extendable bucket hash table with 32-byte key size | Same as hash-[spec]-32-lru table entries, above. |
- | | | and 16 million entries. | |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | 9 | lpm | Longest Prefix Match (LPM) IPv4 table. | In the case of two ports, two routes |
- | | | | are added to the table: |
- | | | | |
- | | | | [0.0.0.0/9 => send to output port 0] |
- | | | | |
- | | | | [0.128.0.0/9 => send to output port 1] |
- | | | | |
- | | | | In case of four ports, four entries are added to the |
- | | | | table: |
- | | | | |
- | | | | [0.0.0.0/10 => send to output port 0] |
- | | | | |
- | | | | [0.64.0.0/10 => send to output port 1] |
- | | | | |
- | | | | [0.128.0.0/10 => send to output port 2] |
- | | | | |
- | | | | [0.192.0.0/10 => send to output port 3] |
- | | | | |
- | | | | The default table rule (used in the case of a lookup |
- | | | | miss) is to drop the packet. |
- | | | | |
- | | | | At run time, core A is storing the IPv4 destination |
- | | | | within the packet meta data to be later used by core |
- | | | | B as the lookup key. |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
- | 10 | acl | Access Control List (ACL) table | In the case of two ports, two ACL rules are added to |
- | | | | the table: |
- | | | | |
- | | | | [priority = 0 (highest), |
- | | | | |
- | | | | IPv4 source = ANY, |
- | | | | |
- | | | | IPv4 destination = 0.0.0.0/9, |
- | | | | |
- | | | | L4 protocol = ANY, |
- | | | | |
- | | | | TCP source port = ANY, |
- | | | | |
- | | | | TCP destination port = ANY |
- | | | | |
- | | | | => send to output port 0] |
- | | | | |
- | | | | |
- | | | | [priority = 0 (highest), |
- | | | | |
- | | | | IPv4 source = ANY, |
- | | | | |
- | | | | IPv4 destination = 0.128.0.0/9, |
- | | | | |
- | | | | L4 protocol = ANY, |
- | | | | |
- | | | | TCP source port = ANY, |
- | | | | |
- | | | | TCP destination port = ANY |
- | | | | |
- | | | | => send to output port 0]. |
- | | | | |
- | | | | |
- | | | | The default table rule (used in the case of a lookup |
- | | | | miss) is to drop the packet. |
- | | | | |
- +-------+------------------------+----------------------------------------------------------+-------------------------------------------------------+
-
-Input Traffic
-~~~~~~~~~~~~~
-
-Regardless of the table type used for the core B pipeline,
-the same input traffic can be used to hit all table entries with uniform distribution,
-which results in uniform distribution of packets sent out on the set of output NIC ports.
-The profile for input traffic is TCP/IPv4 packets with:
-
-* destination IP address as A.B.C.D with A fixed to 0 and B, C,D random
-
-* source IP address fixed to 0.0.0.0
-
-* destination TCP port fixed to 0
-
-* source TCP port fixed to 0
--
2.53.0
next prev parent reply other threads:[~2026-07-28 16:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 16:43 [PATCH 0/6] remove legacy Packet Framework API Stephen Hemminger
2026-07-24 16:43 ` [RFC 1/6] app/test: remove packet framework tests Stephen Hemminger
2026-07-24 16:43 ` [RFC 2/6] app/test-pipeline: remove application Stephen Hemminger
2026-07-24 16:43 ` [RFC 3/6] examples/ip_pipeline: remove example Stephen Hemminger
2026-07-24 16:44 ` [RFC 4/6] pipeline: remove legacy API Stephen Hemminger
2026-07-24 16:44 ` [RFC 6/6] port: " Stephen Hemminger
2026-07-25 7:54 ` [PATCH 0/6] remove legacy Packet Framework API David Marchand
2026-07-25 13:36 ` Stephen Hemminger
2026-07-27 23:11 ` [RFC v2 0/6] remove legacy packet framework Stephen Hemminger
2026-07-27 23:11 ` [RFC v2 1/6] app/test: remove packet framework tests Stephen Hemminger
2026-07-27 23:11 ` [RFC v2 2/6] app/test-pipeline: remove application Stephen Hemminger
2026-07-27 23:11 ` [RFC v2 3/6] examples/ip_pipeline: remove example Stephen Hemminger
2026-07-27 23:11 ` [RFC v2 4/6] pipeline: remove legacy API Stephen Hemminger
2026-07-27 23:11 ` [RFC v2 6/6] port: " Stephen Hemminger
2026-07-28 14:20 ` [PATCH v3 0/6] remove legacy packet framework Stephen Hemminger
2026-07-28 14:20 ` [PATCH v3 1/6] app/test: remove packet framework tests Stephen Hemminger
2026-07-28 14:20 ` [PATCH v3 2/6] app/test-pipeline: remove application Stephen Hemminger
2026-07-28 14:20 ` [PATCH v3 3/6] examples/ip_pipeline: remove example Stephen Hemminger
2026-07-28 14:20 ` [PATCH v3 4/6] pipeline: remove legacy API Stephen Hemminger
2026-07-28 14:20 ` [PATCH v3 6/6] port: " Stephen Hemminger
2026-07-28 14:48 ` [PATCH v3 0/6] remove legacy packet framework David Marchand
2026-07-28 16:35 ` [PATCH v4 0/7] remove deprecated " Stephen Hemminger
2026-07-28 16:35 ` [PATCH v4 1/7] app/test: remove packet framework tests Stephen Hemminger
2026-07-28 16:35 ` Stephen Hemminger [this message]
2026-07-28 16:35 ` [PATCH v4 3/7] examples/ip_pipeline: remove example Stephen Hemminger
2026-07-28 16:35 ` [PATCH v4 4/7] pipeline: remove legacy API Stephen Hemminger
2026-07-28 16:35 ` [PATCH v4 5/7] table: " Stephen Hemminger
2026-07-28 16:35 ` [PATCH v4 6/7] port: " Stephen Hemminger
2026-07-28 16:35 ` [PATCH v4 7/7] doc: remove packet framework images Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260728163713.364168-3-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox