From 75bd512fe75a68d15b132e972a6ed8ca9559d53f Mon Sep 17 00:00:00 2001 From: Noah Chinitz <62520433+NoahChinitzGWU@users.noreply.github.com> Date: Wed, 1 Dec 2021 20:22:51 -0500 Subject: [PATCH 01/19] [Bug Fix] ARP endianess fixed (#317) Changes the source IP address in ARP reply from CPU byte ordering to BE. Commit log: * ARP endianess fixed --- examples/arp_response/arp_response.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/arp_response/arp_response.c b/examples/arp_response/arp_response.c index f7f4b7b71..6b23a0009 100644 --- a/examples/arp_response/arp_response.c +++ b/examples/arp_response/arp_response.c @@ -249,7 +249,7 @@ send_arp_reply(int port, struct rte_ether_addr *tha, uint32_t tip, struct onvm_n out_arp_hdr->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REPLY); rte_ether_addr_copy(&ports->mac[port], &out_arp_hdr->arp_data.arp_sha); - out_arp_hdr->arp_data.arp_sip = state_info->source_ips[ports->id[port]]; + out_arp_hdr->arp_data.arp_sip = rte_cpu_to_be_32(state_info->source_ips[ports->id[port]]); out_arp_hdr->arp_data.arp_tip = tip; rte_ether_addr_copy(tha, &out_arp_hdr->arp_data.arp_tha); From c2c0c6a9f4afed2a0bf2cd02b27c95b1d75f1a47 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Tue, 16 Apr 2024 02:14:19 -0400 Subject: [PATCH 02/19] Update to Meson build system to match DPDK --- .gitignore | 4 ++ .gitmodules | 8 ++- README.md | 12 ++++- dpdk | 1 - meson.build | 9 ++++ onvm/lib/meson.build | 10 ++++ onvm/meson.build | 2 + onvm/onvm_nflib/meson.build | 17 ++++++ scripts/setup.sh | 103 ++++++++++++++++++++++++++++++++++++ subprojects/dpdk | 1 + 10 files changed, 159 insertions(+), 8 deletions(-) delete mode 160000 dpdk create mode 100644 meson.build create mode 100644 onvm/lib/meson.build create mode 100644 onvm/meson.build create mode 100644 onvm/onvm_nflib/meson.build create mode 100755 scripts/setup.sh create mode 160000 subprojects/dpdk diff --git a/.gitignore b/.gitignore index 3f64ac4b5..58d937d34 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # build directories **/build/** **/x86_64-native-linuxapp-gcc/** +/build # dpdk built target dpdk-1.8.0/x86_64-native-linuxapp-gcc/* @@ -49,3 +50,6 @@ _preinstall # Debug files *.dSYM/ + +# Python virtual environment +env \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index f6cce7efa..7c20e1276 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,11 +1,9 @@ -[submodule "dpdk-1.8.0"] - path = dpdk - url = https://dpdk.org/git/dpdk - branch = master - commit = 0da7f445df445630c794897347ee360d6fe6348b [submodule "tools/Pktgen/pktgen-dpdk"] path = tools/Pktgen/pktgen-dpdk url = http://dpdk.org/git/apps/pktgen-dpdk branch = master commit = 807b4d2cfcc8ded46ece85353cefe5d655674de3 +[submodule "dpdk"] + path = subprojects/dpdk + url = https://github.com/DPDK/dpdk.git diff --git a/README.md b/README.md index 7b0524601..d247a25d4 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,17 @@ The [develop][dev] branch tracks experimental builds (active development) wherea You can find information about research projects building on [OpenNetVM][onvm] at the [UCR/GW SDNFV project site][sdnfv]. OpenNetVM is supported in part by NSF grants CNS-1422362 and CNS-1522546. -Installing +Get Started -- -To install openNetVM, please see the [openNetVM Installation][install] guide for a thorough walkthrough. +We've provided a bash script to assist with setting up your development environment for working with OpenNetVM. Take a look at [`scripts/setup.sh`](/scripts/setup.sh) to see a full list of installed packages. + +From the `openNetVM` folder, run the following command: +``` +./scripts/setup.sh +``` + +Once that's completed, head over to the [Getting Started](/docs/Install.md) guide for compiling OpenNetVM/DPDK and running your first NF. + Using openNetVM -- diff --git a/dpdk b/dpdk deleted file mode 160000 index e2a234488..000000000 --- a/dpdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e2a234488854fdeee267a2aa582aa082fce01d6e diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..3b6f8ba17 --- /dev/null +++ b/meson.build @@ -0,0 +1,9 @@ +project('openNetVM', 'c') + + +cc = meson.get_compiler('c') +onvm_source = meson.current_source_dir() +onvm_dpdk = subproject('dpdk') +onvm_dpdk_dep = onvm_dpdk.get_variable('dpdk_static_lib_deps') + +subdir('onvm') diff --git a/onvm/lib/meson.build b/onvm/lib/meson.build new file mode 100644 index 000000000..cd9691ec5 --- /dev/null +++ b/onvm/lib/meson.build @@ -0,0 +1,10 @@ +sources = files('cJSON.c') + +libonvmhelper_includes = include_directories('.') + +libonvmhelper = static_library('libonvmhelper', + sources, + include_directories : libonvmhelper_includes) + +libonvmhelper_dep = declare_dependency(link_with : libonvmhelper, + include_directories: libonvmhelper_includes) \ No newline at end of file diff --git a/onvm/meson.build b/onvm/meson.build new file mode 100644 index 000000000..681e10682 --- /dev/null +++ b/onvm/meson.build @@ -0,0 +1,2 @@ +subdir('lib') +subdir('onvm_nflib') diff --git a/onvm/onvm_nflib/meson.build b/onvm/onvm_nflib/meson.build new file mode 100644 index 000000000..4f3c37bc1 --- /dev/null +++ b/onvm/onvm_nflib/meson.build @@ -0,0 +1,17 @@ +sources = files( + 'onvm_config_common.c', + 'onvm_flow_dir.c', + 'onvm_flow_table.c', + 'onvm_nflib.c', + 'onvm_pkt_common.c', + 'onvm_pkt_helper.c', + 'onvm_sc_common.c', + 'onvm_sc_mgr.c', + 'onvm_threading.c' +) + +libonvm = static_library('libonvm', + sources, + include_directories : include_directories('.'), + dependencies : [onvm_dpdk_dep, libonvmhelper_dep]) +libonvm_dep = declare_dependency(link_with: libonvm) \ No newline at end of file diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 000000000..eda5f1407 --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,103 @@ +#! /bin/bash + +# openNetVM +# https://sdnfv.github.io +# +# OpenNetVM is distributed under the following BSD LICENSE: +# +# Copyright(c) +# 2015-2024 George Washington University +# 2015-2017 University of California Riverside +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * The name of the author may not be used to endorse or promote +# products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# A script to setup the developer environment to build OpenNetVM and its +# subsequent components. + +packages=("build-essential" \ + "python3" \ + "python3-pip" \ + "python3-setuptools" \ + "python3-wheel" \ + "python3-venv" \ + "ninja-build" \ + "pkg-config" \ + "libnuma-dev") +install_packages=true + +pypackages=("meson" \ + "pyelftools") +pyenv="env" + +# Check the passed arguments, and set the appropriate flags if a +# particular argument is detected +for arg in "$@" +do + if [[ $arg == "--noinstall" ]]; then + install_packages=false + break + fi +done + +# (1) +# Install required packages for development +required=$(IFS=' '; echo "${packages[*]}") + +echo "- Installing required packages" +if [ "$install_packages" = true ]; then + echo " - installing: $required" + sudo apt-get install $required +else + echo " - skipping due to --noinstall flag" +fi + +# (2) +# Initialize the Git submodules (dpdk & pkt_gen) +echo "- Initializing Git submodules" + +git submodule update --init + +# (3) +# Create the Python environment (this will be used for compiling onvm) +pyrequired=$(IFS=' '; echo "${pypackages[*]}") + +echo "- Setup Python environment" +echo " - installing $pyrequired" + +python3 -m venv $pyenv +source env/bin/activate +pip3 install $pyrequired + +# (3.1) +# Set environment variables in python environment +echo " - setting environment variables" + +echo export ONVM_HOME=$(pwd) >> ./$pyenv/bin/activate +echo export ONVM_NUM_HUGEPAGES=1024 >> ./$pyenv/bin/activate +echo export RTE_SDK=$(pwd)/dpdk >> ./$pyenv/bin/activate +echo export RTE_TARGET=x86_64-native-linuxapp-gcc >> ./$pyenv/bin/activate \ No newline at end of file diff --git a/subprojects/dpdk b/subprojects/dpdk new file mode 160000 index 000000000..80ecef6d1 --- /dev/null +++ b/subprojects/dpdk @@ -0,0 +1 @@ +Subproject commit 80ecef6d1f71fcebc0a51d7cabc51f73ee142ff2 From 42712868ff850b73894a39965f178f74384d7247 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Tue, 23 Apr 2024 23:18:56 -0400 Subject: [PATCH 03/19] Add dynfield for onvm_pkt_meta and apply dpdk renaming patches --- meson.build | 4 +-- onvm/onvm_mgr/main.c | 2 +- onvm/onvm_mgr/onvm_init.c | 13 +++++++ onvm/onvm_mgr/onvm_init.h | 1 + onvm/onvm_nflib/onvm_common.h | 11 +++--- onvm/onvm_nflib/onvm_nflib.c | 10 +++--- onvm/onvm_nflib/onvm_pkt_common.c | 20 +++++------ onvm/onvm_nflib/onvm_pkt_common.h | 2 +- onvm/onvm_nflib/onvm_pkt_helper.c | 56 +++++++++++++++---------------- onvm/onvm_nflib/onvm_pkt_helper.h | 2 +- onvm/onvm_nflib/onvm_sc_mgr.h | 8 ++--- 11 files changed, 72 insertions(+), 57 deletions(-) diff --git a/meson.build b/meson.build index 3b6f8ba17..174eb6392 100644 --- a/meson.build +++ b/meson.build @@ -1,9 +1,9 @@ project('openNetVM', 'c') - +add_global_arguments('-msse4', language : 'c') cc = meson.get_compiler('c') onvm_source = meson.current_source_dir() -onvm_dpdk = subproject('dpdk') +onvm_dpdk = subproject('dpdk', default_options: ['mssse3=true']) onvm_dpdk_dep = onvm_dpdk.get_variable('dpdk_static_lib_deps') subdir('onvm') diff --git a/onvm/onvm_mgr/main.c b/onvm/onvm_mgr/main.c index 99dee45af..38913af48 100644 --- a/onvm/onvm_mgr/main.c +++ b/onvm/onvm_mgr/main.c @@ -239,7 +239,7 @@ tx_thread_main(void *arg) { /* Now process the Client packets read */ if (likely(tx_count > 0)) { - onvm_pkt_process_tx_batch(tx_mgr, pkts, tx_count, nf); + onvm_pkt_process_tx_batch(tx_mgr, pkts, onvm_config->dynfield_offset, tx_count, nf); } } diff --git a/onvm/onvm_mgr/onvm_init.c b/onvm/onvm_mgr/onvm_init.c index 25884dc96..3750a06bf 100644 --- a/onvm/onvm_mgr/onvm_init.c +++ b/onvm/onvm_mgr/onvm_init.c @@ -207,6 +207,13 @@ init(int argc, char *argv[]) { if (retval != 0) return -1; + /* register onvm_pkt_meta dynfield with DPDK (must be done before init_mbuf_pools) */ + static const struct rte_mbuf_dynfield onvm_pkt_meta_dynfield_desc = { + .name = "onvm_pkt_meta_dynfield", + .size = sizeof(onvm_pkt_meta_t), + .align = alignof(onvm_pkt_meta_t) + }; + /* initialise mbuf pools */ retval = init_mbuf_pools(); if (retval != 0) @@ -224,6 +231,11 @@ init(int argc, char *argv[]) { rte_exit(EXIT_FAILURE, "Cannot create nf message pool: %s\n", rte_strerror(rte_errno)); } + /* initialize onvm_pkt_meta dynfield offset, and load to onvm_config */ + onvm_config->dynfield_offset = rte_mbuf_dynfield_register(&onvm_pkt_meta_dynfield_desc); + if(onvm_config->dynfield_offset < 0) + rte_exit(EXIT_FAILURE, "Cannot register onvm_pkt_meta mbuf field\n"); + /* now initialise the ports we will use */ for (i = 0; i < ports->num_ports; i++) { port_id = ports->id[i]; @@ -275,6 +287,7 @@ init(int argc, char *argv[]) { static void set_default_config(struct onvm_configuration *config) { config->flags.ONVM_NF_SHARE_CORES = ONVM_NF_SHARE_CORES_DEFAULT; + config->dynfield_offset = -1; } /** diff --git a/onvm/onvm_mgr/onvm_init.h b/onvm/onvm_mgr/onvm_init.h index 85d11e9c8..84a8d6c93 100644 --- a/onvm/onvm_mgr/onvm_init.h +++ b/onvm/onvm_mgr/onvm_init.h @@ -59,6 +59,7 @@ #include #include #include +#include #ifdef RTE_LIBRTE_PDUMP #include #endif diff --git a/onvm/onvm_nflib/onvm_common.h b/onvm/onvm_nflib/onvm_common.h index e2b8adcc1..2867579c1 100755 --- a/onvm/onvm_nflib/onvm_common.h +++ b/onvm/onvm_nflib/onvm_common.h @@ -114,16 +114,16 @@ struct onvm_pkt_meta { uint8_t chain_index; /*index of the current step in the service chain*/ uint8_t flags; /* bits for custom NF data. Use with caution to prevent collisions from different NFs. */ }; +typedef struct onvm_pkt_meta onvm_pkt_meta_t; static inline struct onvm_pkt_meta * -onvm_get_pkt_meta(struct rte_mbuf *pkt) { - return (struct onvm_pkt_meta *)&pkt->udata64; +onvm_get_pkt_meta(struct rte_mbuf *pkt, int pkt_meta_offset) { + return RTE_MBUF_DYNFIELD(pkt, pkt_meta_offset, struct onvm_pkt_meta *); } static inline uint8_t -onvm_get_pkt_chain_index(struct rte_mbuf *pkt) { - struct onvm_pkt_meta* pkt_meta = (struct onvm_pkt_meta*) &pkt->udata64; - return pkt_meta->chain_index; +onvm_get_pkt_chain_index(struct rte_mbuf *pkt, int pkt_meta_offset) { + return (onvm_get_pkt_meta(pkt, pkt_meta_offset))->chain_index; } /* @@ -210,6 +210,7 @@ struct onvm_configuration { struct { uint8_t ONVM_NF_SHARE_CORES; } flags; + int dynfield_offset; }; struct core_status { diff --git a/onvm/onvm_nflib/onvm_nflib.c b/onvm/onvm_nflib/onvm_nflib.c index 4e95ed2a2..b2b75f68e 100644 --- a/onvm/onvm_nflib/onvm_nflib.c +++ b/onvm/onvm_nflib/onvm_nflib.c @@ -147,7 +147,7 @@ onvm_nflib_parse_args(int argc, char *argv[], struct onvm_nf_init_cfg *nf_init_c */ static inline uint16_t onvm_nflib_dequeue_packets(void **pkts, struct onvm_nf_local_ctx *nf_local_ctx, - nf_pkt_handler_fn handler) __attribute__((always_inline)); + nf_pkt_handler_fn handler, int pkt_meta_offset) __attribute__((always_inline)); /* * Check if there is a message available for this NF and process it @@ -601,10 +601,10 @@ onvm_nflib_thread_main_loop(void *arg) { } nb_pkts_added = - onvm_nflib_dequeue_packets((void **)pkts, nf_local_ctx, nf->function_table->pkt_handler); + onvm_nflib_dequeue_packets((void **)pkts, nf_local_ctx, nf->function_table->pkt_handler, onvm_config->dynfield_offset); if (likely(nb_pkts_added > 0)) { - onvm_pkt_process_tx_batch(nf->nf_tx_mgr, pkts, nb_pkts_added, nf); + onvm_pkt_process_tx_batch(nf->nf_tx_mgr, pkts, onvm_config->dynfield_offset, nb_pkts_added, nf); } /* Flush the packet buffers */ @@ -965,7 +965,7 @@ onvm_nflib_parse_config(struct onvm_configuration *config) { } static inline uint16_t -onvm_nflib_dequeue_packets(void **pkts, struct onvm_nf_local_ctx *nf_local_ctx, nf_pkt_handler_fn handler) { +onvm_nflib_dequeue_packets(void **pkts, struct onvm_nf_local_ctx *nf_local_ctx, nf_pkt_handler_fn handler, int pkt_meta_offset) { struct onvm_nf *nf; struct onvm_pkt_meta *meta; uint16_t i, nb_pkts; @@ -985,7 +985,7 @@ onvm_nflib_dequeue_packets(void **pkts, struct onvm_nf_local_ctx *nf_local_ctx, /* Give each packet to the user proccessing function */ for (i = 0; i < nb_pkts; i++) { - meta = onvm_get_pkt_meta((struct rte_mbuf *)pkts[i]); + meta = onvm_get_pkt_meta((struct rte_mbuf *)pkts[i], pkt_meta_offset); ret_act = (*handler)((struct rte_mbuf *)pkts[i], meta, nf_local_ctx); /* NF returns 0 to return packets or 1 to buffer */ if (likely(ret_act == 0)) { diff --git a/onvm/onvm_nflib/onvm_pkt_common.c b/onvm/onvm_nflib/onvm_pkt_common.c index 2a6d88c90..a543b2993 100644 --- a/onvm/onvm_nflib/onvm_pkt_common.c +++ b/onvm/onvm_nflib/onvm_pkt_common.c @@ -70,7 +70,7 @@ onvm_pkt_enqueue_port(struct queue_mgr *tx_mgr, uint16_t port, struct rte_mbuf * * */ static inline void -onvm_pkt_process_next_action(struct queue_mgr *tx_mgr, struct rte_mbuf *pkt, struct onvm_nf *nf); +onvm_pkt_process_next_action(struct queue_mgr *tx_mgr, struct rte_mbuf *pkt, int pkt_meta_offset, struct onvm_nf *nf); /* * Helper function to drop a packet. @@ -86,7 +86,7 @@ onvm_pkt_drop(struct rte_mbuf *pkt); /**********************************Interfaces*********************************/ void -onvm_pkt_process_tx_batch(struct queue_mgr *tx_mgr, struct rte_mbuf *pkts[], uint16_t tx_count, struct onvm_nf *nf) { +onvm_pkt_process_tx_batch(struct queue_mgr *tx_mgr, struct rte_mbuf *pkts[], int pkt_meta_offset, uint16_t tx_count, struct onvm_nf *nf) { uint16_t i; struct onvm_pkt_meta *meta; struct packet_buf *out_buf; @@ -95,7 +95,7 @@ onvm_pkt_process_tx_batch(struct queue_mgr *tx_mgr, struct rte_mbuf *pkts[], uin return; for (i = 0; i < tx_count; i++) { - meta = (struct onvm_pkt_meta *)&(((struct rte_mbuf *)pkts[i])->udata64); + meta = onvm_get_pkt_meta(pkts[i], pkt_meta_offset); meta->src = nf->instance_id; if (meta->action == ONVM_NF_ACTION_DROP) { // if the packet is drop, then is 0 @@ -106,7 +106,7 @@ onvm_pkt_process_tx_batch(struct queue_mgr *tx_mgr, struct rte_mbuf *pkts[], uin /* TODO: Here we drop the packet : there will be a flow table in the future to know what to do with the packet next */ nf->stats.act_next++; - onvm_pkt_process_next_action(tx_mgr, pkts[i], nf); + onvm_pkt_process_next_action(tx_mgr, pkts[i], pkt_meta_offset, nf); } else if (meta->action == ONVM_NF_ACTION_TONF) { nf->stats.act_tonf++; onvm_pkt_enqueue_nf(tx_mgr, meta->destination, pkts[i], nf); @@ -271,23 +271,23 @@ onvm_pkt_enqueue_port(struct queue_mgr *tx_mgr, uint16_t port, struct rte_mbuf * } inline static void -onvm_pkt_process_next_action(struct queue_mgr *tx_mgr, struct rte_mbuf *pkt, struct onvm_nf *nf) { +onvm_pkt_process_next_action(struct queue_mgr *tx_mgr, struct rte_mbuf *pkt, int pkt_meta_offset, struct onvm_nf *nf) { if (tx_mgr == NULL || pkt == NULL || nf == NULL) return; struct onvm_flow_entry *flow_entry; struct onvm_service_chain *sc; - struct onvm_pkt_meta *meta = onvm_get_pkt_meta(pkt); + struct onvm_pkt_meta *meta = onvm_get_pkt_meta(pkt, pkt_meta_offset); int ret; ret = onvm_flow_dir_get_pkt(pkt, &flow_entry); if (ret >= 0) { sc = flow_entry->sc; - meta->action = onvm_sc_next_action(sc, pkt); - meta->destination = onvm_sc_next_destination(sc, pkt); + meta->action = onvm_sc_next_action(sc, pkt, pkt_meta_offset); + meta->destination = onvm_sc_next_destination(sc, pkt, pkt_meta_offset); } else { - meta->action = onvm_sc_next_action(default_chain, pkt); - meta->destination = onvm_sc_next_destination(default_chain, pkt); + meta->action = onvm_sc_next_action(default_chain, pkt, pkt_meta_offset); + meta->destination = onvm_sc_next_destination(default_chain, pkt, pkt_meta_offset); } switch (meta->action) { diff --git a/onvm/onvm_nflib/onvm_pkt_common.h b/onvm/onvm_nflib/onvm_pkt_common.h index 3a320c796..ede76d463 100644 --- a/onvm/onvm_nflib/onvm_pkt_common.h +++ b/onvm/onvm_nflib/onvm_pkt_common.h @@ -72,7 +72,7 @@ extern struct onvm_service_chain *default_chain; * */ void -onvm_pkt_process_tx_batch(struct queue_mgr *tx_mgr, struct rte_mbuf *pkts[], uint16_t tx_count, struct onvm_nf *nf); +onvm_pkt_process_tx_batch(struct queue_mgr *tx_mgr, struct rte_mbuf *pkts[], int pkt_meta_offset, uint16_t tx_count, struct onvm_nf *nf); /* * Interface to send packets to all NFs after processing them. diff --git a/onvm/onvm_nflib/onvm_pkt_helper.c b/onvm/onvm_nflib/onvm_pkt_helper.c index 4b2f133da..00abcb4ff 100644 --- a/onvm/onvm_nflib/onvm_pkt_helper.c +++ b/onvm/onvm_nflib/onvm_pkt_helper.c @@ -73,8 +73,8 @@ onvm_pkt_set_mac_addr(struct rte_mbuf* pkt, unsigned src_port_id, unsigned dst_p * Get the MAC addresses of the src and destination NIC ports, * and set the ethernet header's fields to them. */ - rte_ether_addr_copy(&ports->mac[src_port_id], ð->s_addr); - rte_ether_addr_copy(&ports->mac[dst_port_id], ð->d_addr); + rte_ether_addr_copy(&ports->mac[src_port_id], ð->src_addr); + rte_ether_addr_copy(&ports->mac[dst_port_id], ð->dst_addr); return 0; } @@ -95,13 +95,13 @@ onvm_pkt_swap_src_mac_addr(struct rte_mbuf* pkt, unsigned dst_port_id, struct po /* * Copy the source mac address to the destination field. */ - rte_ether_addr_copy(ð->s_addr, ð->d_addr); + rte_ether_addr_copy(ð->src_addr, ð->dst_addr); /* * Get the mac address of the specified destination port id * and set the source field to it. */ - rte_ether_addr_copy(&ports->mac[dst_port_id], ð->s_addr); + rte_ether_addr_copy(&ports->mac[dst_port_id], ð->src_addr); return 0; } @@ -122,13 +122,13 @@ onvm_pkt_swap_dst_mac_addr(struct rte_mbuf* pkt, unsigned src_port_id, struct po /* * Copy the destination mac address to the source field. */ - rte_ether_addr_copy(ð->d_addr, ð->s_addr); + rte_ether_addr_copy(ð->dst_addr, ð->src_addr); /* * Get the mac address of specified source port id * and set the destination field to it. */ - rte_ether_addr_copy(&ports->mac[src_port_id], ð->d_addr); + rte_ether_addr_copy(&ports->mac[src_port_id], ð->dst_addr); return 0; } @@ -322,12 +322,12 @@ onvm_pkt_print_ether(struct rte_ether_hdr* hdr) { if (unlikely(hdr == NULL)) { return; } - printf("Source MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", hdr->s_addr.addr_bytes[0], hdr->s_addr.addr_bytes[1], - hdr->s_addr.addr_bytes[2], hdr->s_addr.addr_bytes[3], hdr->s_addr.addr_bytes[4], - hdr->s_addr.addr_bytes[5]); - printf("Dest MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", hdr->d_addr.addr_bytes[0], hdr->d_addr.addr_bytes[1], - hdr->d_addr.addr_bytes[2], hdr->d_addr.addr_bytes[3], hdr->d_addr.addr_bytes[4], - hdr->d_addr.addr_bytes[5]); + printf("Source MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", hdr->src_addr.addr_bytes[0], hdr->src_addr.addr_bytes[1], + hdr->src_addr.addr_bytes[2], hdr->src_addr.addr_bytes[3], hdr->src_addr.addr_bytes[4], + hdr->src_addr.addr_bytes[5]); + printf("Dest MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", hdr->dst_addr.addr_bytes[0], hdr->dst_addr.addr_bytes[1], + hdr->dst_addr.addr_bytes[2], hdr->dst_addr.addr_bytes[3], hdr->dst_addr.addr_bytes[4], + hdr->dst_addr.addr_bytes[5]); switch (hdr->ether_type) { case RTE_ETHER_TYPE_IPV4: type = "IPv4"; @@ -410,13 +410,13 @@ onvm_pkt_get_checksum_offload_flags(uint8_t port_id) { rte_eth_dev_info_get(port_id, &dev_info); - if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) { + if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM) { hw_offload_flags |= SUPPORTS_IPV4_CHECKSUM_OFFLOAD; } - if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_CKSUM) { + if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_CKSUM) { hw_offload_flags |= SUPPORTS_TCP_CHECKSUM_OFFLOAD; } - if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_CKSUM) { + if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_UDP_CKSUM) { hw_offload_flags |= SUPPORTS_UDP_CHECKSUM_OFFLOAD; } return hw_offload_flags; @@ -480,7 +480,7 @@ onvm_pkt_set_checksums(struct rte_mbuf* pkt) { ip->hdr_checksum = 0; pkt->l2_len = sizeof(struct rte_ether_hdr); pkt->l3_len = (ip->version_ihl & 0b1111) * 4; - pkt->ol_flags |= PKT_TX_IPV4; + pkt->ol_flags |= RTE_MBUF_F_TX_IPV4; if (tcp != NULL) { tcp->cksum = 0; @@ -488,7 +488,7 @@ onvm_pkt_set_checksums(struct rte_mbuf* pkt) { if (hw_cksum_support & SUPPORTS_TCP_CHECKSUM_OFFLOAD) { tcp->cksum = rte_ipv4_phdr_cksum(ip, pkt->ol_flags); - pkt->ol_flags |= PKT_TX_TCP_CKSUM; + pkt->ol_flags |= RTE_MBUF_F_TX_TCP_CKSUM; } else { /* software TCP checksumming */ tcp->cksum = calculate_tcpudp_cksum(ip, tcp, pkt->l3_len, IP_PROTOCOL_TCP); @@ -501,7 +501,7 @@ onvm_pkt_set_checksums(struct rte_mbuf* pkt) { if (hw_cksum_support & SUPPORTS_UDP_CHECKSUM_OFFLOAD) { udp->dgram_cksum = rte_ipv4_phdr_cksum(ip, pkt->ol_flags); - pkt->ol_flags |= PKT_TX_UDP_CKSUM; + pkt->ol_flags |= RTE_MBUF_F_TX_UDP_CKSUM; } else { /* software UDP checksumming */ udp->dgram_cksum = calculate_tcpudp_cksum(ip, udp, pkt->l3_len, IP_PROTOCOL_UDP); @@ -509,7 +509,7 @@ onvm_pkt_set_checksums(struct rte_mbuf* pkt) { } if (hw_cksum_support & SUPPORTS_IPV4_CHECKSUM_OFFLOAD) { - pkt->ol_flags |= PKT_TX_IP_CKSUM; + pkt->ol_flags |= RTE_MBUF_F_TX_IP_CKSUM; } else { /* software IP checksumming */ ip->hdr_checksum = calculate_ip_cksum(ip, pkt->l3_len); @@ -523,12 +523,12 @@ onvm_pkt_swap_ether_hdr(struct rte_ether_hdr* ether_hdr) { struct rte_ether_addr temp_ether_addr; for (i = 0; i < RTE_ETHER_ADDR_LEN; ++i) { - temp_ether_addr.addr_bytes[i] = ether_hdr->s_addr.addr_bytes[i]; - ether_hdr->s_addr.addr_bytes[i] = ether_hdr->d_addr.addr_bytes[i]; + temp_ether_addr.addr_bytes[i] = ether_hdr->src_addr.addr_bytes[i]; + ether_hdr->src_addr.addr_bytes[i] = ether_hdr->dst_addr.addr_bytes[i]; } for (i = 0; i < RTE_ETHER_ADDR_LEN; ++i) { - ether_hdr->d_addr.addr_bytes[i] = temp_ether_addr.addr_bytes[i]; + ether_hdr->dst_addr.addr_bytes[i] = temp_ether_addr.addr_bytes[i]; } return 0; @@ -574,7 +574,7 @@ onvm_pkt_generate_tcp(struct rte_mempool* pktmbuf_pool, struct rte_tcp_hdr* tcp_ return NULL; } - pkt->ol_flags = PKT_TX_IP_CKSUM | PKT_TX_IPV4 | PKT_TX_TCP_CKSUM; + pkt->ol_flags = RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_TCP_CKSUM; pkt->l2_len = sizeof(struct rte_ether_hdr); pkt->l3_len = sizeof(struct rte_ipv4_hdr); @@ -664,17 +664,17 @@ onvm_pkt_fill_ether(struct rte_ether_hdr* eth_hdr, int port, struct rte_ether_ad int i; /* Set ether header */ - rte_ether_addr_copy(&ports->mac[port], ð_hdr->s_addr); + rte_ether_addr_copy(&ports->mac[port], ð_hdr->src_addr); eth_hdr->ether_type = rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV4); for (i = 0; i < RTE_ETHER_ADDR_LEN; ++i) { - eth_hdr->d_addr.addr_bytes[i] = dst_mac_addr->addr_bytes[i]; + eth_hdr->dst_addr.addr_bytes[i] = dst_mac_addr->addr_bytes[i]; } return 0; } struct rte_mbuf* -onvm_pkt_generate_udp_sample(struct rte_mempool* pktmbuf_pool) { +onvm_pkt_generate_udp_sample(struct rte_mempool* pktmbuf_pool, int pkt_meta_offset) { struct onvm_pkt_meta* pmeta = NULL; struct rte_mbuf* pkt; struct rte_udp_hdr udp_hdr; @@ -694,7 +694,7 @@ onvm_pkt_generate_udp_sample(struct rte_mempool* pktmbuf_pool) { } /* Set packet dest */ - pmeta = onvm_get_pkt_meta(pkt); + pmeta = onvm_get_pkt_meta(pkt, pkt_meta_offset); pmeta->destination = SAMPLE_NIC_PORT; pmeta->action = ONVM_NF_ACTION_OUT; @@ -715,7 +715,7 @@ onvm_pkt_generate_udp(struct rte_mempool* pktmbuf_pool, struct rte_udp_hdr* udp_ return NULL; } - pkt->ol_flags = PKT_TX_IP_CKSUM | PKT_TX_IPV4 | PKT_TX_UDP_CKSUM; + pkt->ol_flags = RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_UDP_CKSUM; pkt->l2_len = sizeof(struct rte_ether_hdr); pkt->l3_len = sizeof(struct rte_ipv4_hdr); diff --git a/onvm/onvm_nflib/onvm_pkt_helper.h b/onvm/onvm_nflib/onvm_pkt_helper.h index de62defa6..af9168ae1 100644 --- a/onvm/onvm_nflib/onvm_pkt_helper.h +++ b/onvm/onvm_nflib/onvm_pkt_helper.h @@ -230,6 +230,6 @@ onvm_pkt_generate_udp(struct rte_mempool* pktmbuf_pool, struct rte_udp_hdr* udp_ * Generates a sample UDP packet */ struct rte_mbuf* -onvm_pkt_generate_udp_sample(struct rte_mempool* pktmbuf_pool); +onvm_pkt_generate_udp_sample(struct rte_mempool* pktmbuf_pool, int pkt_meta_offset); #endif // _ONVM_PKT_HELPER_H_" diff --git a/onvm/onvm_nflib/onvm_sc_mgr.h b/onvm/onvm_nflib/onvm_sc_mgr.h index 57d1a1380..9927726ca 100644 --- a/onvm/onvm_nflib/onvm_sc_mgr.h +++ b/onvm/onvm_nflib/onvm_sc_mgr.h @@ -53,8 +53,8 @@ onvm_next_action(struct onvm_service_chain* chain, uint16_t cur_nf) { } static inline uint8_t -onvm_sc_next_action(struct onvm_service_chain* chain, struct rte_mbuf* pkt) { - return onvm_next_action(chain, onvm_get_pkt_chain_index(pkt)); +onvm_sc_next_action(struct onvm_service_chain* chain, struct rte_mbuf* pkt, int pkt_meta_offset) { + return onvm_next_action(chain, onvm_get_pkt_chain_index(pkt, pkt_meta_offset)); } static inline uint16_t @@ -66,8 +66,8 @@ onvm_next_destination(struct onvm_service_chain* chain, uint16_t cur_nf) { } static inline uint16_t -onvm_sc_next_destination(struct onvm_service_chain* chain, struct rte_mbuf* pkt) { - return onvm_next_destination(chain, onvm_get_pkt_chain_index(pkt)); +onvm_sc_next_destination(struct onvm_service_chain* chain, struct rte_mbuf* pkt, int pkt_meta_offset) { + return onvm_next_destination(chain, onvm_get_pkt_chain_index(pkt, pkt_meta_offset)); } /*get service chain*/ From 2dc731aebc988fa9bb7b5c70961d966ccdac882d Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Tue, 23 Apr 2024 23:46:48 -0400 Subject: [PATCH 04/19] Update Meson files to build onvm_mgr --- meson.build | 9 ++++++++- onvm/meson.build | 1 + onvm/onvm_mgr/meson.build | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 onvm/onvm_mgr/meson.build diff --git a/meson.build b/meson.build index 174eb6392..b2f0feda9 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,14 @@ add_global_arguments('-msse4', language : 'c') cc = meson.get_compiler('c') onvm_source = meson.current_source_dir() -onvm_dpdk = subproject('dpdk', default_options: ['mssse3=true']) + +# DPDK dependency instantiation +onvm_dpdk = subproject('dpdk') onvm_dpdk_dep = onvm_dpdk.get_variable('dpdk_static_lib_deps') +# Header directories to search when building components +onvm_headers = include_directories('onvm/') +onvm_nflib_headers = include_directories('onvm/onvm_nflib/') + +# Builds meson.build files found within onvm/ subdir('onvm') diff --git a/onvm/meson.build b/onvm/meson.build index 681e10682..7626742af 100644 --- a/onvm/meson.build +++ b/onvm/meson.build @@ -1,2 +1,3 @@ subdir('lib') subdir('onvm_nflib') +subdir('onvm_mgr') \ No newline at end of file diff --git a/onvm/onvm_mgr/meson.build b/onvm/onvm_mgr/meson.build new file mode 100644 index 000000000..e2e396a5d --- /dev/null +++ b/onvm/onvm_mgr/meson.build @@ -0,0 +1,15 @@ +sources = files( + 'main.c', + 'onvm_init.c', + 'onvm_args.c', + 'onvm_stats.c', + 'onvm_pkt.c', + 'onvm_nf.c' +) + +onvm_mgr_app_name = 'onvm_mgr' + +executable(onvm_mgr_app_name, + sources, + include_directories: [include_directories('.'), onvm_headers, onvm_nflib_headers], + dependencies: [onvm_dpdk_dep, libonvmhelper_dep, libonvm_dep]) \ No newline at end of file From 8da80d278b40b08e38e102ccc6faabd71f9edde5 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Thu, 2 May 2024 13:49:36 -0400 Subject: [PATCH 05/19] Update onvm_mgr to support DPDK 24.03.0 --- meson.build | 5 +++++ onvm/lib/meson.build | 12 ++++++++---- onvm/onvm_mgr/meson.build | 13 ++++++++----- onvm/onvm_mgr/onvm_init.c | 22 ++++++++++------------ onvm/onvm_mgr/onvm_pkt.c | 10 +++++----- onvm/onvm_mgr/onvm_stats.c | 7 +++++++ onvm/onvm_mgr/onvm_stats.h | 14 ++++++++------ onvm/onvm_nflib/meson.build | 19 +++++++++++++++---- onvm/onvm_nflib/onvm_common.h | 3 +++ 9 files changed, 69 insertions(+), 36 deletions(-) diff --git a/meson.build b/meson.build index b2f0feda9..dc332167d 100644 --- a/meson.build +++ b/meson.build @@ -7,10 +7,15 @@ onvm_source = meson.current_source_dir() # DPDK dependency instantiation onvm_dpdk = subproject('dpdk') onvm_dpdk_dep = onvm_dpdk.get_variable('dpdk_static_lib_deps') +onvm_dpdk_shared_dep = onvm_dpdk.get_variable('dpdk_shared_lib_deps') + +# Other required dependencies +onvm_math_dep = cc.find_library('m') # Header directories to search when building components onvm_headers = include_directories('onvm/') onvm_nflib_headers = include_directories('onvm/onvm_nflib/') +onvm_lib_headers = include_directories('onvm/lib/') # Builds meson.build files found within onvm/ subdir('onvm') diff --git a/onvm/lib/meson.build b/onvm/lib/meson.build index cd9691ec5..0824cb8f5 100644 --- a/onvm/lib/meson.build +++ b/onvm/lib/meson.build @@ -2,9 +2,13 @@ sources = files('cJSON.c') libonvmhelper_includes = include_directories('.') -libonvmhelper = static_library('libonvmhelper', +libonvmhelper = library( + 'libonvmhelper', sources, - include_directories : libonvmhelper_includes) + include_directories : libonvmhelper_includes +) -libonvmhelper_dep = declare_dependency(link_with : libonvmhelper, - include_directories: libonvmhelper_includes) \ No newline at end of file +libonvmhelper_dep = declare_dependency( + link_with : libonvmhelper, + include_directories: libonvmhelper_includes +) \ No newline at end of file diff --git a/onvm/onvm_mgr/meson.build b/onvm/onvm_mgr/meson.build index e2e396a5d..f53774907 100644 --- a/onvm/onvm_mgr/meson.build +++ b/onvm/onvm_mgr/meson.build @@ -1,15 +1,18 @@ sources = files( 'main.c', - 'onvm_init.c', 'onvm_args.c', - 'onvm_stats.c', + 'onvm_init.c', + 'onvm_nf.c', 'onvm_pkt.c', - 'onvm_nf.c' + 'onvm_stats.c' ) onvm_mgr_app_name = 'onvm_mgr' +onvm_mgr_include = include_directories('.') + executable(onvm_mgr_app_name, sources, - include_directories: [include_directories('.'), onvm_headers, onvm_nflib_headers], - dependencies: [onvm_dpdk_dep, libonvmhelper_dep, libonvm_dep]) \ No newline at end of file + include_directories: [onvm_mgr_include, onvm_headers, onvm_nflib_headers], + dependencies: [onvm_dpdk_shared_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep], +) \ No newline at end of file diff --git a/onvm/onvm_mgr/onvm_init.c b/onvm/onvm_mgr/onvm_init.c index 3750a06bf..86d49eb2d 100644 --- a/onvm/onvm_mgr/onvm_init.c +++ b/onvm/onvm_mgr/onvm_init.c @@ -115,18 +115,17 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask); static const struct rte_eth_conf port_conf = { .rxmode = { - .mq_mode = ETH_MQ_RX_RSS, - .max_rx_pkt_len = RTE_ETHER_MAX_LEN, - .split_hdr_size = 0, - .offloads = DEV_RX_OFFLOAD_CHECKSUM, + .mq_mode = RTE_ETH_MQ_RX_RSS, + .mtu = RTE_ETHER_MAX_LEN, + .offloads = RTE_ETH_RX_OFFLOAD_CHECKSUM, }, .rx_adv_conf = { .rss_conf = { - .rss_key = rss_symmetric_key, .rss_hf = ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP | ETH_RSS_L2_PAYLOAD, + .rss_key = rss_symmetric_key, .rss_hf = RTE_ETH_RSS_IP | RTE_ETH_RSS_UDP | RTE_ETH_RSS_TCP | RTE_ETH_RSS_L2_PAYLOAD, }, }, - .txmode = {.mq_mode = ETH_MQ_TX_NONE, - .offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM)}, + .txmode = {.mq_mode = RTE_ETH_MQ_TX_NONE, + .offloads = (RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | RTE_ETH_TX_OFFLOAD_UDP_CKSUM | RTE_ETH_TX_OFFLOAD_TCP_CKSUM)}, }; /*********************************Interfaces**********************************/ @@ -373,8 +372,8 @@ init_port(uint8_t port_num) { /* Standard DPDK port initialisation - config port, then set up * rx and tx rings */ rte_eth_dev_info_get(port_num, &dev_info); - if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) - local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; + if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) + local_port_conf.txmode.offloads |= RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; 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( @@ -384,8 +383,7 @@ init_port(uint8_t port_num) { } if (ONVM_USE_JUMBO_FRAMES) { - local_port_conf.rxmode.max_rx_pkt_len = 9600 + RTE_ETHER_CRC_LEN + RTE_ETHER_HDR_LEN; - local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; + local_port_conf.rxmode.mtu = MAX_MTU; } if ((retval = rte_eth_dev_configure(port_num, rx_rings, tx_rings, &local_port_conf)) != 0) @@ -509,7 +507,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask) { "Port %d Link Up - speed %u " "Mbps - %s\n", ports->id[portid], (unsigned)link.link_speed, - (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") + (link.link_duplex == RTE_ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex\n")); else printf("Port %d Link Down\n", (uint8_t)ports->id[portid]); diff --git a/onvm/onvm_mgr/onvm_pkt.c b/onvm/onvm_mgr/onvm_pkt.c index 9e6076e87..96ba60376 100644 --- a/onvm/onvm_mgr/onvm_pkt.c +++ b/onvm/onvm_mgr/onvm_pkt.c @@ -67,19 +67,19 @@ onvm_pkt_process_rx_batch(struct queue_mgr *rx_mgr, struct rte_mbuf *pkts[], uin return; for (i = 0; i < rx_count; i++) { - meta = (struct onvm_pkt_meta *)&(((struct rte_mbuf *)pkts[i])->udata64); + meta = onvm_get_pkt_meta(pkts[i], onvm_config->dynfield_offset); meta->src = 0; meta->chain_index = 0; #ifdef FLOW_LOOKUP ret = onvm_flow_dir_get_pkt(pkts[i], &flow_entry); if (ret >= 0) { sc = flow_entry->sc; - meta->action = onvm_sc_next_action(sc, pkts[i]); - meta->destination = onvm_sc_next_destination(sc, pkts[i]); + meta->action = onvm_sc_next_action(sc, pkts[i], onvm_config->dynfield_offset); + meta->destination = onvm_sc_next_destination(sc, pkts[i], onvm_config->dynfield_offset); } else { #endif - meta->action = onvm_sc_next_action(default_chain, pkts[i]); - meta->destination = onvm_sc_next_destination(default_chain, pkts[i]); + meta->action = onvm_sc_next_action(default_chain, pkts[i], onvm_config->dynfield_offset); + meta->destination = onvm_sc_next_destination(default_chain, pkts[i], onvm_config->dynfield_offset); #ifdef FLOW_LOOKUP } #endif diff --git a/onvm/onvm_mgr/onvm_stats.c b/onvm/onvm_mgr/onvm_stats.c index 8d0863d55..325bf2acf 100644 --- a/onvm/onvm_mgr/onvm_stats.c +++ b/onvm/onvm_mgr/onvm_stats.c @@ -125,6 +125,13 @@ static FILE *json_events_out; /* Holds current timestamp, might want to make this not global */ char buffer[20]; +cJSON* onvm_json_root; +cJSON* onvm_json_port_stats_obj; +cJSON* onvm_json_nf_stats_obj; +cJSON* onvm_json_port_stats[RTE_MAX_ETHPORTS]; +cJSON* onvm_json_nf_stats[MAX_NFS]; +cJSON* onvm_json_events_arr; + /****************************Interfaces***************************************/ void diff --git a/onvm/onvm_mgr/onvm_stats.h b/onvm/onvm_mgr/onvm_stats.h index b6e337282..9c5ba1fff 100644 --- a/onvm/onvm_mgr/onvm_stats.h +++ b/onvm/onvm_mgr/onvm_stats.h @@ -138,12 +138,14 @@ struct onvm_event { void *data; }; -cJSON* onvm_json_root; -cJSON* onvm_json_port_stats_obj; -cJSON* onvm_json_nf_stats_obj; -cJSON* onvm_json_port_stats[RTE_MAX_ETHPORTS]; -cJSON* onvm_json_nf_stats[MAX_NFS]; -cJSON* onvm_json_events_arr; +/****************************Global variables***************************************/ + +extern cJSON* onvm_json_root; +extern cJSON* onvm_json_port_stats_obj; +extern cJSON* onvm_json_nf_stats_obj; +extern cJSON* onvm_json_port_stats[RTE_MAX_ETHPORTS]; +extern cJSON* onvm_json_nf_stats[MAX_NFS]; +extern cJSON* onvm_json_events_arr; /*********************************Interfaces**********************************/ diff --git a/onvm/onvm_nflib/meson.build b/onvm/onvm_nflib/meson.build index 4f3c37bc1..e58235415 100644 --- a/onvm/onvm_nflib/meson.build +++ b/onvm/onvm_nflib/meson.build @@ -10,8 +10,19 @@ sources = files( 'onvm_threading.c' ) -libonvm = static_library('libonvm', +libonvm_includes = include_directories('.') + +libonvm_deps = [ + onvm_dpdk_shared_dep, + libonvmhelper_dep +] + +libonvm = library( + 'libonvm', sources, - include_directories : include_directories('.'), - dependencies : [onvm_dpdk_dep, libonvmhelper_dep]) -libonvm_dep = declare_dependency(link_with: libonvm) \ No newline at end of file + include_directories : libonvm_includes, + dependencies : libonvm_deps) + +libonvm_dep = declare_dependency( + link_with: libonvm, + dependencies: libonvm_deps) \ No newline at end of file diff --git a/onvm/onvm_nflib/onvm_common.h b/onvm/onvm_nflib/onvm_common.h index 2867579c1..7245e9401 100755 --- a/onvm/onvm_nflib/onvm_common.h +++ b/onvm/onvm_nflib/onvm_common.h @@ -59,6 +59,9 @@ #include "onvm_config_common.h" #include "onvm_msg_common.h" +#define JUMBO_FRAME_MAX_SIZE 0x2600 +#define MAX_MTU (JUMBO_FRAME_MAX_SIZE - (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN)) + #define ONVM_NF_HANDLE_TX 1 // should be true if NFs primarily pass packets to each other #define ONVM_NF_SHUTDOWN_CORE_REASSIGNMENT 0 // should be true if on NF shutdown onvm_mgr tries to reallocate cores From 35871bdae50fe381414782e54459c5ea86f1dd61 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Fri, 10 May 2024 23:06:00 -0400 Subject: [PATCH 06/19] Update example apps to DPDK 24 and meson --- examples/aes_decrypt/meson.build | 4 +++ examples/aes_encrypt/meson.build | 4 +++ examples/arp_response/arp_response.c | 8 ++--- examples/arp_response/meson.build | 3 ++ examples/basic_monitor/meson.build | 3 ++ examples/bridge/meson.build | 3 ++ examples/fair_queue/fair_queue.c | 4 +-- examples/fair_queue/meson.build | 3 ++ examples/firewall/meson.build | 3 ++ examples/flow_table/meson.build | 6 ++++ examples/flow_tracker/meson.build | 3 ++ examples/l2fwd/l2fwd.c | 16 ++++----- examples/l2fwd/meson.build | 3 ++ examples/l3fwd/l3fwd.c | 4 +-- examples/l3fwd/meson.build | 5 +++ examples/load_balancer/load_balancer.c | 10 +++--- examples/load_balancer/meson.build | 3 ++ examples/load_generator/load_generator.c | 8 ++--- examples/load_generator/meson.build | 3 ++ examples/meson.build | 42 ++++++++++++++++++++++++ examples/nf_router/meson.build | 3 ++ examples/payload_scan/meson.build | 3 ++ examples/scaling_example/meson.build | 3 ++ examples/scaling_example/scaling.c | 12 +++---- examples/simple_forward/meson.build | 3 ++ examples/simple_fwd_tb/forward_tb.c | 4 +-- examples/simple_fwd_tb/meson.build | 3 ++ examples/skeleton/meson.build | 3 ++ examples/speed_tester/meson.build | 3 ++ examples/speed_tester/speed_tester.c | 8 ++--- examples/test_flow_dir/meson.build | 3 ++ examples/test_messaging/meson.build | 3 ++ meson.build | 18 ++++++---- onvm/onvm_mgr/meson.build | 2 +- onvm/onvm_nflib/meson.build | 4 ++- onvm/onvm_nflib/onvm_common.h | 3 ++ 36 files changed, 170 insertions(+), 46 deletions(-) create mode 100644 examples/aes_decrypt/meson.build create mode 100644 examples/aes_encrypt/meson.build create mode 100644 examples/arp_response/meson.build create mode 100644 examples/basic_monitor/meson.build create mode 100644 examples/bridge/meson.build create mode 100644 examples/fair_queue/meson.build create mode 100644 examples/firewall/meson.build create mode 100644 examples/flow_table/meson.build create mode 100644 examples/flow_tracker/meson.build create mode 100644 examples/l2fwd/meson.build create mode 100644 examples/l3fwd/meson.build create mode 100644 examples/load_balancer/meson.build create mode 100644 examples/load_generator/meson.build create mode 100644 examples/meson.build create mode 100644 examples/nf_router/meson.build create mode 100644 examples/payload_scan/meson.build create mode 100644 examples/scaling_example/meson.build create mode 100644 examples/simple_forward/meson.build create mode 100644 examples/simple_fwd_tb/meson.build create mode 100644 examples/skeleton/meson.build create mode 100644 examples/speed_tester/meson.build create mode 100644 examples/test_flow_dir/meson.build create mode 100644 examples/test_messaging/meson.build diff --git a/examples/aes_decrypt/meson.build b/examples/aes_decrypt/meson.build new file mode 100644 index 000000000..0033f3ed6 --- /dev/null +++ b/examples/aes_decrypt/meson.build @@ -0,0 +1,4 @@ +sources = files( + 'aes.c', + 'aesdecrypt.c' +) \ No newline at end of file diff --git a/examples/aes_encrypt/meson.build b/examples/aes_encrypt/meson.build new file mode 100644 index 000000000..220536ac4 --- /dev/null +++ b/examples/aes_encrypt/meson.build @@ -0,0 +1,4 @@ +sources = files( + 'aes.c', + 'aesencrypt.c' +) \ No newline at end of file diff --git a/examples/arp_response/arp_response.c b/examples/arp_response/arp_response.c index 6b23a0009..c083df871 100644 --- a/examples/arp_response/arp_response.c +++ b/examples/arp_response/arp_response.c @@ -235,9 +235,9 @@ send_arp_reply(int port, struct rte_ether_addr *tha, uint32_t tip, struct onvm_n // SET ETHER HEADER INFO eth_hdr = onvm_pkt_ether_hdr(out_pkt); - rte_ether_addr_copy(&ports->mac[port], ð_hdr->s_addr); + rte_ether_addr_copy(&ports->mac[port], ð_hdr->src_addr); eth_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_ARP); - rte_ether_addr_copy(tha, ð_hdr->d_addr); + rte_ether_addr_copy(tha, ð_hdr->dst_addr); // SET ARP HDR INFO out_arp_hdr = rte_pktmbuf_mtod_offset(out_pkt, struct rte_arp_hdr *, sizeof(struct rte_ether_hdr)); @@ -255,7 +255,7 @@ send_arp_reply(int port, struct rte_ether_addr *tha, uint32_t tip, struct onvm_n rte_ether_addr_copy(tha, &out_arp_hdr->arp_data.arp_tha); // SEND PACKET OUT/SET METAINFO - pmeta = onvm_get_pkt_meta(out_pkt); + pmeta = onvm_get_pkt_meta(out_pkt, nf->dynfield_offset); pmeta->destination = port; pmeta->action = ONVM_NF_ACTION_OUT; @@ -282,7 +282,7 @@ packet_handler(struct rte_mbuf *pkt, struct onvm_pkt_meta *meta, case RTE_ARP_OP_REQUEST: if (rte_be_to_cpu_32(in_arp_hdr->arp_data.arp_tip) == state_info->source_ips[ports->id[pkt->port]]) { - result = send_arp_reply(pkt->port, ð_hdr->s_addr, + result = send_arp_reply(pkt->port, ð_hdr->src_addr, in_arp_hdr->arp_data.arp_sip, nf_local_ctx->nf); if (state_info->print_flag) { printf("ARP Reply From Port %d (ID %d): %d\n", pkt->port, diff --git a/examples/arp_response/meson.build b/examples/arp_response/meson.build new file mode 100644 index 000000000..69c10224d --- /dev/null +++ b/examples/arp_response/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'arp_response.c' +) \ No newline at end of file diff --git a/examples/basic_monitor/meson.build b/examples/basic_monitor/meson.build new file mode 100644 index 000000000..0b72baff0 --- /dev/null +++ b/examples/basic_monitor/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'monitor.c' +) \ No newline at end of file diff --git a/examples/bridge/meson.build b/examples/bridge/meson.build new file mode 100644 index 000000000..4057708fb --- /dev/null +++ b/examples/bridge/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'bridge.c' +) \ No newline at end of file diff --git a/examples/fair_queue/fair_queue.c b/examples/fair_queue/fair_queue.c index 4803caab9..50323a060 100644 --- a/examples/fair_queue/fair_queue.c +++ b/examples/fair_queue/fair_queue.c @@ -268,7 +268,7 @@ tx_loop(struct onvm_nf_local_ctx *nf_local_ctx) { continue; } - meta = onvm_get_pkt_meta((struct rte_mbuf *)pkt); + meta = onvm_get_pkt_meta((struct rte_mbuf *)pkt, nf_local_ctx->nf->dynfield_offset); meta->action = ONVM_NF_ACTION_TONF; meta->destination = destination; pktsTX[tx_batch_size++] = pkt; @@ -327,7 +327,7 @@ rx_loop(struct onvm_nf_local_ctx *nf_local_ctx) { for (i = 0; i < nb_pkts; i++) { if (fairqueue_enqueue(fair_queue, pkts[i]) == -1) { - meta = onvm_get_pkt_meta((struct rte_mbuf *)pkts[i]); + meta = onvm_get_pkt_meta((struct rte_mbuf *)pkts[i], nf_local_ctx->nf->dynfield_offset); meta->action = ONVM_NF_ACTION_DROP; meta->destination = destination; pktsDrop[tx_batch_size++] = pkts[i]; diff --git a/examples/fair_queue/meson.build b/examples/fair_queue/meson.build new file mode 100644 index 000000000..59b5c51e1 --- /dev/null +++ b/examples/fair_queue/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'fair_queue.c' +) \ No newline at end of file diff --git a/examples/firewall/meson.build b/examples/firewall/meson.build new file mode 100644 index 000000000..d596df23e --- /dev/null +++ b/examples/firewall/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'firewall.c' +) \ No newline at end of file diff --git a/examples/flow_table/meson.build b/examples/flow_table/meson.build new file mode 100644 index 000000000..2d7bf8311 --- /dev/null +++ b/examples/flow_table/meson.build @@ -0,0 +1,6 @@ +sources = files( + 'flow_table.c', + 'msgbuf.c', + 'sdn.c', + 'setupconn.c' +) \ No newline at end of file diff --git a/examples/flow_tracker/meson.build b/examples/flow_tracker/meson.build new file mode 100644 index 000000000..3a52e57ed --- /dev/null +++ b/examples/flow_tracker/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'flow_tracker.c' +) \ No newline at end of file diff --git a/examples/l2fwd/l2fwd.c b/examples/l2fwd/l2fwd.c index 4cf3c8280..c648086bc 100755 --- a/examples/l2fwd/l2fwd.c +++ b/examples/l2fwd/l2fwd.c @@ -209,18 +209,18 @@ l2fwd_mac_updating(struct rte_mbuf *pkt, unsigned dest_portid, struct state_info eth = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ - tmp = ð->d_addr.addr_bytes[0]; + tmp = ð->dst_addr.addr_bytes[0]; *((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40); - rte_ether_addr_copy(tmp, ð->s_addr); + rte_ether_addr_copy(tmp, ð->src_addr); if (stats->print_mac) { printf("Packet updated MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - eth->s_addr.addr_bytes[0], - eth->s_addr.addr_bytes[1], - eth->s_addr.addr_bytes[2], - eth->s_addr.addr_bytes[3], - eth->s_addr.addr_bytes[4], - eth->s_addr.addr_bytes[5]); + eth->src_addr.addr_bytes[0], + eth->src_addr.addr_bytes[1], + eth->src_addr.addr_bytes[2], + eth->src_addr.addr_bytes[3], + eth->src_addr.addr_bytes[4], + eth->src_addr.addr_bytes[5]); } } diff --git a/examples/l2fwd/meson.build b/examples/l2fwd/meson.build new file mode 100644 index 000000000..4ebb166db --- /dev/null +++ b/examples/l2fwd/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'l2fwd.c' +) \ No newline at end of file diff --git a/examples/l3fwd/l3fwd.c b/examples/l3fwd/l3fwd.c index 3cf6a92b3..fe72dba9f 100755 --- a/examples/l3fwd/l3fwd.c +++ b/examples/l3fwd/l3fwd.c @@ -196,10 +196,10 @@ packet_handler(struct rte_mbuf *pkt, struct onvm_pkt_meta *meta, ++(ipv4_hdr->hdr_checksum); #endif /* dst addr */ - *(uint64_t *)ð_hdr->d_addr = stats->dest_eth_addr[dst_port]; + *(uint64_t *)ð_hdr->dst_addr = stats->dest_eth_addr[dst_port]; /* src addr */ - rte_ether_addr_copy(&stats->ports_eth_addr[dst_port], ð_hdr->s_addr); + rte_ether_addr_copy(&stats->ports_eth_addr[dst_port], ð_hdr->src_addr); meta->destination = dst_port; stats->port_statistics[dst_port]++; diff --git a/examples/l3fwd/meson.build b/examples/l3fwd/meson.build new file mode 100644 index 000000000..1c8bedf00 --- /dev/null +++ b/examples/l3fwd/meson.build @@ -0,0 +1,5 @@ +sources = files( + 'l3fwd_em.c', + 'l3fwd_lpm.c', + 'l3fwd.c' +) \ No newline at end of file diff --git a/examples/load_balancer/load_balancer.c b/examples/load_balancer/load_balancer.c index f8611879f..401b32ede 100644 --- a/examples/load_balancer/load_balancer.c +++ b/examples/load_balancer/load_balancer.c @@ -599,26 +599,26 @@ packet_handler(struct rte_mbuf *pkt, struct onvm_pkt_meta *meta, if (flow_info->is_active == 0) { flow_info->is_active = 1; for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) { - flow_info->s_addr_bytes[i] = ehdr->s_addr.addr_bytes[i]; + flow_info->s_addr_bytes[i] = ehdr->src_addr.addr_bytes[i]; } } if (pkt->port == lb->server_port) { - if (onvm_get_macaddr(lb->client_port, &ehdr->s_addr) == -1) { + if (onvm_get_macaddr(lb->client_port, &ehdr->src_addr) == -1) { rte_exit(EXIT_FAILURE, "Failed to obtain MAC address\n"); } for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) { - ehdr->d_addr.addr_bytes[i] = flow_info->s_addr_bytes[i]; + ehdr->dst_addr.addr_bytes[i] = flow_info->s_addr_bytes[i]; } ip->src_addr = lb->ip_lb_client; meta->destination = lb->client_port; } else { - if (onvm_get_macaddr(lb->server_port, &ehdr->s_addr) == -1) { + if (onvm_get_macaddr(lb->server_port, &ehdr->src_addr) == -1) { rte_exit(EXIT_FAILURE, "Failed to obtain MAC address\n"); } for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) { - ehdr->d_addr.addr_bytes[i] = lb->server[flow_info->dest].d_addr_bytes[i]; + ehdr->dst_addr.addr_bytes[i] = lb->server[flow_info->dest].d_addr_bytes[i]; } ip->dst_addr = rte_cpu_to_be_32(lb->server[flow_info->dest].d_ip); diff --git a/examples/load_balancer/meson.build b/examples/load_balancer/meson.build new file mode 100644 index 000000000..a114c76a9 --- /dev/null +++ b/examples/load_balancer/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'load_balancer.c' +) \ No newline at end of file diff --git a/examples/load_generator/load_generator.c b/examples/load_generator/load_generator.c index a662a0463..39bc26ac5 100644 --- a/examples/load_generator/load_generator.c +++ b/examples/load_generator/load_generator.c @@ -274,7 +274,7 @@ callback_handler(__attribute__((unused)) struct onvm_nf_local_ctx *nf_local_ctx) pkt_ehdr = (struct rte_ether_hdr *)rte_pktmbuf_append(pkt, packet_size); rte_memcpy(pkt_ehdr, ehdr, sizeof(struct rte_ether_hdr)); - struct onvm_pkt_meta *pmeta = onvm_get_pkt_meta(pkt); + struct onvm_pkt_meta *pmeta = onvm_get_pkt_meta(pkt, nf_local_ctx->nf->dynfield_offset); pmeta->destination = destination; pmeta->flags |= ONVM_SET_BIT(0, LOAD_GEN_BIT); if (action_out) { @@ -327,12 +327,12 @@ nf_setup(struct onvm_nf_local_ctx *nf_local_ctx) { rte_exit(EXIT_FAILURE, "Failed to allocate common ehdr\n"); } - if (onvm_get_macaddr(0, &ehdr->s_addr) == -1) { + if (onvm_get_macaddr(0, &ehdr->src_addr) == -1) { RTE_LOG(INFO, APP, "Using fake MAC address\n"); - onvm_get_fake_macaddr(&ehdr->s_addr); + onvm_get_fake_macaddr(&ehdr->src_addr); } for (j = 0; j < RTE_ETHER_ADDR_LEN; ++j) { - ehdr->d_addr.addr_bytes[j] = d_addr_bytes[j]; + ehdr->dst_addr.addr_bytes[j] = d_addr_bytes[j]; } ehdr->ether_type = rte_cpu_to_be_16(LOCAL_EXPERIMENTAL_ETHER); } diff --git a/examples/load_generator/meson.build b/examples/load_generator/meson.build new file mode 100644 index 000000000..54802a796 --- /dev/null +++ b/examples/load_generator/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'load_generator.c' +) \ No newline at end of file diff --git a/examples/meson.build b/examples/meson.build new file mode 100644 index 000000000..aa664a1cf --- /dev/null +++ b/examples/meson.build @@ -0,0 +1,42 @@ +# List of all the onvm example apps +onvm_examples = [ + 'aes_decrypt', + 'aes_encrypt', + 'arp_response', + 'basic_monitor', + 'bridge', + 'fair_queue', + 'firewall', + # 'flow_table', + 'flow_tracker', + 'l2fwd', + 'l3fwd', + 'load_balancer', + 'load_generator', + # 'ndpi_stats', + 'nf_router', + # 'NFD', + 'payload_scan', + 'scaling_example', + 'simple_forward', + 'simple_fwd_tb', + 'skeleton', + 'speed_tester', + 'test_flow_dir', + 'test_messaging' +] + +foreach example : onvm_examples + name = example + sources = [] + includes = [include_directories(example), onvm_includes] + + subdir(example) + + executable( + 'onvm' + name, + sources, + include_directories: includes, + dependencies: [onvm_dpdk_shared_dep, onvm_nflib_dep], + ) +endforeach diff --git a/examples/nf_router/meson.build b/examples/nf_router/meson.build new file mode 100644 index 000000000..8b005c2e8 --- /dev/null +++ b/examples/nf_router/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'nf_router.c' +) \ No newline at end of file diff --git a/examples/payload_scan/meson.build b/examples/payload_scan/meson.build new file mode 100644 index 000000000..8be5be4c4 --- /dev/null +++ b/examples/payload_scan/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'payload_scan.c' +) \ No newline at end of file diff --git a/examples/scaling_example/meson.build b/examples/scaling_example/meson.build new file mode 100644 index 000000000..8da0def45 --- /dev/null +++ b/examples/scaling_example/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'scaling.c' +) \ No newline at end of file diff --git a/examples/scaling_example/scaling.c b/examples/scaling_example/scaling.c index a30c8769d..5887ba583 100644 --- a/examples/scaling_example/scaling.c +++ b/examples/scaling_example/scaling.c @@ -184,15 +184,15 @@ nf_setup(__attribute__((unused)) struct onvm_nf_local_ctx *nf_local_ctx) { ehdr = (struct rte_ether_hdr *)rte_pktmbuf_append(pkt, packet_size); /* Using manager mac addr for source*/ - if (onvm_get_macaddr(0, &ehdr->s_addr) == -1) { - onvm_get_fake_macaddr(&ehdr->s_addr); + if (onvm_get_macaddr(0, &ehdr->src_addr) == -1) { + onvm_get_fake_macaddr(&ehdr->src_addr); } for (j = 0; j < RTE_ETHER_ADDR_LEN; ++j) { - ehdr->d_addr.addr_bytes[j] = d_addr_bytes[j]; + ehdr->dst_addr.addr_bytes[j] = d_addr_bytes[j]; } ehdr->ether_type = LOCAL_EXPERIMENTAL_ETHER; - pmeta = onvm_get_pkt_meta(pkt); + pmeta = onvm_get_pkt_meta(pkt, nf_local_ctx->nf->dynfield_offset); pmeta->destination = destination; pmeta->action = ONVM_NF_ACTION_TONF; pkt->hash.rss = i; @@ -367,12 +367,12 @@ thread_main_loop(struct onvm_nf_local_ctx *nf_local_ctx) { } /* Process all the packets */ for (i = 0; i < nb_pkts; i++) { - meta = onvm_get_pkt_meta((struct rte_mbuf *)pkts[i]); + meta = onvm_get_pkt_meta((struct rte_mbuf *)pkts[i], nf->dynfield_offset); packet_handler_fwd((struct rte_mbuf *)pkts[i], meta, nf_local_ctx); pktsTX[tx_batch_size++] = pkts[i]; } /* Process all packet actions */ - onvm_pkt_process_tx_batch(nf->nf_tx_mgr, pktsTX, tx_batch_size, nf); + onvm_pkt_process_tx_batch(nf->nf_tx_mgr, pktsTX, nf->dynfield_offset, tx_batch_size, nf); if (tx_batch_size < PACKET_READ_SIZE) { onvm_pkt_flush_all_nfs(nf->nf_tx_mgr, nf); } diff --git a/examples/simple_forward/meson.build b/examples/simple_forward/meson.build new file mode 100644 index 000000000..e66c8302d --- /dev/null +++ b/examples/simple_forward/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'forward.c' +) \ No newline at end of file diff --git a/examples/simple_fwd_tb/forward_tb.c b/examples/simple_fwd_tb/forward_tb.c index ed353ca20..1abd0798b 100644 --- a/examples/simple_fwd_tb/forward_tb.c +++ b/examples/simple_fwd_tb/forward_tb.c @@ -310,12 +310,12 @@ thread_main_loop(struct onvm_nf_local_ctx *nf_local_ctx) { /* Process all the dequeued packets */ for (i = 0; i < nb_pkts; i++) { - meta = onvm_get_pkt_meta((struct rte_mbuf *)pkts[i]); + meta = onvm_get_pkt_meta((struct rte_mbuf *)pkts[i], nf->dynfield_offset); packet_handler_tb((struct rte_mbuf *)pkts[i], meta, nf_local_ctx); pktsTX[tx_batch_size++] = pkts[i]; } - onvm_pkt_process_tx_batch(nf->nf_tx_mgr, pktsTX, tx_batch_size, nf); + onvm_pkt_process_tx_batch(nf->nf_tx_mgr, pktsTX, nf->dynfield_offset, tx_batch_size, nf); if (tx_batch_size < PACKET_READ_SIZE) { onvm_pkt_flush_all_nfs(nf->nf_tx_mgr, nf); } diff --git a/examples/simple_fwd_tb/meson.build b/examples/simple_fwd_tb/meson.build new file mode 100644 index 000000000..504a7a01c --- /dev/null +++ b/examples/simple_fwd_tb/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'forward_tb.c' +) \ No newline at end of file diff --git a/examples/skeleton/meson.build b/examples/skeleton/meson.build new file mode 100644 index 000000000..185d428b6 --- /dev/null +++ b/examples/skeleton/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'skeleton.c' +) \ No newline at end of file diff --git a/examples/speed_tester/meson.build b/examples/speed_tester/meson.build new file mode 100644 index 000000000..bd39a56c4 --- /dev/null +++ b/examples/speed_tester/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'speed_tester.c' +) \ No newline at end of file diff --git a/examples/speed_tester/speed_tester.c b/examples/speed_tester/speed_tester.c index 361d3d23c..816cd8656 100644 --- a/examples/speed_tester/speed_tester.c +++ b/examples/speed_tester/speed_tester.c @@ -393,16 +393,16 @@ nf_setup(struct onvm_nf_local_ctx *nf_local_ctx) { /*using manager mac addr for source *using input string for dest addr */ - if (onvm_get_macaddr(0, &ehdr->s_addr) == -1) { + if (onvm_get_macaddr(0, &ehdr->src_addr) == -1) { RTE_LOG(INFO, APP, "Using fake MAC address\n"); - onvm_get_fake_macaddr(&ehdr->s_addr); + onvm_get_fake_macaddr(&ehdr->src_addr); } for (j = 0; j < RTE_ETHER_ADDR_LEN; ++j) { - ehdr->d_addr.addr_bytes[j] = d_addr_bytes[j]; + ehdr->dst_addr.addr_bytes[j] = d_addr_bytes[j]; } ehdr->ether_type = LOCAL_EXPERIMENTAL_ETHER; - pmeta = onvm_get_pkt_meta(pkt); + pmeta = onvm_get_pkt_meta(pkt, nf_local_ctx->nf->dynfield_offset); pmeta->destination = destination; pmeta->action = ONVM_NF_ACTION_TONF; pmeta->flags = ONVM_SET_BIT(0, SPEED_TESTER_BIT); diff --git a/examples/test_flow_dir/meson.build b/examples/test_flow_dir/meson.build new file mode 100644 index 000000000..aa22362a1 --- /dev/null +++ b/examples/test_flow_dir/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'test_flow_dir.c' +) \ No newline at end of file diff --git a/examples/test_messaging/meson.build b/examples/test_messaging/meson.build new file mode 100644 index 000000000..846b353fb --- /dev/null +++ b/examples/test_messaging/meson.build @@ -0,0 +1,3 @@ +sources = files( + 'test_messaging.c' +) \ No newline at end of file diff --git a/meson.build b/meson.build index dc332167d..d4a987f48 100644 --- a/meson.build +++ b/meson.build @@ -4,18 +4,22 @@ add_global_arguments('-msse4', language : 'c') cc = meson.get_compiler('c') onvm_source = meson.current_source_dir() -# DPDK dependency instantiation +# DPDK dependencies onvm_dpdk = subproject('dpdk') onvm_dpdk_dep = onvm_dpdk.get_variable('dpdk_static_lib_deps') onvm_dpdk_shared_dep = onvm_dpdk.get_variable('dpdk_shared_lib_deps') -# Other required dependencies +# ONVM dependencies +onvm_nflib_dep = [] onvm_math_dep = cc.find_library('m') -# Header directories to search when building components -onvm_headers = include_directories('onvm/') -onvm_nflib_headers = include_directories('onvm/onvm_nflib/') -onvm_lib_headers = include_directories('onvm/lib/') +# Include directories to be used when building components and examples +onvm_includes = include_directories('onvm/', + 'onvm/onvm_nflib', + 'onvm/onvm_mgr') -# Builds meson.build files found within onvm/ +# Build the ONVM components (onvm_mgr, nflib, lib) subdir('onvm') + +# Build the ONVM example apps +subdir('examples') \ No newline at end of file diff --git a/onvm/onvm_mgr/meson.build b/onvm/onvm_mgr/meson.build index f53774907..16a8d7c60 100644 --- a/onvm/onvm_mgr/meson.build +++ b/onvm/onvm_mgr/meson.build @@ -13,6 +13,6 @@ onvm_mgr_include = include_directories('.') executable(onvm_mgr_app_name, sources, - include_directories: [onvm_mgr_include, onvm_headers, onvm_nflib_headers], + include_directories: [onvm_mgr_include, onvm_includes], dependencies: [onvm_dpdk_shared_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep], ) \ No newline at end of file diff --git a/onvm/onvm_nflib/meson.build b/onvm/onvm_nflib/meson.build index e58235415..ac96a7f7b 100644 --- a/onvm/onvm_nflib/meson.build +++ b/onvm/onvm_nflib/meson.build @@ -25,4 +25,6 @@ libonvm = library( libonvm_dep = declare_dependency( link_with: libonvm, - dependencies: libonvm_deps) \ No newline at end of file + dependencies: libonvm_deps) + +onvm_nflib_dep += libonvm_dep \ No newline at end of file diff --git a/onvm/onvm_nflib/onvm_common.h b/onvm/onvm_nflib/onvm_common.h index 7245e9401..b50aecd96 100755 --- a/onvm/onvm_nflib/onvm_common.h +++ b/onvm/onvm_nflib/onvm_common.h @@ -328,6 +328,9 @@ struct onvm_nf { /* Mutex for NF sem_wait */ sem_t *nf_mutex; } shared_core; + + /** Used by RTE_MBUF_DYNFIELD to access ovnm pkt meta*/ + int dynfield_offset; }; /* From dd5bd480dbad29a30849f5e7e6bc9ddddc5be87a Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Fri, 10 May 2024 23:16:12 -0400 Subject: [PATCH 07/19] Delete old makefiles --- Makefile | 55 ---------------------- examples/Makefile | 64 -------------------------- examples/aes_decrypt/Makefile | 69 ---------------------------- examples/aes_encrypt/Makefile | 69 ---------------------------- examples/arp_response/Makefile | 62 ------------------------- examples/basic_monitor/Makefile | 62 ------------------------- examples/bridge/Makefile | 67 --------------------------- examples/fair_queue/Makefile | 68 --------------------------- examples/firewall/Makefile | 62 ------------------------- examples/flow_table/Makefile | 68 --------------------------- examples/flow_tracker/Makefile | 60 ------------------------ examples/l2fwd/Makefile | 62 ------------------------- examples/l3fwd/Makefile | 62 ------------------------- examples/load_balancer/Makefile | 69 ---------------------------- examples/load_generator/Makefile | 62 ------------------------- examples/nf_router/Makefile | 68 --------------------------- examples/payload_scan/Makefile | 62 ------------------------- examples/scaling_example/Makefile | 68 --------------------------- examples/simple_forward/Makefile | 68 --------------------------- examples/simple_fwd_tb/Makefile | 68 --------------------------- examples/skeleton/Makefile | 67 --------------------------- examples/speed_tester/Makefile | 76 ------------------------------- examples/test_flow_dir/Makefile | 68 --------------------------- examples/test_messaging/Makefile | 67 --------------------------- onvm/Makefile | 52 --------------------- onvm/lib/Makefile | 56 ----------------------- onvm/onvm_mgr/Makefile | 76 ------------------------------- onvm/onvm_nflib/Makefile | 61 ------------------------- 28 files changed, 1818 deletions(-) delete mode 100644 Makefile delete mode 100644 examples/Makefile delete mode 100644 examples/aes_decrypt/Makefile delete mode 100644 examples/aes_encrypt/Makefile delete mode 100644 examples/arp_response/Makefile delete mode 100644 examples/basic_monitor/Makefile delete mode 100644 examples/bridge/Makefile delete mode 100644 examples/fair_queue/Makefile delete mode 100755 examples/firewall/Makefile delete mode 100644 examples/flow_table/Makefile delete mode 100644 examples/flow_tracker/Makefile delete mode 100755 examples/l2fwd/Makefile delete mode 100755 examples/l3fwd/Makefile delete mode 100644 examples/load_balancer/Makefile delete mode 100644 examples/load_generator/Makefile delete mode 100644 examples/nf_router/Makefile delete mode 100644 examples/payload_scan/Makefile delete mode 100644 examples/scaling_example/Makefile delete mode 100644 examples/simple_forward/Makefile delete mode 100644 examples/simple_fwd_tb/Makefile delete mode 100644 examples/skeleton/Makefile delete mode 100644 examples/speed_tester/Makefile delete mode 100644 examples/test_flow_dir/Makefile delete mode 100644 examples/test_messaging/Makefile delete mode 100644 onvm/Makefile delete mode 100644 onvm/lib/Makefile delete mode 100644 onvm/onvm_mgr/Makefile delete mode 100644 onvm/onvm_nflib/Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 2ba3d95ac..000000000 --- a/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# 2016-2017 Hewlett Packard Enterprise Development LP -# 2010-2014 Intel Corporation. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(ONVM_HOME),) -$(error "Please define ONVM_HOME environment variable") -endif - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -all: - # cd $(ONVM_HOME)/dpdk && make - cd $(ONVM_HOME)/onvm && make - cd $(ONVM_HOME)/examples && make - -.PHONY: tags - -tags: - ctags -R . diff --git a/examples/Makefile b/examples/Makefile deleted file mode 100644 index e064ccd51..000000000 --- a/examples/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# 2016-2017 Hewlett Packard Enterprise Development LP -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -# To add new examples, append the directory name to this variable - -examples = bridge basic_monitor simple_forward speed_tester flow_table test_flow_dir aes_encrypt aes_decrypt flow_tracker load_balancer arp_response nf_router scaling_example load_generator payload_scan firewall simple_fwd_tb l2fwd test_messaging l3fwd fair_queue skeleton - - -ifeq ($(NDPI_HOME),) -$(warning "Skipping ndpi_stats NF as NDPI_HOME is not set") -else -examples +=ndpi_stats -endif - -clean_examples=$(addprefix clean_,$(examples)) - -.PHONY: $(examples) $(clean_examples) - -all : $(examples) -clean: $(clean_examples) - -$(examples): - cd $@ && $(MAKE) - -$(clean_examples): - cd $(patsubst clean_%,%,$@) && $(MAKE) clean diff --git a/examples/aes_decrypt/Makefile b/examples/aes_decrypt/Makefile deleted file mode 100644 index 01670a76a..000000000 --- a/examples/aes_decrypt/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# 2016-2017 Hewlett Packard Enterprise Development LP -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = aes_decrypt - -# all source are stored in SRCS-y -SRCS-y := aesdecrypt.c aes.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/aes_encrypt/Makefile b/examples/aes_encrypt/Makefile deleted file mode 100644 index 0ad2e8310..000000000 --- a/examples/aes_encrypt/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# 2016-2017 Hewlett Packard Enterprise Development LP -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = aes_encrypt - -# all source are stored in SRCS-y -SRCS-y := aesencrypt.c aes.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/arp_response/Makefile b/examples/arp_response/Makefile deleted file mode 100644 index 9ebdda51a..000000000 --- a/examples/arp_response/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= $(RTE_TARGET) - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = arp_response - -# all source are stored in SRCS-y -SRCS-y := arp_response.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/basic_monitor/Makefile b/examples/basic_monitor/Makefile deleted file mode 100644 index aff1328c3..000000000 --- a/examples/basic_monitor/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= $(RTE_TARGET) - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = basic_monitor - -# all source are stored in SRCS-y -SRCS-y := monitor.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 -g - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/bridge/Makefile b/examples/bridge/Makefile deleted file mode 100644 index 9ed3370af..000000000 --- a/examples/bridge/Makefile +++ /dev/null @@ -1,67 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# binary name -APP = bridge - -# all source are stored in SRCS-y -SRCS-y := bridge.c - -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/fair_queue/Makefile b/examples/fair_queue/Makefile deleted file mode 100644 index da97b989e..000000000 --- a/examples/fair_queue/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = fair_queue - -# all source are stored in SRCS-y -SRCS-y := fair_queue.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/firewall/Makefile b/examples/firewall/Makefile deleted file mode 100755 index 02a6e4e28..000000000 --- a/examples/firewall/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2016 George Washington University -# 2015-2016 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= $(RTE_TARGET) - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = firewall - -# all source are stored in SRCS-y -SRCS-y := firewall.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/flow_table/Makefile b/examples/flow_table/Makefile deleted file mode 100644 index 479f816c5..000000000 --- a/examples/flow_table/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = flow_table - -# all source are stored in SRCS-y -SRCS-y := flow_table.c sdn.c setupconn.c msgbuf.c - -# OpenNetVM path -ONVM ?= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/flow_tracker/Makefile b/examples/flow_tracker/Makefile deleted file mode 100644 index 0a6adc616..000000000 --- a/examples/flow_tracker/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2016 George Washington University -# 2015-2016 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) - $(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= $(RTE_TARGET) - -# Default target, can be overridden by the command line or environment -include $(RTE_SDK)/mk/rte.vars.mk -# Binary name -APP = flow_tracker - -# all sources are stored in SRCS-y -SRCS-y := flow_tracker.c - -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/l2fwd/Makefile b/examples/l2fwd/Makefile deleted file mode 100755 index d79041bd3..000000000 --- a/examples/l2fwd/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2020 George Washington University -# 2015-2020 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= $(RTE_TARGET) - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = l2fwd - -# all source are stored in SRCS-y -SRCS-y := l2fwd.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile deleted file mode 100755 index d7a09a633..000000000 --- a/examples/l3fwd/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2020 George Washington University -# 2015-2020 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= $(RTE_TARGET) - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = l3fwd - -# all source are stored in SRCS-y -SRCS-y := l3fwd.c l3fwd_lpm.c l3fwd_em.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile deleted file mode 100644 index 9757b5a53..000000000 --- a/examples/load_balancer/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = load_balancer - -# all source are stored in SRCS-y -SRCS-y := load_balancer.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -#CFLAGS += $(USER_FLAGS) -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/load_generator/Makefile b/examples/load_generator/Makefile deleted file mode 100644 index 6f2bcf0e8..000000000 --- a/examples/load_generator/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= $(RTE_TARGET) - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = load_generator - -# all source are stored in SRCS-y -SRCS-y := load_generator.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/nf_router/Makefile b/examples/nf_router/Makefile deleted file mode 100644 index f7ae6b684..000000000 --- a/examples/nf_router/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = nf_router - -# all source are stored in SRCS-y -SRCS-y := nf_router.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/payload_scan/Makefile b/examples/payload_scan/Makefile deleted file mode 100644 index 76abccbee..000000000 --- a/examples/payload_scan/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= $(RTE_TARGET) - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = payload_scan - -# all source are stored in SRCS-y -SRCS-y := payload_scan.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 -g - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/scaling_example/Makefile b/examples/scaling_example/Makefile deleted file mode 100644 index 58e4b1394..000000000 --- a/examples/scaling_example/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = scaling_example - -# all source are stored in SRCS-y -SRCS-y := scaling.c - -# OpenNetVM path -ONVM ?= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/simple_forward/Makefile b/examples/simple_forward/Makefile deleted file mode 100644 index bdcc8e94c..000000000 --- a/examples/simple_forward/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = simple_forward - -# all source are stored in SRCS-y -SRCS-y := forward.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/simple_fwd_tb/Makefile b/examples/simple_fwd_tb/Makefile deleted file mode 100644 index d89e1a6e9..000000000 --- a/examples/simple_fwd_tb/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = simple_fwd_tb - -# all source are stored in SRCS-y -SRCS-y := forward_tb.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile deleted file mode 100644 index 6505a1485..000000000 --- a/examples/skeleton/Makefile +++ /dev/null @@ -1,67 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# binary name [EDIT & ADD NF TAG TO "examples" VARIABLE WITHIN MAKEFILE OF EXAMPLES DIRECTORY] -APP = skeleton - -# all source are stored in SRCS-y -SRCS-y := skeleton.c - -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/speed_tester/Makefile b/examples/speed_tester/Makefile deleted file mode 100644 index 49e81b4a5..000000000 --- a/examples/speed_tester/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#Set this to 1 if libpcap is installed to use pcap replay -ENABLE_PCAP=0 - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = speed_tester - -# all source are stored in SRCS-y -SRCS-y := speed_tester.c - -# OpenNetVM path -ONVM ?= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -ifeq ($(ENABLE_PCAP), 1) -LDFLAGS += -lpcap -CFLAGS +=-D LIBPCAP -endif - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/test_flow_dir/Makefile b/examples/test_flow_dir/Makefile deleted file mode 100644 index 1edd6386c..000000000 --- a/examples/test_flow_dir/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -# binary name -APP = test_flow_dir - -# all source are stored in SRCS-y -SRCS-y := test_flow_dir.c - -# OpenNetVM path -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/examples/test_messaging/Makefile b/examples/test_messaging/Makefile deleted file mode 100644 index ffb501a59..000000000 --- a/examples/test_messaging/Makefile +++ /dev/null @@ -1,67 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2021 George Washington University -# 2015-2021 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# binary name -APP = test_messaging - -# all source are stored in SRCS-y -SRCS-y := test_messaging.c - -ONVM= $(SRCDIR)/../../onvm - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -CFLAGS += -I$(ONVM)/onvm_nflib -CFLAGS += -I$(ONVM)/lib -LDFLAGS += $(ONVM)/onvm_nflib/$(RTE_TARGET)/libonvm.a -LDFLAGS += $(ONVM)/lib/$(RTE_TARGET)/lib/libonvmhelper.a -lm - -# workaround for a gcc bug with noreturn attribute -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 -ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) -CFLAGS_main.o += -Wno-return-type -endif - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/onvm/Makefile b/onvm/Makefile deleted file mode 100644 index eaaf3c316..000000000 --- a/onvm/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# 2010-2014 Intel Corporation. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -# Default target, can be overriden by command line or environment -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -include $(RTE_SDK)/mk/rte.vars.mk - -DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += lib -DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += onvm_nflib -DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += onvm_mgr - -include $(RTE_SDK)/mk/rte.extsubdir.mk diff --git a/onvm/lib/Makefile b/onvm/lib/Makefile deleted file mode 100644 index e9828ea12..000000000 --- a/onvm/lib/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# 2010-2014 Intel Corporation. -# 2016-2017 Hewlett Packard Enterprise Development LP -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# binary name -LIB = libonvmhelper.a - -# all source are stored in SRCS-y -SRCS-y := cJSON.c - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) - -include $(RTE_SDK)/mk/rte.extlib.mk diff --git a/onvm/onvm_mgr/Makefile b/onvm/onvm_mgr/Makefile deleted file mode 100644 index 90cda1fa2..000000000 --- a/onvm/onvm_mgr/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# 2010-2014 Intel Corporation. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# set this to 0 to disable flow table lookup for incoming packets -ENABLE_FLOW_LOOKUP=1 - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -# Default target, can be overriden by command line or environment -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -include $(RTE_SDK)/mk/rte.vars.mk - -ifneq ($(CONFIG_RTE_EXEC_ENV),"linuxapp") -$(error This application can only operate in a linuxapp environment, \ -please change the definition of the RTE_TARGET environment variable) -endif - -# binary name -APP = onvm_mgr - -# all source are stored in SRCS-y -SRCS-y := main.c onvm_init.c onvm_args.c onvm_stats.c onvm_pkt.c onvm_nf.c - -INC := onvm_mgr.h onvm_init.h onvm_args.h onvm_stats.h onvm_nf.h onvm_pkt.h - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) -CFLAGS += -I$(SRCDIR)/../ -I$(SRCDIR)/../onvm_nflib/ -I$(SRCDIR)/../lib/ -LDFLAGS += $(SRCDIR)/../lib/$(RTE_TARGET)/libonvmhelper.a -LDFLAGS += $(SRCDIR)/../onvm_nflib/$(RTE_TARGET)/libonvm.a - -ifeq ($(ENABLE_FLOW_LOOKUP), 1) -CFLAGS +=-D FLOW_LOOKUP -endif - -# for newer gcc, e.g. 4.4, no-strict-aliasing may not be necessary -# and so the next line can be removed in those cases. -EXTRA_CFLAGS += -fno-strict-aliasing - -include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/onvm/onvm_nflib/Makefile b/onvm/onvm_nflib/Makefile deleted file mode 100644 index 69d9f2864..000000000 --- a/onvm/onvm_nflib/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# openNetVM -# https://github.com/sdnfv/openNetVM -# -# BSD LICENSE -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# 2010-2014 Intel Corporation. -# 2016-2017 Hewlett Packard Enterprise Development LP -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -ifeq ($(ONVM_HOME),) -$(error "Please define the ONVM_HOME environment variable") -endif - -# Default target, can be overriden by command line or environment -include $(RTE_SDK)/mk/rte.vars.mk - -RTE_TARGET ?= x86_64-native-linuxapp-gcc - -# binary name -LIB = libonvm.a - -# all source are stored in SRCS-y -SRCS-y := onvm_pkt_helper.c onvm_sc_common.c onvm_sc_mgr.c onvm_flow_table.c onvm_flow_dir.c onvm_nflib.c onvm_pkt_common.c onvm_config_common.c onvm_threading.c - -CFLAGS += $(WERROR_FLAGS) -O3 $(USER_FLAGS) -CFLAGS += -I$(ONVM_HOME)/onvm/lib - -include $(RTE_SDK)/mk/rte.extlib.mk From d720d9e09d25526cae69371e70b0142d5df8a999 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Wed, 15 May 2024 22:30:07 -0400 Subject: [PATCH 08/19] Cleanup example nf Meson script and add Meson artifacts to .gitignore --- .gitignore | 6 +++++- examples/meson.build | 5 +++-- meson.build | 7 +++++-- onvm/onvm_mgr/meson.build | 5 +++-- scripts/setup.sh | 3 ++- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 58d937d34..8b9c4e6ed 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,8 @@ _preinstall *.dSYM/ # Python virtual environment -env \ No newline at end of file +env + +# Meson artifacts +/insstall +**/insstall/** \ No newline at end of file diff --git a/examples/meson.build b/examples/meson.build index aa664a1cf..6e7d4d384 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -27,16 +27,17 @@ onvm_examples = [ ] foreach example : onvm_examples - name = example + name = 'onvm_' + example sources = [] includes = [include_directories(example), onvm_includes] subdir(example) executable( - 'onvm' + name, + name, sources, include_directories: includes, dependencies: [onvm_dpdk_shared_dep, onvm_nflib_dep], + install_tag: name ) endforeach diff --git a/meson.build b/meson.build index d4a987f48..e0a9e7ead 100644 --- a/meson.build +++ b/meson.build @@ -4,6 +4,9 @@ add_global_arguments('-msse4', language : 'c') cc = meson.get_compiler('c') onvm_source = meson.current_source_dir() +# ONVM configurations +onvm_mgr_app_name = 'onvm_mgr' + # DPDK dependencies onvm_dpdk = subproject('dpdk') onvm_dpdk_dep = onvm_dpdk.get_variable('dpdk_static_lib_deps') @@ -15,8 +18,8 @@ onvm_math_dep = cc.find_library('m') # Include directories to be used when building components and examples onvm_includes = include_directories('onvm/', - 'onvm/onvm_nflib', - 'onvm/onvm_mgr') + 'onvm/onvm_nflib', + 'onvm/onvm_mgr') # Build the ONVM components (onvm_mgr, nflib, lib) subdir('onvm') diff --git a/onvm/onvm_mgr/meson.build b/onvm/onvm_mgr/meson.build index 16a8d7c60..77eb259de 100644 --- a/onvm/onvm_mgr/meson.build +++ b/onvm/onvm_mgr/meson.build @@ -7,12 +7,13 @@ sources = files( 'onvm_stats.c' ) -onvm_mgr_app_name = 'onvm_mgr' - onvm_mgr_include = include_directories('.') executable(onvm_mgr_app_name, sources, include_directories: [onvm_mgr_include, onvm_includes], dependencies: [onvm_dpdk_shared_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep], + install: true, + install_dir: onvm_source + '/onvm/onvm_mgr', + install_tag: 'onvm_mgr' ) \ No newline at end of file diff --git a/scripts/setup.sh b/scripts/setup.sh index eda5f1407..eba1df8d8 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -47,7 +47,8 @@ packages=("build-essential" \ "python3-venv" \ "ninja-build" \ "pkg-config" \ - "libnuma-dev") + "libnuma-dev" \ + "libpcap-dev") install_packages=true pypackages=("meson" \ From 3fe65a0a8f75484d0352a45284982a4e7eb4dda4 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Thu, 13 Jun 2024 22:26:55 -0400 Subject: [PATCH 09/19] Update runtime setup and project installation scripts --- scripts/install.sh | 142 ++++++++++--------------- scripts/install_old.sh | 137 ++++++++++++++++++++++++ scripts/{setup.sh => setup_runtime.sh} | 81 +++++--------- 3 files changed, 217 insertions(+), 143 deletions(-) create mode 100755 scripts/install_old.sh rename scripts/{setup.sh => setup_runtime.sh} (51%) diff --git a/scripts/install.sh b/scripts/install.sh index c87b457cb..e211aca03 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -6,7 +6,7 @@ # OpenNetVM is distributed under the following BSD LICENSE: # # Copyright(c) -# 2015-2017 George Washington University +# 2015-2024 George Washington University # 2015-2017 University of California Riverside # All rights reserved. # @@ -35,103 +35,71 @@ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -e - -# A script to configure openNetVM -# Expected to be run as scripts/install.sh -# CONFIGURATION (via environment variable): -# - Make sure $RTE_TARGET and $RTE_SDK are correct (see install docs) -# - Set $ONVM_NUM_HUGEPAGES to control the number of pages created -# - Set $ONVM_SKIP_FSTAB to not add huge fs to /etc/fstab - -#Print a table with enviromental variable locations -echo "----------------------------------------" -echo "ONVM Environment Variables:" -echo "----------------------------------------" -echo "RTE_SDK: $RTE_SDK" -echo "RTE_TARGET: $RTE_TARGET" -echo "ONVM_NUM_HUGEPAGES: $ONVM_NUM_HUGEPAGES" -echo "ONVM_SKIP_HUGEPAGES: $ONVM_SKIP_HUGEPAGES" -echo "ONVM_SKIP_FSTAB: $ONVM_SKIP_FSTAB" -echo "----------------------------------------" - -if [ -z "$RTE_TARGET" ]; then - echo "Please export \$RTE_TARGET. Or try running this without sudo." - exit 1 -fi - -if [ -z "$RTE_SDK" ]; then - echo "Please export \$RTE_SDK" - exit 1 -fi - -# Validate sudo access -sudo -v - +# +# A script to install required linux packages and perform initial developer +# environment setup actions. + +packages=("build-essential" \ + "python3" \ + "python3-pip" \ + "python3-setuptools" \ + "python3-wheel" \ + "python3-venv" \ + "ninja-build" \ + "pkg-config" \ + "libnuma-dev" \ + "libpcap-dev") +install_packages=true + +pypackages=("meson" \ + "pyelftools") +pyenv="env" + +# Check the passed arguments, and set the appropriate flags if a +# particular argument is detected +for arg in "$@" +do + if [[ $arg == "--noinstall" ]]; then + install_packages=false + break + fi +done + +# Check to make sure this script is running in the correct working +# directory. # Ensure we're working relative to the onvm root directory -if [ "$(basename "$(pwd)")" == "scripts" ]; then - cd .. +if [ "$(basename "$(pwd)")" != "openNetVM" ]; then + echo "Please run the installation script from the parent openNetVM directory" fi -# Set state variables -start_dir=$(pwd) - -if [ -z "$ONVM_HOME" ]; then - echo "Please export \$ONVM_HOME and set it to $start_dir" - exit 1 -fi - -# Source DPDK helper functions -. "$ONVM_HOME"/scripts/dpdk_helper_scripts.sh - -set +e -remove_igb_uio_module -set -e -# Compile dpdk -cd "$RTE_SDK" -echo "Compiling and installing dpdk in $RTE_SDK" +# (1) +# Install required packages for development +required=$(IFS=' '; echo "${packages[*]}") -# Adding ldflags.txt output for mTCP compatibility -if grep "ldflags.txt" "$RTE_SDK"/mk/rte.app.mk > /dev/null -then - : +echo "- Installing required packages" +if [ "$install_packages" = true ]; then + echo " - installing: $required" + sudo apt-get install $required else - # want to use single quotes for sed operation - # shellcheck disable=SC2016 - sed -i -e 's/O_TO_EXE_STR =/\$(shell if [ \! -d \${RTE_SDK}\/\${RTE_TARGET}\/lib ]\; then mkdir -p \${RTE_SDK}\/\${RTE_TARGET}\/lib\; fi)\nLINKER_FLAGS = \$(call linkerprefix,\$(LDLIBS))\n\$(shell echo \${LINKER_FLAGS} \> \${RTE_SDK}\/\${RTE_TARGET}\/lib\/ldflags\.txt)\nO_TO_EXE_STR =/g' "$RTE_SDK"/mk/rte.app.mk + echo " - skipping due to --noinstall flag" fi -sed -i 's/CONFIG_RTE_EAL_IGB_UIO=n/CONFIG_RTE_EAL_IGB_UIO=y/g' "$RTE_SDK"/config/common_base -sleep 1 -make config T="$RTE_TARGET" -make T="$RTE_TARGET" -j 8 -make install T="$RTE_TARGET" -j 8 +# (2) +# Initialize the Git submodules (dpdk & pkt_gen) +echo "- Initializing Git submodules" -# Refresh sudo -sudo -v +git submodule update --init -cd "$start_dir" - -# Setup/Check for free HugePages if the user wants to -if [ -z "$ONVM_SKIP_HUGEPAGES" ]; then - set_numa_pages -fi - -grep -m 1 "huge" /etc/fstab | cat -# Only add to /etc/fstab if user wants it -if [ "${PIPESTATUS[0]}" != 0 ] && [ -z "$ONVM_SKIP_FSTAB" ]; then - echo "Adding huge fs to /etc/fstab" - sleep 1 - sudo sh -c "echo \"huge /mnt/huge hugetlbfs defaults 0 0\" >> /etc/fstab" -fi -# Configure local environment -echo "Configuring environment" -sleep 1 -scripts/setup_environment.sh +# (3) +# Create the Python environment (this will be used for compiling onvm) +pyrequired=$(IFS=' '; echo "${pypackages[*]}") -echo "ONVM INSTALL COMPLETED SUCCESSFULLY" +echo "- Setup Python environment" +echo " - installing $pyrequired" +python3 -m venv $pyenv +source env/bin/activate +pip3 install $pyrequired \ No newline at end of file diff --git a/scripts/install_old.sh b/scripts/install_old.sh new file mode 100755 index 000000000..c87b457cb --- /dev/null +++ b/scripts/install_old.sh @@ -0,0 +1,137 @@ +#! /bin/bash + +# openNetVM +# https://sdnfv.github.io +# +# OpenNetVM is distributed under the following BSD LICENSE: +# +# Copyright(c) +# 2015-2017 George Washington University +# 2015-2017 University of California Riverside +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * The name of the author may not be used to endorse or promote +# products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -e + +# A script to configure openNetVM +# Expected to be run as scripts/install.sh +# CONFIGURATION (via environment variable): +# - Make sure $RTE_TARGET and $RTE_SDK are correct (see install docs) +# - Set $ONVM_NUM_HUGEPAGES to control the number of pages created +# - Set $ONVM_SKIP_FSTAB to not add huge fs to /etc/fstab + +#Print a table with enviromental variable locations +echo "----------------------------------------" +echo "ONVM Environment Variables:" +echo "----------------------------------------" +echo "RTE_SDK: $RTE_SDK" +echo "RTE_TARGET: $RTE_TARGET" +echo "ONVM_NUM_HUGEPAGES: $ONVM_NUM_HUGEPAGES" +echo "ONVM_SKIP_HUGEPAGES: $ONVM_SKIP_HUGEPAGES" +echo "ONVM_SKIP_FSTAB: $ONVM_SKIP_FSTAB" +echo "----------------------------------------" + +if [ -z "$RTE_TARGET" ]; then + echo "Please export \$RTE_TARGET. Or try running this without sudo." + exit 1 +fi + +if [ -z "$RTE_SDK" ]; then + echo "Please export \$RTE_SDK" + exit 1 +fi + +# Validate sudo access +sudo -v + +# Ensure we're working relative to the onvm root directory +if [ "$(basename "$(pwd)")" == "scripts" ]; then + cd .. +fi + +# Set state variables +start_dir=$(pwd) + +if [ -z "$ONVM_HOME" ]; then + echo "Please export \$ONVM_HOME and set it to $start_dir" + exit 1 +fi + +# Source DPDK helper functions +. "$ONVM_HOME"/scripts/dpdk_helper_scripts.sh + +set +e +remove_igb_uio_module +set -e + +# Compile dpdk +cd "$RTE_SDK" +echo "Compiling and installing dpdk in $RTE_SDK" + +# Adding ldflags.txt output for mTCP compatibility +if grep "ldflags.txt" "$RTE_SDK"/mk/rte.app.mk > /dev/null +then + : +else + # want to use single quotes for sed operation + # shellcheck disable=SC2016 + sed -i -e 's/O_TO_EXE_STR =/\$(shell if [ \! -d \${RTE_SDK}\/\${RTE_TARGET}\/lib ]\; then mkdir -p \${RTE_SDK}\/\${RTE_TARGET}\/lib\; fi)\nLINKER_FLAGS = \$(call linkerprefix,\$(LDLIBS))\n\$(shell echo \${LINKER_FLAGS} \> \${RTE_SDK}\/\${RTE_TARGET}\/lib\/ldflags\.txt)\nO_TO_EXE_STR =/g' "$RTE_SDK"/mk/rte.app.mk +fi + +sed -i 's/CONFIG_RTE_EAL_IGB_UIO=n/CONFIG_RTE_EAL_IGB_UIO=y/g' "$RTE_SDK"/config/common_base + +sleep 1 +make config T="$RTE_TARGET" +make T="$RTE_TARGET" -j 8 +make install T="$RTE_TARGET" -j 8 + +# Refresh sudo +sudo -v + +cd "$start_dir" + +# Setup/Check for free HugePages if the user wants to +if [ -z "$ONVM_SKIP_HUGEPAGES" ]; then + set_numa_pages +fi + +grep -m 1 "huge" /etc/fstab | cat +# Only add to /etc/fstab if user wants it +if [ "${PIPESTATUS[0]}" != 0 ] && [ -z "$ONVM_SKIP_FSTAB" ]; then + echo "Adding huge fs to /etc/fstab" + sleep 1 + sudo sh -c "echo \"huge /mnt/huge hugetlbfs defaults 0 0\" >> /etc/fstab" +fi + +# Configure local environment +echo "Configuring environment" +sleep 1 +scripts/setup_environment.sh + +echo "ONVM INSTALL COMPLETED SUCCESSFULLY" + diff --git a/scripts/setup.sh b/scripts/setup_runtime.sh similarity index 51% rename from scripts/setup.sh rename to scripts/setup_runtime.sh index eba1df8d8..60ea88ab8 100755 --- a/scripts/setup.sh +++ b/scripts/setup_runtime.sh @@ -36,69 +36,38 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# A script to setup the developer environment to build OpenNetVM and its -# subsequent components. +# Sets configuration items on the host system required to run openNetVM -packages=("build-essential" \ - "python3" \ - "python3-pip" \ - "python3-setuptools" \ - "python3-wheel" \ - "python3-venv" \ - "ninja-build" \ - "pkg-config" \ - "libnuma-dev" \ - "libpcap-dev") -install_packages=true +DPDK_DEVBIND=/subprojects/dpdk/usertools/dpdk-devbind.py -pypackages=("meson" \ - "pyelftools") -pyenv="env" - -# Check the passed arguments, and set the appropriate flags if a -# particular argument is detected -for arg in "$@" -do - if [[ $arg == "--noinstall" ]]; then - install_packages=false - break - fi -done - -# (1) -# Install required packages for development -required=$(IFS=' '; echo "${packages[*]}") - -echo "- Installing required packages" -if [ "$install_packages" = true ]; then - echo " - installing: $required" - sudo apt-get install $required -else - echo " - skipping due to --noinstall flag" +# Check to make sure this script is running in the correct working +# directory. +# Ensure we're working relative to the onvm root directory +if [ "$(basename "$(pwd)")" != "openNetVM" ]; then + echo "Please run the installation script from the parent openNetVM directory" fi -# (2) -# Initialize the Git submodules (dpdk & pkt_gen) -echo "- Initializing Git submodules" +# Check sudo privileges +sudo -v -git submodule update --init -# (3) -# Create the Python environment (this will be used for compiling onvm) -pyrequired=$(IFS=' '; echo "${pypackages[*]}") +# (1) +# Disable address space layout randomization (ASLR) +echo "- Disabling ASLR" +sudo sh -c "echo 0 > /proc/sys/kernel/randomize_va_space" -echo "- Setup Python environment" -echo " - installing $pyrequired" -python3 -m venv $pyenv -source env/bin/activate -pip3 install $pyrequired +# (2) +# Disable hyperthreading +echo "- Disabling hyperthreading" -# (3.1) -# Set environment variables in python environment -echo " - setting environment variables" +CPUS_TO_SKIP=" $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | sed 's/[^0-9].*//' | sort | uniq | tr "\r\n" " ") " +for CPU_PATH in /sys/devices/system/cpu/cpu[0-9]*; do + CPU="$(echo "$CPU_PATH" | tr -cd "0-9")" + echo "$CPUS_TO_SKIP" | grep " $CPU " > /dev/null + if [ $? -ne 0 ]; then + echo 0 > "$CPU_PATH"/online + fi +done -echo export ONVM_HOME=$(pwd) >> ./$pyenv/bin/activate -echo export ONVM_NUM_HUGEPAGES=1024 >> ./$pyenv/bin/activate -echo export RTE_SDK=$(pwd)/dpdk >> ./$pyenv/bin/activate -echo export RTE_TARGET=x86_64-native-linuxapp-gcc >> ./$pyenv/bin/activate \ No newline at end of file +lscpu | grep -i -E "^CPU\(s\):|core|socket" \ No newline at end of file From 8c92b228b44c4ba92a7483ddd50173b152fa0a74 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Thu, 13 Jun 2024 23:04:13 -0400 Subject: [PATCH 10/19] Add dpdk-kmods gitmodule to support igb_uio driver --- .gitmodules | 4 ++++ scripts/install.sh | 9 ++++++++- scripts/setup_runtime.sh | 16 +++++++++++++--- subprojects/dpdk-kmods | 1 + 4 files changed, 26 insertions(+), 4 deletions(-) create mode 160000 subprojects/dpdk-kmods diff --git a/.gitmodules b/.gitmodules index 7c20e1276..868901118 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,7 @@ [submodule "dpdk"] path = subprojects/dpdk url = https://github.com/DPDK/dpdk.git +[submodule "subprojects/dpdk-kmods"] + path = subprojects/dpdk-kmods + url = https://dpdk.org/git/dpdk-kmods + ignore = all diff --git a/scripts/install.sh b/scripts/install.sh index e211aca03..2128f1e5b 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -102,4 +102,11 @@ echo " - installing $pyrequired" python3 -m venv $pyenv source env/bin/activate -pip3 install $pyrequired \ No newline at end of file +pip3 install $pyrequired + + +# (4) +# Build the dpdk-kmods uio kernel module +echo "- Building the dpdk-kmods uio kernel module" +cd subprojects/dpdk-kmods/linux/igb_uio +make \ No newline at end of file diff --git a/scripts/setup_runtime.sh b/scripts/setup_runtime.sh index 60ea88ab8..e67ceb606 100755 --- a/scripts/setup_runtime.sh +++ b/scripts/setup_runtime.sh @@ -38,8 +38,6 @@ # # Sets configuration items on the host system required to run openNetVM -DPDK_DEVBIND=/subprojects/dpdk/usertools/dpdk-devbind.py - # Check to make sure this script is running in the correct working # directory. # Ensure we're working relative to the onvm root directory @@ -70,4 +68,16 @@ for CPU_PATH in /sys/devices/system/cpu/cpu[0-9]*; do fi done -lscpu | grep -i -E "^CPU\(s\):|core|socket" \ No newline at end of file +lscpu | grep -i -E "^CPU\(s\):|core|socket" + + +# (3) +# Load the uio kernel module from dpdk-kmods +grep -m 1 "igb_uio" /proc/modules | cat +if [ "${PIPESTATUS[0]}" != 0 ]; then + echo "- Loading uio kernel module" + sudo modprobe uio + sudo insmod sigb_uio.ko +else + echo "- uio kernel module already loaded" +fi \ No newline at end of file diff --git a/subprojects/dpdk-kmods b/subprojects/dpdk-kmods new file mode 160000 index 000000000..e721c733c --- /dev/null +++ b/subprojects/dpdk-kmods @@ -0,0 +1 @@ +Subproject commit e721c733cd24206399bebb8f0751b0387c4c1595 From 4e2b3b846c73bbe37245e14da4457a8f54885ba4 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Wed, 26 Jun 2024 15:08:44 -0400 Subject: [PATCH 11/19] Add new startup script for onvm_mgr --- onvm/lib/meson.build | 3 +- onvm/onvm_nflib/meson.build | 3 +- scripts/setup_runtime.sh | 2 +- scripts/start.sh | 282 ++++++++++++++++++++++++++++++++++++ 4 files changed, 287 insertions(+), 3 deletions(-) create mode 100755 scripts/start.sh diff --git a/onvm/lib/meson.build b/onvm/lib/meson.build index 0824cb8f5..3dbf6cf42 100644 --- a/onvm/lib/meson.build +++ b/onvm/lib/meson.build @@ -5,7 +5,8 @@ libonvmhelper_includes = include_directories('.') libonvmhelper = library( 'libonvmhelper', sources, - include_directories : libonvmhelper_includes + include_directories : libonvmhelper_includes, + install: true ) libonvmhelper_dep = declare_dependency( diff --git a/onvm/onvm_nflib/meson.build b/onvm/onvm_nflib/meson.build index ac96a7f7b..63593d627 100644 --- a/onvm/onvm_nflib/meson.build +++ b/onvm/onvm_nflib/meson.build @@ -21,7 +21,8 @@ libonvm = library( 'libonvm', sources, include_directories : libonvm_includes, - dependencies : libonvm_deps) + dependencies : libonvm_deps, + install: true) libonvm_dep = declare_dependency( link_with: libonvm, diff --git a/scripts/setup_runtime.sh b/scripts/setup_runtime.sh index e67ceb606..402524128 100755 --- a/scripts/setup_runtime.sh +++ b/scripts/setup_runtime.sh @@ -77,7 +77,7 @@ grep -m 1 "igb_uio" /proc/modules | cat if [ "${PIPESTATUS[0]}" != 0 ]; then echo "- Loading uio kernel module" sudo modprobe uio - sudo insmod sigb_uio.ko + sudo insmod ./subprojects/dpdk-kmods/linux/igb_uio/igb_uio.ko else echo "- uio kernel module already loaded" fi \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100755 index 000000000..44092cb89 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,282 @@ +#!/bin/bash + +function usage { + echo "$0 -k PORTMASK -n NF-COREMASK [-m MANAGER CORES] [-r NUM-SERVICES] [-d DEFAULT-SERVICE] [-s STATS-OUTPUT] [-p WEB-PORT-NUMBER] [-z STATS-SLEEP-TIME]" + # this works well on our 2x6-core nodes + echo "$0 -k 3 -n 0xF0 --> cores 0,1,2, with ports 0 and 1, with NFs running on cores 4,5,6,7" + echo -e "\tBy default, cores will be used as follows in numerical order:" + echo -e "\t\tRX thread, TX thread, ..., TX thread for last NF, Stats thread" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4" + echo -e "\tRuns ONVM the same way as above, but manually configures cores 2, 3 and 4 to be used as stated" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -s web" + echo -e "\tRuns ONVM the same way as above, but prints statistics to the web browser" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -s web -p 9000" + echo -e "\tRuns OVNM the same as above, but runs the web stats on port 9000 instead of defaulting to 8080" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -s stdout" + echo -e "\tRuns ONVM the same way as above, but prints statistics to stdout" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -s stdout -c" + echo -e "\tRuns ONVM the same way as above, but enables shared cpu support" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -s stdout -c -j" + echo -e "\tRuns ONVM the same way as above, but allows ports to send and receive jumbo frames" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -s stdout -t 42" + echo -e "\tRuns ONVM the same way as above, but shuts down after 42 seconds" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -s stdout -l 64" + echo -e "\tRuns ONVM the same way as above, but shuts down after receiving 64 million packets" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -s stdout -v" + echo -e "\tRuns ONVM the same way as above, but prints statistics to stdout in extra verbose mode" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -s stdout -vv" + echo -e "\tRuns ONVM the same way as above, but prints statistics to stdout in raw data dump mode" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -a 0x7f000000000 -s stdout" + echo -e "\tRuns ONVM the same way as above, but adds a --base-virtaddr dpdk parameter to overwrite default address" + echo -e "$0 -k 3 -n 0xF0 -m 2,3,4 -r 10 -d 2" + echo -e "\tRuns ONVM the same way as above, but limits max service IDs to 10 and uses service ID 2 as the default" + exit 1 +} + +# User can still use legacy syntax for backwards compatibility. Check syntax of input +# Check validity of core input +core_check="^([0-8]+,){2}([0-8]+)(,[0-8]+)*$" +port_check="^[0-9]+$" +nf_check="^0x[0-9A-F]+$" +flag_check="^-[a-z]$" +# Check for argument matches +[[ $1 =~ $core_check ]] +if [[ -n ${BASH_REMATCH[0]} ]] +then + core_match=true +else + core_match=false +fi +[[ $2 =~ $port_check ]] +if [[ -n ${BASH_REMATCH[0]} ]] +then + port_match=true +else + port_match=false +fi +[[ $3 =~ $nf_check ]] +if [[ -n ${BASH_REMATCH[0]} ]] +then + nf_match=true +else + nf_match=false +fi + +# Make sure someone isn't inputting the cores incorrectly and they are using legacy syntax +# The flag regex check ensures that the user is trying to input a flag, which is an indicator that they are using the new syntax +if [[ ! $1 =~ $flag_check ]] && (! $core_match || ! $port_match || ! $nf_match) +then + if ( ! $core_match && ( $port_match || $nf_match )) + then + # This verifies that the user actually tried to input the cores but did so incorrectly + echo "Error: Invalid Manager Cores. Proper syntax: $0 [OPTIONS]" + echo "Example: $0 0,1,2 1 0xF8 -s stdout" + exit 1 + elif ( ! $port_match && ( $core_match || $nf_match )) + then + # This verifies that the user actually tried to input the port mask but did so incorrectly + echo "Error: Invalid Port Mask. Proper syntax: $0 [OPTIONS]" + echo "Example: $0 0,1,2 1 0xF8 -s stdout" + exit 1 + elif ( ! $nf_match && ($core_match || $port_match )) + then + # This verifies that the user actually tried to input the NF core mask but did so incorrectly + echo "Error: Invalid NF Core Mask. Proper syntax: $0 [OPTIONS]" + echo "Example: $0 0,1,2 1 0xF8 -s stdout" + exit 1 + # We should never get here, but just a catch-all situation + else + echo "Error: Invalid input." + echo "" + usage + fi +elif $core_match && $port_match && $nf_match +then + script_name=$0 + cpu=$1 + ports=$2 + nf_cores=$3 + shift 3 +fi + +SCRIPT=$(readlink -f "$0") +SCRIPTPATH=$(dirname "$SCRIPT") +verbosity=1 +# Initialize base virtual address to empty. +virt_addr="" + +# only check for duplicate manager if not in Docker container +if [[ -n $(pgrep -u root -f "/onvm_mgr/.*/onvm_mgr") ]] && ! grep -q "docker" /proc/1/cgroup +then + echo "Manager cannot be started while another is running" + exit 1 +fi + +while getopts "a:r:d:s:t:l:p:z:cvm:k:n:j" opt; do + case $opt in + a) virt_addr="--base-virtaddr=$OPTARG";; + r) num_srvc="-r $OPTARG";; + d) def_srvc="-d $OPTARG";; + s) stats="-s $OPTARG";; + t) ttl="-t $OPTARG";; + l) packet_limit="-l $OPTARG";; + p) web_port="$OPTARG";; + z) stats_sleep_time="-z $OPTARG";; + c) shared_cpu_flag="-c";; + v) verbosity=$((verbosity+1));; + m) + # User is trying to set CPU cores but has already done so using legacy syntax + if [[ -n $cpu ]] + then + echo "Error: Cannot use manual manager core flag with legacy syntax. Proper syntax: $script_name [OPTIONS]" + echo "Example: $script_name 0,1,2 1 0xF8 -s stdout" + exit 1 + else + cpu=$OPTARG + fi;; + k) + # User is trying to set port mask but has already done so using legacy syntax + if [[ -n $ports ]] + then + echo "Error: Cannot use manual port mask flag with legacy syntax. Proper syntax: $script_name [OPTIONS]" + echo "Example: $script_name 0,1,2 1 0xF8 -s stdout" + exit 1 + else + ports=$OPTARG + fi;; + n) + # User is trying to set NF core mask but has already done so using legacy syntax + if [[ -n $nf_cores ]] + then + echo "Error: Cannot use manual NF core mask flag with legacy syntax. Proper syntax: $script_name [OPTIONS]" + echo "Example: $script_name 0,1,2 1 0xF8 -s stdout" + exit 1 + else + nf_cores=$OPTARG + fi;; + j) jumbo_frames_flag="-j";; + \?) echo "Unknown option -$OPTARG" && usage + ;; + esac +done + +# Verify that dependency bc is installed +if [[ -z $(command -v bc) ]] +then + echo "Error: bc is not installed. Install using:" + echo " sudo apt-get install bc" + echo "See dependencies for more information" + exit 1 +fi + +# Check for ports flag +if [ -z "$ports" ] +then + echo "Error: Port Mask not set. openNetVM requires that a Port Mask be set using -k using a hexadecimal number (without 0x)" + echo "" + usage +# Check port mask +elif [[ ! $ports =~ $port_check ]] +then + echo "Error: Invalid port mask. Check input and try again." + echo "" + usage +fi + +# Check for nf_cores flag +if [ -z "$nf_cores" ] +then + echo "Error: NF Core Mask not set. openNetVM requires that a NF Core Mask be set using -n using a hexadecimal number (starting with 0x)" + echo "" + usage +# Check NF core mask +elif [[ ! $nf_cores =~ $nf_check ]] +then + echo "Error: Invalid NF core mask. Check input and try again." + echo "" + usage +fi + +# Check for CPU core flag +if [ -z "$cpu" ] +then + echo "INFO: Using default CPU cores 0,1,2" + echo "" + cpu="0,1,2" +# Check CPU cores +elif [[ ! $cpu =~ $core_check ]] +then + echo "Error: Invalid CPU cores. openNetVM accepts 3 or more cores. Check input and try again." + echo "" + usage +fi + +if [ -z "$nf_cores" ] +then + usage +fi + +# Convert the port mask to binary +# Using bc where obase=2 indicates the output is base 2 and ibase=16 indicates the input is base 16 +ports_bin=$(echo "obase=2; ibase=16; $ports" | bc) +# Splice out the 0's from the binary numbers. The result is only 1's. Example: 1011001 -> 1111 +ports_bin="${ports_bin//0/}" +# The number of ports is the length of the string of 1's. Using above example: 1111 -> 4 +count_ports="${#ports_bin}" + +ports_detected=$(subprojects/dpdk/usertools/dpdk-devbind.py --status-dev net | sed '/Network devices using kernel driver/q' | grep -c "drv") +if [[ $ports_detected -lt $count_ports ]] +then + echo "Error: Invalid port mask. Insufficient NICs bound." + exit 1 +fi + +# Trim 0x from NF mask +nf_cores_trimmed=${nf_cores:2} +# Convert nf_cores to compare to cpu +nf_cores_trimmed=$(echo "obase=10; ibase=16; $nf_cores_trimmed" | bc) +# Convert cpu to separate +cpu_separated=$(echo $cpu | tr "," "\n") +for core in $cpu_separated +do + if (( nf_cores_trimmed & (1 << (core)) )) + then + echo "WARNING: Manager and NF cores overlap." + echo "" + break + fi +done + +verbosity_level="-v $verbosity" + +# If base virtual address has not been set by the user, set to default. +if [[ -z $virt_addr ]] +then + echo "Base virtual address set to default 0x7f000000000" + virt_addr="--base-virtaddr=0x7f000000000" +fi + +if [ "${stats}" = "-s web" ] +then + cd "$ONVM_HOME"/onvm_web/ || usage + if [ -n "${web_port}" ] + then + . start_web_console.sh -p "${web_port}" + else + . start_web_console.sh + fi + + cd "$ONVM_HOME"/onvm || usage +fi + +sudo rm -rf /mnt/huge/rtemap_* +# watch out for variable expansion +# shellcheck disable=SC2086 +sudo ./onvm/onvm_mgr/onvm_mgr -l "$cpu" -n 4 --proc-type=primary ${virt_addr} -- -p ${ports} -n ${nf_cores} ${num_srvc} ${def_srvc} ${stats} ${stats_sleep_time} ${verbosity_level} ${ttl} ${packet_limit} ${shared_cpu_flag} ${jumbo_frames_flag} + +if [ "${stats}" = "-s web" ] +then + echo "Killing web stats running with PIDs: $ONVM_WEB_PID, $ONVM_WEB_PID2" + kill "$ONVM_WEB_PID" + kill "$ONVM_WEB_PID2" +fi From e08de18e4b4915a3e2f405a3b2212bcfa0e0fd02 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Wed, 26 Jun 2024 15:45:36 -0400 Subject: [PATCH 12/19] Update README.md to reflect changes since DPDK update --- README.md | 105 +++++++++++++++++++++++++----------------------------- 1 file changed, 49 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index d247a25d4..b825b4d75 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,82 @@ -[openNetVM][onvm] -== +# [openNetVM][onvm] -_Please let us know if you use OpenNetVM in your research by [emailing us](mailto:timwood@gwu.edu) or completing this [short survey](https://goo.gl/forms/oxcnGO45Kxq1Zyyi2)._ +> _Please let us know if you use OpenNetVM in your research by [emailing us](mailto:timwood@gwu.edu) or completing this [short survey](https://goo.gl/forms/oxcnGO45Kxq1Zyyi2)._ -_Want to get started quickly?_ Try using our NSF CloudLab profile: https://www.cloudlab.us/p/GWCloudLab/onvm +> _Want to get started quickly?_ Try using our NSF CloudLab profile: +openNetVM is a high performance NFV platform based on [DPDK][dpdk] and [Docker][docker] containers. openNetVM provides a flexible framework for deploying network functions and interconnecting them to build service chains. -Notes --- +openNetVM is an open source version of the NetVM platform described in our [NSDI 2014][nsdi14] and [HotMiddlebox 2016][hotmiddlebox16] papers, released under the [BSD][license] license. -We have updated our DPDK submodule to point to a new version, v20.05. If you have already cloned this repository, please update your DPDK submodule by running: +The [develop][dev] branch tracks experimental builds (active development) whereas the [master][mast] branch tracks verified stable releases. Please read our [releases][rels] document for more information about our releases and release cycle. -``` -git submodule sync -git submodule update --init -``` +You can find information about research projects building on [OpenNetVM][onvm] at the [UCR/GW SDNFV project site][sdnfv]. OpenNetVM is supported in part by NSF grants CNS-1422362 and CNS-1522546. -And then rebuild DPDK using the [install guide][install] or running these commands: +## Getting Started + +We've provided a bash script to assist with setting up your development environment for working with OpenNetVM. Take a look at [`scripts/setup.sh`](/scripts/setup.sh) to see a full list of installed packages. +From the `openNetVM` folder, run the following two commands: + +```text +./scripts/setup.sh ``` -cd dpdk -make config T=$RTE_TARGET -make T=$RTE_TARGET -j 8 -make install T=$RTE_TARGET -j 8 + +```text +sudo ./scripts/setup_runtime.sh ``` -The current OpenNetVM version is 20.10. Please see our [release](docs/Releases.md) document for more information. +### Building -About --- -openNetVM is a high performance NFV platform based on [DPDK][dpdk] and [Docker][docker] containers. openNetVM provides a flexible framework for deploying network functions and interconnecting them to build service chains. +OpenNetVM uses the [Meson][meson] build system to compile all components, including dpdk. From the `openNetVM` parent folder run the following to setup build: -openNetVM is an open source version of the NetVM platform described in our [NSDI 2014][nsdi14] and [HotMiddlebox 2016][hotmiddlebox16] papers, released under the [BSD][license] license. +```text +meson build +``` -The [develop][dev] branch tracks experimental builds (active development) whereas the [master][mast] branch tracks verified stable releases. Please read our [releases][rels] document for more information about our releases and release cycle. +Then, `cd` into the build folder and run ninja to compile: -You can find information about research projects building on [OpenNetVM][onvm] at the [UCR/GW SDNFV project site][sdnfv]. OpenNetVM is supported in part by NSF grants CNS-1422362 and CNS-1522546. +```text +cd ./build +ninja +``` -Get Started --- -We've provided a bash script to assist with setting up your development environment for working with OpenNetVM. Take a look at [`scripts/setup.sh`](/scripts/setup.sh) to see a full list of installed packages. +### Running onvm_mgr -From the `openNetVM` folder, run the following command: -``` -./scripts/setup.sh -``` +## Usage Guide -Once that's completed, head over to the [Getting Started](/docs/Install.md) guide for compiling OpenNetVM/DPDK and running your first NF. +### Sample NFs +openNetVM comes with several sample NFs. To get started with these, check out the [examples guide][examples]. -Using openNetVM --- -openNetVM comes with several sample network functions. To get started with some examples, please see the [Example Uses][examples] guide +### Creating NFs -Creating NFs --- -The [NF Development][nfs] guide will provide what you need to start creating your own NFs. +We have created an [NF development guide][nfs] to provide you with steps to create your first NF. + +### Containerizing NFs -Dockerize NFs --- NFs can be run inside docker containers, with the NF being automatically or hand started. For more informations, see our [Docker guide][docker-nf]. -TCP Stack --- +### mTCP apps as NFs + openNetVM can run mTCP applications as NFs. For more information, visit [mTCP][mtcp]. -Citing OpenNetVM --- +## Citing + If you use OpenNetVM in your work, please cite our paper: -``` + +```text @inproceedings{zhang_opennetvm:_2016, - title = {{OpenNetVM}: {A} {Platform} for {High} {Performance} {Network} {Service} {Chains}}, - booktitle = {Proceedings of the 2016 {ACM} {SIGCOMM} {Workshop} on {Hot} {Topics} in {Middleboxes} and {Network} {Function} {Virtualization}}, - publisher = {ACM}, - author = {Zhang, Wei and Liu, Guyue and Zhang, Wenhui and Shah, Neel and Lopreiato, Phillip and Todeschi, Gregoire and Ramakrishnan, K.K. and Wood, Timothy}, - month = aug, - year = {2016}, + title = {{OpenNetVM}: {A} {Platform} for {High} {Performance} {Network} {Service} {Chains}}, + booktitle = {Proceedings of the 2016 {ACM} {SIGCOMM} {Workshop} on {Hot} {Topics} in {Middleboxes} and {Network} {Function} {Virtualization}}, + publisher = {ACM}, + author = {Zhang, Wei and Liu, Guyue and Zhang, Wenhui and Shah, Neel and Lopreiato, Phillip and Todeschi, Gregoire and Ramakrishnan, K.K. and Wood, Timothy}, + month = aug, + year = {2016}, } ``` -_Please let us know if you use OpenNetVM in your research by [emailing us](mailto:timwood@gwu.edu) or completing this [short survey](https://goo.gl/forms/oxcnGO45Kxq1Zyyi2)._ - - - - +>_Please let us know if you use OpenNetVM in your research by [emailing us](mailto:timwood@gwu.edu) or completing this [short survey](https://goo.gl/forms/oxcnGO45Kxq1Zyyi2)._ [onvm]: http://sdnfv.github.io/onvm/ [sdnfv]: http://sdnfv.github.io/ @@ -92,7 +85,6 @@ _Please let us know if you use OpenNetVM in your research by [emailing us](mailt [docker]: https://www.docker.com/ [nsdi14]: http://faculty.cs.gwu.edu/timwood/papers/14-NSDI-netvm.pdf [hotmiddlebox16]: http://faculty.cs.gwu.edu/timwood/papers/16-HotMiddlebox-onvm.pdf -[install]: docs/Install.md [examples]: docs/Examples.md [nfs]: docs/NF_Dev.md [docker-nf]: docs/Docker.md @@ -100,3 +92,4 @@ _Please let us know if you use OpenNetVM in your research by [emailing us](mailt [mast]: https://github.com/sdnfv/openNetVM/tree/master [rels]: docs/Releases.md [mtcp]: https://github.com/eunyoung14/mtcp +[meson]: https://mesonbuild.com/ From d36313fa33e5890eb88773fcd21cf8cb708046df Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Wed, 26 Jun 2024 16:20:08 -0400 Subject: [PATCH 13/19] Fix installation issue with example apps and meson --- examples/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/meson.build b/examples/meson.build index 6e7d4d384..0ba664178 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -38,6 +38,8 @@ foreach example : onvm_examples sources, include_directories: includes, dependencies: [onvm_dpdk_shared_dep, onvm_nflib_dep], - install_tag: name + install_tag: name, + install: true, + install_dir: onvm_source + '/examples/' + example ) endforeach From c695a76f729eb3d1b61389e4e052602246003bde Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Wed, 26 Jun 2024 16:27:35 -0400 Subject: [PATCH 14/19] Update README refs to readthedocs --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b825b4d75..4e2617bec 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,18 @@ ninja ### Running onvm_mgr +After finishing build, from the build directory, you can run the `install` command to place the compiled executables in ther source directories. + +```text +meson install +``` + +Then, you can use our provided startup script to launch onvm_mgr. This scripts assumes the `openNetVM` folder is your working directory. + +```text +./scripts/startup.sh +``` + ## Usage Guide ### Sample NFs @@ -85,9 +97,9 @@ If you use OpenNetVM in your work, please cite our paper: [docker]: https://www.docker.com/ [nsdi14]: http://faculty.cs.gwu.edu/timwood/papers/14-NSDI-netvm.pdf [hotmiddlebox16]: http://faculty.cs.gwu.edu/timwood/papers/16-HotMiddlebox-onvm.pdf -[examples]: docs/Examples.md -[nfs]: docs/NF_Dev.md -[docker-nf]: docs/Docker.md +[examples]: https://opennetvm.readthedocs.io/en/develop/examples/index.html +[nfs]: https://opennetvm.readthedocs.io/en/develop/nfdev/index.html +[docker-nf]: https://opennetvm.readthedocs.io/en/develop/docker/index.html [dev]: https://github.com/sdnfv/openNetVM/tree/develop [mast]: https://github.com/sdnfv/openNetVM/tree/master [rels]: docs/Releases.md From 513f293b3e346fec2645b0f46558bc9ca6a84ba3 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Wed, 26 Jun 2024 16:38:06 -0400 Subject: [PATCH 15/19] Update runtime script to configure hugepages --- scripts/setup_runtime.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/scripts/setup_runtime.sh b/scripts/setup_runtime.sh index 402524128..9fe7565fd 100755 --- a/scripts/setup_runtime.sh +++ b/scripts/setup_runtime.sh @@ -38,13 +38,24 @@ # # Sets configuration items on the host system required to run openNetVM -# Check to make sure this script is running in the correct working +arg_hugepages=true + +# Basic check to make sure this script is running in the correct working # directory. -# Ensure we're working relative to the onvm root directory if [ "$(basename "$(pwd)")" != "openNetVM" ]; then echo "Please run the installation script from the parent openNetVM directory" fi +# Parse the passed arguments, and set the appropriate flags if a +# particular argument is detected +for arg in "$@" +do + if [[ $arg == "--nohugepages" ]]; then + arg_hugepages=false + break + fi +done + # Check sudo privileges sudo -v @@ -80,4 +91,16 @@ if [ "${PIPESTATUS[0]}" != 0 ]; then sudo insmod ./subprojects/dpdk-kmods/linux/igb_uio/igb_uio.ko else echo "- uio kernel module already loaded" +fi + + +# (4) +# Setup hugepages. +# This will be skipped if --nohugepages is passed in. +if [ "$arg_hugepages" = true ]; then + echo "- Configuring hugepages" + . ./scripts/dpdk_helper_scripts.sh + set_numa_pages "$hp_count" +else + echo "- Skipping hugepages" fi \ No newline at end of file From 7ca9af2c2e24c64568c71f062e4ad855bd6e3e75 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Mon, 26 Aug 2024 16:15:41 -0400 Subject: [PATCH 16/19] Fix install script on CloudLab and README --- .gitignore | 5 ++++- README.md | 4 ++-- scripts/install.sh | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8b9c4e6ed..6f0314dc4 100644 --- a/.gitignore +++ b/.gitignore @@ -56,4 +56,7 @@ env # Meson artifacts /insstall -**/insstall/** \ No newline at end of file +**/insstall/** + +# Submodules +/subprojects/dpdk-kmods/* \ No newline at end of file diff --git a/README.md b/README.md index 4e2617bec..410167e59 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,12 @@ You can find information about research projects building on [OpenNetVM][onvm] a ## Getting Started -We've provided a bash script to assist with setting up your development environment for working with OpenNetVM. Take a look at [`scripts/setup.sh`](/scripts/setup.sh) to see a full list of installed packages. +We've provided two scripts to install required dependencies, and configure your machine to run OpenNetVM. Required dependencies are installed by [`scripts/install.sh`](/scripts/install.sh), and configuration is done by [`scripts/setup_runtime.sh`](/scripts/setup_runtime.sh). From the `openNetVM` folder, run the following two commands: ```text -./scripts/setup.sh +./scripts/install.sh ``` ```text diff --git a/scripts/install.sh b/scripts/install.sh index 2128f1e5b..da1398bf0 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -80,6 +80,7 @@ required=$(IFS=' '; echo "${packages[*]}") echo "- Installing required packages" if [ "$install_packages" = true ]; then echo " - installing: $required" + sudo apt-get update sudo apt-get install $required else echo " - skipping due to --noinstall flag" From e823acd135248d0683bb35f5984f23b2eaa56535 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Mon, 26 Aug 2024 19:31:31 -0400 Subject: [PATCH 17/19] Update install location and tags --- .gitignore | 5 ++++- examples/meson.build | 4 ++-- meson.build | 3 +++ onvm/lib/meson.build | 4 +++- onvm/onvm_mgr/meson.build | 4 ++-- onvm/onvm_nflib/meson.build | 4 +++- scripts/build.sh | 5 +++++ scripts/start.sh | 2 +- 8 files changed, 23 insertions(+), 8 deletions(-) create mode 100755 scripts/build.sh diff --git a/.gitignore b/.gitignore index 6f0314dc4..f4defeed1 100644 --- a/.gitignore +++ b/.gitignore @@ -59,4 +59,7 @@ env **/insstall/** # Submodules -/subprojects/dpdk-kmods/* \ No newline at end of file +/subprojects/dpdk-kmods/* + +# Output directories +/bin \ No newline at end of file diff --git a/examples/meson.build b/examples/meson.build index 0ba664178..bcbe57f13 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -38,8 +38,8 @@ foreach example : onvm_examples sources, include_directories: includes, dependencies: [onvm_dpdk_shared_dep, onvm_nflib_dep], - install_tag: name, install: true, - install_dir: onvm_source + '/examples/' + example + install_tag: 'onvm', + install_dir: onvm_output_dir + '/nf/' + example ) endforeach diff --git a/meson.build b/meson.build index e0a9e7ead..0b9310039 100644 --- a/meson.build +++ b/meson.build @@ -4,6 +4,9 @@ add_global_arguments('-msse4', language : 'c') cc = meson.get_compiler('c') onvm_source = meson.current_source_dir() +# Output directory that executables are installed into +onvm_output_dir = meson.current_source_dir() + '/bin' + # ONVM configurations onvm_mgr_app_name = 'onvm_mgr' diff --git a/onvm/lib/meson.build b/onvm/lib/meson.build index 3dbf6cf42..9dcea39ad 100644 --- a/onvm/lib/meson.build +++ b/onvm/lib/meson.build @@ -6,7 +6,9 @@ libonvmhelper = library( 'libonvmhelper', sources, include_directories : libonvmhelper_includes, - install: true + install: true, + install_tag: 'onvm', + install_dir: onvm_output_dir + '/lib' ) libonvmhelper_dep = declare_dependency( diff --git a/onvm/onvm_mgr/meson.build b/onvm/onvm_mgr/meson.build index 77eb259de..8a03c4a54 100644 --- a/onvm/onvm_mgr/meson.build +++ b/onvm/onvm_mgr/meson.build @@ -14,6 +14,6 @@ executable(onvm_mgr_app_name, include_directories: [onvm_mgr_include, onvm_includes], dependencies: [onvm_dpdk_shared_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep], install: true, - install_dir: onvm_source + '/onvm/onvm_mgr', - install_tag: 'onvm_mgr' + install_tag: 'onvm', + install_dir: onvm_output_dir, ) \ No newline at end of file diff --git a/onvm/onvm_nflib/meson.build b/onvm/onvm_nflib/meson.build index 63593d627..098da150a 100644 --- a/onvm/onvm_nflib/meson.build +++ b/onvm/onvm_nflib/meson.build @@ -22,7 +22,9 @@ libonvm = library( sources, include_directories : libonvm_includes, dependencies : libonvm_deps, - install: true) + install: true, + install_tag: 'onvm', + install_dir: onvm_output_dir + '/lib') libonvm_dep = declare_dependency( link_with: libonvm, diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 000000000..c71b84317 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +meson build +ninja -C build +meson install -C build --tags=onvm \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh index 44092cb89..c7c724899 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -272,7 +272,7 @@ fi sudo rm -rf /mnt/huge/rtemap_* # watch out for variable expansion # shellcheck disable=SC2086 -sudo ./onvm/onvm_mgr/onvm_mgr -l "$cpu" -n 4 --proc-type=primary ${virt_addr} -- -p ${ports} -n ${nf_cores} ${num_srvc} ${def_srvc} ${stats} ${stats_sleep_time} ${verbosity_level} ${ttl} ${packet_limit} ${shared_cpu_flag} ${jumbo_frames_flag} +sudo ./bin/onvm_mgr -l "$cpu" -n 4 --proc-type=primary ${virt_addr} -- -p ${ports} -n ${nf_cores} ${num_srvc} ${def_srvc} ${stats} ${stats_sleep_time} ${verbosity_level} ${ttl} ${packet_limit} ${shared_cpu_flag} ${jumbo_frames_flag} if [ "${stats}" = "-s web" ] then From 7356263f7d1844c94a0c4f840643f671640da436 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Mon, 9 Sep 2024 14:26:48 -0400 Subject: [PATCH 18/19] Fix pthread missing dep that occurs on cloudlab --- meson.build | 1 + onvm/onvm_mgr/meson.build | 2 +- onvm/onvm_nflib/meson.build | 1 + scripts/setup_cloudlab.sh | 56 ------------------------------------- 4 files changed, 3 insertions(+), 57 deletions(-) delete mode 100755 scripts/setup_cloudlab.sh diff --git a/meson.build b/meson.build index 0b9310039..17ab89dcf 100644 --- a/meson.build +++ b/meson.build @@ -18,6 +18,7 @@ onvm_dpdk_shared_dep = onvm_dpdk.get_variable('dpdk_shared_lib_deps') # ONVM dependencies onvm_nflib_dep = [] onvm_math_dep = cc.find_library('m') +onvm_thread_dep = dependency('threads') # Include directories to be used when building components and examples onvm_includes = include_directories('onvm/', diff --git a/onvm/onvm_mgr/meson.build b/onvm/onvm_mgr/meson.build index 8a03c4a54..4d363b40a 100644 --- a/onvm/onvm_mgr/meson.build +++ b/onvm/onvm_mgr/meson.build @@ -12,7 +12,7 @@ onvm_mgr_include = include_directories('.') executable(onvm_mgr_app_name, sources, include_directories: [onvm_mgr_include, onvm_includes], - dependencies: [onvm_dpdk_shared_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep], + dependencies: [onvm_dpdk_shared_dep, onvm_thread_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep], install: true, install_tag: 'onvm', install_dir: onvm_output_dir, diff --git a/onvm/onvm_nflib/meson.build b/onvm/onvm_nflib/meson.build index 098da150a..ec6e7c38a 100644 --- a/onvm/onvm_nflib/meson.build +++ b/onvm/onvm_nflib/meson.build @@ -14,6 +14,7 @@ libonvm_includes = include_directories('.') libonvm_deps = [ onvm_dpdk_shared_dep, + onvm_thread_dep, libonvmhelper_dep ] diff --git a/scripts/setup_cloudlab.sh b/scripts/setup_cloudlab.sh deleted file mode 100755 index 13fa79618..000000000 --- a/scripts/setup_cloudlab.sh +++ /dev/null @@ -1,56 +0,0 @@ -#! /bin/bash - -# openNetVM -# https://sdnfv.github.io -# -# OpenNetVM is distributed under the following BSD LICENSE: -# -# Copyright(c) -# 2015-2017 George Washington University -# 2015-2017 University of California Riverside -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# A script to configure dpdk environment variables on the cloudlab server - -ONVM_PATH=/local/onvm/openNetVM -DPDK_PATH=/local/onvm/openNetVM/dpdk - -if [ -z "$RTE_TARGET" ]; then - export RTE_TARGET=x86_64-native-linuxapp-gcc -fi - -if [ -z "$RTE_SDK" ]; then - export RTE_SDK=$DPDK_PATH -fi - -if [ -z "$ONVM_HOME" ]; then - export ONVM_HOME=$ONVM_PATH -fi - -bash "$ONVM_HOME"/scripts/setup_environment.sh From 06e732f90e77efe8a8e4b27defc3e1259ff4c404 Mon Sep 17 00:00:00 2001 From: Benjamin Marasco Date: Tue, 10 Sep 2024 00:10:20 -0400 Subject: [PATCH 19/19] Update to use system wide dpdk install --- README.md | 19 +++++++------------ examples/meson.build | 2 +- meson.build | 6 +++--- onvm/lib/meson.build | 3 +-- onvm/onvm_mgr/meson.build | 2 +- onvm/onvm_nflib/meson.build | 6 +++--- scripts/install.sh | 17 ++++++++++++++--- 7 files changed, 30 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 410167e59..7306deb1a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ We've provided two scripts to install required dependencies, and configure your From the `openNetVM` folder, run the following two commands: ```text -./scripts/install.sh +sudo ./scripts/install.sh ``` ```text @@ -31,25 +31,20 @@ sudo ./scripts/setup_runtime.sh OpenNetVM uses the [Meson][meson] build system to compile all components, including dpdk. From the `openNetVM` parent folder run the following to setup build: ```text -meson build +./scripts/build.sh ``` -Then, `cd` into the build folder and run ninja to compile: +This will take care of the Meson build setup, compilation, and installation of onvm shared libriaries. + +Afterwards you may need to run the following comand to update the linker. ```text -cd ./build -ninja +ldconfig ``` ### Running onvm_mgr -After finishing build, from the build directory, you can run the `install` command to place the compiled executables in ther source directories. - -```text -meson install -``` - -Then, you can use our provided startup script to launch onvm_mgr. This scripts assumes the `openNetVM` folder is your working directory. +You can use our provided startup script to launch onvm_mgr. This scripts assumes the `openNetVM` folder is your working directory. ```text ./scripts/startup.sh diff --git a/examples/meson.build b/examples/meson.build index bcbe57f13..40e4e6328 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -37,7 +37,7 @@ foreach example : onvm_examples name, sources, include_directories: includes, - dependencies: [onvm_dpdk_shared_dep, onvm_nflib_dep], + dependencies: [onvm_dpdk_dep, onvm_nflib_dep], install: true, install_tag: 'onvm', install_dir: onvm_output_dir + '/nf/' + example diff --git a/meson.build b/meson.build index 17ab89dcf..e7aa13706 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,5 @@ project('openNetVM', 'c') + add_global_arguments('-msse4', language : 'c') cc = meson.get_compiler('c') @@ -11,14 +12,13 @@ onvm_output_dir = meson.current_source_dir() + '/bin' onvm_mgr_app_name = 'onvm_mgr' # DPDK dependencies -onvm_dpdk = subproject('dpdk') -onvm_dpdk_dep = onvm_dpdk.get_variable('dpdk_static_lib_deps') -onvm_dpdk_shared_dep = onvm_dpdk.get_variable('dpdk_shared_lib_deps') +onvm_dpdk_dep = dependency('libdpdk') # ONVM dependencies onvm_nflib_dep = [] onvm_math_dep = cc.find_library('m') onvm_thread_dep = dependency('threads') +onvm_systemd_dep = cc.find_library('systemd') # Include directories to be used when building components and examples onvm_includes = include_directories('onvm/', diff --git a/onvm/lib/meson.build b/onvm/lib/meson.build index 9dcea39ad..f09d96b36 100644 --- a/onvm/lib/meson.build +++ b/onvm/lib/meson.build @@ -7,8 +7,7 @@ libonvmhelper = library( sources, include_directories : libonvmhelper_includes, install: true, - install_tag: 'onvm', - install_dir: onvm_output_dir + '/lib' + install_tag: 'onvm' ) libonvmhelper_dep = declare_dependency( diff --git a/onvm/onvm_mgr/meson.build b/onvm/onvm_mgr/meson.build index 4d363b40a..dd15464c2 100644 --- a/onvm/onvm_mgr/meson.build +++ b/onvm/onvm_mgr/meson.build @@ -12,7 +12,7 @@ onvm_mgr_include = include_directories('.') executable(onvm_mgr_app_name, sources, include_directories: [onvm_mgr_include, onvm_includes], - dependencies: [onvm_dpdk_shared_dep, onvm_thread_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep], + dependencies: [onvm_dpdk_dep, onvm_thread_dep, libonvm_dep, libonvmhelper_dep, onvm_math_dep], install: true, install_tag: 'onvm', install_dir: onvm_output_dir, diff --git a/onvm/onvm_nflib/meson.build b/onvm/onvm_nflib/meson.build index ec6e7c38a..e0154ac46 100644 --- a/onvm/onvm_nflib/meson.build +++ b/onvm/onvm_nflib/meson.build @@ -13,7 +13,7 @@ sources = files( libonvm_includes = include_directories('.') libonvm_deps = [ - onvm_dpdk_shared_dep, + onvm_dpdk_dep, onvm_thread_dep, libonvmhelper_dep ] @@ -23,9 +23,9 @@ libonvm = library( sources, include_directories : libonvm_includes, dependencies : libonvm_deps, + pic: true, install: true, - install_tag: 'onvm', - install_dir: onvm_output_dir + '/lib') + install_tag: 'onvm') libonvm_dep = declare_dependency( link_with: libonvm, diff --git a/scripts/install.sh b/scripts/install.sh index da1398bf0..a55ab5922 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -48,7 +48,8 @@ packages=("build-essential" \ "ninja-build" \ "pkg-config" \ "libnuma-dev" \ - "libpcap-dev") + "libpcap-dev" \ + "libsystemd-dev") install_packages=true pypackages=("meson" \ @@ -81,7 +82,7 @@ echo "- Installing required packages" if [ "$install_packages" = true ]; then echo " - installing: $required" sudo apt-get update - sudo apt-get install $required + sudo apt-get install $required -y else echo " - skipping due to --noinstall flag" fi @@ -110,4 +111,14 @@ pip3 install $pyrequired # Build the dpdk-kmods uio kernel module echo "- Building the dpdk-kmods uio kernel module" cd subprojects/dpdk-kmods/linux/igb_uio -make \ No newline at end of file +make +cd - + +# (5) +# Install dpdk +echo "- Installing dpdk" +cd subprojects/dpdk +meson build +ninja -C build +ninja -C build install +sudo ldconfig