aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2019-02-28 05:58:56 -0800
committerDamjan Marion <dmarion@me.com>2019-03-01 20:25:39 +0000
commit01f5c90259766708c66ed1548398fd52ebbfadb0 (patch)
tree3a309e2c6193ea8ac4daafb2e4f56b770132749c
parentbbe2de1fbf06da4f420c292d3e7c73f9b588c53e (diff)
pppoe: migrate old MULTIARCH macros to VLIB_NODE_FN
Change-Id: I0af8104f6d35820aa39d22cd23d4f9211d61faa0 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
-rw-r--r--src/plugins/pppoe/CMakeLists.txt4
-rw-r--r--src/plugins/pppoe/pppoe_cp_node.c8
-rw-r--r--src/plugins/pppoe/pppoe_decap.c6
3 files changed, 6 insertions, 12 deletions
diff --git a/src/plugins/pppoe/CMakeLists.txt b/src/plugins/pppoe/CMakeLists.txt
index 61ed7a4eb09..33f9b57230b 100644
--- a/src/plugins/pppoe/CMakeLists.txt
+++ b/src/plugins/pppoe/CMakeLists.txt
@@ -19,6 +19,10 @@ add_vpp_plugin(pppoe
pppoe_cp_node.c
pppoe_decap.c
+ MULTIARCH_SOURCES
+ pppoe_cp_node.c
+ pppoe_decap.c
+
API_FILES
pppoe.api
diff --git a/src/plugins/pppoe/pppoe_cp_node.c b/src/plugins/pppoe/pppoe_cp_node.c
index 884d207d655..3f866450cfb 100644
--- a/src/plugins/pppoe/pppoe_cp_node.c
+++ b/src/plugins/pppoe/pppoe_cp_node.c
@@ -19,8 +19,6 @@
#include <vnet/ppp/packet.h>
#include <pppoe/pppoe.h>
-vlib_node_registration_t pppoe_cp_dispatch_node;
-
#define foreach_pppoe_cp_next \
_(DROP, "error-drop") \
_(INTERFACE, "interface-output" ) \
@@ -66,8 +64,7 @@ static u8 * format_pppoe_cp_trace (u8 * s, va_list * args)
return s;
}
-static uword
-pppoe_cp_dispatch (vlib_main_t * vm,
+VLIB_NODE_FN (pppoe_cp_dispatch_node) (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
{
@@ -236,7 +233,6 @@ pppoe_cp_dispatch (vlib_main_t * vm,
}
VLIB_REGISTER_NODE (pppoe_cp_dispatch_node) = {
- .function = pppoe_cp_dispatch,
.name = "pppoe-cp-dispatch",
/* Takes a vector of packets. */
.vector_size = sizeof (u32),
@@ -251,5 +247,3 @@ VLIB_REGISTER_NODE (pppoe_cp_dispatch_node) = {
.format_trace = format_pppoe_cp_trace,
};
-VLIB_NODE_FUNCTION_MULTIARCH (pppoe_cp_dispatch_node, pppoe_cp_dispatch)
-
diff --git a/src/plugins/pppoe/pppoe_decap.c b/src/plugins/pppoe/pppoe_decap.c
index 4f9e766e7f1..256dd83e43d 100644
--- a/src/plugins/pppoe/pppoe_decap.c
+++ b/src/plugins/pppoe/pppoe_decap.c
@@ -46,8 +46,7 @@ static u8 * format_pppoe_rx_trace (u8 * s, va_list * args)
return s;
}
-static uword
-pppoe_input (vlib_main_t * vm,
+VLIB_NODE_FN (pppoe_input_node) (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
{
@@ -399,7 +398,6 @@ static char * pppoe_error_strings[] = {
};
VLIB_REGISTER_NODE (pppoe_input_node) = {
- .function = pppoe_input,
.name = "pppoe-input",
/* Takes a vector of packets. */
.vector_size = sizeof (u32),
@@ -417,6 +415,4 @@ VLIB_REGISTER_NODE (pppoe_input_node) = {
.format_trace = format_pppoe_rx_trace,
};
-VLIB_NODE_FUNCTION_MULTIARCH (pppoe_input_node, pppoe_input)
-
='n83' href='#n83'>83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
#!/usr/bin/env bash

# Copyright (c) 2020 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -xuo pipefail

# Setting variables.
DPDK_DIR="dpdk"
ROOTDIR="/tmp/openvpp-testing"
TESTPMDLOG="screenlog.0"
PWDDIR="$(pwd)"

# Setting command line arguments.
cpu_corelist="${1}"
nb_cores="${2}"
queue_nums="${3}"
jumbo_frames="${4}"
rxd="${5:-128}"
txd="${6:-512}"
arch="$(uname -m)"

# DPDK prefers "arm64" to "aarch64" and does not allow arm64 native target.
if [ "${arch}" == "aarch64" ]; then
    arch="arm64"
    machine="armv8a"
else
    machine="native"
fi

# Try to kill the testpmd.
sudo pgrep testpmd
if [ ${?} -eq "0" ]; then
    success=false
    sudo pkill testpmd
    echo "RC = ${?}"
    for attempt in {1..60}; do
        echo "Checking if testpmd is still alive, attempt nr ${attempt}"
        sudo pgrep testpmd
        if [ ${?} -eq "1" ]; then
            echo "testpmd is dead"
            success=true
            break
        fi
        echo "testpmd is still alive, waiting 1 second"
        sleep 1
    done
    if [ "${success}" = false ]; then
        echo "The command sudo pkill testpmd failed"
        sudo pkill -9 testpmd
        echo "RC = ${?}"
        exit 1
    fi
else
    echo "testpmd is not running"
fi

# Try to kill the l3fwd.
sudo pgrep l3fwd
if [ ${?} -eq "0" ]; then
    success=false
    sudo pkill l3fwd
    echo "RC = ${?}"
    for attempt in {1..60}; do
        echo "Checking if l3fwd is still alive, attempt nr ${attempt}"
        sudo pgrep l3fwd
        if [ ${?} -eq "1" ]; then
            echo "l3fwd is dead"
            success=true
            break
        fi
        echo "l3fwd is still alive, waiting 1 second"
        sleep 1
    done
    if [ "${success}" = false ]; then
        echo "The command sudo pkill l3fwd failed"
        sudo pkill -9 l3fwd
        echo "RC = ${?}"
        exit 1
    fi
else
    echo "l3fwd is not running"
fi

# Remove hugepages.
sudo rm -f /dev/hugepages/*

sleep 2

cd "${ROOTDIR}/${DPDK_DIR}/"
rm -f "${TESTPMDLOG}"
TESTPMD_BIN="./${arch}-${machine}-linuxapp-gcc/app/testpmd"

if [ "${jumbo_frames}" = "yes" ]; then
    sudo sh -c "screen -dmSL DPDK-test ${TESTPMD_BIN} \
        -l ${cpu_corelist} -n 4 --log-level 8 -v -- \
        --numa \
        --nb-ports=2 \
        --portmask=0x3 \
        --nb-cores=${nb_cores} \
        --max-pkt-len=9000 \
        --tx-offloads=0x7FFFFFFF \
        --forward-mode=io \
        --rxq=${queue_nums} \
        --txq=$((${nb_cores} + 1)) \
        --burst=64 \
        --rxd=${rxd} \
        --txd=${txd} \
        --disable-link-check \
        --auto-start"
else
    sudo sh -c "screen -dmSL DPDK-test ${TESTPMD_BIN} \
        -l ${cpu_corelist} -n 4 --log-level 8 -v -- \
        --numa \
        --nb-ports=2 \
        --portmask=0x3 \
        --nb-cores=${nb_cores} \
        --forward-mode=io \
        --rxq=${queue_nums} \
        --txq=$((${nb_cores} + 1)) \
        --burst=64 \
        --rxd=${rxd} \
        --txd=${txd} \
        --disable-link-check \
        --auto-start"
fi

for attempt in {1..60}; do
    echo "Checking if testpmd is alive, attempt nr ${attempt}"
    fgrep "Press enter to exit" "${TESTPMDLOG}"
    if [ "${?}" -eq "0" ]; then
        exit 0
    fi
    sleep 1
done
cat "${TESTPMDLOG}"

exit 1