|
Open vSwitch CI |
49a9e2 |
diff --git a/.ci/dpdk-build.sh b/.ci/dpdk-build.sh
|
|
Open vSwitch CI |
49a9e2 |
new file mode 100755
|
|
Open vSwitch CI |
49a9e2 |
index 000000000..02dcefef6
|
|
Open vSwitch CI |
49a9e2 |
--- /dev/null
|
|
Open vSwitch CI |
49a9e2 |
+++ b/.ci/dpdk-build.sh
|
|
Open vSwitch CI |
49a9e2 |
@@ -0,0 +1,54 @@
|
|
Open vSwitch CI |
49a9e2 |
+#!/bin/bash
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+set -o errexit
|
|
Open vSwitch CI |
49a9e2 |
+set -x
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+function build_dpdk()
|
|
Open vSwitch CI |
49a9e2 |
+{
|
|
Open vSwitch CI |
49a9e2 |
+ local VERSION_FILE="dpdk-dir/cached-version"
|
|
Open vSwitch CI |
49a9e2 |
+ local DPDK_VER=$1
|
|
Open vSwitch CI |
49a9e2 |
+ local DPDK_OPTS=""
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ rm -rf dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
|
|
Open vSwitch CI |
49a9e2 |
+ git clone --single-branch $DPDK_GIT dpdk-dir -b "${DPDK_VER##refs/*/}"
|
|
Open vSwitch CI |
49a9e2 |
+ pushd dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
+ git log -1 --oneline
|
|
Open vSwitch CI |
49a9e2 |
+ else
|
|
Open vSwitch CI |
49a9e2 |
+ wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz
|
|
Open vSwitch CI |
49a9e2 |
+ tar xvf dpdk-$1.tar.xz > /dev/null
|
|
Open vSwitch CI |
49a9e2 |
+ DIR_NAME=$(tar -tf dpdk-$1.tar.xz | head -1 | cut -f1 -d"/")
|
|
Open vSwitch CI |
49a9e2 |
+ mv ${DIR_NAME} dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
+ pushd dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
+ fi
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ # Switching to 'default' machine to make dpdk-dir cache usable on
|
|
Open vSwitch CI |
49a9e2 |
+ # different CPUs. We can't be sure that all CI machines are exactly same.
|
|
Open vSwitch CI |
49a9e2 |
+ DPDK_OPTS="$DPDK_OPTS -Dmachine=default"
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ # Disable building DPDK unit tests. Not needed for OVS build or tests.
|
|
Open vSwitch CI |
49a9e2 |
+ DPDK_OPTS="$DPDK_OPTS -Dtests=false"
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ # Disable DPDK developer mode, this results in less build checks and less
|
|
Open vSwitch CI |
49a9e2 |
+ # meson verbose outputs.
|
|
Open vSwitch CI |
49a9e2 |
+ DPDK_OPTS="$DPDK_OPTS -Ddeveloper_mode=disabled"
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ # OVS compilation and "normal" unit tests (run in the CI) do not depend on
|
|
Open vSwitch CI |
49a9e2 |
+ # any DPDK driver being present.
|
|
Open vSwitch CI |
49a9e2 |
+ # We can disable all drivers to save compilation time.
|
|
Open vSwitch CI |
49a9e2 |
+ DPDK_OPTS="$DPDK_OPTS -Ddisable_drivers=*/*"
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ # Install DPDK using prefix.
|
|
Open vSwitch CI |
49a9e2 |
+ DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ meson $DPDK_OPTS build
|
|
Open vSwitch CI |
49a9e2 |
+ ninja -C build
|
|
Open vSwitch CI |
49a9e2 |
+ ninja -C build install
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ echo "Installed DPDK in $(pwd)"
|
|
Open vSwitch CI |
49a9e2 |
+ popd
|
|
Open vSwitch CI |
49a9e2 |
+ echo "${DPDK_VER}" > ${VERSION_FILE}
|
|
Open vSwitch CI |
49a9e2 |
+}
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+build_dpdk $DPDK_VER
|
|
Open vSwitch CI |
49a9e2 |
diff --git a/.ci/dpdk-prepare.sh b/.ci/dpdk-prepare.sh
|
|
Open vSwitch CI |
49a9e2 |
new file mode 100755
|
|
Open vSwitch CI |
49a9e2 |
index 000000000..f7e6215dd
|
|
Open vSwitch CI |
49a9e2 |
--- /dev/null
|
|
Open vSwitch CI |
49a9e2 |
+++ b/.ci/dpdk-prepare.sh
|
|
Open vSwitch CI |
49a9e2 |
@@ -0,0 +1,11 @@
|
|
Open vSwitch CI |
49a9e2 |
+#!/bin/bash
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+set -ev
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+# Installing wheel separately because it may be needed to build some
|
|
Open vSwitch CI |
49a9e2 |
+# of the packages during dependency backtracking and pip >= 22.0 will
|
|
Open vSwitch CI |
49a9e2 |
+# abort backtracking on build failures:
|
|
Open vSwitch CI |
49a9e2 |
+# https://github.com/pypa/pip/issues/10655
|
|
Open vSwitch CI |
49a9e2 |
+pip3 install --disable-pip-version-check --user wheel
|
|
Open vSwitch CI |
49a9e2 |
+pip3 install --disable-pip-version-check --user pyelftools
|
|
Open vSwitch CI |
49a9e2 |
+pip3 install --user 'meson==0.53.2'
|
|
Open vSwitch CI |
49a9e2 |
diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
|
|
Open vSwitch CI |
49a9e2 |
index 10021fddb..99850a943 100755
|
|
Open vSwitch CI |
49a9e2 |
--- a/.ci/linux-build.sh
|
|
Open vSwitch CI |
49a9e2 |
+++ b/.ci/linux-build.sh
|
|
Open vSwitch CI |
49a9e2 |
@@ -9,9 +9,7 @@ EXTRA_OPTS="--enable-Werror"
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
function install_dpdk()
|
|
Open vSwitch CI |
49a9e2 |
{
|
|
Open vSwitch CI |
49a9e2 |
- local DPDK_VER=$1
|
|
Open vSwitch CI |
49a9e2 |
local VERSION_FILE="dpdk-dir/cached-version"
|
|
Open vSwitch CI |
49a9e2 |
- local DPDK_OPTS=""
|
|
Open vSwitch CI |
49a9e2 |
local DPDK_LIB=$(pwd)/dpdk-dir/build/lib/x86_64-linux-gnu
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
if [ "$DPDK_SHARED" ]; then
|
|
Open vSwitch CI |
49a9e2 |
@@ -24,63 +22,14 @@ function install_dpdk()
|
|
Open vSwitch CI |
49a9e2 |
# Export the following path for pkg-config to find the .pc file.
|
|
Open vSwitch CI |
49a9e2 |
export PKG_CONFIG_PATH=$DPDK_LIB/pkgconfig/:$PKG_CONFIG_PATH
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
- if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
|
|
Open vSwitch CI |
49a9e2 |
- # Avoid using cache for git tree build.
|
|
Open vSwitch CI |
49a9e2 |
- rm -rf dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
- DPDK_GIT=${DPDK_GIT:-https://dpdk.org/git/dpdk}
|
|
Open vSwitch CI |
49a9e2 |
- git clone --single-branch $DPDK_GIT dpdk-dir -b "${DPDK_VER##refs/*/}"
|
|
Open vSwitch CI |
49a9e2 |
- pushd dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
- git log -1 --oneline
|
|
Open vSwitch CI |
49a9e2 |
- else
|
|
Open vSwitch CI |
49a9e2 |
- if [ -f "${VERSION_FILE}" ]; then
|
|
Open vSwitch CI |
49a9e2 |
- VER=$(cat ${VERSION_FILE})
|
|
Open vSwitch CI |
49a9e2 |
- if [ "${VER}" = "${DPDK_VER}" ]; then
|
|
Open vSwitch CI |
49a9e2 |
- # Update the library paths.
|
|
Open vSwitch CI |
49a9e2 |
- sudo ldconfig
|
|
Open vSwitch CI |
49a9e2 |
- echo "Found cached DPDK ${VER} build in $(pwd)/dpdk-dir"
|
|
Open vSwitch CI |
49a9e2 |
- return
|
|
Open vSwitch CI |
49a9e2 |
- fi
|
|
Open vSwitch CI |
49a9e2 |
- fi
|
|
Open vSwitch CI |
49a9e2 |
- # No cache or version mismatch.
|
|
Open vSwitch CI |
49a9e2 |
- rm -rf dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
- wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz
|
|
Open vSwitch CI |
49a9e2 |
- tar xvf dpdk-$1.tar.xz > /dev/null
|
|
Open vSwitch CI |
49a9e2 |
- DIR_NAME=$(tar -tf dpdk-$1.tar.xz | head -1 | cut -f1 -d"/")
|
|
Open vSwitch CI |
49a9e2 |
- mv ${DIR_NAME} dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
- pushd dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
+ if [ ! -f "${VERSION_FILE}" ]; then
|
|
Open vSwitch CI |
49a9e2 |
+ echo "Could not find DPDK in $(pwd)/dpdk-dir"
|
|
Open vSwitch CI |
49a9e2 |
+ return 1
|
|
Open vSwitch CI |
49a9e2 |
fi
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
- # Switching to 'default' machine to make dpdk-dir cache usable on
|
|
Open vSwitch CI |
49a9e2 |
- # different CPUs. We can't be sure that all CI machines are exactly same.
|
|
Open vSwitch CI |
49a9e2 |
- DPDK_OPTS="$DPDK_OPTS -Dmachine=default"
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
- # Disable building DPDK unit tests. Not needed for OVS build or tests.
|
|
Open vSwitch CI |
49a9e2 |
- DPDK_OPTS="$DPDK_OPTS -Dtests=false"
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
- # Disable DPDK developer mode, this results in less build checks and less
|
|
Open vSwitch CI |
49a9e2 |
- # meson verbose outputs.
|
|
Open vSwitch CI |
49a9e2 |
- DPDK_OPTS="$DPDK_OPTS -Ddeveloper_mode=disabled"
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
- # OVS compilation and "normal" unit tests (run in the CI) do not depend on
|
|
Open vSwitch CI |
49a9e2 |
- # any DPDK driver being present.
|
|
Open vSwitch CI |
49a9e2 |
- # We can disable all drivers to save compilation time.
|
|
Open vSwitch CI |
49a9e2 |
- DPDK_OPTS="$DPDK_OPTS -Ddisable_drivers=*/*"
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
- # Install DPDK using prefix.
|
|
Open vSwitch CI |
49a9e2 |
- DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
- CC=gcc meson $DPDK_OPTS build
|
|
Open vSwitch CI |
49a9e2 |
- ninja -C build
|
|
Open vSwitch CI |
49a9e2 |
- ninja -C build install
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
# Update the library paths.
|
|
Open vSwitch CI |
49a9e2 |
sudo ldconfig
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
- echo "Installed DPDK source in $(pwd)"
|
|
Open vSwitch CI |
49a9e2 |
- popd
|
|
Open vSwitch CI |
49a9e2 |
- echo "${DPDK_VER}" > ${VERSION_FILE}
|
|
Open vSwitch CI |
49a9e2 |
+ echo "Found cached DPDK $(cat ${VERSION_FILE}) build in $(pwd)/dpdk-dir"
|
|
Open vSwitch CI |
49a9e2 |
}
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
function configure_ovs()
|
|
Open vSwitch CI |
49a9e2 |
@@ -130,10 +79,7 @@ assert ovs.json.from_string('{\"a\": 42}') == {'a': 42}"
|
|
Open vSwitch CI |
49a9e2 |
fi
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then
|
|
Open vSwitch CI |
49a9e2 |
- if [ -z "$DPDK_VER" ]; then
|
|
Open vSwitch CI |
49a9e2 |
- DPDK_VER="22.11.1"
|
|
Open vSwitch CI |
49a9e2 |
- fi
|
|
Open vSwitch CI |
49a9e2 |
- install_dpdk $DPDK_VER
|
|
Open vSwitch CI |
49a9e2 |
+ install_dpdk
|
|
Open vSwitch CI |
49a9e2 |
fi
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
if [ "$CC" = "clang" ]; then
|
|
Open vSwitch CI |
49a9e2 |
diff --git a/.ci/linux-prepare.sh b/.ci/linux-prepare.sh
|
|
Open vSwitch CI |
49a9e2 |
index f414a879c..c28b6819a 100755
|
|
Open vSwitch CI |
49a9e2 |
--- a/.ci/linux-prepare.sh
|
|
Open vSwitch CI |
49a9e2 |
+++ b/.ci/linux-prepare.sh
|
|
Open vSwitch CI |
49a9e2 |
@@ -23,8 +23,7 @@ cd ..
|
|
Open vSwitch CI |
49a9e2 |
# https://github.com/pypa/pip/issues/10655
|
|
Open vSwitch CI |
49a9e2 |
pip3 install --disable-pip-version-check --user wheel
|
|
Open vSwitch CI |
49a9e2 |
pip3 install --disable-pip-version-check --user \
|
|
Open vSwitch CI |
49a9e2 |
- flake8 'hacking>=3.0' netaddr pyparsing sphinx setuptools pyelftools
|
|
Open vSwitch CI |
49a9e2 |
-pip3 install --user 'meson==0.53.2'
|
|
Open vSwitch CI |
49a9e2 |
+ flake8 'hacking>=3.0' netaddr pyparsing sphinx setuptools
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
# Install python test dependencies
|
|
Open vSwitch CI |
49a9e2 |
pip3 install -r python/test_requirements.txt
|
|
Open vSwitch CI |
49a9e2 |
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
|
|
Open vSwitch CI |
49a9e2 |
index 82675b973..8e71b9533 100644
|
|
Open vSwitch CI |
49a9e2 |
--- a/.github/workflows/build-and-test.yml
|
|
Open vSwitch CI |
49a9e2 |
+++ b/.github/workflows/build-and-test.yml
|
|
Open vSwitch CI |
49a9e2 |
@@ -3,12 +3,80 @@ name: Build and Test
|
|
Open vSwitch CI |
49a9e2 |
on: [push, pull_request]
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
jobs:
|
|
Open vSwitch CI |
49a9e2 |
+ build-dpdk:
|
|
Open vSwitch CI |
49a9e2 |
+ env:
|
|
Open vSwitch CI |
49a9e2 |
+ dependencies: gcc libnuma-dev ninja-build
|
|
Open vSwitch CI |
49a9e2 |
+ CC: gcc
|
|
Open vSwitch CI |
49a9e2 |
+ DPDK_GIT: https://dpdk.org/git/dpdk-stable
|
|
Open vSwitch CI |
49a9e2 |
+ DPDK_VER: 22.11.1
|
|
Open vSwitch CI |
49a9e2 |
+ name: dpdk gcc
|
|
Open vSwitch CI |
49a9e2 |
+ outputs:
|
|
Open vSwitch CI |
49a9e2 |
+ dpdk_key: ${{ steps.gen_dpdk_key.outputs.key }}
|
|
Open vSwitch CI |
49a9e2 |
+ runs-on: ubuntu-20.04
|
|
Open vSwitch CI |
49a9e2 |
+ timeout-minutes: 30
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ steps:
|
|
Open vSwitch CI |
49a9e2 |
+ - name: checkout
|
|
Open vSwitch CI |
49a9e2 |
+ uses: actions/checkout@v3
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ - name: update PATH
|
|
Open vSwitch CI |
49a9e2 |
+ run: |
|
|
Open vSwitch CI |
49a9e2 |
+ echo "$HOME/bin" >> $GITHUB_PATH
|
|
Open vSwitch CI |
49a9e2 |
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ - name: create ci signature file for the dpdk cache key
|
|
Open vSwitch CI |
49a9e2 |
+ # This will collect most of DPDK related lines, so hash will be different
|
|
Open vSwitch CI |
49a9e2 |
+ # if something changed in a way we're building DPDK including DPDK_VER.
|
|
Open vSwitch CI |
49a9e2 |
+ # This also allows us to use cache from any branch as long as version
|
|
Open vSwitch CI |
49a9e2 |
+ # and a way we're building DPDK stays the same.
|
|
Open vSwitch CI |
49a9e2 |
+ run: |
|
|
Open vSwitch CI |
49a9e2 |
+ grep -irE 'RTE_|DPDK|meson|ninja' .ci/dpdk-* > dpdk-ci-signature
|
|
Open vSwitch CI |
49a9e2 |
+ grep -rwE 'DPDK_GIT|DPDK_VER' .github/ >> dpdk-ci-signature
|
|
Open vSwitch CI |
49a9e2 |
+ if [ "${DPDK_VER##refs/*/}" != "${DPDK_VER}" ]; then
|
|
Open vSwitch CI |
49a9e2 |
+ git ls-remote --heads $DPDK_GIT $DPDK_VER >> dpdk-ci-signature
|
|
Open vSwitch CI |
49a9e2 |
+ fi
|
|
Open vSwitch CI |
49a9e2 |
+ cat dpdk-ci-signature
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ - name: generate ci DPDK key
|
|
Open vSwitch CI |
49a9e2 |
+ id: gen_dpdk_key
|
|
Open vSwitch CI |
49a9e2 |
+ env:
|
|
Open vSwitch CI |
49a9e2 |
+ ci_key: ${{ hashFiles('dpdk-ci-signature') }}
|
|
Open vSwitch CI |
49a9e2 |
+ run: echo 'key=dpdk-${{ env.ci_key }}' >> $GITHUB_OUTPUT
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ - name: cache
|
|
Open vSwitch CI |
49a9e2 |
+ id: dpdk_cache
|
|
Open vSwitch CI |
49a9e2 |
+ uses: actions/cache@v3
|
|
Open vSwitch CI |
49a9e2 |
+ with:
|
|
Open vSwitch CI |
49a9e2 |
+ path: dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
+ key: ${{ steps.gen_dpdk_key.outputs.key }}
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ - name: set up python
|
|
Open vSwitch CI |
49a9e2 |
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
|
|
Open vSwitch CI |
49a9e2 |
+ uses: actions/setup-python@v4
|
|
Open vSwitch CI |
49a9e2 |
+ with:
|
|
Open vSwitch CI |
49a9e2 |
+ python-version: '3.9'
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ - name: update APT cache
|
|
Open vSwitch CI |
49a9e2 |
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
|
|
Open vSwitch CI |
49a9e2 |
+ run: sudo apt update || true
|
|
Open vSwitch CI |
49a9e2 |
+ - name: install common dependencies
|
|
Open vSwitch CI |
49a9e2 |
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
|
|
Open vSwitch CI |
49a9e2 |
+ run: sudo apt install -y ${{ env.dependencies }}
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ - name: prepare
|
|
Open vSwitch CI |
49a9e2 |
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
|
|
Open vSwitch CI |
49a9e2 |
+ run: ./.ci/dpdk-prepare.sh
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
+ - name: build
|
|
Open vSwitch CI |
49a9e2 |
+ if: steps.dpdk_cache.outputs.cache-hit != 'true'
|
|
Open vSwitch CI |
49a9e2 |
+ run: ./.ci/dpdk-build.sh
|
|
Open vSwitch CI |
49a9e2 |
+
|
|
Open vSwitch CI |
49a9e2 |
build-linux:
|
|
Open vSwitch CI |
49a9e2 |
+ needs: build-dpdk
|
|
Open vSwitch CI |
49a9e2 |
env:
|
|
Open vSwitch CI |
49a9e2 |
dependencies: |
|
|
Open vSwitch CI |
49a9e2 |
- automake libtool gcc bc libjemalloc2 libjemalloc-dev \
|
|
Open vSwitch CI |
49a9e2 |
- libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev \
|
|
Open vSwitch CI |
49a9e2 |
- ninja-build selinux-policy-dev libbpf-dev
|
|
Open vSwitch CI |
49a9e2 |
+ automake libtool gcc bc libjemalloc2 libjemalloc-dev libssl-dev \
|
|
Open vSwitch CI |
49a9e2 |
+ llvm-dev libnuma-dev libpcap-dev selinux-policy-dev libbpf-dev
|
|
Open vSwitch CI |
49a9e2 |
ASAN: ${{ matrix.asan }}
|
|
Open vSwitch CI |
49a9e2 |
UBSAN: ${{ matrix.ubsan }}
|
|
Open vSwitch CI |
49a9e2 |
CC: ${{ matrix.compiler }}
|
|
Open vSwitch CI |
49a9e2 |
@@ -104,25 +172,12 @@ jobs:
|
|
Open vSwitch CI |
49a9e2 |
with:
|
|
Open vSwitch CI |
49a9e2 |
python-version: '3.9'
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
- - name: create ci signature file for the dpdk cache key
|
|
Open vSwitch CI |
49a9e2 |
- if: matrix.dpdk != '' || matrix.dpdk_shared != ''
|
|
Open vSwitch CI |
49a9e2 |
- # This will collect most of DPDK related lines, so hash will be different
|
|
Open vSwitch CI |
49a9e2 |
- # if something changed in a way we're building DPDK including DPDK_VER.
|
|
Open vSwitch CI |
49a9e2 |
- # This also allows us to use cache from any branch as long as version
|
|
Open vSwitch CI |
49a9e2 |
- # and a way we're building DPDK stays the same.
|
|
Open vSwitch CI |
49a9e2 |
- run: |
|
|
Open vSwitch CI |
49a9e2 |
- grep -irE 'RTE_|DPDK|meson|ninja' -r .ci/ > dpdk-ci-signature
|
|
Open vSwitch CI |
49a9e2 |
- cat dpdk-ci-signature
|
|
Open vSwitch CI |
49a9e2 |
-
|
|
Open vSwitch CI |
49a9e2 |
- name: cache
|
|
Open vSwitch CI |
49a9e2 |
if: matrix.dpdk != '' || matrix.dpdk_shared != ''
|
|
Open vSwitch CI |
49a9e2 |
uses: actions/cache@v3
|
|
Open vSwitch CI |
49a9e2 |
- env:
|
|
Open vSwitch CI |
49a9e2 |
- matrix_key: ${{ matrix.dpdk }}${{ matrix.dpdk_shared }}
|
|
Open vSwitch CI |
49a9e2 |
- ci_key: ${{ hashFiles('dpdk-ci-signature') }}
|
|
Open vSwitch CI |
49a9e2 |
with:
|
|
Open vSwitch CI |
49a9e2 |
path: dpdk-dir
|
|
Open vSwitch CI |
49a9e2 |
- key: ${{ env.matrix_key }}-${{ env.ci_key }}
|
|
Open vSwitch CI |
49a9e2 |
+ key: ${{ needs.build-dpdk.outputs.dpdk_key }}
|
|
Open vSwitch CI |
49a9e2 |
|
|
Open vSwitch CI |
49a9e2 |
- name: update APT cache
|
|
Open vSwitch CI |
49a9e2 |
run: sudo apt update || true
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
diff --git a/Documentation/ref/ovs-actions.7.rst b/Documentation/ref/ovs-actions.7.rst
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
index b59b7634f..d13895655 100644
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
--- a/Documentation/ref/ovs-actions.7.rst
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+++ b/Documentation/ref/ovs-actions.7.rst
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -1380,7 +1380,7 @@ The ``delete_field`` action
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
| ``delete_field:``\ *field*
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
The ``delete_field`` action deletes a *field* in the syntax described under
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
-`Field Specifications`_ above. Currently, only the ``tun_metadta`` fields are
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+`Field Specifications`_ above. Currently, only the ``tun_metadata`` fields are
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
supported.
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
This action was added in Open vSwitch 2.14.
|
|
Open vSwitch CI |
49a9e2 |
diff --git a/Makefile.am b/Makefile.am
|
|
Open vSwitch CI |
49a9e2 |
index e605187b8..df9c33dfe 100644
|
|
Open vSwitch CI |
49a9e2 |
--- a/Makefile.am
|
|
Open vSwitch CI |
49a9e2 |
+++ b/Makefile.am
|
|
Open vSwitch CI |
49a9e2 |
@@ -75,6 +75,8 @@ EXTRA_DIST = \
|
|
Open vSwitch CI |
49a9e2 |
MAINTAINERS.rst \
|
|
Open vSwitch CI |
49a9e2 |
README.rst \
|
|
Open vSwitch CI |
49a9e2 |
NOTICE \
|
|
Open vSwitch CI |
49a9e2 |
+ .ci/dpdk-build.sh \
|
|
Open vSwitch CI |
49a9e2 |
+ .ci/dpdk-prepare.sh \
|
|
Open vSwitch CI |
49a9e2 |
.ci/linux-build.sh \
|
|
Open vSwitch CI |
49a9e2 |
.ci/linux-prepare.sh \
|
|
Open vSwitch CI |
49a9e2 |
.ci/osx-build.sh \
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
diff --git a/NEWS b/NEWS
|
|
Open vSwitch CI |
bd45b6 |
index 37a01dea5..e59f9530b 100644
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
--- a/NEWS
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+++ b/NEWS
|
|
Open vSwitch CI |
bd45b6 |
@@ -1,3 +1,12 @@
|
|
Open vSwitch CI |
bd45b6 |
+v3.1.2 - xx xxx xxxx
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+--------------------
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
Open vSwitch CI |
bd45b6 |
+v3.1.1 - 06 Apr 2023
|
|
Open vSwitch CI |
bd45b6 |
+--------------------
|
|
Open vSwitch CI |
bd45b6 |
+ - Bug fixes
|
|
Open vSwitch CI |
bd45b6 |
+ - Security:
|
|
Open vSwitch CI |
bd45b6 |
+ * Fixed vulnerability CVE-2023-1668.
|
|
Open vSwitch CI |
bd45b6 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
v3.1.0 - 16 Feb 2023
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
--------------------
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- ovs-vswitchd now detects changes in CPU affinity and adjusts the number
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
diff --git a/configure.ac b/configure.ac
|
|
Open vSwitch CI |
bd45b6 |
index 9bf896c01..78a7ae31a 100644
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
--- a/configure.ac
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+++ b/configure.ac
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -13,7 +13,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
# limitations under the License.
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
AC_PREREQ(2.63)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
-AC_INIT(openvswitch, 3.1.0, bugs@openvswitch.org)
|
|
Open vSwitch CI |
bd45b6 |
+AC_INIT(openvswitch, 3.1.2, bugs@openvswitch.org)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
AC_CONFIG_SRCDIR([vswitchd/ovs-vswitchd.c])
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
AC_CONFIG_MACRO_DIR([m4])
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
AC_CONFIG_AUX_DIR([build-aux])
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
diff --git a/debian/changelog b/debian/changelog
|
|
Open vSwitch CI |
bd45b6 |
index a5ad222c4..4663a2c29 100644
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
--- a/debian/changelog
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+++ b/debian/changelog
|
|
Open vSwitch CI |
bd45b6 |
@@ -1,3 +1,15 @@
|
|
Open vSwitch CI |
bd45b6 |
+openvswitch (3.1.2-1) unstable; urgency=low
|
|
Open vSwitch CI |
bd45b6 |
+ [ Open vSwitch team ]
|
|
Open vSwitch CI |
bd45b6 |
+ * New upstream version
|
|
Open vSwitch CI |
bd45b6 |
+
|
|
Open vSwitch CI |
bd45b6 |
+ -- Open vSwitch team <dev@openvswitch.org> Thu, 06 Apr 2023 15:10:30 +0200
|
|
Open vSwitch CI |
bd45b6 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+openvswitch (3.1.1-1) unstable; urgency=low
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ [ Open vSwitch team ]
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ * New upstream version
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
Open vSwitch CI |
bd45b6 |
+ -- Open vSwitch team <dev@openvswitch.org> Thu, 06 Apr 2023 15:10:30 +0200
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
openvswitch (3.1.0-1) unstable; urgency=low
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
* New upstream version
|
|
Open vSwitch CI |
aaf0be |
diff --git a/include/openvswitch/meta-flow.h b/include/openvswitch/meta-flow.h
|
|
Open vSwitch CI |
aaf0be |
index 045dce8f5..3b0220aaa 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/include/openvswitch/meta-flow.h
|
|
Open vSwitch CI |
aaf0be |
+++ b/include/openvswitch/meta-flow.h
|
|
Open vSwitch CI |
aaf0be |
@@ -2366,6 +2366,10 @@ void mf_format_subvalue(const union mf_subvalue *subvalue, struct ds *s);
|
|
Open vSwitch CI |
aaf0be |
void field_array_set(enum mf_field_id id, const union mf_value *,
|
|
Open vSwitch CI |
aaf0be |
struct field_array *);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+/* Mask the required l3 prerequisites if a 'set' action occurs. */
|
|
Open vSwitch CI |
aaf0be |
+void mf_set_mask_l3_prereqs(const struct mf_field *, const struct flow *,
|
|
Open vSwitch CI |
aaf0be |
+ struct flow_wildcards *);
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
#ifdef __cplusplus
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
#endif
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/classifier.c b/lib/classifier.c
|
|
Open vSwitch CI |
aaf0be |
index 0a89626cc..18dbfc83a 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/classifier.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/classifier.c
|
|
Open vSwitch CI |
aaf0be |
@@ -1695,6 +1695,8 @@ find_match_wc(const struct cls_subtable *subtable, ovs_version_t version,
|
|
Open vSwitch CI |
aaf0be |
const struct cls_match *rule = NULL;
|
|
Open vSwitch CI |
aaf0be |
struct flowmap stages_map = FLOWMAP_EMPTY_INITIALIZER;
|
|
Open vSwitch CI |
aaf0be |
unsigned int mask_offset = 0;
|
|
Open vSwitch CI |
aaf0be |
+ bool adjust_ports_mask = false;
|
|
Open vSwitch CI |
aaf0be |
+ ovs_be32 ports_mask;
|
|
Open vSwitch CI |
aaf0be |
int i;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
/* Try to finish early by checking fields in segments. */
|
|
Open vSwitch CI |
aaf0be |
@@ -1722,6 +1724,9 @@ find_match_wc(const struct cls_subtable *subtable, ovs_version_t version,
|
|
Open vSwitch CI |
aaf0be |
subtable->index_maps[i], flow, wc)) {
|
|
Open vSwitch CI |
aaf0be |
goto no_match;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
+ /* Accumulate the map used so far. */
|
|
Open vSwitch CI |
aaf0be |
+ stages_map = flowmap_or(stages_map, subtable->index_maps[i]);
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
hash = flow_hash_in_minimask_range(flow, &subtable->mask,
|
|
Open vSwitch CI |
aaf0be |
subtable->index_maps[i],
|
|
Open vSwitch CI |
aaf0be |
&mask_offset, &basis);
|
|
Open vSwitch CI |
aaf0be |
@@ -1731,14 +1736,16 @@ find_match_wc(const struct cls_subtable *subtable, ovs_version_t version,
|
|
Open vSwitch CI |
aaf0be |
* unwildcarding all the ports bits, use the ports trie to figure out a
|
|
Open vSwitch CI |
aaf0be |
* smaller set of bits to unwildcard. */
|
|
Open vSwitch CI |
aaf0be |
unsigned int mbits;
|
|
Open vSwitch CI |
aaf0be |
- ovs_be32 value, plens, mask;
|
|
Open vSwitch CI |
aaf0be |
+ ovs_be32 value, plens;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
- mask = miniflow_get_ports(&subtable->mask.masks);
|
|
Open vSwitch CI |
aaf0be |
- value = ((OVS_FORCE ovs_be32 *)flow)[TP_PORTS_OFS32] & mask;
|
|
Open vSwitch CI |
aaf0be |
+ ports_mask = miniflow_get_ports(&subtable->mask.masks);
|
|
Open vSwitch CI |
aaf0be |
+ value = ((OVS_FORCE ovs_be32 *) flow)[TP_PORTS_OFS32] & ports_mask;
|
|
Open vSwitch CI |
aaf0be |
mbits = trie_lookup_value(&subtable->ports_trie, &value, &plens, 32);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
- ((OVS_FORCE ovs_be32 *)&wc->masks)[TP_PORTS_OFS32] |=
|
|
Open vSwitch CI |
aaf0be |
- mask & be32_prefix_mask(mbits);
|
|
Open vSwitch CI |
aaf0be |
+ ports_mask &= be32_prefix_mask(mbits);
|
|
Open vSwitch CI |
aaf0be |
+ ports_mask |= ((OVS_FORCE ovs_be32 *) &wc->masks)[TP_PORTS_OFS32];
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ adjust_ports_mask = true;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
goto no_match;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
@@ -1751,6 +1758,14 @@ no_match:
|
|
Open vSwitch CI |
aaf0be |
/* Unwildcard the bits in stages so far, as they were used in determining
|
|
Open vSwitch CI |
aaf0be |
* there is no match. */
|
|
Open vSwitch CI |
aaf0be |
flow_wildcards_fold_minimask_in_map(wc, &subtable->mask, stages_map);
|
|
Open vSwitch CI |
aaf0be |
+ if (adjust_ports_mask) {
|
|
Open vSwitch CI |
aaf0be |
+ /* This has to be done after updating flow wildcards to overwrite
|
|
Open vSwitch CI |
aaf0be |
+ * the ports mask back. We can't simply disable the corresponding bit
|
|
Open vSwitch CI |
aaf0be |
+ * in the stages map, because it has 64-bit resolution, i.e. one
|
|
Open vSwitch CI |
aaf0be |
+ * bit covers not only tp_src/dst, but also ct_tp_src/dst, which are
|
|
Open vSwitch CI |
aaf0be |
+ * not covered by the trie. */
|
|
Open vSwitch CI |
aaf0be |
+ ((OVS_FORCE ovs_be32 *) &wc->masks)[TP_PORTS_OFS32] = ports_mask;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
return NULL;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
bd45b6 |
diff --git a/lib/conntrack-tp.h b/lib/conntrack-tp.h
|
|
Open vSwitch CI |
bd45b6 |
index 4d411d19f..7ece2eae2 100644
|
|
Open vSwitch CI |
bd45b6 |
--- a/lib/conntrack-tp.h
|
|
Open vSwitch CI |
bd45b6 |
+++ b/lib/conntrack-tp.h
|
|
Open vSwitch CI |
bd45b6 |
@@ -17,8 +17,15 @@
|
|
Open vSwitch CI |
bd45b6 |
#ifndef CONNTRACK_TP_H
|
|
Open vSwitch CI |
bd45b6 |
#define CONNTRACK_TP_H 1
|
|
Open vSwitch CI |
bd45b6 |
|
|
Open vSwitch CI |
bd45b6 |
+#include <stdint.h>
|
|
Open vSwitch CI |
bd45b6 |
+
|
|
Open vSwitch CI |
bd45b6 |
#define CT_DPIF_NETDEV_TP_MIN 30
|
|
Open vSwitch CI |
bd45b6 |
+
|
|
Open vSwitch CI |
bd45b6 |
enum ct_timeout;
|
|
Open vSwitch CI |
bd45b6 |
+struct conn;
|
|
Open vSwitch CI |
bd45b6 |
+struct conntrack;
|
|
Open vSwitch CI |
bd45b6 |
+struct timeout_policy;
|
|
Open vSwitch CI |
bd45b6 |
+
|
|
Open vSwitch CI |
bd45b6 |
void timeout_policy_init(struct conntrack *ct);
|
|
Open vSwitch CI |
bd45b6 |
int timeout_policy_update(struct conntrack *ct, struct timeout_policy *tp);
|
|
Open vSwitch CI |
bd45b6 |
int timeout_policy_delete(struct conntrack *ct, uint32_t tp_id);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
diff --git a/lib/conntrack.c b/lib/conntrack.c
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
index 524670e45..8cf7779c6 100644
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
--- a/lib/conntrack.c
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+++ b/lib/conntrack.c
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -1512,12 +1512,12 @@ conntrack_clean(struct conntrack *ct, long long now)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
clean_end = n_conn_limit / 64;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
for (i = ct->next_sweep; i < N_EXP_LISTS; i++) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- count += ct_sweep(ct, &ct->exp_lists[i], now);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
-
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
if (count > clean_end) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
next_wakeup = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
break;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ count += ct_sweep(ct, &ct->exp_lists[i], now);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
ct->next_sweep = (i < N_EXP_LISTS) ? i : 0;
|
|
Open vSwitch CI |
93dcca |
diff --git a/lib/cpu.c b/lib/cpu.c
|
|
Open vSwitch CI |
93dcca |
index 0292f715e..fbbea4005 100644
|
|
Open vSwitch CI |
93dcca |
--- a/lib/cpu.c
|
|
Open vSwitch CI |
93dcca |
+++ b/lib/cpu.c
|
|
Open vSwitch CI |
93dcca |
@@ -37,7 +37,9 @@ static bool x86_has_isa(uint32_t leaf, enum x86_reg reg, uint32_t bit)
|
|
Open vSwitch CI |
93dcca |
{
|
|
Open vSwitch CI |
93dcca |
uint32_t regs[4];
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- ovs_assert(__get_cpuid_max(leaf & X86_LEAF_MASK, NULL) >= leaf);
|
|
Open vSwitch CI |
93dcca |
+ if (__get_cpuid_max(leaf & X86_LEAF_MASK, NULL) < leaf) {
|
|
Open vSwitch CI |
93dcca |
+ return false;
|
|
Open vSwitch CI |
93dcca |
+ }
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
__cpuid_count(leaf, 0, regs[EAX], regs[EBX], regs[ECX], regs[EDX]);
|
|
Open vSwitch CI |
93dcca |
return (regs[reg] & ((uint32_t) 1 << bit)) != 0;
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
|
|
Open vSwitch CI |
aaf0be |
index 134496ef3..5d2635946 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/db-ctl-base.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/db-ctl-base.c
|
|
Open vSwitch CI |
aaf0be |
@@ -1492,7 +1492,7 @@ cmd_add(struct ctl_context *ctx)
|
|
Open vSwitch CI |
aaf0be |
const struct ovsdb_idl_column *column;
|
|
Open vSwitch CI |
aaf0be |
const struct ovsdb_idl_row *row;
|
|
Open vSwitch CI |
aaf0be |
const struct ovsdb_type *type;
|
|
Open vSwitch CI |
aaf0be |
- struct ovsdb_datum new;
|
|
Open vSwitch CI |
aaf0be |
+ struct ovsdb_datum old;
|
|
Open vSwitch CI |
aaf0be |
int i;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
ctx->error = get_table(table_name, &table);
|
|
Open vSwitch CI |
aaf0be |
@@ -1516,13 +1516,7 @@ cmd_add(struct ctl_context *ctx)
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
type = &column->type;
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
- if (ctx->last_command) {
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_datum_init_empty(&new;;
|
|
Open vSwitch CI |
aaf0be |
- } else {
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_datum_clone(&new, ovsdb_idl_read(row, column));
|
|
Open vSwitch CI |
aaf0be |
- }
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
+ ovsdb_datum_clone(&old, ovsdb_idl_read(row, column));
|
|
Open vSwitch CI |
aaf0be |
for (i = 4; i < ctx->argc; i++) {
|
|
Open vSwitch CI |
aaf0be |
struct ovsdb_type add_type;
|
|
Open vSwitch CI |
aaf0be |
struct ovsdb_datum add;
|
|
Open vSwitch CI |
aaf0be |
@@ -1533,41 +1527,23 @@ cmd_add(struct ctl_context *ctx)
|
|
Open vSwitch CI |
aaf0be |
ctx->error = ovsdb_datum_from_string(&add, &add_type, ctx->argv[i],
|
|
Open vSwitch CI |
aaf0be |
ctx->symtab);
|
|
Open vSwitch CI |
aaf0be |
if (ctx->error) {
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_datum_destroy(&new, &column->type);
|
|
Open vSwitch CI |
aaf0be |
+ ovsdb_datum_destroy(&old, &column->type);
|
|
Open vSwitch CI |
aaf0be |
return;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_datum_union(&new, &add, type);
|
|
Open vSwitch CI |
aaf0be |
+ ovsdb_datum_union(&old, &add, type);
|
|
Open vSwitch CI |
aaf0be |
ovsdb_datum_destroy(&add, type);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
- if (!ctx->last_command && new.n > type->n_max) {
|
|
Open vSwitch CI |
aaf0be |
+ if (old.n > type->n_max) {
|
|
Open vSwitch CI |
aaf0be |
ctl_error(ctx, "\"add\" operation would put %u %s in column %s of "
|
|
Open vSwitch CI |
aaf0be |
"table %s but the maximum number is %u",
|
|
Open vSwitch CI |
aaf0be |
- new.n,
|
|
Open vSwitch CI |
aaf0be |
+ old.n,
|
|
Open vSwitch CI |
aaf0be |
type->value.type == OVSDB_TYPE_VOID ? "values" : "pairs",
|
|
Open vSwitch CI |
aaf0be |
column->name, table->name, type->n_max);
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_datum_destroy(&new, &column->type);
|
|
Open vSwitch CI |
aaf0be |
+ ovsdb_datum_destroy(&old, &column->type);
|
|
Open vSwitch CI |
aaf0be |
return;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
- if (ctx->last_command) {
|
|
Open vSwitch CI |
aaf0be |
- /* Partial updates can only be made one by one. */
|
|
Open vSwitch CI |
aaf0be |
- for (i = 0; i < new.n; i++) {
|
|
Open vSwitch CI |
aaf0be |
- struct ovsdb_datum *datum = xmalloc(sizeof *datum);
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_datum_init_empty(datum);
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_datum_add_from_index_unsafe(datum, &new, i, type);
|
|
Open vSwitch CI |
aaf0be |
- if (ovsdb_type_is_map(type)) {
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_idl_txn_write_partial_map(row, column, datum);
|
|
Open vSwitch CI |
aaf0be |
- } else {
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_idl_txn_write_partial_set(row, column, datum);
|
|
Open vSwitch CI |
aaf0be |
- }
|
|
Open vSwitch CI |
aaf0be |
- }
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_datum_destroy(&new, &column->type);
|
|
Open vSwitch CI |
aaf0be |
- } else {
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_idl_txn_verify(row, column);
|
|
Open vSwitch CI |
aaf0be |
- ovsdb_idl_txn_write(row, column, &new;;
|
|
Open vSwitch CI |
aaf0be |
- }
|
|
Open vSwitch CI |
aaf0be |
+ ovsdb_idl_txn_verify(row, column);
|
|
Open vSwitch CI |
aaf0be |
+ ovsdb_idl_txn_write(row, column, &old;;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
invalidate_cache(ctx);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/dpctl.c b/lib/dpctl.c
|
|
Open vSwitch CI |
fc879c |
index d12d9b8a5..bfc397329 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/dpctl.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/dpctl.c
|
|
Open vSwitch CI |
aaf0be |
@@ -1713,10 +1713,16 @@ dpctl_flush_conntrack(int argc, const char *argv[],
|
|
Open vSwitch CI |
aaf0be |
uint16_t zone, *pzone = NULL;
|
|
Open vSwitch CI |
aaf0be |
int error;
|
|
Open vSwitch CI |
aaf0be |
int args = argc - 1;
|
|
Open vSwitch CI |
aaf0be |
+ int zone_pos = 1;
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ if (dp_arg_exists(argc, argv)) {
|
|
Open vSwitch CI |
aaf0be |
+ args--;
|
|
Open vSwitch CI |
aaf0be |
+ zone_pos = 2;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
/* Parse zone. */
|
|
Open vSwitch CI |
aaf0be |
- if (args && !strncmp(argv[1], "zone=", 5)) {
|
|
Open vSwitch CI |
aaf0be |
- if (!ovs_scan(argv[1], "zone=%"SCNu16, &zone)) {
|
|
Open vSwitch CI |
aaf0be |
+ if (args && !strncmp(argv[zone_pos], "zone=", 5)) {
|
|
Open vSwitch CI |
aaf0be |
+ if (!ovs_scan(argv[zone_pos], "zone=%"SCNu16, &zone)) {
|
|
Open vSwitch CI |
aaf0be |
ds_put_cstr(&ds, "failed to parse zone");
|
|
Open vSwitch CI |
aaf0be |
error = EINVAL;
|
|
Open vSwitch CI |
aaf0be |
goto error;
|
|
Open vSwitch CI |
aaf0be |
@@ -1744,7 +1750,7 @@ dpctl_flush_conntrack(int argc, const char *argv[],
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
/* Report error if there is more than one unparsed argument. */
|
|
Open vSwitch CI |
aaf0be |
- if (args > 1) {
|
|
Open vSwitch CI |
aaf0be |
+ if (args > 0) {
|
|
Open vSwitch CI |
aaf0be |
ds_put_cstr(&ds, "invalid arguments");
|
|
Open vSwitch CI |
aaf0be |
error = EINVAL;
|
|
Open vSwitch CI |
aaf0be |
goto error;
|
|
Open vSwitch CI |
fc879c |
@@ -2196,7 +2202,7 @@ parse_ct_limit_zones(const char *argv, struct ovs_list *zone_limits,
|
|
Open vSwitch CI |
fc879c |
argcopy = xstrdup(argv + 5);
|
|
Open vSwitch CI |
fc879c |
next_zone = strtok_r(argcopy, ",", &save_ptr);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- do {
|
|
Open vSwitch CI |
fc879c |
+ while (next_zone != NULL) {
|
|
Open vSwitch CI |
fc879c |
if (ovs_scan(next_zone, "%"SCNu16, &zone)) {
|
|
Open vSwitch CI |
fc879c |
ct_dpif_push_zone_limit(zone_limits, zone, 0, 0);
|
|
Open vSwitch CI |
fc879c |
} else {
|
|
Open vSwitch CI |
fc879c |
@@ -2204,7 +2210,8 @@ parse_ct_limit_zones(const char *argv, struct ovs_list *zone_limits,
|
|
Open vSwitch CI |
fc879c |
free(argcopy);
|
|
Open vSwitch CI |
fc879c |
return EINVAL;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- } while ((next_zone = strtok_r(NULL, ",", &save_ptr)) != NULL);
|
|
Open vSwitch CI |
fc879c |
+ next_zone = strtok_r(NULL, ",", &save_ptr);
|
|
Open vSwitch CI |
fc879c |
+ }
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
free(argcopy);
|
|
Open vSwitch CI |
fc879c |
return 0;
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
|
|
Open vSwitch CI |
aaf0be |
index c9f7179c3..aed2c8fbb 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/dpif-netdev.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/dpif-netdev.c
|
|
Open vSwitch CI |
aaf0be |
@@ -9616,6 +9616,7 @@ dpif_netdev_bond_stats_get(struct dpif *dpif, uint32_t bond_id,
|
|
Open vSwitch CI |
aaf0be |
const struct dpif_class dpif_netdev_class = {
|
|
Open vSwitch CI |
aaf0be |
"netdev",
|
|
Open vSwitch CI |
aaf0be |
true, /* cleanup_required */
|
|
Open vSwitch CI |
aaf0be |
+ true, /* synced_dp_layers */
|
|
Open vSwitch CI |
aaf0be |
dpif_netdev_init,
|
|
Open vSwitch CI |
aaf0be |
dpif_netdev_enumerate,
|
|
Open vSwitch CI |
aaf0be |
dpif_netdev_port_open_type,
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
|
|
Open vSwitch CI |
7f2e72 |
index 026b0daa8..dc56e863f 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/dpif-netlink.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/dpif-netlink.c
|
|
Open vSwitch CI |
7f2e72 |
@@ -395,7 +395,7 @@ dpif_netlink_open(const struct dpif_class *class OVS_UNUSED, const char *name,
|
|
Open vSwitch CI |
7f2e72 |
dp_request.user_features |= OVS_DP_F_UNALIGNED;
|
|
Open vSwitch CI |
7f2e72 |
dp_request.user_features |= OVS_DP_F_VPORT_PIDS;
|
|
Open vSwitch CI |
7f2e72 |
dp_request.user_features |= OVS_DP_F_UNSUPPORTED;
|
|
Open vSwitch CI |
7f2e72 |
- error = dpif_netlink_dp_transact(&dp_request, &dp, &buf;;
|
|
Open vSwitch CI |
7f2e72 |
+ error = dpif_netlink_dp_transact(&dp_request, NULL, NULL);
|
|
Open vSwitch CI |
7f2e72 |
if (error) {
|
|
Open vSwitch CI |
7f2e72 |
/* The Open vSwitch kernel module has two modes for dispatching
|
|
Open vSwitch CI |
7f2e72 |
* upcalls: per-vport and per-cpu.
|
|
Open vSwitch CI |
aaf0be |
@@ -2582,7 +2582,7 @@ dpif_netlink_calculate_n_handlers(void)
|
|
Open vSwitch CI |
aaf0be |
n_handlers = MIN(next_prime_num, total_cores);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
- return n_handlers;
|
|
Open vSwitch CI |
aaf0be |
+ return MAX(n_handlers, 1);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
static int
|
|
Open vSwitch CI |
aaf0be |
@@ -4515,6 +4515,7 @@ dpif_netlink_cache_set_size(struct dpif *dpif_, uint32_t level, uint32_t size)
|
|
Open vSwitch CI |
aaf0be |
const struct dpif_class dpif_netlink_class = {
|
|
Open vSwitch CI |
aaf0be |
"system",
|
|
Open vSwitch CI |
aaf0be |
false, /* cleanup_required */
|
|
Open vSwitch CI |
aaf0be |
+ false, /* synced_dp_layers */
|
|
Open vSwitch CI |
aaf0be |
NULL, /* init */
|
|
Open vSwitch CI |
aaf0be |
dpif_netlink_enumerate,
|
|
Open vSwitch CI |
aaf0be |
NULL,
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
|
|
Open vSwitch CI |
aaf0be |
index 12477a24f..b8ead8a02 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/dpif-provider.h
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/dpif-provider.h
|
|
Open vSwitch CI |
aaf0be |
@@ -127,6 +127,14 @@ struct dpif_class {
|
|
Open vSwitch CI |
aaf0be |
* datapaths that can not exist without it (e.g. netdev datapath). */
|
|
Open vSwitch CI |
aaf0be |
bool cleanup_required;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+ /* If 'true' the specific dpif implementation synchronizes the various
|
|
Open vSwitch CI |
aaf0be |
+ * datapath implementation layers, i.e., the dpif's layer in combination
|
|
Open vSwitch CI |
aaf0be |
+ * with the underlying netdev offload layers. For example, dpif-netlink
|
|
Open vSwitch CI |
aaf0be |
+ * does not sync its kernel flows with the tc ones, i.e., only one gets
|
|
Open vSwitch CI |
aaf0be |
+ * installed. On the other hand, dpif-netdev installs both flows,
|
|
Open vSwitch CI |
aaf0be |
+ * internally keeps track of both, and represents them as one. */
|
|
Open vSwitch CI |
aaf0be |
+ bool synced_dp_layers;
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
/* Called when the dpif provider is registered, typically at program
|
|
Open vSwitch CI |
aaf0be |
* startup. Returning an error from this function will prevent any
|
|
Open vSwitch CI |
aaf0be |
* datapath with this class from being created.
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/dpif.c b/lib/dpif.c
|
|
Open vSwitch CI |
aaf0be |
index fe4db83fb..3305401fe 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/dpif.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/dpif.c
|
|
Open vSwitch CI |
aaf0be |
@@ -2109,3 +2109,9 @@ dpif_cache_set_size(struct dpif *dpif, uint32_t level, uint32_t size)
|
|
Open vSwitch CI |
aaf0be |
? dpif->dpif_class->cache_set_size(dpif, level, size)
|
|
Open vSwitch CI |
aaf0be |
: EOPNOTSUPP;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+bool
|
|
Open vSwitch CI |
aaf0be |
+dpif_synced_dp_layers(struct dpif *dpif)
|
|
Open vSwitch CI |
aaf0be |
+{
|
|
Open vSwitch CI |
aaf0be |
+ return dpif->dpif_class->synced_dp_layers;
|
|
Open vSwitch CI |
aaf0be |
+}
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/dpif.h b/lib/dpif.h
|
|
Open vSwitch CI |
aaf0be |
index 6cb4dae6d..129cbf6a1 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/dpif.h
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/dpif.h
|
|
Open vSwitch CI |
aaf0be |
@@ -939,6 +939,7 @@ int dpif_get_pmds_for_port(const struct dpif * dpif, odp_port_t port_no,
|
|
Open vSwitch CI |
aaf0be |
char *dpif_get_dp_version(const struct dpif *);
|
|
Open vSwitch CI |
aaf0be |
bool dpif_supports_tnl_push_pop(const struct dpif *);
|
|
Open vSwitch CI |
aaf0be |
bool dpif_supports_explicit_drop_action(const struct dpif *);
|
|
Open vSwitch CI |
aaf0be |
+bool dpif_synced_dp_layers(struct dpif *);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
/* Log functions. */
|
|
Open vSwitch CI |
aaf0be |
struct vlog_module;
|
|
Open vSwitch CI |
285dce |
diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c
|
|
Open vSwitch CI |
285dce |
index bbb31ef27..7054f8e74 100644
|
|
Open vSwitch CI |
285dce |
--- a/lib/fatal-signal.c
|
|
Open vSwitch CI |
285dce |
+++ b/lib/fatal-signal.c
|
|
Open vSwitch CI |
285dce |
@@ -78,6 +78,39 @@ static void call_hooks(int sig_nr);
|
|
Open vSwitch CI |
285dce |
static BOOL WINAPI ConsoleHandlerRoutine(DWORD dwCtrlType);
|
|
Open vSwitch CI |
285dce |
#endif
|
|
Open vSwitch CI |
285dce |
|
|
Open vSwitch CI |
285dce |
+/* Sets up a pipe or event handle that will be used to wake up the current
|
|
Open vSwitch CI |
285dce |
+ * process after signal is received, so it can be processed outside of the
|
|
Open vSwitch CI |
285dce |
+ * signal handler context in fatal_signal_run(). */
|
|
Open vSwitch CI |
285dce |
+static void
|
|
Open vSwitch CI |
285dce |
+fatal_signal_create_wakeup_events(void)
|
|
Open vSwitch CI |
285dce |
+{
|
|
Open vSwitch CI |
285dce |
+#ifndef _WIN32
|
|
Open vSwitch CI |
285dce |
+ xpipe_nonblocking(signal_fds);
|
|
Open vSwitch CI |
285dce |
+#else
|
|
Open vSwitch CI |
285dce |
+ wevent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
|
Open vSwitch CI |
285dce |
+ if (!wevent) {
|
|
Open vSwitch CI |
285dce |
+ char *msg_buf = ovs_lasterror_to_string();
|
|
Open vSwitch CI |
285dce |
+ VLOG_FATAL("Failed to create a event (%s).", msg_buf);
|
|
Open vSwitch CI |
285dce |
+ }
|
|
Open vSwitch CI |
285dce |
+#endif
|
|
Open vSwitch CI |
285dce |
+}
|
|
Open vSwitch CI |
285dce |
+
|
|
Open vSwitch CI |
285dce |
+static void
|
|
Open vSwitch CI |
285dce |
+fatal_signal_destroy_wakeup_events(void)
|
|
Open vSwitch CI |
285dce |
+{
|
|
Open vSwitch CI |
285dce |
+#ifndef _WIN32
|
|
Open vSwitch CI |
285dce |
+ close(signal_fds[0]);
|
|
Open vSwitch CI |
285dce |
+ signal_fds[0] = -1;
|
|
Open vSwitch CI |
285dce |
+ close(signal_fds[1]);
|
|
Open vSwitch CI |
285dce |
+ signal_fds[1] = -1;
|
|
Open vSwitch CI |
285dce |
+#else
|
|
Open vSwitch CI |
285dce |
+ ResetEvent(wevent);
|
|
Open vSwitch CI |
285dce |
+ CloseHandle(wevent);
|
|
Open vSwitch CI |
285dce |
+ wevent = NULL;
|
|
Open vSwitch CI |
285dce |
+#endif
|
|
Open vSwitch CI |
285dce |
+}
|
|
Open vSwitch CI |
285dce |
+
|
|
Open vSwitch CI |
285dce |
+
|
|
Open vSwitch CI |
285dce |
/* Initializes the fatal signal handling module. Calling this function is
|
|
Open vSwitch CI |
285dce |
* optional, because calling any other function in the module will also
|
|
Open vSwitch CI |
285dce |
* initialize it. However, in a multithreaded program, the module must be
|
|
Open vSwitch CI |
285dce |
@@ -94,15 +127,10 @@ fatal_signal_init(void)
|
|
Open vSwitch CI |
285dce |
inited = true;
|
|
Open vSwitch CI |
285dce |
|
|
Open vSwitch CI |
285dce |
ovs_mutex_init_recursive(&mutex);
|
|
Open vSwitch CI |
285dce |
-#ifndef _WIN32
|
|
Open vSwitch CI |
285dce |
- xpipe_nonblocking(signal_fds);
|
|
Open vSwitch CI |
285dce |
-#else
|
|
Open vSwitch CI |
285dce |
- wevent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
|
Open vSwitch CI |
285dce |
- if (!wevent) {
|
|
Open vSwitch CI |
285dce |
- char *msg_buf = ovs_lasterror_to_string();
|
|
Open vSwitch CI |
285dce |
- VLOG_FATAL("Failed to create a event (%s).", msg_buf);
|
|
Open vSwitch CI |
285dce |
- }
|
|
Open vSwitch CI |
285dce |
|
|
Open vSwitch CI |
285dce |
+ fatal_signal_create_wakeup_events();
|
|
Open vSwitch CI |
285dce |
+
|
|
Open vSwitch CI |
285dce |
+#ifdef _WIN32
|
|
Open vSwitch CI |
285dce |
/* Register a function to handle Ctrl+C. */
|
|
Open vSwitch CI |
285dce |
SetConsoleCtrlHandler(ConsoleHandlerRoutine, true);
|
|
Open vSwitch CI |
285dce |
#endif
|
|
Open vSwitch CI |
285dce |
@@ -456,6 +484,9 @@ do_unlink_files(void)
|
|
Open vSwitch CI |
285dce |
* hooks passed a 'cancel_cb' function to fatal_signal_add_hook(), then those
|
|
Open vSwitch CI |
285dce |
* functions will be called, allowing them to free resources, etc.
|
|
Open vSwitch CI |
285dce |
*
|
|
Open vSwitch CI |
285dce |
+ * Also re-creates wake-up events, so signals in one of the processes do not
|
|
Open vSwitch CI |
285dce |
+ * wake up the other one.
|
|
Open vSwitch CI |
285dce |
+ *
|
|
Open vSwitch CI |
285dce |
* Following a fork, one of the resulting processes can call this function to
|
|
Open vSwitch CI |
285dce |
* allow it to terminate without calling the hooks registered before calling
|
|
Open vSwitch CI |
285dce |
* this function. New hooks registered after calling this function will take
|
|
Open vSwitch CI |
285dce |
@@ -467,6 +498,9 @@ fatal_signal_fork(void)
|
|
Open vSwitch CI |
285dce |
|
|
Open vSwitch CI |
285dce |
assert_single_threaded();
|
|
Open vSwitch CI |
285dce |
|
|
Open vSwitch CI |
285dce |
+ fatal_signal_destroy_wakeup_events();
|
|
Open vSwitch CI |
285dce |
+ fatal_signal_create_wakeup_events();
|
|
Open vSwitch CI |
285dce |
+
|
|
Open vSwitch CI |
285dce |
for (i = 0; i < n_hooks; i++) {
|
|
Open vSwitch CI |
285dce |
struct hook *h = &hooks[i];
|
|
Open vSwitch CI |
285dce |
if (h->cancel_cb) {
|
|
Open vSwitch CI |
7f2e72 |
diff --git a/lib/learning-switch.c b/lib/learning-switch.c
|
|
Open vSwitch CI |
7f2e72 |
index 8102475ca..cdf42935c 100644
|
|
Open vSwitch CI |
7f2e72 |
--- a/lib/learning-switch.c
|
|
Open vSwitch CI |
7f2e72 |
+++ b/lib/learning-switch.c
|
|
Open vSwitch CI |
7f2e72 |
@@ -569,6 +569,7 @@ process_packet_in(struct lswitch *sw, const struct ofp_header *oh)
|
|
Open vSwitch CI |
7f2e72 |
}
|
|
Open vSwitch CI |
7f2e72 |
|
|
Open vSwitch CI |
7f2e72 |
/* Prepare packet_out in case we need one. */
|
|
Open vSwitch CI |
7f2e72 |
+ match_init_catchall(&po.flow_metadata);
|
|
Open vSwitch CI |
7f2e72 |
po.buffer_id = buffer_id;
|
|
Open vSwitch CI |
7f2e72 |
if (buffer_id == UINT32_MAX) {
|
|
Open vSwitch CI |
7f2e72 |
po.packet = dp_packet_data(&pkt);
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/meta-flow.c b/lib/meta-flow.c
|
|
Open vSwitch CI |
aaf0be |
index c576ae620..474344194 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/meta-flow.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/meta-flow.c
|
|
Open vSwitch CI |
aaf0be |
@@ -3676,3 +3676,28 @@ mf_bitmap_not(struct mf_bitmap x)
|
|
Open vSwitch CI |
aaf0be |
bitmap_not(x.bm, MFF_N_IDS);
|
|
Open vSwitch CI |
aaf0be |
return x;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+void
|
|
Open vSwitch CI |
aaf0be |
+mf_set_mask_l3_prereqs(const struct mf_field *mf, const struct flow *fl,
|
|
Open vSwitch CI |
aaf0be |
+ struct flow_wildcards *wc)
|
|
Open vSwitch CI |
aaf0be |
+{
|
|
Open vSwitch CI |
aaf0be |
+ if (is_ip_any(fl) &&
|
|
Open vSwitch CI |
aaf0be |
+ ((mf->id == MFF_IPV4_SRC) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_IPV4_DST) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_IPV6_SRC) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_IPV6_DST) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_IPV6_LABEL) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_IP_DSCP) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_IP_ECN) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_IP_TTL))) {
|
|
Open vSwitch CI |
aaf0be |
+ WC_MASK_FIELD(wc, nw_proto);
|
|
Open vSwitch CI |
aaf0be |
+ } else if ((fl->dl_type == htons(ETH_TYPE_ARP)) &&
|
|
Open vSwitch CI |
aaf0be |
+ ((mf->id == MFF_ARP_OP) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_ARP_SHA) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_ARP_THA) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_ARP_SPA) ||
|
|
Open vSwitch CI |
aaf0be |
+ (mf->id == MFF_ARP_TPA))) {
|
|
Open vSwitch CI |
aaf0be |
+ /* mask only the lower 8 bits. */
|
|
Open vSwitch CI |
aaf0be |
+ wc->masks.nw_proto = 0xff;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
+}
|
|
Open vSwitch CI |
772b08 |
diff --git a/lib/meta-flow.xml b/lib/meta-flow.xml
|
|
Open vSwitch CI |
772b08 |
index a1a20366d..bdd12f6a7 100644
|
|
Open vSwitch CI |
772b08 |
--- a/lib/meta-flow.xml
|
|
Open vSwitch CI |
772b08 |
+++ b/lib/meta-flow.xml
|
|
Open vSwitch CI |
772b08 |
@@ -4312,9 +4312,9 @@ r r c c c.
|
|
Open vSwitch CI |
772b08 |
<bits name="pln" above="8" below="4" width=".2"/>
|
|
Open vSwitch CI |
772b08 |
<bits name="op" above="16" width=".2" fill="yes"/>
|
|
Open vSwitch CI |
772b08 |
<bits name="sha" above="48" width="0.5" fill="yes"/>
|
|
Open vSwitch CI |
772b08 |
- <bits name="spa" above="16" width="0.3" fill="yes"/>
|
|
Open vSwitch CI |
772b08 |
+ <bits name="spa" above="32" width="0.5" fill="yes"/>
|
|
Open vSwitch CI |
772b08 |
<bits name="tha" above="48" width="0.5" fill="yes"/>
|
|
Open vSwitch CI |
772b08 |
- <bits name="tpa" above="16" width="0.3" fill="yes"/>
|
|
Open vSwitch CI |
772b08 |
+ <bits name="tpa" above="32" width="0.5" fill="yes"/>
|
|
Open vSwitch CI |
772b08 |
</header>
|
|
Open vSwitch CI |
772b08 |
</diagram>
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
5b04d8 |
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
|
|
Open vSwitch CI |
5b04d8 |
index ab5b8223e..ac182436b 100644
|
|
Open vSwitch CI |
5b04d8 |
--- a/lib/netdev-dpdk.c
|
|
Open vSwitch CI |
5b04d8 |
+++ b/lib/netdev-dpdk.c
|
|
Open vSwitch CI |
5b04d8 |
@@ -840,7 +840,7 @@ dpdk_mp_create(struct netdev_dpdk *dev, int mtu)
|
|
Open vSwitch CI |
5b04d8 |
static struct dpdk_mp *
|
|
Open vSwitch CI |
5b04d8 |
dpdk_mp_get(struct netdev_dpdk *dev, int mtu)
|
|
Open vSwitch CI |
5b04d8 |
{
|
|
Open vSwitch CI |
5b04d8 |
- struct dpdk_mp *dmp, *next;
|
|
Open vSwitch CI |
5b04d8 |
+ struct dpdk_mp *dmp = NULL, *next;
|
|
Open vSwitch CI |
5b04d8 |
bool reuse = false;
|
|
Open vSwitch CI |
5b04d8 |
|
|
Open vSwitch CI |
5b04d8 |
ovs_mutex_lock(&dpdk_mp_mutex);
|
|
Open vSwitch CI |
93dcca |
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
|
|
Open vSwitch CI |
93dcca |
index 65bdd51db..94b99a7be 100644
|
|
Open vSwitch CI |
93dcca |
--- a/lib/netdev-linux.c
|
|
Open vSwitch CI |
93dcca |
+++ b/lib/netdev-linux.c
|
|
Open vSwitch CI |
93dcca |
@@ -2712,8 +2712,16 @@ tc_add_matchall_policer(struct netdev *netdev, uint32_t kbits_rate,
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
err = tc_transact(&request, &reply);
|
|
Open vSwitch CI |
93dcca |
if (!err) {
|
|
Open vSwitch CI |
93dcca |
- struct tcmsg *tc =
|
|
Open vSwitch CI |
93dcca |
- ofpbuf_at_assert(reply, NLMSG_HDRLEN, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
+ struct ofpbuf b = ofpbuf_const_initializer(reply->data, reply->size);
|
|
Open vSwitch CI |
93dcca |
+ struct nlmsghdr *nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
|
|
Open vSwitch CI |
93dcca |
+ struct tcmsg *tc = ofpbuf_try_pull(&b, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
+
|
|
Open vSwitch CI |
93dcca |
+ if (!nlmsg || !tc) {
|
|
Open vSwitch CI |
93dcca |
+ VLOG_ERR_RL(&rl,
|
|
Open vSwitch CI |
93dcca |
+ "Failed to add match all policer, malformed reply");
|
|
Open vSwitch CI |
93dcca |
+ ofpbuf_delete(reply);
|
|
Open vSwitch CI |
93dcca |
+ return EPROTO;
|
|
Open vSwitch CI |
93dcca |
+ }
|
|
Open vSwitch CI |
93dcca |
ofpbuf_delete(reply);
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
@@ -5732,26 +5740,27 @@ static int
|
|
Open vSwitch CI |
93dcca |
tc_update_policer_action_stats(struct ofpbuf *msg,
|
|
Open vSwitch CI |
93dcca |
struct ofputil_meter_stats *stats)
|
|
Open vSwitch CI |
93dcca |
{
|
|
Open vSwitch CI |
93dcca |
+ struct ofpbuf b = ofpbuf_const_initializer(msg->data, msg->size);
|
|
Open vSwitch CI |
93dcca |
+ struct nlmsghdr *nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
|
|
Open vSwitch CI |
93dcca |
+ struct tcamsg *tca = ofpbuf_try_pull(&b, sizeof *tca);
|
|
Open vSwitch CI |
93dcca |
struct ovs_flow_stats stats_dropped;
|
|
Open vSwitch CI |
93dcca |
struct ovs_flow_stats stats_hw;
|
|
Open vSwitch CI |
93dcca |
struct ovs_flow_stats stats_sw;
|
|
Open vSwitch CI |
93dcca |
const struct nlattr *act;
|
|
Open vSwitch CI |
93dcca |
struct nlattr *prio;
|
|
Open vSwitch CI |
93dcca |
- struct tcamsg *tca;
|
|
Open vSwitch CI |
93dcca |
int error = 0;
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
if (!stats) {
|
|
Open vSwitch CI |
93dcca |
goto exit;
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- if (NLMSG_HDRLEN + sizeof *tca > msg->size) {
|
|
Open vSwitch CI |
93dcca |
+ if (!nlmsg || !tca) {
|
|
Open vSwitch CI |
93dcca |
VLOG_ERR_RL(&rl, "Failed to get action stats, size error");
|
|
Open vSwitch CI |
93dcca |
error = EPROTO;
|
|
Open vSwitch CI |
93dcca |
goto exit;
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- tca = ofpbuf_at_assert(msg, NLMSG_HDRLEN, sizeof *tca);
|
|
Open vSwitch CI |
93dcca |
- act = nl_attr_find(msg, NLMSG_HDRLEN + sizeof *tca, TCA_ACT_TAB);
|
|
Open vSwitch CI |
93dcca |
+ act = nl_attr_find(&b, 0, TCA_ACT_TAB);
|
|
Open vSwitch CI |
93dcca |
if (!act) {
|
|
Open vSwitch CI |
93dcca |
VLOG_ERR_RL(&rl, "Failed to get action stats, can't find attribute");
|
|
Open vSwitch CI |
93dcca |
error = EPROTO;
|
|
Open vSwitch CI |
93dcca |
@@ -6016,20 +6025,26 @@ static int
|
|
Open vSwitch CI |
93dcca |
tc_parse_class(const struct ofpbuf *msg, unsigned int *handlep,
|
|
Open vSwitch CI |
93dcca |
struct nlattr **options, struct netdev_queue_stats *stats)
|
|
Open vSwitch CI |
93dcca |
{
|
|
Open vSwitch CI |
93dcca |
+ struct ofpbuf b = ofpbuf_const_initializer(msg->data, msg->size);
|
|
Open vSwitch CI |
93dcca |
+ struct nlmsghdr *nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
|
|
Open vSwitch CI |
93dcca |
+ struct tcmsg *tc = ofpbuf_try_pull(&b, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
static const struct nl_policy tca_policy[] = {
|
|
Open vSwitch CI |
93dcca |
[TCA_OPTIONS] = { .type = NL_A_NESTED, .optional = false },
|
|
Open vSwitch CI |
93dcca |
[TCA_STATS2] = { .type = NL_A_NESTED, .optional = false },
|
|
Open vSwitch CI |
93dcca |
};
|
|
Open vSwitch CI |
93dcca |
struct nlattr *ta[ARRAY_SIZE(tca_policy)];
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- if (!nl_policy_parse(msg, NLMSG_HDRLEN + sizeof(struct tcmsg),
|
|
Open vSwitch CI |
93dcca |
- tca_policy, ta, ARRAY_SIZE(ta))) {
|
|
Open vSwitch CI |
93dcca |
+ if (!nlmsg || !tc) {
|
|
Open vSwitch CI |
93dcca |
+ VLOG_ERR_RL(&rl, "failed to parse class message, malformed reply");
|
|
Open vSwitch CI |
93dcca |
+ goto error;
|
|
Open vSwitch CI |
93dcca |
+ }
|
|
Open vSwitch CI |
93dcca |
+
|
|
Open vSwitch CI |
93dcca |
+ if (!nl_policy_parse(&b, 0, tca_policy, ta, ARRAY_SIZE(ta))) {
|
|
Open vSwitch CI |
93dcca |
VLOG_WARN_RL(&rl, "failed to parse class message");
|
|
Open vSwitch CI |
93dcca |
goto error;
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
if (handlep) {
|
|
Open vSwitch CI |
93dcca |
- struct tcmsg *tc = ofpbuf_at_assert(msg, NLMSG_HDRLEN, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
*handlep = tc->tcm_handle;
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
772b08 |
diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
|
|
Open vSwitch CI |
772b08 |
index b89dfdd52..6c9094638 100644
|
|
Open vSwitch CI |
772b08 |
--- a/lib/netdev-native-tnl.c
|
|
Open vSwitch CI |
772b08 |
+++ b/lib/netdev-native-tnl.c
|
|
Open vSwitch CI |
772b08 |
@@ -320,7 +320,7 @@ netdev_tnl_ip_build_header(struct ovs_action_push_tnl *data,
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
static void *
|
|
Open vSwitch CI |
772b08 |
-udp_build_header(struct netdev_tunnel_config *tnl_cfg,
|
|
Open vSwitch CI |
772b08 |
+udp_build_header(const struct netdev_tunnel_config *tnl_cfg,
|
|
Open vSwitch CI |
772b08 |
struct ovs_action_push_tnl *data,
|
|
Open vSwitch CI |
772b08 |
const struct netdev_tnl_build_header_params *params)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
@@ -452,7 +452,6 @@ netdev_gre_push_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
const struct ovs_action_push_tnl *data)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
struct netdev_vport *dev = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
struct gre_base_hdr *greh;
|
|
Open vSwitch CI |
772b08 |
int ip_tot_size;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
@@ -468,8 +467,7 @@ netdev_gre_push_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
int seq_ofs = gre_header_len(greh->flags) - 4;
|
|
Open vSwitch CI |
772b08 |
ovs_16aligned_be32 *seq_opt =
|
|
Open vSwitch CI |
772b08 |
ALIGNED_CAST(ovs_16aligned_be32 *, (char *)greh + seq_ofs);
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg = &dev->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
- put_16aligned_be32(seq_opt, htonl(tnl_cfg->seqno++));
|
|
Open vSwitch CI |
772b08 |
+ put_16aligned_be32(seq_opt, htonl(atomic_count_inc(&dev->gre_seqno)));
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
@@ -478,16 +476,11 @@ netdev_gre_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
struct ovs_action_push_tnl *data,
|
|
Open vSwitch CI |
772b08 |
const struct netdev_tnl_build_header_params *params)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
- struct netdev_vport *dev = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
struct gre_base_hdr *greh;
|
|
Open vSwitch CI |
772b08 |
ovs_16aligned_be32 *options;
|
|
Open vSwitch CI |
772b08 |
unsigned int hlen;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- /* XXX: RCUfy tnl_cfg. */
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_lock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg = &dev->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
-
|
|
Open vSwitch CI |
772b08 |
greh = netdev_tnl_ip_build_header(data, params, IPPROTO_GRE);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
if (params->flow->packet_type == htonl(PT_ETH)) {
|
|
Open vSwitch CI |
772b08 |
@@ -495,8 +488,7 @@ netdev_gre_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
} else if (pt_ns(params->flow->packet_type) == OFPHTN_ETHERTYPE) {
|
|
Open vSwitch CI |
772b08 |
greh->protocol = pt_ns_type_be(params->flow->packet_type);
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- return 1;
|
|
Open vSwitch CI |
772b08 |
+ return EINVAL;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
greh->flags = 0;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
@@ -507,6 +499,8 @@ netdev_gre_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
options++;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg = netdev_get_tunnel_config(netdev);
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
if (tnl_cfg->out_key_present) {
|
|
Open vSwitch CI |
772b08 |
greh->flags |= htons(GRE_KEY);
|
|
Open vSwitch CI |
772b08 |
put_16aligned_be32(options, be64_to_be32(params->flow->tunnel.tun_id));
|
|
Open vSwitch CI |
772b08 |
@@ -519,8 +513,6 @@ netdev_gre_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
options++;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
-
|
|
Open vSwitch CI |
772b08 |
hlen = (uint8_t *) options - (uint8_t *) greh;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
data->header_len += hlen;
|
|
Open vSwitch CI |
772b08 |
@@ -605,7 +597,6 @@ netdev_erspan_push_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
const struct ovs_action_push_tnl *data)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
struct netdev_vport *dev = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
struct erspan_base_hdr *ersh;
|
|
Open vSwitch CI |
772b08 |
struct gre_base_hdr *greh;
|
|
Open vSwitch CI |
772b08 |
struct erspan_md2 *md2;
|
|
Open vSwitch CI |
772b08 |
@@ -615,9 +606,8 @@ netdev_erspan_push_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
data->header_len, &ip_tot_size);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
/* update GRE seqno */
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg = &dev->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
ovs_16aligned_be32 *seqno = (ovs_16aligned_be32 *) (greh + 1);
|
|
Open vSwitch CI |
772b08 |
- put_16aligned_be32(seqno, htonl(tnl_cfg->seqno++));
|
|
Open vSwitch CI |
772b08 |
+ put_16aligned_be32(seqno, htonl(atomic_count_inc(&dev->gre_seqno)));
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
/* update v2 timestamp */
|
|
Open vSwitch CI |
772b08 |
if (greh->protocol == htons(ETH_TYPE_ERSPAN2)) {
|
|
Open vSwitch CI |
772b08 |
@@ -632,8 +622,7 @@ netdev_erspan_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
struct ovs_action_push_tnl *data,
|
|
Open vSwitch CI |
772b08 |
const struct netdev_tnl_build_header_params *params)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
- struct netdev_vport *dev = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
struct gre_base_hdr *greh;
|
|
Open vSwitch CI |
772b08 |
struct erspan_base_hdr *ersh;
|
|
Open vSwitch CI |
772b08 |
unsigned int hlen;
|
|
Open vSwitch CI |
772b08 |
@@ -641,21 +630,19 @@ netdev_erspan_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
int erspan_ver;
|
|
Open vSwitch CI |
772b08 |
uint16_t sid;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- /* XXX: RCUfy tnl_cfg. */
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_lock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg = &dev->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
greh = netdev_tnl_ip_build_header(data, params, IPPROTO_GRE);
|
|
Open vSwitch CI |
772b08 |
ersh = ERSPAN_HDR(greh);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
tun_id = ntohl(be64_to_be32(params->flow->tunnel.tun_id));
|
|
Open vSwitch CI |
772b08 |
/* ERSPAN only has 10-bit session ID */
|
|
Open vSwitch CI |
772b08 |
if (tun_id & ~ERSPAN_SID_MASK) {
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- return 1;
|
|
Open vSwitch CI |
772b08 |
+ return EINVAL;
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
sid = (uint16_t) tun_id;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg = netdev_get_tunnel_config(netdev);
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
if (tnl_cfg->erspan_ver_flow) {
|
|
Open vSwitch CI |
772b08 |
erspan_ver = params->flow->tunnel.erspan_ver;
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
@@ -702,12 +689,9 @@ netdev_erspan_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
hlen = ERSPAN_GREHDR_LEN + sizeof *ersh + ERSPAN_V2_MDSIZE;
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
VLOG_WARN_RL(&err_rl, "ERSPAN version error %d", tnl_cfg->erspan_ver);
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- return 1;
|
|
Open vSwitch CI |
772b08 |
+ return EINVAL;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
-
|
|
Open vSwitch CI |
772b08 |
data->header_len += hlen;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
if (params->is_ipv6) {
|
|
Open vSwitch CI |
772b08 |
@@ -786,7 +770,6 @@ netdev_gtpu_push_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
const struct ovs_action_push_tnl *data)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
struct netdev_vport *dev = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
struct udp_header *udp;
|
|
Open vSwitch CI |
772b08 |
struct gtpuhdr *gtpuh;
|
|
Open vSwitch CI |
772b08 |
int ip_tot_size;
|
|
Open vSwitch CI |
772b08 |
@@ -801,10 +784,9 @@ netdev_gtpu_push_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
gtpuh = ALIGNED_CAST(struct gtpuhdr *, udp + 1);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg = &dev->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg->set_seq) {
|
|
Open vSwitch CI |
772b08 |
+ if (gtpuh->md.flags & GTPU_S_MASK) {
|
|
Open vSwitch CI |
772b08 |
ovs_be16 *seqno = ALIGNED_CAST(ovs_be16 *, gtpuh + 1);
|
|
Open vSwitch CI |
772b08 |
- *seqno = htons(tnl_cfg->seqno++);
|
|
Open vSwitch CI |
772b08 |
+ *seqno = htons(atomic_count_inc(&dev->gre_seqno));
|
|
Open vSwitch CI |
772b08 |
payload_len += sizeof(struct gtpuhdr_opt);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
gtpuh->len = htons(payload_len);
|
|
Open vSwitch CI |
772b08 |
@@ -815,13 +797,12 @@ netdev_gtpu_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
struct ovs_action_push_tnl *data,
|
|
Open vSwitch CI |
772b08 |
const struct netdev_tnl_build_header_params *params)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
- struct netdev_vport *dev = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
struct gtpuhdr *gtph;
|
|
Open vSwitch CI |
772b08 |
unsigned int gtpu_hlen;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_lock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg = &dev->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg = netdev_get_tunnel_config(netdev);
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
gtph = udp_build_header(tnl_cfg, data, params);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
/* Set to default if not set in flow. */
|
|
Open vSwitch CI |
772b08 |
@@ -837,7 +818,6 @@ netdev_gtpu_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
gtph->md.flags |= GTPU_S_MASK;
|
|
Open vSwitch CI |
772b08 |
gtpu_hlen += sizeof(struct gtpuhdr_opt);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
data->header_len += gtpu_hlen;
|
|
Open vSwitch CI |
772b08 |
data->tnl_type = OVS_VPORT_TYPE_GTPU;
|
|
Open vSwitch CI |
772b08 |
@@ -920,13 +900,10 @@ netdev_vxlan_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
struct ovs_action_push_tnl *data,
|
|
Open vSwitch CI |
772b08 |
const struct netdev_tnl_build_header_params *params)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
- struct netdev_vport *dev = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
struct vxlanhdr *vxh;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- /* XXX: RCUfy tnl_cfg. */
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_lock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg = &dev->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg = netdev_get_tunnel_config(netdev);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
vxh = udp_build_header(tnl_cfg, data, params);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
@@ -951,10 +928,10 @@ netdev_vxlan_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
vxh->vx_gpe.next_protocol = VXLAN_GPE_NP_ETHERNET;
|
|
Open vSwitch CI |
772b08 |
break;
|
|
Open vSwitch CI |
772b08 |
default:
|
|
Open vSwitch CI |
772b08 |
- goto drop;
|
|
Open vSwitch CI |
772b08 |
+ return EINVAL;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
- goto drop;
|
|
Open vSwitch CI |
772b08 |
+ return EINVAL;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
put_16aligned_be32(&vxh->vx_flags, htonl(VXLAN_FLAGS));
|
|
Open vSwitch CI |
772b08 |
@@ -962,14 +939,9 @@ netdev_vxlan_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
htonl(ntohll(params->flow->tunnel.tun_id) << 8));
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
data->header_len += sizeof *vxh;
|
|
Open vSwitch CI |
772b08 |
data->tnl_type = OVS_VPORT_TYPE_VXLAN;
|
|
Open vSwitch CI |
772b08 |
return 0;
|
|
Open vSwitch CI |
772b08 |
-
|
|
Open vSwitch CI |
772b08 |
-drop:
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- return 1;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
struct dp_packet *
|
|
Open vSwitch CI |
772b08 |
@@ -1033,22 +1005,14 @@ netdev_geneve_build_header(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
struct ovs_action_push_tnl *data,
|
|
Open vSwitch CI |
772b08 |
const struct netdev_tnl_build_header_params *params)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
- struct netdev_vport *dev = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
struct genevehdr *gnh;
|
|
Open vSwitch CI |
772b08 |
int opt_len;
|
|
Open vSwitch CI |
772b08 |
bool crit_opt;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- /* XXX: RCUfy tnl_cfg. */
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_lock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg = &dev->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
-
|
|
Open vSwitch CI |
772b08 |
- gnh = udp_build_header(tnl_cfg, data, params);
|
|
Open vSwitch CI |
772b08 |
+ gnh = udp_build_header(netdev_get_tunnel_config(netdev), data, params);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
put_16aligned_be32(&gnh->vni, htonl(ntohll(params->flow->tunnel.tun_id) << 8));
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
-
|
|
Open vSwitch CI |
772b08 |
opt_len = tun_metadata_to_geneve_header(¶ms->flow->tunnel,
|
|
Open vSwitch CI |
772b08 |
gnh->options, &crit_opt);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
|
|
Open vSwitch CI |
772b08 |
index b3421c099..2d7858f51 100644
|
|
Open vSwitch CI |
772b08 |
--- a/lib/netdev-offload-dpdk.c
|
|
Open vSwitch CI |
772b08 |
+++ b/lib/netdev-offload-dpdk.c
|
|
Open vSwitch CI |
772b08 |
@@ -2345,13 +2345,13 @@ netdev_offload_dpdk_flow_destroy(struct ufid_to_rte_flow_data *rte_flow_data)
|
|
Open vSwitch CI |
772b08 |
ovsrcu_get(void *, &netdev->hw_info.offload_data);
|
|
Open vSwitch CI |
772b08 |
data->rte_flow_counters[tid]--;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- ufid_to_rte_flow_disassociate(rte_flow_data);
|
|
Open vSwitch CI |
772b08 |
VLOG_DBG_RL(&rl, "%s/%s: rte_flow 0x%"PRIxPTR
|
|
Open vSwitch CI |
772b08 |
" flow destroy %d ufid " UUID_FMT,
|
|
Open vSwitch CI |
772b08 |
netdev_get_name(netdev), netdev_get_name(physdev),
|
|
Open vSwitch CI |
772b08 |
(intptr_t) rte_flow,
|
|
Open vSwitch CI |
772b08 |
netdev_dpdk_get_port_id(physdev),
|
|
Open vSwitch CI |
772b08 |
UUID_ARGS((struct uuid *) ufid));
|
|
Open vSwitch CI |
772b08 |
+ ufid_to_rte_flow_disassociate(rte_flow_data);
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
VLOG_ERR("Failed flow: %s/%s: flow destroy %d ufid " UUID_FMT,
|
|
Open vSwitch CI |
772b08 |
netdev_get_name(netdev), netdev_get_name(physdev),
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
|
|
Open vSwitch CI |
a7040a |
index 4c78c4816..09f6393f8 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/netdev-offload-tc.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/netdev-offload-tc.c
|
|
Open vSwitch CI |
aaf0be |
@@ -276,8 +276,9 @@ del_filter_and_ufid_mapping(struct tcf_id *id, const ovs_u128 *ufid,
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
err = tc_del_flower_filter(id);
|
|
Open vSwitch CI |
aaf0be |
- if (!err) {
|
|
Open vSwitch CI |
aaf0be |
+ if (!err || err == ENODEV) {
|
|
Open vSwitch CI |
aaf0be |
del_ufid_tc_mapping(ufid);
|
|
Open vSwitch CI |
aaf0be |
+ return 0;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
return err;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
a7040a |
@@ -524,7 +525,11 @@ delete_chains_from_netdev(struct netdev *netdev, struct tcf_id *id)
|
|
Open vSwitch CI |
a7040a |
*/
|
|
Open vSwitch CI |
a7040a |
HMAP_FOR_EACH_POP (chain_node, node, &map) {
|
|
Open vSwitch CI |
a7040a |
id->chain = chain_node->chain;
|
|
Open vSwitch CI |
a7040a |
- tc_del_flower_filter(id);
|
|
Open vSwitch CI |
a7040a |
+ /* Delete empty chain doesn't seem to work with
|
|
Open vSwitch CI |
a7040a |
+ * tc_del_flower_filter() so use tc_del_filter()
|
|
Open vSwitch CI |
a7040a |
+ * without specifying TCA_KIND.
|
|
Open vSwitch CI |
a7040a |
+ */
|
|
Open vSwitch CI |
a7040a |
+ tc_del_filter(id, NULL);
|
|
Open vSwitch CI |
a7040a |
free(chain_node);
|
|
Open vSwitch CI |
a7040a |
}
|
|
Open vSwitch CI |
a7040a |
}
|
|
Open vSwitch CI |
a7040a |
@@ -871,7 +876,7 @@ parse_tc_flower_to_actions__(struct tc_flower *flower, struct ofpbuf *buf,
|
|
Open vSwitch CI |
aaf0be |
outport =
|
|
Open vSwitch CI |
aaf0be |
netdev_ifindex_to_odp_port(action->out.ifindex_out);
|
|
Open vSwitch CI |
aaf0be |
if (!outport) {
|
|
Open vSwitch CI |
aaf0be |
- return ENOENT;
|
|
Open vSwitch CI |
aaf0be |
+ return -ENOENT;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
nl_msg_put_u32(buf, OVS_ACTION_ATTR_OUTPUT, odp_to_u32(outport));
|
|
Open vSwitch CI |
a7040a |
@@ -964,7 +969,7 @@ parse_tc_flower_to_actions__(struct tc_flower *flower, struct ofpbuf *buf,
|
|
Open vSwitch CI |
aaf0be |
uint32_t meter_id;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
if (police_idx_lookup(action->police.index, &meter_id)) {
|
|
Open vSwitch CI |
aaf0be |
- return ENOENT;
|
|
Open vSwitch CI |
aaf0be |
+ return -ENOENT;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
nl_msg_put_u32(buf, OVS_ACTION_ATTR_METER, meter_id);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
a7040a |
@@ -983,6 +988,9 @@ parse_tc_flower_to_actions__(struct tc_flower *flower, struct ofpbuf *buf,
|
|
Open vSwitch CI |
aaf0be |
buf, OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER);
|
|
Open vSwitch CI |
aaf0be |
i = parse_tc_flower_to_actions__(flower, buf, i + 1,
|
|
Open vSwitch CI |
aaf0be |
action->police.result_jump);
|
|
Open vSwitch CI |
aaf0be |
+ if (i < 0) {
|
|
Open vSwitch CI |
aaf0be |
+ return i;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
nl_msg_end_nested(buf, act_offset);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
act_offset = nl_msg_start_nested(
|
|
Open vSwitch CI |
a7040a |
@@ -994,6 +1002,9 @@ parse_tc_flower_to_actions__(struct tc_flower *flower, struct ofpbuf *buf,
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
if (jump != 0) {
|
|
Open vSwitch CI |
aaf0be |
i = parse_tc_flower_to_actions__(flower, buf, i, jump);
|
|
Open vSwitch CI |
aaf0be |
+ if (i < 0) {
|
|
Open vSwitch CI |
aaf0be |
+ return i;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
nl_msg_end_nested(buf, act_offset);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
a7040a |
@@ -1013,11 +1024,11 @@ parse_tc_flower_to_actions__(struct tc_flower *flower, struct ofpbuf *buf,
|
|
Open vSwitch CI |
aaf0be |
return i;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
-static void
|
|
Open vSwitch CI |
aaf0be |
+static int
|
|
Open vSwitch CI |
aaf0be |
parse_tc_flower_to_actions(struct tc_flower *flower,
|
|
Open vSwitch CI |
aaf0be |
struct ofpbuf *buf)
|
|
Open vSwitch CI |
aaf0be |
{
|
|
Open vSwitch CI |
aaf0be |
- parse_tc_flower_to_actions__(flower, buf, 0, 0);
|
|
Open vSwitch CI |
aaf0be |
+ return parse_tc_flower_to_actions__(flower, buf, 0, 0);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
static int
|
|
Open vSwitch CI |
a7040a |
@@ -1030,9 +1041,10 @@ parse_tc_flower_to_match(const struct netdev *netdev,
|
|
Open vSwitch CI |
aaf0be |
struct ofpbuf *buf,
|
|
Open vSwitch CI |
aaf0be |
bool terse)
|
|
Open vSwitch CI |
aaf0be |
{
|
|
Open vSwitch CI |
aaf0be |
- size_t act_off;
|
|
Open vSwitch CI |
aaf0be |
struct tc_flower_key *key = &flower->key;
|
|
Open vSwitch CI |
aaf0be |
struct tc_flower_key *mask = &flower->mask;
|
|
Open vSwitch CI |
aaf0be |
+ size_t act_off;
|
|
Open vSwitch CI |
aaf0be |
+ int err;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
if (terse) {
|
|
Open vSwitch CI |
aaf0be |
return parse_tc_flower_terse_to_match(flower, match, stats, attrs);
|
|
Open vSwitch CI |
a7040a |
@@ -1229,7 +1241,10 @@ parse_tc_flower_to_match(const struct netdev *netdev,
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
act_off = nl_msg_start_nested(buf, OVS_FLOW_ATTR_ACTIONS);
|
|
Open vSwitch CI |
aaf0be |
- parse_tc_flower_to_actions(flower, buf);
|
|
Open vSwitch CI |
aaf0be |
+ err = parse_tc_flower_to_actions(flower, buf);
|
|
Open vSwitch CI |
aaf0be |
+ if (err < 0) {
|
|
Open vSwitch CI |
aaf0be |
+ return -err;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
nl_msg_end_nested(buf, act_off);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
*actions = ofpbuf_at_assert(buf, act_off, sizeof(struct nlattr));
|
|
Open vSwitch CI |
a7040a |
@@ -1272,8 +1287,8 @@ netdev_tc_flow_dump_next(struct netdev_flow_dump *dump,
|
|
Open vSwitch CI |
aaf0be |
continue;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
- if (flower.act_cookie.len) {
|
|
Open vSwitch CI |
aaf0be |
- *ufid = *((ovs_u128 *) flower.act_cookie.data);
|
|
Open vSwitch CI |
aaf0be |
+ if (flower.act_cookie.len >= sizeof *ufid) {
|
|
Open vSwitch CI |
aaf0be |
+ *ufid = get_32aligned_u128(flower.act_cookie.data);
|
|
Open vSwitch CI |
aaf0be |
} else if (!find_ufid(netdev, &id, ufid)) {
|
|
Open vSwitch CI |
aaf0be |
continue;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
a7040a |
@@ -2490,15 +2505,23 @@ netdev_tc_flow_get(struct netdev *netdev,
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
err = tc_get_flower(&id, &flower);
|
|
Open vSwitch CI |
aaf0be |
if (err) {
|
|
Open vSwitch CI |
aaf0be |
- VLOG_ERR_RL(&error_rl, "flow get failed (dev %s prio %d handle %d): %s",
|
|
Open vSwitch CI |
aaf0be |
+ VLOG_ERR_RL(&error_rl,
|
|
Open vSwitch CI |
aaf0be |
+ "flow get failed (dev %s prio %d handle %d): %s",
|
|
Open vSwitch CI |
aaf0be |
netdev_get_name(netdev), id.prio, id.handle,
|
|
Open vSwitch CI |
aaf0be |
ovs_strerror(err));
|
|
Open vSwitch CI |
aaf0be |
return err;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
in_port = netdev_ifindex_to_odp_port(id.ifindex);
|
|
Open vSwitch CI |
aaf0be |
- parse_tc_flower_to_match(netdev, &flower, match, actions,
|
|
Open vSwitch CI |
aaf0be |
- stats, attrs, buf, false);
|
|
Open vSwitch CI |
aaf0be |
+ err = parse_tc_flower_to_match(netdev, &flower, match, actions,
|
|
Open vSwitch CI |
aaf0be |
+ stats, attrs, buf, false);
|
|
Open vSwitch CI |
aaf0be |
+ if (err) {
|
|
Open vSwitch CI |
aaf0be |
+ VLOG_ERR_RL(&error_rl,
|
|
Open vSwitch CI |
aaf0be |
+ "flow get parse failed (dev %s prio %d handle %d): %s",
|
|
Open vSwitch CI |
aaf0be |
+ netdev_get_name(netdev), id.prio, id.handle,
|
|
Open vSwitch CI |
aaf0be |
+ ovs_strerror(err));
|
|
Open vSwitch CI |
aaf0be |
+ return err;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
if (stats) {
|
|
Open vSwitch CI |
aaf0be |
struct dpif_flow_stats adjust_stats;
|
|
Open vSwitch CI |
a7040a |
@@ -2860,8 +2883,9 @@ netdev_tc_init_flow_api(struct netdev *netdev)
|
|
Open vSwitch CI |
a7040a |
error = tc_add_del_qdisc(ifindex, true, block_id, hook);
|
|
Open vSwitch CI |
a7040a |
|
|
Open vSwitch CI |
a7040a |
if (error && error != EEXIST) {
|
|
Open vSwitch CI |
a7040a |
- VLOG_INFO("failed adding ingress qdisc required for offloading: %s",
|
|
Open vSwitch CI |
a7040a |
- ovs_strerror(error));
|
|
Open vSwitch CI |
a7040a |
+ VLOG_INFO("failed adding ingress qdisc required for offloading "
|
|
Open vSwitch CI |
a7040a |
+ "on %s: %s",
|
|
Open vSwitch CI |
a7040a |
+ netdev_get_name(netdev), ovs_strerror(error));
|
|
Open vSwitch CI |
a7040a |
return error;
|
|
Open vSwitch CI |
a7040a |
}
|
|
Open vSwitch CI |
a7040a |
|
|
Open vSwitch CI |
fc879c |
diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c
|
|
Open vSwitch CI |
fc879c |
index 4592262bd..a5fa62487 100644
|
|
Open vSwitch CI |
fc879c |
--- a/lib/netdev-offload.c
|
|
Open vSwitch CI |
fc879c |
+++ b/lib/netdev-offload.c
|
|
Open vSwitch CI |
fc879c |
@@ -485,11 +485,13 @@ netdev_set_hw_info(struct netdev *netdev, int type, int val)
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
/* Protects below port hashmaps. */
|
|
Open vSwitch CI |
fc879c |
-static struct ovs_rwlock netdev_hmap_rwlock = OVS_RWLOCK_INITIALIZER;
|
|
Open vSwitch CI |
fc879c |
+static struct ovs_rwlock ifindex_to_port_rwlock = OVS_RWLOCK_INITIALIZER;
|
|
Open vSwitch CI |
fc879c |
+static struct ovs_rwlock port_to_netdev_rwlock
|
|
Open vSwitch CI |
fc879c |
+ OVS_ACQ_BEFORE(ifindex_to_port_rwlock) = OVS_RWLOCK_INITIALIZER;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
-static struct hmap port_to_netdev OVS_GUARDED_BY(netdev_hmap_rwlock)
|
|
Open vSwitch CI |
fc879c |
+static struct hmap port_to_netdev OVS_GUARDED_BY(port_to_netdev_rwlock)
|
|
Open vSwitch CI |
fc879c |
= HMAP_INITIALIZER(&port_to_netdev);
|
|
Open vSwitch CI |
fc879c |
-static struct hmap ifindex_to_port OVS_GUARDED_BY(netdev_hmap_rwlock)
|
|
Open vSwitch CI |
fc879c |
+static struct hmap ifindex_to_port OVS_GUARDED_BY(ifindex_to_port_rwlock)
|
|
Open vSwitch CI |
fc879c |
= HMAP_INITIALIZER(&ifindex_to_port);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data {
|
|
Open vSwitch CI |
fc879c |
@@ -506,12 +508,12 @@ struct port_to_netdev_data {
|
|
Open vSwitch CI |
fc879c |
*/
|
|
Open vSwitch CI |
fc879c |
bool
|
|
Open vSwitch CI |
fc879c |
netdev_any_oor(void)
|
|
Open vSwitch CI |
fc879c |
- OVS_EXCLUDED(netdev_hmap_rwlock)
|
|
Open vSwitch CI |
fc879c |
+ OVS_EXCLUDED(port_to_netdev_rwlock)
|
|
Open vSwitch CI |
fc879c |
{
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
bool oor = false;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
HMAP_FOR_EACH (data, portno_node, &port_to_netdev) {
|
|
Open vSwitch CI |
fc879c |
struct netdev *dev = data->netdev;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
@@ -520,7 +522,7 @@ netdev_any_oor(void)
|
|
Open vSwitch CI |
fc879c |
break;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
return oor;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
@@ -594,13 +596,13 @@ netdev_ports_flow_flush(const char *dpif_type)
|
|
Open vSwitch CI |
fc879c |
{
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
HMAP_FOR_EACH (data, portno_node, &port_to_netdev) {
|
|
Open vSwitch CI |
fc879c |
if (netdev_get_dpif_type(data->netdev) == dpif_type) {
|
|
Open vSwitch CI |
fc879c |
netdev_flow_flush(data->netdev);
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
void
|
|
Open vSwitch CI |
fc879c |
@@ -610,7 +612,7 @@ netdev_ports_traverse(const char *dpif_type,
|
|
Open vSwitch CI |
fc879c |
{
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
HMAP_FOR_EACH (data, portno_node, &port_to_netdev) {
|
|
Open vSwitch CI |
fc879c |
if (netdev_get_dpif_type(data->netdev) == dpif_type) {
|
|
Open vSwitch CI |
fc879c |
if (cb(data->netdev, data->dpif_port.port_no, aux)) {
|
|
Open vSwitch CI |
fc879c |
@@ -618,7 +620,7 @@ netdev_ports_traverse(const char *dpif_type,
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
struct netdev_flow_dump **
|
|
Open vSwitch CI |
fc879c |
@@ -629,7 +631,7 @@ netdev_ports_flow_dump_create(const char *dpif_type, int *ports, bool terse)
|
|
Open vSwitch CI |
fc879c |
int count = 0;
|
|
Open vSwitch CI |
fc879c |
int i = 0;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
HMAP_FOR_EACH (data, portno_node, &port_to_netdev) {
|
|
Open vSwitch CI |
fc879c |
if (netdev_get_dpif_type(data->netdev) == dpif_type) {
|
|
Open vSwitch CI |
fc879c |
count++;
|
|
Open vSwitch CI |
fc879c |
@@ -648,7 +650,7 @@ netdev_ports_flow_dump_create(const char *dpif_type, int *ports, bool terse)
|
|
Open vSwitch CI |
fc879c |
i++;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
*ports = i;
|
|
Open vSwitch CI |
fc879c |
return dumps;
|
|
Open vSwitch CI |
fc879c |
@@ -660,15 +662,15 @@ netdev_ports_flow_del(const char *dpif_type, const ovs_u128 *ufid,
|
|
Open vSwitch CI |
fc879c |
{
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
HMAP_FOR_EACH (data, portno_node, &port_to_netdev) {
|
|
Open vSwitch CI |
fc879c |
if (netdev_get_dpif_type(data->netdev) == dpif_type
|
|
Open vSwitch CI |
fc879c |
&& !netdev_flow_del(data->netdev, ufid, stats)) {
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
return 0;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
return ENOENT;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
@@ -681,16 +683,16 @@ netdev_ports_flow_get(const char *dpif_type, struct match *match,
|
|
Open vSwitch CI |
fc879c |
{
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
HMAP_FOR_EACH (data, portno_node, &port_to_netdev) {
|
|
Open vSwitch CI |
fc879c |
if (netdev_get_dpif_type(data->netdev) == dpif_type
|
|
Open vSwitch CI |
fc879c |
&& !netdev_flow_get(data->netdev, match, actions,
|
|
Open vSwitch CI |
fc879c |
ufid, stats, attrs, buf)) {
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
return 0;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
return ENOENT;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
@@ -702,7 +704,7 @@ netdev_ports_hash(odp_port_t port, const char *dpif_type)
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
static struct port_to_netdev_data *
|
|
Open vSwitch CI |
fc879c |
netdev_ports_lookup(odp_port_t port_no, const char *dpif_type)
|
|
Open vSwitch CI |
fc879c |
- OVS_REQ_RDLOCK(netdev_hmap_rwlock)
|
|
Open vSwitch CI |
fc879c |
+ OVS_REQ_RDLOCK(port_to_netdev_rwlock)
|
|
Open vSwitch CI |
fc879c |
{
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
@@ -726,9 +728,9 @@ netdev_ports_insert(struct netdev *netdev, struct dpif_port *dpif_port)
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
ovs_assert(dpif_type);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_wrlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_wrlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
if (netdev_ports_lookup(dpif_port->port_no, dpif_type)) {
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
return EEXIST;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
@@ -738,14 +740,16 @@ netdev_ports_insert(struct netdev *netdev, struct dpif_port *dpif_port)
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
if (ifindex >= 0) {
|
|
Open vSwitch CI |
fc879c |
data->ifindex = ifindex;
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_wrlock(&ifindex_to_port_rwlock);
|
|
Open vSwitch CI |
fc879c |
hmap_insert(&ifindex_to_port, &data->ifindex_node, ifindex);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&ifindex_to_port_rwlock);
|
|
Open vSwitch CI |
fc879c |
} else {
|
|
Open vSwitch CI |
fc879c |
data->ifindex = -1;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
hmap_insert(&port_to_netdev, &data->portno_node,
|
|
Open vSwitch CI |
fc879c |
netdev_ports_hash(dpif_port->port_no, dpif_type));
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
netdev_init_flow_api(netdev);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
@@ -758,12 +762,12 @@ netdev_ports_get(odp_port_t port_no, const char *dpif_type)
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
struct netdev *ret = NULL;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
data = netdev_ports_lookup(port_no, dpif_type);
|
|
Open vSwitch CI |
fc879c |
if (data) {
|
|
Open vSwitch CI |
fc879c |
ret = netdev_ref(data->netdev);
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
return ret;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
@@ -774,19 +778,21 @@ netdev_ports_remove(odp_port_t port_no, const char *dpif_type)
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
int ret = ENOENT;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_wrlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_wrlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
data = netdev_ports_lookup(port_no, dpif_type);
|
|
Open vSwitch CI |
fc879c |
if (data) {
|
|
Open vSwitch CI |
fc879c |
dpif_port_destroy(&data->dpif_port);
|
|
Open vSwitch CI |
fc879c |
netdev_close(data->netdev); /* unref and possibly close */
|
|
Open vSwitch CI |
fc879c |
hmap_remove(&port_to_netdev, &data->portno_node);
|
|
Open vSwitch CI |
fc879c |
if (data->ifindex >= 0) {
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_wrlock(&ifindex_to_port_rwlock);
|
|
Open vSwitch CI |
fc879c |
hmap_remove(&ifindex_to_port, &data->ifindex_node);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&ifindex_to_port_rwlock);
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
free(data);
|
|
Open vSwitch CI |
fc879c |
ret = 0;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
return ret;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
@@ -798,7 +804,7 @@ netdev_ports_get_n_flows(const char *dpif_type, odp_port_t port_no,
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
int ret = EOPNOTSUPP;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
data = netdev_ports_lookup(port_no, dpif_type);
|
|
Open vSwitch CI |
fc879c |
if (data) {
|
|
Open vSwitch CI |
fc879c |
uint64_t thread_n_flows[MAX_OFFLOAD_THREAD_NB] = {0};
|
|
Open vSwitch CI |
fc879c |
@@ -812,7 +818,7 @@ netdev_ports_get_n_flows(const char *dpif_type, odp_port_t port_no,
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
return ret;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
@@ -822,14 +828,14 @@ netdev_ifindex_to_odp_port(int ifindex)
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
odp_port_t ret = 0;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&ifindex_to_port_rwlock);
|
|
Open vSwitch CI |
fc879c |
HMAP_FOR_EACH_WITH_HASH (data, ifindex_node, ifindex, &ifindex_to_port) {
|
|
Open vSwitch CI |
fc879c |
if (data->ifindex == ifindex) {
|
|
Open vSwitch CI |
fc879c |
ret = data->dpif_port.port_no;
|
|
Open vSwitch CI |
fc879c |
break;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&ifindex_to_port_rwlock);
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
return ret;
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
@@ -847,11 +853,11 @@ netdev_ports_flow_init(void)
|
|
Open vSwitch CI |
fc879c |
{
|
|
Open vSwitch CI |
fc879c |
struct port_to_netdev_data *data;
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_rdlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_rdlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
HMAP_FOR_EACH (data, portno_node, &port_to_netdev) {
|
|
Open vSwitch CI |
fc879c |
netdev_init_flow_api(data->netdev);
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
- ovs_rwlock_unlock(&netdev_hmap_rwlock);
|
|
Open vSwitch CI |
fc879c |
+ ovs_rwlock_unlock(&port_to_netdev_rwlock);
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
void
|
|
Open vSwitch CI |
772b08 |
diff --git a/lib/netdev-vport-private.h b/lib/netdev-vport-private.h
|
|
Open vSwitch CI |
772b08 |
index d89a28c66..586231057 100644
|
|
Open vSwitch CI |
772b08 |
--- a/lib/netdev-vport-private.h
|
|
Open vSwitch CI |
772b08 |
+++ b/lib/netdev-vport-private.h
|
|
Open vSwitch CI |
772b08 |
@@ -22,11 +22,17 @@
|
|
Open vSwitch CI |
772b08 |
#include "compiler.h"
|
|
Open vSwitch CI |
772b08 |
#include "netdev.h"
|
|
Open vSwitch CI |
772b08 |
#include "netdev-provider.h"
|
|
Open vSwitch CI |
772b08 |
+#include "ovs-atomic.h"
|
|
Open vSwitch CI |
772b08 |
#include "ovs-thread.h"
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
struct netdev_vport {
|
|
Open vSwitch CI |
772b08 |
struct netdev up;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
+ OVSRCU_TYPE(const struct netdev_tunnel_config *) tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
+ /* Sequence number for outgoing GRE packets. */
|
|
Open vSwitch CI |
772b08 |
+ atomic_count gre_seqno;
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
/* Protects all members below. */
|
|
Open vSwitch CI |
772b08 |
struct ovs_mutex mutex;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
@@ -34,7 +40,6 @@ struct netdev_vport {
|
|
Open vSwitch CI |
772b08 |
struct netdev_stats stats;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
/* Tunnels. */
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
char egress_iface[IFNAMSIZ];
|
|
Open vSwitch CI |
772b08 |
bool carrier_status;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
|
|
Open vSwitch CI |
772b08 |
index 3b3927865..4cfe15d5a 100644
|
|
Open vSwitch CI |
772b08 |
--- a/lib/netdev-vport.c
|
|
Open vSwitch CI |
772b08 |
+++ b/lib/netdev-vport.c
|
|
Open vSwitch CI |
772b08 |
@@ -37,6 +37,7 @@
|
|
Open vSwitch CI |
772b08 |
#include "netdev-provider.h"
|
|
Open vSwitch CI |
772b08 |
#include "netdev-vport-private.h"
|
|
Open vSwitch CI |
772b08 |
#include "openvswitch/dynamic-string.h"
|
|
Open vSwitch CI |
772b08 |
+#include "ovs-atomic.h"
|
|
Open vSwitch CI |
772b08 |
#include "ovs-router.h"
|
|
Open vSwitch CI |
772b08 |
#include "packets.h"
|
|
Open vSwitch CI |
772b08 |
#include "openvswitch/poll-loop.h"
|
|
Open vSwitch CI |
772b08 |
@@ -68,8 +69,8 @@ static int get_patch_config(const struct netdev *netdev, struct smap *args);
|
|
Open vSwitch CI |
772b08 |
static int get_tunnel_config(const struct netdev *, struct smap *args);
|
|
Open vSwitch CI |
772b08 |
static bool tunnel_check_status_change__(struct netdev_vport *);
|
|
Open vSwitch CI |
772b08 |
static void update_vxlan_global_cfg(struct netdev *,
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *,
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *);
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *,
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
struct vport_class {
|
|
Open vSwitch CI |
772b08 |
const char *dpif_port;
|
|
Open vSwitch CI |
772b08 |
@@ -90,10 +91,16 @@ vport_class_cast(const struct netdev_class *class)
|
|
Open vSwitch CI |
772b08 |
return CONTAINER_OF(class, struct vport_class, netdev_class);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
+static const struct netdev_tunnel_config *
|
|
Open vSwitch CI |
772b08 |
+vport_tunnel_config(struct netdev_vport *netdev)
|
|
Open vSwitch CI |
772b08 |
+{
|
|
Open vSwitch CI |
772b08 |
+ return ovsrcu_get(const struct netdev_tunnel_config *, &netdev->tnl_cfg);
|
|
Open vSwitch CI |
772b08 |
+}
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
static const struct netdev_tunnel_config *
|
|
Open vSwitch CI |
772b08 |
get_netdev_tunnel_config(const struct netdev *netdev)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
- return &netdev_vport_cast(netdev)->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+ return vport_tunnel_config(netdev_vport_cast(netdev));
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
bool
|
|
Open vSwitch CI |
772b08 |
@@ -134,8 +141,6 @@ netdev_vport_get_dpif_port(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
if (netdev_vport_needs_dst_port(netdev)) {
|
|
Open vSwitch CI |
772b08 |
- const struct netdev_vport *vport = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
-
|
|
Open vSwitch CI |
772b08 |
/*
|
|
Open vSwitch CI |
772b08 |
* Note: IFNAMSIZ is 16 bytes long. Implementations should choose
|
|
Open vSwitch CI |
772b08 |
* a dpif port name that is short enough to fit including any
|
|
Open vSwitch CI |
772b08 |
@@ -144,7 +149,7 @@ netdev_vport_get_dpif_port(const struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
BUILD_ASSERT(NETDEV_VPORT_NAME_BUFSIZE >= IFNAMSIZ);
|
|
Open vSwitch CI |
772b08 |
ovs_assert(strlen(dpif_port) + 6 < IFNAMSIZ);
|
|
Open vSwitch CI |
772b08 |
snprintf(namebuf, bufsize, "%s_%d", dpif_port,
|
|
Open vSwitch CI |
772b08 |
- ntohs(vport->tnl_cfg.dst_port));
|
|
Open vSwitch CI |
772b08 |
+ ntohs(netdev_get_tunnel_config(netdev)->dst_port));
|
|
Open vSwitch CI |
772b08 |
return namebuf;
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
return dpif_port;
|
|
Open vSwitch CI |
772b08 |
@@ -162,12 +167,14 @@ netdev_vport_route_changed(void)
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
vports = netdev_get_vports(&n_vports);
|
|
Open vSwitch CI |
772b08 |
for (i = 0; i < n_vports; i++) {
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
struct netdev *netdev_ = vports[i];
|
|
Open vSwitch CI |
772b08 |
struct netdev_vport *netdev = netdev_vport_cast(netdev_);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
ovs_mutex_lock(&netdev->mutex);
|
|
Open vSwitch CI |
772b08 |
/* Finds all tunnel vports. */
|
|
Open vSwitch CI |
772b08 |
- if (ipv6_addr_is_set(&netdev->tnl_cfg.ipv6_dst)) {
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg = netdev_get_tunnel_config(netdev_);
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg && ipv6_addr_is_set(&tnl_cfg->ipv6_dst)) {
|
|
Open vSwitch CI |
772b08 |
if (tunnel_check_status_change__(netdev)) {
|
|
Open vSwitch CI |
772b08 |
netdev_change_seq_changed(netdev_);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
@@ -198,6 +205,7 @@ netdev_vport_construct(struct netdev *netdev_)
|
|
Open vSwitch CI |
772b08 |
uint16_t port = 0;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
ovs_mutex_init(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
+ atomic_count_init(&dev->gre_seqno, 0);
|
|
Open vSwitch CI |
772b08 |
eth_addr_random(&dev->etheraddr);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
if (name && dpif_port && (strlen(name) > strlen(dpif_port) + 1) &&
|
|
Open vSwitch CI |
772b08 |
@@ -206,26 +214,31 @@ netdev_vport_construct(struct netdev *netdev_)
|
|
Open vSwitch CI |
772b08 |
port = atoi(p);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
+ struct netdev_tunnel_config *tnl_cfg = xzalloc(sizeof *tnl_cfg);
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
/* If a destination port for tunnel ports is specified in the netdev
|
|
Open vSwitch CI |
772b08 |
* name, use it instead of the default one. Otherwise, use the default
|
|
Open vSwitch CI |
772b08 |
* destination port */
|
|
Open vSwitch CI |
772b08 |
if (!strcmp(type, "geneve")) {
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg.dst_port = port ? htons(port) : htons(GENEVE_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->dst_port = port ? htons(port) : htons(GENEVE_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
} else if (!strcmp(type, "vxlan")) {
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg.dst_port = port ? htons(port) : htons(VXLAN_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
- update_vxlan_global_cfg(netdev_, NULL, &dev->tnl_cfg);
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->dst_port = port ? htons(port) : htons(VXLAN_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
+ update_vxlan_global_cfg(netdev_, NULL, tnl_cfg);
|
|
Open vSwitch CI |
772b08 |
} else if (!strcmp(type, "lisp")) {
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg.dst_port = port ? htons(port) : htons(LISP_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->dst_port = port ? htons(port) : htons(LISP_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
} else if (!strcmp(type, "stt")) {
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg.dst_port = port ? htons(port) : htons(STT_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->dst_port = port ? htons(port) : htons(STT_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
} else if (!strcmp(type, "gtpu")) {
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg.dst_port = port ? htons(port) : htons(GTPU_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->dst_port = port ? htons(port) : htons(GTPU_DST_PORT);
|
|
Open vSwitch CI |
772b08 |
} else if (!strcmp(type, "bareudp")) {
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg.dst_port = htons(port);
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->dst_port = htons(port);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg.dont_fragment = true;
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg.ttl = DEFAULT_TTL;
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->dont_fragment = true;
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->ttl = DEFAULT_TTL;
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
+ ovsrcu_set(&dev->tnl_cfg, tnl_cfg);
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
return 0;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
@@ -233,12 +246,15 @@ static void
|
|
Open vSwitch CI |
772b08 |
netdev_vport_destruct(struct netdev *netdev_)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
struct netdev_vport *netdev = netdev_vport_cast(netdev_);
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *tnl_cfg = vport_tunnel_config(netdev);
|
|
Open vSwitch CI |
772b08 |
const char *type = netdev_get_type(netdev_);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
if (!strcmp(type, "vxlan")) {
|
|
Open vSwitch CI |
772b08 |
- update_vxlan_global_cfg(netdev_, &netdev->tnl_cfg, NULL);
|
|
Open vSwitch CI |
772b08 |
+ update_vxlan_global_cfg(netdev_, tnl_cfg, NULL);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
+ ovsrcu_set(&netdev->tnl_cfg, NULL);
|
|
Open vSwitch CI |
772b08 |
+ ovsrcu_postpone(free, CONST_CAST(struct netdev_tunnel_config *, tnl_cfg));
|
|
Open vSwitch CI |
772b08 |
free(netdev->peer);
|
|
Open vSwitch CI |
772b08 |
ovs_mutex_destroy(&netdev->mutex);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
@@ -281,15 +297,16 @@ static bool
|
|
Open vSwitch CI |
772b08 |
tunnel_check_status_change__(struct netdev_vport *netdev)
|
|
Open vSwitch CI |
772b08 |
OVS_REQUIRES(netdev->mutex)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *tnl_cfg = vport_tunnel_config(netdev);
|
|
Open vSwitch CI |
772b08 |
+ const struct in6_addr *route;
|
|
Open vSwitch CI |
772b08 |
char iface[IFNAMSIZ];
|
|
Open vSwitch CI |
772b08 |
bool status = false;
|
|
Open vSwitch CI |
772b08 |
- struct in6_addr *route;
|
|
Open vSwitch CI |
772b08 |
struct in6_addr gw;
|
|
Open vSwitch CI |
772b08 |
uint32_t mark;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
iface[0] = '\0';
|
|
Open vSwitch CI |
772b08 |
- route = &netdev->tnl_cfg.ipv6_dst;
|
|
Open vSwitch CI |
772b08 |
- mark = netdev->tnl_cfg.egress_pkt_mark;
|
|
Open vSwitch CI |
772b08 |
+ route = &tnl_cfg->ipv6_dst;
|
|
Open vSwitch CI |
772b08 |
+ mark = tnl_cfg->egress_pkt_mark;
|
|
Open vSwitch CI |
772b08 |
if (ovs_router_lookup(mark, route, iface, NULL, &gw)) {
|
|
Open vSwitch CI |
772b08 |
struct netdev *egress_netdev;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
@@ -465,8 +482,8 @@ vxlan_get_port_ext_gbp_str(uint16_t port, bool gbp,
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
static void
|
|
Open vSwitch CI |
772b08 |
update_vxlan_global_cfg(struct netdev *netdev,
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *old_cfg,
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config *new_cfg)
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *old_cfg,
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *new_cfg)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
unsigned int count;
|
|
Open vSwitch CI |
772b08 |
char namebuf[20];
|
|
Open vSwitch CI |
772b08 |
@@ -510,19 +527,20 @@ static bool
|
|
Open vSwitch CI |
772b08 |
is_concomitant_vxlan_tunnel_present(struct netdev_vport *dev,
|
|
Open vSwitch CI |
772b08 |
const struct netdev_tunnel_config *tnl_cfg)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
- char namebuf[20];
|
|
Open vSwitch CI |
772b08 |
- const char *type = netdev_get_type(&dev->up);
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *dev_tnl_cfg = vport_tunnel_config(dev);
|
|
Open vSwitch CI |
772b08 |
struct vport_class *vclass = vport_class_cast(netdev_get_class(&dev->up));
|
|
Open vSwitch CI |
772b08 |
+ const char *type = netdev_get_type(&dev->up);
|
|
Open vSwitch CI |
772b08 |
+ char namebuf[20];
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
if (strcmp(type, "vxlan")) {
|
|
Open vSwitch CI |
772b08 |
return false;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (dev->tnl_cfg.dst_port == tnl_cfg->dst_port &&
|
|
Open vSwitch CI |
772b08 |
- (dev->tnl_cfg.exts & (1 << OVS_VXLAN_EXT_GBP)) ==
|
|
Open vSwitch CI |
772b08 |
+ if (dev_tnl_cfg->dst_port == tnl_cfg->dst_port &&
|
|
Open vSwitch CI |
772b08 |
+ (dev_tnl_cfg->exts & (1 << OVS_VXLAN_EXT_GBP)) ==
|
|
Open vSwitch CI |
772b08 |
(tnl_cfg->exts & (1 << OVS_VXLAN_EXT_GBP))) {
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (ntohs(dev->tnl_cfg.dst_port) == VXLAN_DST_PORT) {
|
|
Open vSwitch CI |
772b08 |
+ if (ntohs(dev_tnl_cfg->dst_port) == VXLAN_DST_PORT) {
|
|
Open vSwitch CI |
772b08 |
/* Special case where we kept the default port/gbp, only ok if
|
|
Open vSwitch CI |
772b08 |
the opposite of the default does not exits */
|
|
Open vSwitch CI |
772b08 |
vxlan_get_port_ext_gbp_str(ntohs(tnl_cfg->dst_port),
|
|
Open vSwitch CI |
772b08 |
@@ -538,9 +556,9 @@ is_concomitant_vxlan_tunnel_present(struct netdev_vport *dev,
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
/* Same port: ok if no one is left with the previous configuration */
|
|
Open vSwitch CI |
772b08 |
- if (dev->tnl_cfg.dst_port == tnl_cfg->dst_port) {
|
|
Open vSwitch CI |
772b08 |
- vxlan_get_port_ext_gbp_str(ntohs(dev->tnl_cfg.dst_port),
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg.exts &
|
|
Open vSwitch CI |
772b08 |
+ if (dev_tnl_cfg->dst_port == tnl_cfg->dst_port) {
|
|
Open vSwitch CI |
772b08 |
+ vxlan_get_port_ext_gbp_str(ntohs(dev_tnl_cfg->dst_port),
|
|
Open vSwitch CI |
772b08 |
+ dev_tnl_cfg->exts &
|
|
Open vSwitch CI |
772b08 |
(1 << OVS_VXLAN_EXT_GBP),
|
|
Open vSwitch CI |
772b08 |
namebuf, sizeof(namebuf));
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
@@ -568,6 +586,7 @@ static int
|
|
Open vSwitch CI |
772b08 |
set_tunnel_config(struct netdev *dev_, const struct smap *args, char **errp)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
struct netdev_vport *dev = netdev_vport_cast(dev_);
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *curr_tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
const char *name = netdev_get_name(dev_);
|
|
Open vSwitch CI |
772b08 |
const char *type = netdev_get_type(dev_);
|
|
Open vSwitch CI |
772b08 |
struct ds errors = DS_EMPTY_INITIALIZER;
|
|
Open vSwitch CI |
772b08 |
@@ -858,11 +877,16 @@ set_tunnel_config(struct netdev *dev_, const struct smap *args, char **errp)
|
|
Open vSwitch CI |
772b08 |
err = EEXIST;
|
|
Open vSwitch CI |
772b08 |
goto out;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
- update_vxlan_global_cfg(dev_, &dev->tnl_cfg, &tnl_cfg);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
ovs_mutex_lock(&dev->mutex);
|
|
Open vSwitch CI |
772b08 |
- if (memcmp(&dev->tnl_cfg, &tnl_cfg, sizeof tnl_cfg)) {
|
|
Open vSwitch CI |
772b08 |
- dev->tnl_cfg = tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
+ curr_tnl_cfg = vport_tunnel_config(dev);
|
|
Open vSwitch CI |
772b08 |
+ update_vxlan_global_cfg(dev_, curr_tnl_cfg, &tnl_cfg);
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
+ if (memcmp(curr_tnl_cfg, &tnl_cfg, sizeof tnl_cfg)) {
|
|
Open vSwitch CI |
772b08 |
+ ovsrcu_set(&dev->tnl_cfg, xmemdup(&tnl_cfg, sizeof tnl_cfg));
|
|
Open vSwitch CI |
772b08 |
+ ovsrcu_postpone(free, CONST_CAST(struct netdev_tunnel_config *,
|
|
Open vSwitch CI |
772b08 |
+ curr_tnl_cfg));
|
|
Open vSwitch CI |
772b08 |
tunnel_check_status_change__(dev);
|
|
Open vSwitch CI |
772b08 |
netdev_change_seq_changed(dev_);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
@@ -887,61 +911,60 @@ out:
|
|
Open vSwitch CI |
772b08 |
static int
|
|
Open vSwitch CI |
772b08 |
get_tunnel_config(const struct netdev *dev, struct smap *args)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
- struct netdev_vport *netdev = netdev_vport_cast(dev);
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *tnl_cfg = netdev_get_tunnel_config(dev);
|
|
Open vSwitch CI |
772b08 |
const char *type = netdev_get_type(dev);
|
|
Open vSwitch CI |
772b08 |
- struct netdev_tunnel_config tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_lock(&netdev->mutex);
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg = netdev->tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
- ovs_mutex_unlock(&netdev->mutex);
|
|
Open vSwitch CI |
772b08 |
+ if (!tnl_cfg) {
|
|
Open vSwitch CI |
772b08 |
+ return 0;
|
|
Open vSwitch CI |
772b08 |
+ }
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (ipv6_addr_is_set(&tnl_cfg.ipv6_dst)) {
|
|
Open vSwitch CI |
772b08 |
- smap_add_ipv6(args, "remote_ip", &tnl_cfg.ipv6_dst);
|
|
Open vSwitch CI |
772b08 |
- } else if (tnl_cfg.ip_dst_flow) {
|
|
Open vSwitch CI |
772b08 |
+ if (ipv6_addr_is_set(&tnl_cfg->ipv6_dst)) {
|
|
Open vSwitch CI |
772b08 |
+ smap_add_ipv6(args, "remote_ip", &tnl_cfg->ipv6_dst);
|
|
Open vSwitch CI |
772b08 |
+ } else if (tnl_cfg->ip_dst_flow) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "remote_ip", "flow");
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (ipv6_addr_is_set(&tnl_cfg.ipv6_src)) {
|
|
Open vSwitch CI |
772b08 |
- smap_add_ipv6(args, "local_ip", &tnl_cfg.ipv6_src);
|
|
Open vSwitch CI |
772b08 |
- } else if (tnl_cfg.ip_src_flow) {
|
|
Open vSwitch CI |
772b08 |
+ if (ipv6_addr_is_set(&tnl_cfg->ipv6_src)) {
|
|
Open vSwitch CI |
772b08 |
+ smap_add_ipv6(args, "local_ip", &tnl_cfg->ipv6_src);
|
|
Open vSwitch CI |
772b08 |
+ } else if (tnl_cfg->ip_src_flow) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "local_ip", "flow");
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.in_key_flow && tnl_cfg.out_key_flow) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->in_key_flow && tnl_cfg->out_key_flow) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "key", "flow");
|
|
Open vSwitch CI |
772b08 |
- } else if (tnl_cfg.in_key_present && tnl_cfg.out_key_present
|
|
Open vSwitch CI |
772b08 |
- && tnl_cfg.in_key == tnl_cfg.out_key) {
|
|
Open vSwitch CI |
772b08 |
- smap_add_format(args, "key", "%"PRIu64, ntohll(tnl_cfg.in_key));
|
|
Open vSwitch CI |
772b08 |
+ } else if (tnl_cfg->in_key_present && tnl_cfg->out_key_present
|
|
Open vSwitch CI |
772b08 |
+ && tnl_cfg->in_key == tnl_cfg->out_key) {
|
|
Open vSwitch CI |
772b08 |
+ smap_add_format(args, "key", "%"PRIu64, ntohll(tnl_cfg->in_key));
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.in_key_flow) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->in_key_flow) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "in_key", "flow");
|
|
Open vSwitch CI |
772b08 |
- } else if (tnl_cfg.in_key_present) {
|
|
Open vSwitch CI |
772b08 |
+ } else if (tnl_cfg->in_key_present) {
|
|
Open vSwitch CI |
772b08 |
smap_add_format(args, "in_key", "%"PRIu64,
|
|
Open vSwitch CI |
772b08 |
- ntohll(tnl_cfg.in_key));
|
|
Open vSwitch CI |
772b08 |
+ ntohll(tnl_cfg->in_key));
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.out_key_flow) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->out_key_flow) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "out_key", "flow");
|
|
Open vSwitch CI |
772b08 |
- } else if (tnl_cfg.out_key_present) {
|
|
Open vSwitch CI |
772b08 |
+ } else if (tnl_cfg->out_key_present) {
|
|
Open vSwitch CI |
772b08 |
smap_add_format(args, "out_key", "%"PRIu64,
|
|
Open vSwitch CI |
772b08 |
- ntohll(tnl_cfg.out_key));
|
|
Open vSwitch CI |
772b08 |
+ ntohll(tnl_cfg->out_key));
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.ttl_inherit) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->ttl_inherit) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "ttl", "inherit");
|
|
Open vSwitch CI |
772b08 |
- } else if (tnl_cfg.ttl != DEFAULT_TTL) {
|
|
Open vSwitch CI |
772b08 |
- smap_add_format(args, "ttl", "%"PRIu8, tnl_cfg.ttl);
|
|
Open vSwitch CI |
772b08 |
+ } else if (tnl_cfg->ttl != DEFAULT_TTL) {
|
|
Open vSwitch CI |
772b08 |
+ smap_add_format(args, "ttl", "%"PRIu8, tnl_cfg->ttl);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.tos_inherit) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->tos_inherit) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "tos", "inherit");
|
|
Open vSwitch CI |
772b08 |
- } else if (tnl_cfg.tos) {
|
|
Open vSwitch CI |
772b08 |
- smap_add_format(args, "tos", "0x%x", tnl_cfg.tos);
|
|
Open vSwitch CI |
772b08 |
+ } else if (tnl_cfg->tos) {
|
|
Open vSwitch CI |
772b08 |
+ smap_add_format(args, "tos", "0x%x", tnl_cfg->tos);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.dst_port) {
|
|
Open vSwitch CI |
772b08 |
- uint16_t dst_port = ntohs(tnl_cfg.dst_port);
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->dst_port) {
|
|
Open vSwitch CI |
772b08 |
+ uint16_t dst_port = ntohs(tnl_cfg->dst_port);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
if ((!strcmp("geneve", type) && dst_port != GENEVE_DST_PORT) ||
|
|
Open vSwitch CI |
772b08 |
(!strcmp("vxlan", type) && dst_port != VXLAN_DST_PORT) ||
|
|
Open vSwitch CI |
772b08 |
@@ -953,33 +976,33 @@ get_tunnel_config(const struct netdev *dev, struct smap *args)
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.csum) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->csum) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "csum", "true");
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.set_seq) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->set_seq) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "seq", "true");
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- enum tunnel_layers layers = tunnel_supported_layers(type, &tnl_cfg);
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.pt_mode != default_pt_mode(layers)) {
|
|
Open vSwitch CI |
772b08 |
+ enum tunnel_layers layers = tunnel_supported_layers(type, tnl_cfg);
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->pt_mode != default_pt_mode(layers)) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "packet_type",
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg.pt_mode == NETDEV_PT_LEGACY_L2 ? "legacy_l2"
|
|
Open vSwitch CI |
772b08 |
- : tnl_cfg.pt_mode == NETDEV_PT_LEGACY_L3 ? "legacy_l3"
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->pt_mode == NETDEV_PT_LEGACY_L2 ? "legacy_l2"
|
|
Open vSwitch CI |
772b08 |
+ : tnl_cfg->pt_mode == NETDEV_PT_LEGACY_L3 ? "legacy_l3"
|
|
Open vSwitch CI |
772b08 |
: "ptap");
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (!tnl_cfg.dont_fragment) {
|
|
Open vSwitch CI |
772b08 |
+ if (!tnl_cfg->dont_fragment) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "df_default", "false");
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.set_egress_pkt_mark) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->set_egress_pkt_mark) {
|
|
Open vSwitch CI |
772b08 |
smap_add_format(args, "egress_pkt_mark",
|
|
Open vSwitch CI |
772b08 |
- "%"PRIu32, tnl_cfg.egress_pkt_mark);
|
|
Open vSwitch CI |
772b08 |
+ "%"PRIu32, tnl_cfg->egress_pkt_mark);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
if (!strcmp("erspan", type) || !strcmp("ip6erspan", type)) {
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.erspan_ver_flow) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->erspan_ver_flow) {
|
|
Open vSwitch CI |
772b08 |
/* since version number is not determined,
|
|
Open vSwitch CI |
772b08 |
* assume print all other as flow
|
|
Open vSwitch CI |
772b08 |
*/
|
|
Open vSwitch CI |
772b08 |
@@ -988,27 +1011,27 @@ get_tunnel_config(const struct netdev *dev, struct smap *args)
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "erspan_dir", "flow");
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "erspan_hwid", "flow");
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
- smap_add_format(args, "erspan_ver", "%d", tnl_cfg.erspan_ver);
|
|
Open vSwitch CI |
772b08 |
+ smap_add_format(args, "erspan_ver", "%d", tnl_cfg->erspan_ver);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.erspan_ver == 1) {
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.erspan_idx_flow) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->erspan_ver == 1) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->erspan_idx_flow) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "erspan_idx", "flow");
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
smap_add_format(args, "erspan_idx", "0x%x",
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg.erspan_idx);
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->erspan_idx);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
- } else if (tnl_cfg.erspan_ver == 2) {
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.erspan_dir_flow) {
|
|
Open vSwitch CI |
772b08 |
+ } else if (tnl_cfg->erspan_ver == 2) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->erspan_dir_flow) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "erspan_dir", "flow");
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
smap_add_format(args, "erspan_dir", "%d",
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg.erspan_dir);
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->erspan_dir);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
- if (tnl_cfg.erspan_hwid_flow) {
|
|
Open vSwitch CI |
772b08 |
+ if (tnl_cfg->erspan_hwid_flow) {
|
|
Open vSwitch CI |
772b08 |
smap_add(args, "erspan_hwid", "flow");
|
|
Open vSwitch CI |
772b08 |
} else {
|
|
Open vSwitch CI |
772b08 |
smap_add_format(args, "erspan_hwid", "0x%x",
|
|
Open vSwitch CI |
772b08 |
- tnl_cfg.erspan_hwid);
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg->erspan_hwid);
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
@@ -1138,9 +1161,11 @@ netdev_vport_get_stats(const struct netdev *netdev, struct netdev_stats *stats)
|
|
Open vSwitch CI |
772b08 |
static enum netdev_pt_mode
|
|
Open vSwitch CI |
772b08 |
netdev_vport_get_pt_mode(const struct netdev *netdev)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
- struct netdev_vport *dev = netdev_vport_cast(netdev);
|
|
Open vSwitch CI |
772b08 |
+ const struct netdev_tunnel_config *tnl_cfg;
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
+ tnl_cfg = netdev_get_tunnel_config(netdev);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
- return dev->tnl_cfg.pt_mode;
|
|
Open vSwitch CI |
772b08 |
+ return tnl_cfg ? tnl_cfg->pt_mode : NETDEV_PT_UNKNOWN;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/netdev-windows.c b/lib/netdev-windows.c
|
|
Open vSwitch CI |
aaf0be |
index 4ad45ffa1..3fad501e3 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/netdev-windows.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/netdev-windows.c
|
|
Open vSwitch CI |
aaf0be |
@@ -156,6 +156,7 @@ netdev_windows_system_construct(struct netdev *netdev_)
|
|
Open vSwitch CI |
aaf0be |
struct netdev_windows_netdev_info info;
|
|
Open vSwitch CI |
aaf0be |
struct ofpbuf *buf;
|
|
Open vSwitch CI |
aaf0be |
int ret;
|
|
Open vSwitch CI |
aaf0be |
+ const char *type = NULL;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
/* Query the attributes and runtime status of the netdev. */
|
|
Open vSwitch CI |
aaf0be |
ret = query_netdev(netdev_get_name(&netdev->up), &info, &buf;;
|
|
Open vSwitch CI |
aaf0be |
@@ -167,6 +168,16 @@ netdev_windows_system_construct(struct netdev *netdev_)
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
ofpbuf_delete(buf);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+ /* Don't create netdev if ovs-type is "internal"
|
|
Open vSwitch CI |
aaf0be |
+ * but the type of netdev->up is "system". */
|
|
Open vSwitch CI |
aaf0be |
+ type = netdev_get_type(&netdev->up);
|
|
Open vSwitch CI |
aaf0be |
+ if (type && !strcmp(type, "system") &&
|
|
Open vSwitch CI |
aaf0be |
+ (info.ovs_type == OVS_VPORT_TYPE_INTERNAL)) {
|
|
Open vSwitch CI |
aaf0be |
+ VLOG_DBG("construct device %s, ovs_type: %u failed",
|
|
Open vSwitch CI |
aaf0be |
+ netdev_get_name(&netdev->up), info.ovs_type);
|
|
Open vSwitch CI |
aaf0be |
+ return 1;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
netdev->change_seq = 1;
|
|
Open vSwitch CI |
aaf0be |
netdev->dev_type = info.ovs_type;
|
|
Open vSwitch CI |
aaf0be |
netdev->port_no = info.port_no;
|
|
Open vSwitch CI |
772b08 |
diff --git a/lib/netdev.h b/lib/netdev.h
|
|
Open vSwitch CI |
772b08 |
index acf174927..47c15bde7 100644
|
|
Open vSwitch CI |
772b08 |
--- a/lib/netdev.h
|
|
Open vSwitch CI |
772b08 |
+++ b/lib/netdev.h
|
|
Open vSwitch CI |
772b08 |
@@ -72,6 +72,9 @@ struct sset;
|
|
Open vSwitch CI |
772b08 |
struct ovs_action_push_tnl;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
enum netdev_pt_mode {
|
|
Open vSwitch CI |
772b08 |
+ /* Unknown mode. The netdev is not configured yet. */
|
|
Open vSwitch CI |
772b08 |
+ NETDEV_PT_UNKNOWN = 0,
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
/* The netdev is packet type aware. It can potentially carry any kind of
|
|
Open vSwitch CI |
772b08 |
* packet. This "modern" mode is appropriate for both netdevs that handle
|
|
Open vSwitch CI |
772b08 |
* only a single kind of packet (such as a virtual or physical Ethernet
|
|
Open vSwitch CI |
772b08 |
@@ -130,7 +133,6 @@ struct netdev_tunnel_config {
|
|
Open vSwitch CI |
772b08 |
enum netdev_pt_mode pt_mode;
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
bool set_seq;
|
|
Open vSwitch CI |
772b08 |
- uint32_t seqno;
|
|
Open vSwitch CI |
772b08 |
uint32_t erspan_idx;
|
|
Open vSwitch CI |
772b08 |
uint8_t erspan_ver;
|
|
Open vSwitch CI |
772b08 |
uint8_t erspan_dir;
|
|
Open vSwitch CI |
7f2e72 |
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
|
|
Open vSwitch CI |
7f2e72 |
index a90b926ef..102b183a8 100644
|
|
Open vSwitch CI |
7f2e72 |
--- a/lib/ofp-parse.c
|
|
Open vSwitch CI |
7f2e72 |
+++ b/lib/ofp-parse.c
|
|
Open vSwitch CI |
7f2e72 |
@@ -71,16 +71,13 @@ str_to_u16(const char *str, const char *name, uint16_t *valuep)
|
|
Open vSwitch CI |
7f2e72 |
char * OVS_WARN_UNUSED_RESULT
|
|
Open vSwitch CI |
7f2e72 |
str_to_u32(const char *str, uint32_t *valuep)
|
|
Open vSwitch CI |
7f2e72 |
{
|
|
Open vSwitch CI |
7f2e72 |
- char *tail;
|
|
Open vSwitch CI |
7f2e72 |
- uint32_t value;
|
|
Open vSwitch CI |
7f2e72 |
+ unsigned long long value;
|
|
Open vSwitch CI |
7f2e72 |
|
|
Open vSwitch CI |
7f2e72 |
if (!str[0]) {
|
|
Open vSwitch CI |
7f2e72 |
return xstrdup("missing required numeric argument");
|
|
Open vSwitch CI |
7f2e72 |
}
|
|
Open vSwitch CI |
7f2e72 |
|
|
Open vSwitch CI |
7f2e72 |
- errno = 0;
|
|
Open vSwitch CI |
7f2e72 |
- value = strtoul(str, &tail, 0);
|
|
Open vSwitch CI |
7f2e72 |
- if (errno == EINVAL || errno == ERANGE || *tail) {
|
|
Open vSwitch CI |
7f2e72 |
+ if (!str_to_ullong(str, 0, &value) || value > UINT32_MAX) {
|
|
Open vSwitch CI |
7f2e72 |
return xasprintf("invalid numeric format %s", str);
|
|
Open vSwitch CI |
7f2e72 |
}
|
|
Open vSwitch CI |
7f2e72 |
*valuep = value;
|
|
Open vSwitch CI |
aaf0be |
diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
|
|
Open vSwitch CI |
aaf0be |
index 2d382f1e8..ac5d2c3d0 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/lib/ovs-thread.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/lib/ovs-thread.c
|
|
Open vSwitch CI |
aaf0be |
@@ -674,7 +674,7 @@ count_cpu_cores(void)
|
|
Open vSwitch CI |
aaf0be |
static int cpu_cores;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
ovs_mutex_lock(&cpu_cores_mutex);
|
|
Open vSwitch CI |
aaf0be |
- if (now - last_updated >= COUNT_CPU_UPDATE_TIME_MS) {
|
|
Open vSwitch CI |
aaf0be |
+ if (!last_updated || now - last_updated >= COUNT_CPU_UPDATE_TIME_MS) {
|
|
Open vSwitch CI |
aaf0be |
last_updated = now;
|
|
Open vSwitch CI |
aaf0be |
cpu_cores = count_cpu_cores__();
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
772b08 |
diff --git a/lib/smap.c b/lib/smap.c
|
|
Open vSwitch CI |
772b08 |
index c1633e2a1..47fb34502 100644
|
|
Open vSwitch CI |
772b08 |
--- a/lib/smap.c
|
|
Open vSwitch CI |
772b08 |
+++ b/lib/smap.c
|
|
Open vSwitch CI |
772b08 |
@@ -100,7 +100,7 @@ smap_add_format(struct smap *smap, const char *key, const char *format, ...)
|
|
Open vSwitch CI |
772b08 |
/* Adds 'key' paired with a string representation of 'addr'. It is the
|
|
Open vSwitch CI |
772b08 |
* caller's responsibility to avoid duplicate keys if desirable. */
|
|
Open vSwitch CI |
772b08 |
void
|
|
Open vSwitch CI |
772b08 |
-smap_add_ipv6(struct smap *smap, const char *key, struct in6_addr *addr)
|
|
Open vSwitch CI |
772b08 |
+smap_add_ipv6(struct smap *smap, const char *key, const struct in6_addr *addr)
|
|
Open vSwitch CI |
772b08 |
{
|
|
Open vSwitch CI |
772b08 |
char buf[INET6_ADDRSTRLEN];
|
|
Open vSwitch CI |
772b08 |
ipv6_string_mapped(buf, addr);
|
|
Open vSwitch CI |
772b08 |
diff --git a/lib/smap.h b/lib/smap.h
|
|
Open vSwitch CI |
772b08 |
index 2fe6c540a..d1d2ae6f2 100644
|
|
Open vSwitch CI |
772b08 |
--- a/lib/smap.h
|
|
Open vSwitch CI |
772b08 |
+++ b/lib/smap.h
|
|
Open vSwitch CI |
772b08 |
@@ -100,7 +100,7 @@ struct smap_node *smap_add_nocopy(struct smap *, char *, char *);
|
|
Open vSwitch CI |
772b08 |
bool smap_add_once(struct smap *, const char *, const char *);
|
|
Open vSwitch CI |
772b08 |
void smap_add_format(struct smap *, const char *key, const char *, ...)
|
|
Open vSwitch CI |
772b08 |
OVS_PRINTF_FORMAT(3, 4);
|
|
Open vSwitch CI |
772b08 |
-void smap_add_ipv6(struct smap *, const char *, struct in6_addr *);
|
|
Open vSwitch CI |
772b08 |
+void smap_add_ipv6(struct smap *, const char *, const struct in6_addr *);
|
|
Open vSwitch CI |
772b08 |
void smap_replace(struct smap *, const char *, const char *);
|
|
Open vSwitch CI |
772b08 |
void smap_replace_nocopy(struct smap *, const char *, char *);
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c
|
|
Open vSwitch CI |
772b08 |
index 62da9febb..86747e58b 100644
|
|
Open vSwitch CI |
772b08 |
--- a/lib/stream-ssl.c
|
|
Open vSwitch CI |
772b08 |
+++ b/lib/stream-ssl.c
|
|
Open vSwitch CI |
772b08 |
@@ -1075,7 +1075,13 @@ do_ssl_init(void)
|
|
Open vSwitch CI |
772b08 |
VLOG_ERR("SSL_CTX_new: %s", ERR_error_string(ERR_get_error(), NULL));
|
|
Open vSwitch CI |
772b08 |
return ENOPROTOOPT;
|
|
Open vSwitch CI |
772b08 |
}
|
|
Open vSwitch CI |
772b08 |
- SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
+ long options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;
|
|
Open vSwitch CI |
772b08 |
+#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
|
|
Open vSwitch CI |
772b08 |
+ options |= SSL_OP_IGNORE_UNEXPECTED_EOF;
|
|
Open vSwitch CI |
772b08 |
+#endif
|
|
Open vSwitch CI |
772b08 |
+ SSL_CTX_set_options(ctx, options);
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
#if OPENSSL_VERSION_NUMBER < 0x3000000fL
|
|
Open vSwitch CI |
772b08 |
SSL_CTX_set_tmp_dh_callback(ctx, tmp_dh_callback);
|
|
Open vSwitch CI |
772b08 |
#else
|
|
Open vSwitch CI |
a7040a |
diff --git a/lib/tc.c b/lib/tc.c
|
|
Open vSwitch CI |
93dcca |
index 4c07e2216..270dc95ce 100644
|
|
Open vSwitch CI |
a7040a |
--- a/lib/tc.c
|
|
Open vSwitch CI |
a7040a |
+++ b/lib/tc.c
|
|
Open vSwitch CI |
93dcca |
@@ -36,6 +36,7 @@
|
|
Open vSwitch CI |
93dcca |
#include <unistd.h>
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
#include "byte-order.h"
|
|
Open vSwitch CI |
93dcca |
+#include "coverage.h"
|
|
Open vSwitch CI |
93dcca |
#include "netlink-socket.h"
|
|
Open vSwitch CI |
93dcca |
#include "netlink.h"
|
|
Open vSwitch CI |
93dcca |
#include "openvswitch/ofpbuf.h"
|
|
Open vSwitch CI |
93dcca |
@@ -67,6 +68,8 @@
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
VLOG_DEFINE_THIS_MODULE(tc);
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
+COVERAGE_DEFINE(tc_netlink_malformed_reply);
|
|
Open vSwitch CI |
93dcca |
+
|
|
Open vSwitch CI |
93dcca |
static struct vlog_rate_limit error_rl = VLOG_RATE_LIMIT_INIT(60, 5);
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
static enum tc_offload_policy tc_policy = TC_POLICY_NONE;
|
|
Open vSwitch CI |
93dcca |
@@ -2190,18 +2193,19 @@ int
|
|
Open vSwitch CI |
93dcca |
parse_netlink_to_tc_flower(struct ofpbuf *reply, struct tcf_id *id,
|
|
Open vSwitch CI |
93dcca |
struct tc_flower *flower, bool terse)
|
|
Open vSwitch CI |
93dcca |
{
|
|
Open vSwitch CI |
93dcca |
- struct tcmsg *tc;
|
|
Open vSwitch CI |
93dcca |
+ struct ofpbuf b = ofpbuf_const_initializer(reply->data, reply->size);
|
|
Open vSwitch CI |
93dcca |
+ struct nlmsghdr *nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
|
|
Open vSwitch CI |
93dcca |
+ struct tcmsg *tc = ofpbuf_try_pull(&b, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
struct nlattr *ta[ARRAY_SIZE(tca_policy)];
|
|
Open vSwitch CI |
93dcca |
const char *kind;
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- if (NLMSG_HDRLEN + sizeof *tc > reply->size) {
|
|
Open vSwitch CI |
93dcca |
+ if (!nlmsg || !tc) {
|
|
Open vSwitch CI |
93dcca |
+ COVERAGE_INC(tc_netlink_malformed_reply);
|
|
Open vSwitch CI |
93dcca |
return EPROTO;
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
memset(flower, 0, sizeof *flower);
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- tc = ofpbuf_at_assert(reply, NLMSG_HDRLEN, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
-
|
|
Open vSwitch CI |
93dcca |
flower->key.eth_type = (OVS_FORCE ovs_be16) tc_get_minor(tc->tcm_info);
|
|
Open vSwitch CI |
93dcca |
flower->mask.eth_type = OVS_BE16_MAX;
|
|
Open vSwitch CI |
93dcca |
id->prio = tc_get_major(tc->tcm_info);
|
|
Open vSwitch CI |
93dcca |
@@ -2215,8 +2219,7 @@ parse_netlink_to_tc_flower(struct ofpbuf *reply, struct tcf_id *id,
|
|
Open vSwitch CI |
93dcca |
return EAGAIN;
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- if (!nl_policy_parse(reply, NLMSG_HDRLEN + sizeof *tc,
|
|
Open vSwitch CI |
93dcca |
- tca_policy, ta, ARRAY_SIZE(ta))) {
|
|
Open vSwitch CI |
93dcca |
+ if (!nl_policy_parse(&b, 0, tca_policy, ta, ARRAY_SIZE(ta))) {
|
|
Open vSwitch CI |
93dcca |
VLOG_ERR_RL(&error_rl, "failed to parse tca policy");
|
|
Open vSwitch CI |
93dcca |
return EPROTO;
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
@@ -2237,13 +2240,17 @@ parse_netlink_to_tc_flower(struct ofpbuf *reply, struct tcf_id *id,
|
|
Open vSwitch CI |
93dcca |
int
|
|
Open vSwitch CI |
93dcca |
parse_netlink_to_tc_chain(struct ofpbuf *reply, uint32_t *chain)
|
|
Open vSwitch CI |
93dcca |
{
|
|
Open vSwitch CI |
93dcca |
+ struct ofpbuf b = ofpbuf_const_initializer(reply->data, reply->size);
|
|
Open vSwitch CI |
93dcca |
+ struct nlmsghdr *nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
|
|
Open vSwitch CI |
93dcca |
+ struct tcmsg *tc = ofpbuf_try_pull(&b, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
struct nlattr *ta[ARRAY_SIZE(tca_chain_policy)];
|
|
Open vSwitch CI |
93dcca |
- struct tcmsg *tc;
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- tc = ofpbuf_at_assert(reply, NLMSG_HDRLEN, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
+ if (!nlmsg || !tc) {
|
|
Open vSwitch CI |
93dcca |
+ COVERAGE_INC(tc_netlink_malformed_reply);
|
|
Open vSwitch CI |
93dcca |
+ return EPROTO;
|
|
Open vSwitch CI |
93dcca |
+ }
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- if (!nl_policy_parse(reply, NLMSG_HDRLEN + sizeof *tc,
|
|
Open vSwitch CI |
93dcca |
- tca_chain_policy, ta, ARRAY_SIZE(ta))) {
|
|
Open vSwitch CI |
93dcca |
+ if (!nl_policy_parse(&b, 0, tca_chain_policy, ta, ARRAY_SIZE(ta))) {
|
|
Open vSwitch CI |
93dcca |
VLOG_ERR_RL(&error_rl, "failed to parse tca chain policy");
|
|
Open vSwitch CI |
93dcca |
return EINVAL;
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
@@ -2307,21 +2314,27 @@ int
|
|
Open vSwitch CI |
93dcca |
parse_netlink_to_tc_policer(struct ofpbuf *reply, uint32_t police_idx[])
|
|
Open vSwitch CI |
93dcca |
{
|
|
Open vSwitch CI |
93dcca |
static struct nl_policy actions_orders_policy[TCA_ACT_MAX_PRIO] = {};
|
|
Open vSwitch CI |
93dcca |
+ struct ofpbuf b = ofpbuf_const_initializer(reply->data, reply->size);
|
|
Open vSwitch CI |
93dcca |
struct nlattr *actions_orders[ARRAY_SIZE(actions_orders_policy)];
|
|
Open vSwitch CI |
93dcca |
+ struct nlmsghdr *nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
|
|
Open vSwitch CI |
93dcca |
const int max_size = ARRAY_SIZE(actions_orders_policy);
|
|
Open vSwitch CI |
93dcca |
+ struct tcamsg *tca = ofpbuf_try_pull(&b, sizeof *tca);
|
|
Open vSwitch CI |
93dcca |
const struct nlattr *actions;
|
|
Open vSwitch CI |
93dcca |
struct tc_flower flower;
|
|
Open vSwitch CI |
93dcca |
- struct tcamsg *tca;
|
|
Open vSwitch CI |
93dcca |
int i, cnt = 0;
|
|
Open vSwitch CI |
93dcca |
int err;
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
+ if (!nlmsg || !tca) {
|
|
Open vSwitch CI |
93dcca |
+ COVERAGE_INC(tc_netlink_malformed_reply);
|
|
Open vSwitch CI |
93dcca |
+ return EPROTO;
|
|
Open vSwitch CI |
93dcca |
+ }
|
|
Open vSwitch CI |
93dcca |
+
|
|
Open vSwitch CI |
93dcca |
for (i = 0; i < max_size; i++) {
|
|
Open vSwitch CI |
93dcca |
actions_orders_policy[i].type = NL_A_NESTED;
|
|
Open vSwitch CI |
93dcca |
actions_orders_policy[i].optional = true;
|
|
Open vSwitch CI |
93dcca |
}
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
- tca = ofpbuf_at_assert(reply, NLMSG_HDRLEN, sizeof *tca);
|
|
Open vSwitch CI |
93dcca |
- actions = nl_attr_find(reply, NLMSG_HDRLEN + sizeof *tca, TCA_ACT_TAB);
|
|
Open vSwitch CI |
93dcca |
+ actions = nl_attr_find(&b, 0, TCA_ACT_TAB);
|
|
Open vSwitch CI |
93dcca |
if (!actions || !nl_parse_nested(actions, actions_orders_policy,
|
|
Open vSwitch CI |
93dcca |
actions_orders, max_size)) {
|
|
Open vSwitch CI |
93dcca |
VLOG_ERR_RL(&error_rl,
|
|
Open vSwitch CI |
93dcca |
@@ -2354,7 +2367,9 @@ tc_del_filter(struct tcf_id *id, const char *kind)
|
|
Open vSwitch CI |
a7040a |
struct ofpbuf request;
|
|
Open vSwitch CI |
a7040a |
|
|
Open vSwitch CI |
a7040a |
request_from_tcf_id(id, 0, RTM_DELTFILTER, NLM_F_ACK, &request);
|
|
Open vSwitch CI |
a7040a |
- nl_msg_put_string(&request, TCA_KIND, kind);
|
|
Open vSwitch CI |
a7040a |
+ if (kind) {
|
|
Open vSwitch CI |
a7040a |
+ nl_msg_put_string(&request, TCA_KIND, kind);
|
|
Open vSwitch CI |
a7040a |
+ }
|
|
Open vSwitch CI |
a7040a |
return tc_transact(&request, NULL);
|
|
Open vSwitch CI |
a7040a |
}
|
|
Open vSwitch CI |
a7040a |
|
|
Open vSwitch CI |
93dcca |
@@ -3821,8 +3836,15 @@ tc_replace_flower(struct tcf_id *id, struct tc_flower *flower)
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
error = tc_transact(&request, &reply);
|
|
Open vSwitch CI |
93dcca |
if (!error) {
|
|
Open vSwitch CI |
93dcca |
- struct tcmsg *tc =
|
|
Open vSwitch CI |
93dcca |
- ofpbuf_at_assert(reply, NLMSG_HDRLEN, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
+ struct ofpbuf b = ofpbuf_const_initializer(reply->data, reply->size);
|
|
Open vSwitch CI |
93dcca |
+ struct nlmsghdr *nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
|
|
Open vSwitch CI |
93dcca |
+ struct tcmsg *tc = ofpbuf_try_pull(&b, sizeof *tc);
|
|
Open vSwitch CI |
93dcca |
+
|
|
Open vSwitch CI |
93dcca |
+ if (!nlmsg || !tc) {
|
|
Open vSwitch CI |
93dcca |
+ COVERAGE_INC(tc_netlink_malformed_reply);
|
|
Open vSwitch CI |
93dcca |
+ ofpbuf_delete(reply);
|
|
Open vSwitch CI |
93dcca |
+ return EPROTO;
|
|
Open vSwitch CI |
93dcca |
+ }
|
|
Open vSwitch CI |
93dcca |
|
|
Open vSwitch CI |
93dcca |
id->prio = tc_get_major(tc->tcm_info);
|
|
Open vSwitch CI |
93dcca |
id->handle = tc->tcm_handle;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
diff --git a/ofproto/ofproto-dpif-ipfix.c b/ofproto/ofproto-dpif-ipfix.c
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
index 742eed399..f13478a88 100644
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
--- a/ofproto/ofproto-dpif-ipfix.c
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+++ b/ofproto/ofproto-dpif-ipfix.c
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -124,11 +124,18 @@ struct dpif_ipfix_port {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
uint32_t ifindex;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
};
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+struct dpif_ipfix_domain {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ struct hmap_node hmap_node; /* In struct dpif_ipfix_exporter's domains. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ time_t last_template_set_time;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+};
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
struct dpif_ipfix_exporter {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
uint32_t exporter_id; /* Exporting Process identifier */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- struct collectors *collectors;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
uint32_t seq_number;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- time_t last_template_set_time;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ struct collectors *collectors;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ struct hmap domains; /* Contains struct dpif_ipfix_domain indexed by
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ observation domain id. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ time_t last_stats_sent_time;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
struct hmap cache_flow_key_map; /* ipfix_flow_cache_entry. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
struct ovs_list cache_flow_start_timestamp_list; /* ipfix_flow_cache_entry. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
uint32_t cache_active_timeout; /* In seconds. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -617,6 +624,9 @@ static void get_export_time_now(uint64_t *, uint32_t *);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void dpif_ipfix_cache_expire_now(struct dpif_ipfix_exporter *, bool);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+static void dpif_ipfix_exporter_del_domain(struct dpif_ipfix_exporter *,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ struct dpif_ipfix_domain *);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static bool
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
ofproto_ipfix_bridge_exporter_options_equal(
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
const struct ofproto_ipfix_bridge_exporter_options *a,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -697,13 +707,14 @@ dpif_ipfix_exporter_init(struct dpif_ipfix_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->exporter_id = ++exporter_total_count;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->collectors = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->seq_number = 1;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- exporter->last_template_set_time = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ exporter->last_stats_sent_time = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
hmap_init(&exporter->cache_flow_key_map);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
ovs_list_init(&exporter->cache_flow_start_timestamp_list);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->cache_active_timeout = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->cache_max_flows = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->virtual_obs_id = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->virtual_obs_len = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ hmap_init(&exporter->domains);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
memset(&exporter->ipfix_global_stats, 0,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
sizeof(struct dpif_ipfix_global_stats));
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -711,6 +722,7 @@ dpif_ipfix_exporter_init(struct dpif_ipfix_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_exporter_clear(struct dpif_ipfix_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
/* Flush the cache with flow end reason "forced end." */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_cache_expire_now(exporter, true);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -719,22 +731,29 @@ dpif_ipfix_exporter_clear(struct dpif_ipfix_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->exporter_id = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->collectors = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->seq_number = 1;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- exporter->last_template_set_time = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ exporter->last_stats_sent_time = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->cache_active_timeout = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->cache_max_flows = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
free(exporter->virtual_obs_id);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->virtual_obs_id = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
exporter->virtual_obs_len = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ struct dpif_ipfix_domain *dom;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ HMAP_FOR_EACH_SAFE (dom, hmap_node, &exporter->domains) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ dpif_ipfix_exporter_del_domain(exporter, dom);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
memset(&exporter->ipfix_global_stats, 0,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
sizeof(struct dpif_ipfix_global_stats));
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_exporter_destroy(struct dpif_ipfix_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_exporter_clear(exporter);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
hmap_destroy(&exporter->cache_flow_key_map);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ hmap_destroy(&exporter->domains);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static bool
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -742,7 +761,7 @@ dpif_ipfix_exporter_set_options(struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
const struct sset *targets,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
const uint32_t cache_active_timeout,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
const uint32_t cache_max_flows,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- const char *virtual_obs_id)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ const char *virtual_obs_id) OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
size_t virtual_obs_len;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
collectors_destroy(exporter->collectors);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -769,6 +788,37 @@ dpif_ipfix_exporter_set_options(struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
return true;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+static struct dpif_ipfix_domain *
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+dpif_ipfix_exporter_find_domain(const struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ uint32_t domain_id) OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ struct dpif_ipfix_domain *dom;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ HMAP_FOR_EACH_WITH_HASH (dom, hmap_node, hash_int(domain_id, 0),
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ &exporter->domains) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ return dom;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+static struct dpif_ipfix_domain *
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+dpif_ipfix_exporter_insert_domain(struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ const uint32_t domain_id) OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ struct dpif_ipfix_domain *dom = xmalloc(sizeof *dom);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ dom->last_template_set_time = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ hmap_insert(&exporter->domains, &dom->hmap_node, hash_int(domain_id, 0));
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ return dom;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+dpif_ipfix_exporter_del_domain(struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ struct dpif_ipfix_domain *dom)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ hmap_remove(&exporter->domains, &dom->hmap_node);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ free(dom);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static struct dpif_ipfix_port *
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_find_port(const struct dpif_ipfix *di,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
odp_port_t odp_port) OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -909,6 +959,7 @@ dpif_ipfix_bridge_exporter_init(struct dpif_ipfix_bridge_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_bridge_exporter_clear(struct dpif_ipfix_bridge_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_exporter_clear(&exporter->exporter);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
ofproto_ipfix_bridge_exporter_options_destroy(exporter->options);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -918,6 +969,7 @@ dpif_ipfix_bridge_exporter_clear(struct dpif_ipfix_bridge_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_bridge_exporter_destroy(struct dpif_ipfix_bridge_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_bridge_exporter_clear(exporter);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_exporter_destroy(&exporter->exporter);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -927,7 +979,7 @@ static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_bridge_exporter_set_options(
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
struct dpif_ipfix_bridge_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
const struct ofproto_ipfix_bridge_exporter_options *options,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- bool *options_changed)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ bool *options_changed) OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
if (!options || sset_is_empty(&options->targets)) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
/* No point in doing any work if there are no targets. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -1003,6 +1055,7 @@ dpif_ipfix_flow_exporter_init(struct dpif_ipfix_flow_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_flow_exporter_clear(struct dpif_ipfix_flow_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_exporter_clear(&exporter->exporter);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
ofproto_ipfix_flow_exporter_options_destroy(exporter->options);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -1011,6 +1064,7 @@ dpif_ipfix_flow_exporter_clear(struct dpif_ipfix_flow_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_flow_exporter_destroy(struct dpif_ipfix_flow_exporter *exporter)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_flow_exporter_clear(exporter);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_exporter_destroy(&exporter->exporter);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -1020,7 +1074,7 @@ static bool
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_flow_exporter_set_options(
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
struct dpif_ipfix_flow_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
const struct ofproto_ipfix_flow_exporter_options *options,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- bool *options_changed)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ bool *options_changed) OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
if (sset_is_empty(&options->targets)) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
/* No point in doing any work if there are no targets. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -1071,6 +1125,7 @@ dpif_ipfix_flow_exporter_set_options(
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
remove_flow_exporter(struct dpif_ipfix *di,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
struct dpif_ipfix_flow_exporter_map_node *node)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
hmap_remove(&di->flow_exporter_map, &node->node);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_flow_exporter_destroy(&node->exporter);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -2000,6 +2055,7 @@ static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
ipfix_cache_update(struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
struct ipfix_flow_cache_entry *entry,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
enum ipfix_sampled_packet_type sampled_pkt_type)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
struct ipfix_flow_cache_entry *old_entry;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
size_t current_flows = 0;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -2811,14 +2867,36 @@ dpif_ipfix_flow_sample(struct dpif_ipfix *di, const struct dp_packet *packet,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
ovs_mutex_unlock(&mutex);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+static bool
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+dpif_ipfix_should_send_template(struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ const uint32_t observation_domain_id,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ const uint32_t export_time_sec)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ struct dpif_ipfix_domain *domain;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ domain = dpif_ipfix_exporter_find_domain(exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ observation_domain_id);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ if (!domain) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ /* First time we see this obs_domain_id. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ domain = dpif_ipfix_exporter_insert_domain(exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ observation_domain_id);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ if ((domain->last_template_set_time + IPFIX_TEMPLATE_INTERVAL)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ <= export_time_sec) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ domain->last_template_set_time = export_time_sec;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ return true;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ return false;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_cache_expire(struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
bool forced_end, const uint64_t export_time_usec,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- const uint32_t export_time_sec)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ const uint32_t export_time_sec) OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
struct ipfix_flow_cache_entry *entry;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
uint64_t max_flow_start_timestamp_usec;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- bool template_msg_sent = false;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
enum ipfix_flow_end_reason flow_end_reason;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
if (ovs_list_is_empty(&exporter->cache_flow_start_timestamp_list)) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -2844,25 +2922,28 @@ dpif_ipfix_cache_expire(struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
break;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- ovs_list_remove(&entry->cache_flow_start_timestamp_list_node);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- hmap_remove(&exporter->cache_flow_key_map,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- &entry->flow_key_map_node);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ /* XXX: Make frequency of the (Options) Template and Exporter Process
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ * Statistics transmission configurable.
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ * Cf. IETF RFC 5101 Section 4.3. and 10.3.6. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ if ((exporter->last_stats_sent_time + IPFIX_TEMPLATE_INTERVAL)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ <= export_time_sec) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ exporter->last_stats_sent_time = export_time_sec;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ ipfix_send_exporter_data_msg(exporter, export_time_sec);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- /* XXX: Make frequency of the (Options) Template and Exporter Process
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- * Statistics transmission configurable.
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- * Cf. IETF RFC 5101 Section 4.3. and 10.3.6. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- if (!template_msg_sent
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- && (exporter->last_template_set_time + IPFIX_TEMPLATE_INTERVAL)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- <= export_time_sec) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ if (dpif_ipfix_should_send_template(exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ entry->flow_key.obs_domain_id,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ export_time_sec)) {
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ VLOG_DBG("Sending templates for ObservationDomainID %"PRIu32,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ entry->flow_key.obs_domain_id);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
ipfix_send_template_msgs(exporter, export_time_sec,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
entry->flow_key.obs_domain_id);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- exporter->last_template_set_time = export_time_sec;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- template_msg_sent = true;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
-
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- /* Send Exporter Process Statistics. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- ipfix_send_exporter_data_msg(exporter, export_time_sec);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
}
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ ovs_list_remove(&entry->cache_flow_start_timestamp_list_node);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ hmap_remove(&exporter->cache_flow_key_map,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ &entry->flow_key_map_node);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
/* XXX: Group multiple data records for the same obs domain id
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
* into the same message. */
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
ipfix_send_data_msg(exporter, export_time_sec, entry, flow_end_reason);
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
@@ -2883,7 +2964,7 @@ get_export_time_now(uint64_t *export_time_usec, uint32_t *export_time_sec)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
dpif_ipfix_cache_expire_now(struct dpif_ipfix_exporter *exporter,
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
- bool forced_end)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
+ bool forced_end) OVS_REQUIRES(mutex)
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
uint64_t export_time_usec;
|
|
![](https://seccdn.libravatar.org/avatar/b2bae7c59c15a793276441554597530b76ba1a4e46b50cfd2d251410797c0a67?s=16&d=retro) |
ef58f0 |
uint32_t export_time_sec;
|
|
Open vSwitch CI |
aaf0be |
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
|
|
Open vSwitch CI |
77a508 |
index e05ffe312..b44c72969 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/ofproto/ofproto-dpif-upcall.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/ofproto/ofproto-dpif-upcall.c
|
|
Open vSwitch CI |
aaf0be |
@@ -47,17 +47,20 @@
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
#define UPCALL_MAX_BATCH 64
|
|
Open vSwitch CI |
aaf0be |
#define REVALIDATE_MAX_BATCH 50
|
|
Open vSwitch CI |
aaf0be |
+#define UINT64_THREE_QUARTERS (UINT64_MAX / 4 * 3)
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
VLOG_DEFINE_THIS_MODULE(ofproto_dpif_upcall);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
COVERAGE_DEFINE(dumped_duplicate_flow);
|
|
Open vSwitch CI |
aaf0be |
COVERAGE_DEFINE(dumped_new_flow);
|
|
Open vSwitch CI |
aaf0be |
COVERAGE_DEFINE(handler_duplicate_upcall);
|
|
Open vSwitch CI |
aaf0be |
-COVERAGE_DEFINE(upcall_ukey_contention);
|
|
Open vSwitch CI |
aaf0be |
-COVERAGE_DEFINE(upcall_ukey_replace);
|
|
Open vSwitch CI |
aaf0be |
COVERAGE_DEFINE(revalidate_missed_dp_flow);
|
|
Open vSwitch CI |
aaf0be |
+COVERAGE_DEFINE(ukey_dp_change);
|
|
Open vSwitch CI |
aaf0be |
+COVERAGE_DEFINE(ukey_invalid_stat_reset);
|
|
Open vSwitch CI |
aaf0be |
COVERAGE_DEFINE(upcall_flow_limit_hit);
|
|
Open vSwitch CI |
aaf0be |
COVERAGE_DEFINE(upcall_flow_limit_kill);
|
|
Open vSwitch CI |
aaf0be |
+COVERAGE_DEFINE(upcall_ukey_contention);
|
|
Open vSwitch CI |
aaf0be |
+COVERAGE_DEFINE(upcall_ukey_replace);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
/* A thread that reads upcalls from dpif, forwards each upcall's packet,
|
|
Open vSwitch CI |
aaf0be |
* and possibly sets up a kernel flow as a cache. */
|
|
Open vSwitch CI |
aaf0be |
@@ -287,6 +290,7 @@ struct udpif_key {
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
struct ovs_mutex mutex; /* Guards the following. */
|
|
Open vSwitch CI |
aaf0be |
struct dpif_flow_stats stats OVS_GUARDED; /* Last known stats.*/
|
|
Open vSwitch CI |
aaf0be |
+ const char *dp_layer OVS_GUARDED; /* Last known dp_layer. */
|
|
Open vSwitch CI |
aaf0be |
long long int created OVS_GUARDED; /* Estimate of creation time. */
|
|
Open vSwitch CI |
aaf0be |
uint64_t dump_seq OVS_GUARDED; /* Tracks udpif->dump_seq. */
|
|
Open vSwitch CI |
aaf0be |
uint64_t reval_seq OVS_GUARDED; /* Tracks udpif->reval_seq. */
|
|
Open vSwitch CI |
aaf0be |
@@ -780,6 +784,17 @@ udpif_get_n_flows(struct udpif *udpif)
|
|
Open vSwitch CI |
aaf0be |
atomic_store_relaxed(&udpif->n_flows_timestamp, now);
|
|
Open vSwitch CI |
aaf0be |
dpif_get_dp_stats(udpif->dpif, &stats);
|
|
Open vSwitch CI |
aaf0be |
flow_count = stats.n_flows;
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ if (!dpif_synced_dp_layers(udpif->dpif)) {
|
|
Open vSwitch CI |
aaf0be |
+ /* If the dpif layer does not sync the flows, we need to include
|
|
Open vSwitch CI |
aaf0be |
+ * the hardware offloaded flows separately. */
|
|
Open vSwitch CI |
aaf0be |
+ uint64_t hw_flows;
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ if (!dpif_get_n_offloaded_flows(udpif->dpif, &hw_flows)) {
|
|
Open vSwitch CI |
aaf0be |
+ flow_count += hw_flows;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
atomic_store_relaxed(&udpif->n_flows, flow_count);
|
|
Open vSwitch CI |
aaf0be |
ovs_mutex_unlock(&udpif->n_flows_mutex);
|
|
Open vSwitch CI |
aaf0be |
} else {
|
|
Open vSwitch CI |
aaf0be |
@@ -1766,6 +1781,7 @@ ukey_create__(const struct nlattr *key, size_t key_len,
|
|
Open vSwitch CI |
aaf0be |
ukey->created = ukey->flow_time = time_msec();
|
|
Open vSwitch CI |
aaf0be |
memset(&ukey->stats, 0, sizeof ukey->stats);
|
|
Open vSwitch CI |
aaf0be |
ukey->stats.used = used;
|
|
Open vSwitch CI |
aaf0be |
+ ukey->dp_layer = NULL;
|
|
Open vSwitch CI |
aaf0be |
ukey->xcache = NULL;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
ukey->offloaded = false;
|
|
Open vSwitch CI |
aaf0be |
@@ -2095,10 +2111,12 @@ ukey_delete(struct umap *umap, struct udpif_key *ukey)
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
static bool
|
|
Open vSwitch CI |
aaf0be |
-should_revalidate(const struct udpif *udpif, uint64_t packets,
|
|
Open vSwitch CI |
aaf0be |
- long long int used)
|
|
Open vSwitch CI |
aaf0be |
+should_revalidate(const struct udpif *udpif, const struct udpif_key *ukey,
|
|
Open vSwitch CI |
aaf0be |
+ uint64_t packets)
|
|
Open vSwitch CI |
aaf0be |
+ OVS_REQUIRES(ukey->mutex)
|
|
Open vSwitch CI |
aaf0be |
{
|
|
Open vSwitch CI |
aaf0be |
long long int metric, now, duration;
|
|
Open vSwitch CI |
aaf0be |
+ long long int used = ukey->stats.used;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
if (!used) {
|
|
Open vSwitch CI |
aaf0be |
/* Always revalidate the first time a flow is dumped. */
|
|
Open vSwitch CI |
aaf0be |
@@ -2125,8 +2143,12 @@ should_revalidate(const struct udpif *udpif, uint64_t packets,
|
|
Open vSwitch CI |
aaf0be |
duration = now - used;
|
|
Open vSwitch CI |
aaf0be |
metric = duration / packets;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
- if (metric < 1000 / ofproto_min_revalidate_pps) {
|
|
Open vSwitch CI |
aaf0be |
- /* The flow is receiving more than min-revalidate-pps, so keep it. */
|
|
Open vSwitch CI |
aaf0be |
+ if (metric < 1000 / ofproto_min_revalidate_pps ||
|
|
Open vSwitch CI |
aaf0be |
+ (ukey->offloaded && duration < ofproto_offloaded_stats_delay)) {
|
|
Open vSwitch CI |
aaf0be |
+ /* The flow is receiving more than min-revalidate-pps, so keep it.
|
|
Open vSwitch CI |
aaf0be |
+ * Or it's a hardware offloaded flow that might take up to X seconds
|
|
Open vSwitch CI |
aaf0be |
+ * to update its statistics. Until we are sure the statistics had a
|
|
Open vSwitch CI |
aaf0be |
+ * chance to be updated, also keep it. */
|
|
Open vSwitch CI |
aaf0be |
return true;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
return false;
|
|
Open vSwitch CI |
77a508 |
@@ -2302,6 +2324,27 @@ exit:
|
|
Open vSwitch CI |
77a508 |
return result;
|
|
Open vSwitch CI |
77a508 |
}
|
|
Open vSwitch CI |
77a508 |
|
|
Open vSwitch CI |
77a508 |
+static void
|
|
Open vSwitch CI |
77a508 |
+log_unexpected_stats_jump(struct udpif_key *ukey,
|
|
Open vSwitch CI |
77a508 |
+ const struct dpif_flow_stats *stats)
|
|
Open vSwitch CI |
77a508 |
+ OVS_REQUIRES(ukey->mutex)
|
|
Open vSwitch CI |
77a508 |
+{
|
|
Open vSwitch CI |
77a508 |
+ static struct vlog_rate_limit rll = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
Open vSwitch CI |
77a508 |
+ struct ds ds = DS_EMPTY_INITIALIZER;
|
|
Open vSwitch CI |
77a508 |
+ struct ofpbuf *actions;
|
|
Open vSwitch CI |
77a508 |
+
|
|
Open vSwitch CI |
77a508 |
+ odp_format_ufid(&ukey->ufid, &ds);
|
|
Open vSwitch CI |
77a508 |
+ ds_put_cstr(&ds, ", ");
|
|
Open vSwitch CI |
77a508 |
+ odp_flow_key_format(ukey->key, ukey->key_len, &ds);
|
|
Open vSwitch CI |
77a508 |
+ ds_put_cstr(&ds, ", actions:");
|
|
Open vSwitch CI |
77a508 |
+ actions = ovsrcu_get(struct ofpbuf *, &ukey->actions);
|
|
Open vSwitch CI |
77a508 |
+ format_odp_actions(&ds, actions->data, actions->size, NULL);
|
|
Open vSwitch CI |
77a508 |
+ VLOG_WARN_RL(&rll, "Unexpected jump in packet stats from %"PRIu64
|
|
Open vSwitch CI |
77a508 |
+ " to %"PRIu64" when handling ukey %s",
|
|
Open vSwitch CI |
77a508 |
+ ukey->stats.n_packets, stats->n_packets, ds_cstr(&ds);;
|
|
Open vSwitch CI |
77a508 |
+ ds_destroy(&ds);
|
|
Open vSwitch CI |
77a508 |
+}
|
|
Open vSwitch CI |
77a508 |
+
|
|
Open vSwitch CI |
77a508 |
/* Verifies that the datapath actions of 'ukey' are still correct, and pushes
|
|
Open vSwitch CI |
77a508 |
* 'stats' for it.
|
|
Open vSwitch CI |
77a508 |
*
|
|
Open vSwitch CI |
77a508 |
@@ -2324,7 +2367,7 @@ static enum reval_result
|
|
Open vSwitch CI |
aaf0be |
revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey,
|
|
Open vSwitch CI |
aaf0be |
const struct dpif_flow_stats *stats,
|
|
Open vSwitch CI |
aaf0be |
struct ofpbuf *odp_actions, uint64_t reval_seq,
|
|
Open vSwitch CI |
aaf0be |
- struct recirc_refs *recircs, bool offloaded)
|
|
Open vSwitch CI |
aaf0be |
+ struct recirc_refs *recircs)
|
|
Open vSwitch CI |
aaf0be |
OVS_REQUIRES(ukey->mutex)
|
|
Open vSwitch CI |
aaf0be |
{
|
|
Open vSwitch CI |
aaf0be |
bool need_revalidate = ukey->reval_seq != reval_seq;
|
|
Open vSwitch CI |
77a508 |
@@ -2335,15 +2378,19 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey,
|
|
Open vSwitch CI |
77a508 |
|
|
Open vSwitch CI |
77a508 |
push.used = stats->used;
|
|
Open vSwitch CI |
77a508 |
push.tcp_flags = stats->tcp_flags;
|
|
Open vSwitch CI |
77a508 |
- push.n_packets = (stats->n_packets > ukey->stats.n_packets
|
|
Open vSwitch CI |
77a508 |
- ? stats->n_packets - ukey->stats.n_packets
|
|
Open vSwitch CI |
77a508 |
- : 0);
|
|
Open vSwitch CI |
77a508 |
- push.n_bytes = (stats->n_bytes > ukey->stats.n_bytes
|
|
Open vSwitch CI |
77a508 |
- ? stats->n_bytes - ukey->stats.n_bytes
|
|
Open vSwitch CI |
77a508 |
- : 0);
|
|
Open vSwitch CI |
77a508 |
+ push.n_packets = stats->n_packets - ukey->stats.n_packets;
|
|
Open vSwitch CI |
77a508 |
+ push.n_bytes = stats->n_bytes - ukey->stats.n_bytes;
|
|
Open vSwitch CI |
77a508 |
+
|
|
Open vSwitch CI |
aaf0be |
+ if (stats->n_packets < ukey->stats.n_packets &&
|
|
Open vSwitch CI |
aaf0be |
+ ukey->stats.n_packets < UINT64_THREE_QUARTERS) {
|
|
Open vSwitch CI |
aaf0be |
+ /* Report cases where the packet counter is lower than the previous
|
|
Open vSwitch CI |
aaf0be |
+ * instance, but exclude the potential wrapping of an uint64_t. */
|
|
Open vSwitch CI |
aaf0be |
+ COVERAGE_INC(ukey_invalid_stat_reset);
|
|
Open vSwitch CI |
77a508 |
+ log_unexpected_stats_jump(ukey, stats);
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
77a508 |
|
|
Open vSwitch CI |
aaf0be |
if (need_revalidate) {
|
|
Open vSwitch CI |
aaf0be |
- if (should_revalidate(udpif, push.n_packets, ukey->stats.used)) {
|
|
Open vSwitch CI |
aaf0be |
+ if (should_revalidate(udpif, ukey, push.n_packets)) {
|
|
Open vSwitch CI |
aaf0be |
if (!ukey->xcache) {
|
|
Open vSwitch CI |
aaf0be |
ukey->xcache = xlate_cache_new();
|
|
Open vSwitch CI |
aaf0be |
} else {
|
|
Open vSwitch CI |
77a508 |
@@ -2359,7 +2406,7 @@ revalidate_ukey(struct udpif *udpif, struct udpif_key *ukey,
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
/* Stats for deleted flows will be attributed upon flow deletion. Skip. */
|
|
Open vSwitch CI |
aaf0be |
if (result != UKEY_DELETE) {
|
|
Open vSwitch CI |
aaf0be |
- xlate_push_stats(ukey->xcache, &push, offloaded);
|
|
Open vSwitch CI |
aaf0be |
+ xlate_push_stats(ukey->xcache, &push, ukey->offloaded);
|
|
Open vSwitch CI |
aaf0be |
ukey->stats = *stats;
|
|
Open vSwitch CI |
aaf0be |
ukey->reval_seq = reval_seq;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
77a508 |
@@ -2455,6 +2502,15 @@ push_dp_ops(struct udpif *udpif, struct ukey_op *ops, size_t n_ops)
|
|
Open vSwitch CI |
aaf0be |
push->tcp_flags = stats->tcp_flags | op->ukey->stats.tcp_flags;
|
|
Open vSwitch CI |
aaf0be |
push->n_packets = stats->n_packets - op->ukey->stats.n_packets;
|
|
Open vSwitch CI |
aaf0be |
push->n_bytes = stats->n_bytes - op->ukey->stats.n_bytes;
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ if (stats->n_packets < op->ukey->stats.n_packets &&
|
|
Open vSwitch CI |
aaf0be |
+ op->ukey->stats.n_packets < UINT64_THREE_QUARTERS) {
|
|
Open vSwitch CI |
aaf0be |
+ /* Report cases where the packet counter is lower than the
|
|
Open vSwitch CI |
aaf0be |
+ * previous instance, but exclude the potential wrapping of an
|
|
Open vSwitch CI |
aaf0be |
+ * uint64_t. */
|
|
Open vSwitch CI |
aaf0be |
+ COVERAGE_INC(ukey_invalid_stat_reset);
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
ovs_mutex_unlock(&op->ukey->mutex);
|
|
Open vSwitch CI |
aaf0be |
} else {
|
|
Open vSwitch CI |
aaf0be |
push = stats;
|
|
Open vSwitch CI |
77a508 |
@@ -2759,6 +2815,22 @@ revalidate(struct revalidator *revalidator)
|
|
Open vSwitch CI |
aaf0be |
continue;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+ ukey->offloaded = f->attrs.offloaded;
|
|
Open vSwitch CI |
aaf0be |
+ if (!ukey->dp_layer
|
|
Open vSwitch CI |
aaf0be |
+ || (!dpif_synced_dp_layers(udpif->dpif)
|
|
Open vSwitch CI |
aaf0be |
+ && strcmp(ukey->dp_layer, f->attrs.dp_layer))) {
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ if (ukey->dp_layer) {
|
|
Open vSwitch CI |
aaf0be |
+ /* The dp_layer has changed this is probably due to an
|
|
Open vSwitch CI |
aaf0be |
+ * earlier revalidate cycle moving it to/from hw offload.
|
|
Open vSwitch CI |
aaf0be |
+ * In this case we should reset the ukey stored statistics,
|
|
Open vSwitch CI |
aaf0be |
+ * as they are from the deleted DP flow. */
|
|
Open vSwitch CI |
aaf0be |
+ COVERAGE_INC(ukey_dp_change);
|
|
Open vSwitch CI |
aaf0be |
+ memset(&ukey->stats, 0, sizeof ukey->stats);
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
+ ukey->dp_layer = f->attrs.dp_layer;
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
already_dumped = ukey->dump_seq == dump_seq;
|
|
Open vSwitch CI |
aaf0be |
if (already_dumped) {
|
|
Open vSwitch CI |
aaf0be |
/* The flow has already been handled during this flow dump
|
|
Open vSwitch CI |
77a508 |
@@ -2790,8 +2862,7 @@ revalidate(struct revalidator *revalidator)
|
|
Open vSwitch CI |
aaf0be |
result = UKEY_DELETE;
|
|
Open vSwitch CI |
aaf0be |
} else {
|
|
Open vSwitch CI |
aaf0be |
result = revalidate_ukey(udpif, ukey, &stats, &odp_actions,
|
|
Open vSwitch CI |
aaf0be |
- reval_seq, &recircs,
|
|
Open vSwitch CI |
aaf0be |
- f->attrs.offloaded);
|
|
Open vSwitch CI |
aaf0be |
+ reval_seq, &recircs);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
ukey->dump_seq = dump_seq;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
77a508 |
@@ -2876,7 +2947,7 @@ revalidator_sweep__(struct revalidator *revalidator, bool purge)
|
|
Open vSwitch CI |
aaf0be |
COVERAGE_INC(revalidate_missed_dp_flow);
|
|
Open vSwitch CI |
aaf0be |
memcpy(&stats, &ukey->stats, sizeof stats);
|
|
Open vSwitch CI |
aaf0be |
result = revalidate_ukey(udpif, ukey, &stats, &odp_actions,
|
|
Open vSwitch CI |
aaf0be |
- reval_seq, &recircs, false);
|
|
Open vSwitch CI |
aaf0be |
+ reval_seq, &recircs);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
if (result != UKEY_KEEP) {
|
|
Open vSwitch CI |
aaf0be |
/* Clears 'recircs' if filled by revalidate_ukey(). */
|
|
Open vSwitch CI |
aaf0be |
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
|
|
Open vSwitch CI |
fc879c |
index a9cf3cbee..10a5844d8 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/ofproto/ofproto-dpif-xlate.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/ofproto/ofproto-dpif-xlate.c
|
|
Open vSwitch CI |
fc879c |
@@ -66,6 +66,7 @@
|
|
Open vSwitch CI |
fc879c |
#include "tunnel.h"
|
|
Open vSwitch CI |
fc879c |
#include "util.h"
|
|
Open vSwitch CI |
fc879c |
#include "uuid.h"
|
|
Open vSwitch CI |
fc879c |
+#include "vlan-bitmap.h"
|
|
Open vSwitch CI |
fc879c |
|
|
Open vSwitch CI |
fc879c |
COVERAGE_DEFINE(xlate_actions);
|
|
Open vSwitch CI |
fc879c |
COVERAGE_DEFINE(xlate_actions_oversize);
|
|
Open vSwitch CI |
fc879c |
@@ -1028,7 +1029,10 @@ xlate_xbundle_set(struct xbundle *xbundle,
|
|
Open vSwitch CI |
fc879c |
xbundle->qinq_ethtype = qinq_ethtype;
|
|
Open vSwitch CI |
fc879c |
xbundle->vlan = vlan;
|
|
Open vSwitch CI |
fc879c |
xbundle->trunks = trunks;
|
|
Open vSwitch CI |
fc879c |
- xbundle->cvlans = cvlans;
|
|
Open vSwitch CI |
fc879c |
+ if (!vlan_bitmap_equal(xbundle->cvlans, cvlans)) {
|
|
Open vSwitch CI |
fc879c |
+ free(xbundle->cvlans);
|
|
Open vSwitch CI |
fc879c |
+ xbundle->cvlans = vlan_bitmap_clone(cvlans);
|
|
Open vSwitch CI |
fc879c |
+ }
|
|
Open vSwitch CI |
fc879c |
xbundle->use_priority_tags = use_priority_tags;
|
|
Open vSwitch CI |
fc879c |
xbundle->floodable = floodable;
|
|
Open vSwitch CI |
fc879c |
xbundle->protected = protected;
|
|
Open vSwitch CI |
fc879c |
@@ -1380,6 +1384,7 @@ xlate_xbundle_remove(struct xlate_cfg *xcfg, struct xbundle *xbundle)
|
|
Open vSwitch CI |
fc879c |
ovs_list_remove(&xbundle->list_node);
|
|
Open vSwitch CI |
fc879c |
bond_unref(xbundle->bond);
|
|
Open vSwitch CI |
fc879c |
lacp_unref(xbundle->lacp);
|
|
Open vSwitch CI |
fc879c |
+ free(xbundle->cvlans);
|
|
Open vSwitch CI |
fc879c |
free(xbundle->name);
|
|
Open vSwitch CI |
fc879c |
free(xbundle);
|
|
Open vSwitch CI |
fc879c |
}
|
|
Open vSwitch CI |
fc879c |
@@ -5211,6 +5216,7 @@ compose_dec_ttl(struct xlate_ctx *ctx, struct ofpact_cnt_ids *ids)
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
ctx->wc->masks.nw_ttl = 0xff;
|
|
Open vSwitch CI |
aaf0be |
+ WC_MASK_FIELD(ctx->wc, nw_proto);
|
|
Open vSwitch CI |
aaf0be |
if (flow->nw_ttl > 1) {
|
|
Open vSwitch CI |
aaf0be |
flow->nw_ttl--;
|
|
Open vSwitch CI |
aaf0be |
return false;
|
|
Open vSwitch CI |
fc879c |
@@ -7128,6 +7134,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
|
|
Open vSwitch CI |
aaf0be |
case OFPACT_SET_IPV4_SRC:
|
|
Open vSwitch CI |
aaf0be |
if (flow->dl_type == htons(ETH_TYPE_IP)) {
|
|
Open vSwitch CI |
aaf0be |
memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src);
|
|
Open vSwitch CI |
aaf0be |
+ WC_MASK_FIELD(wc, nw_proto);
|
|
Open vSwitch CI |
aaf0be |
flow->nw_src = ofpact_get_SET_IPV4_SRC(a)->ipv4;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
break;
|
|
Open vSwitch CI |
fc879c |
@@ -7135,12 +7142,14 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
|
|
Open vSwitch CI |
aaf0be |
case OFPACT_SET_IPV4_DST:
|
|
Open vSwitch CI |
aaf0be |
if (flow->dl_type == htons(ETH_TYPE_IP)) {
|
|
Open vSwitch CI |
aaf0be |
memset(&wc->masks.nw_dst, 0xff, sizeof wc->masks.nw_dst);
|
|
Open vSwitch CI |
aaf0be |
+ WC_MASK_FIELD(wc, nw_proto);
|
|
Open vSwitch CI |
aaf0be |
flow->nw_dst = ofpact_get_SET_IPV4_DST(a)->ipv4;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
break;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
case OFPACT_SET_IP_DSCP:
|
|
Open vSwitch CI |
aaf0be |
if (is_ip_any(flow)) {
|
|
Open vSwitch CI |
aaf0be |
+ WC_MASK_FIELD(wc, nw_proto);
|
|
Open vSwitch CI |
aaf0be |
wc->masks.nw_tos |= IP_DSCP_MASK;
|
|
Open vSwitch CI |
aaf0be |
flow->nw_tos &= ~IP_DSCP_MASK;
|
|
Open vSwitch CI |
aaf0be |
flow->nw_tos |= ofpact_get_SET_IP_DSCP(a)->dscp;
|
|
Open vSwitch CI |
fc879c |
@@ -7149,6 +7158,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
case OFPACT_SET_IP_ECN:
|
|
Open vSwitch CI |
aaf0be |
if (is_ip_any(flow)) {
|
|
Open vSwitch CI |
aaf0be |
+ WC_MASK_FIELD(wc, nw_proto);
|
|
Open vSwitch CI |
aaf0be |
wc->masks.nw_tos |= IP_ECN_MASK;
|
|
Open vSwitch CI |
aaf0be |
flow->nw_tos &= ~IP_ECN_MASK;
|
|
Open vSwitch CI |
aaf0be |
flow->nw_tos |= ofpact_get_SET_IP_ECN(a)->ecn;
|
|
Open vSwitch CI |
fc879c |
@@ -7157,6 +7167,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
case OFPACT_SET_IP_TTL:
|
|
Open vSwitch CI |
aaf0be |
if (is_ip_any(flow)) {
|
|
Open vSwitch CI |
aaf0be |
+ WC_MASK_FIELD(wc, nw_proto);
|
|
Open vSwitch CI |
aaf0be |
wc->masks.nw_ttl = 0xff;
|
|
Open vSwitch CI |
aaf0be |
flow->nw_ttl = ofpact_get_SET_IP_TTL(a)->ttl;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
fc879c |
@@ -7224,6 +7235,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
/* Set the field only if the packet actually has it. */
|
|
Open vSwitch CI |
aaf0be |
if (mf_are_prereqs_ok(mf, flow, wc)) {
|
|
Open vSwitch CI |
aaf0be |
+ mf_set_mask_l3_prereqs(mf, flow, wc);
|
|
Open vSwitch CI |
aaf0be |
mf_mask_field_masked(mf, ofpact_set_field_mask(set_field), wc);
|
|
Open vSwitch CI |
aaf0be |
mf_set_flow_value_masked(mf, set_field->value,
|
|
Open vSwitch CI |
aaf0be |
ofpact_set_field_mask(set_field),
|
|
Open vSwitch CI |
fc879c |
@@ -7280,6 +7292,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
case OFPACT_DEC_TTL:
|
|
Open vSwitch CI |
aaf0be |
wc->masks.nw_ttl = 0xff;
|
|
Open vSwitch CI |
aaf0be |
+ WC_MASK_FIELD(wc, nw_proto);
|
|
Open vSwitch CI |
aaf0be |
if (compose_dec_ttl(ctx, ofpact_get_DEC_TTL(a))) {
|
|
Open vSwitch CI |
aaf0be |
return;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
|
|
Open vSwitch CI |
aaf0be |
index f87e27a8c..fad7342b0 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/ofproto/ofproto-dpif.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/ofproto/ofproto-dpif.c
|
|
Open vSwitch CI |
aaf0be |
@@ -714,12 +714,6 @@ close_dpif_backer(struct dpif_backer *backer, bool del)
|
|
Open vSwitch CI |
aaf0be |
free(backer);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
-/* Datapath port slated for removal from datapath. */
|
|
Open vSwitch CI |
aaf0be |
-struct odp_garbage {
|
|
Open vSwitch CI |
aaf0be |
- struct ovs_list list_node;
|
|
Open vSwitch CI |
aaf0be |
- odp_port_t odp_port;
|
|
Open vSwitch CI |
aaf0be |
-};
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
static void check_support(struct dpif_backer *backer);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
static int
|
|
Open vSwitch CI |
aaf0be |
@@ -729,8 +723,6 @@ open_dpif_backer(const char *type, struct dpif_backer **backerp)
|
|
Open vSwitch CI |
aaf0be |
struct dpif_port_dump port_dump;
|
|
Open vSwitch CI |
aaf0be |
struct dpif_port port;
|
|
Open vSwitch CI |
aaf0be |
struct shash_node *node;
|
|
Open vSwitch CI |
aaf0be |
- struct ovs_list garbage_list;
|
|
Open vSwitch CI |
aaf0be |
- struct odp_garbage *garbage;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
struct sset names;
|
|
Open vSwitch CI |
aaf0be |
char *backer_name;
|
|
Open vSwitch CI |
aaf0be |
@@ -792,25 +784,23 @@ open_dpif_backer(const char *type, struct dpif_backer **backerp)
|
|
Open vSwitch CI |
aaf0be |
dpif_flow_flush(backer->dpif);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
- /* Loop through the ports already on the datapath and remove any
|
|
Open vSwitch CI |
aaf0be |
- * that we don't need anymore. */
|
|
Open vSwitch CI |
aaf0be |
- ovs_list_init(&garbage_list);
|
|
Open vSwitch CI |
aaf0be |
+ /* Loop through the ports already on the datapath and find ones that are
|
|
Open vSwitch CI |
aaf0be |
+ * not on the initial OpenFlow ports list. These are stale ports, that we
|
|
Open vSwitch CI |
aaf0be |
+ * do not need anymore, or tunnel backing interfaces, that do not generally
|
|
Open vSwitch CI |
aaf0be |
+ * match the name of OpenFlow tunnel ports, or both. Add all of them to
|
|
Open vSwitch CI |
aaf0be |
+ * the list of tunnel backers. type_run() will garbage collect those that
|
|
Open vSwitch CI |
aaf0be |
+ * are not active tunnel backing interfaces during revalidation. */
|
|
Open vSwitch CI |
aaf0be |
dpif_port_dump_start(&port_dump, backer->dpif);
|
|
Open vSwitch CI |
aaf0be |
while (dpif_port_dump_next(&port_dump, &port)) {
|
|
Open vSwitch CI |
aaf0be |
node = shash_find(&init_ofp_ports, port.name);
|
|
Open vSwitch CI |
aaf0be |
if (!node && strcmp(port.name, dpif_base_name(backer->dpif))) {
|
|
Open vSwitch CI |
aaf0be |
- garbage = xmalloc(sizeof *garbage);
|
|
Open vSwitch CI |
aaf0be |
- garbage->odp_port = port.port_no;
|
|
Open vSwitch CI |
aaf0be |
- ovs_list_push_front(&garbage_list, &garbage->list_node);
|
|
Open vSwitch CI |
aaf0be |
+ simap_put(&backer->tnl_backers, port.name,
|
|
Open vSwitch CI |
aaf0be |
+ odp_to_u32(port.port_no));
|
|
Open vSwitch CI |
aaf0be |
+ backer->need_revalidate = REV_RECONFIGURE;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
dpif_port_dump_done(&port_dump);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
- LIST_FOR_EACH_POP (garbage, list_node, &garbage_list) {
|
|
Open vSwitch CI |
aaf0be |
- dpif_port_del(backer->dpif, garbage->odp_port, false);
|
|
Open vSwitch CI |
aaf0be |
- free(garbage);
|
|
Open vSwitch CI |
aaf0be |
- }
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
shash_add(&all_dpif_backers, type, backer);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
check_support(backer);
|
|
Open vSwitch CI |
aaf0be |
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
|
|
Open vSwitch CI |
aaf0be |
index a84ddc1d0..143ded690 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/ofproto/ofproto-provider.h
|
|
Open vSwitch CI |
aaf0be |
+++ b/ofproto/ofproto-provider.h
|
|
Open vSwitch CI |
aaf0be |
@@ -541,6 +541,11 @@ extern unsigned ofproto_max_revalidator;
|
|
Open vSwitch CI |
aaf0be |
* duration exceeds half of max-revalidator config variable. */
|
|
Open vSwitch CI |
aaf0be |
extern unsigned ofproto_min_revalidate_pps;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+/* Worst case delay (in ms) it might take before statistics of offloaded flows
|
|
Open vSwitch CI |
aaf0be |
+ * are updated. Offloaded flows younger than this delay will always be
|
|
Open vSwitch CI |
aaf0be |
+ * revalidated regardless of ofproto_min_revalidate_pps. */
|
|
Open vSwitch CI |
aaf0be |
+extern unsigned ofproto_offloaded_stats_delay;
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
/* Number of upcall handler and revalidator threads. Only affects the
|
|
Open vSwitch CI |
aaf0be |
* ofproto-dpif implementation. */
|
|
Open vSwitch CI |
aaf0be |
extern uint32_t n_handlers, n_revalidators;
|
|
Open vSwitch CI |
aaf0be |
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
|
|
Open vSwitch CI |
aaf0be |
index 17f636ed9..5fc1a7409 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/ofproto/ofproto.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/ofproto/ofproto.c
|
|
Open vSwitch CI |
aaf0be |
@@ -311,6 +311,7 @@ unsigned ofproto_flow_limit = OFPROTO_FLOW_LIMIT_DEFAULT;
|
|
Open vSwitch CI |
aaf0be |
unsigned ofproto_max_idle = OFPROTO_MAX_IDLE_DEFAULT;
|
|
Open vSwitch CI |
aaf0be |
unsigned ofproto_max_revalidator = OFPROTO_MAX_REVALIDATOR_DEFAULT;
|
|
Open vSwitch CI |
aaf0be |
unsigned ofproto_min_revalidate_pps = OFPROTO_MIN_REVALIDATE_PPS_DEFAULT;
|
|
Open vSwitch CI |
aaf0be |
+unsigned ofproto_offloaded_stats_delay = OFPROTO_OFFLOADED_STATS_DELAY;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
uint32_t n_handlers, n_revalidators;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
@@ -727,6 +728,15 @@ ofproto_set_min_revalidate_pps(unsigned min_revalidate_pps)
|
|
Open vSwitch CI |
aaf0be |
ofproto_min_revalidate_pps = min_revalidate_pps ? min_revalidate_pps : 1;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+/* Set worst case delay (in ms) it might take before statistics of offloaded
|
|
Open vSwitch CI |
aaf0be |
+ * flows are updated. Offloaded flows younger than this delay will always be
|
|
Open vSwitch CI |
aaf0be |
+ * revalidated regardless of ofproto_min_revalidate_pps. */
|
|
Open vSwitch CI |
aaf0be |
+void
|
|
Open vSwitch CI |
aaf0be |
+ofproto_set_offloaded_stats_delay(unsigned offloaded_stats_delay)
|
|
Open vSwitch CI |
aaf0be |
+{
|
|
Open vSwitch CI |
aaf0be |
+ ofproto_offloaded_stats_delay = offloaded_stats_delay;
|
|
Open vSwitch CI |
aaf0be |
+}
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
/* If forward_bpdu is true, the NORMAL action will forward frames with
|
|
Open vSwitch CI |
aaf0be |
* reserved (e.g. STP) destination Ethernet addresses. if forward_bpdu is false,
|
|
Open vSwitch CI |
aaf0be |
* the NORMAL action will drop these frames. */
|
|
Open vSwitch CI |
aaf0be |
diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h
|
|
Open vSwitch CI |
aaf0be |
index 4e15167ab..fa7973ac7 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/ofproto/ofproto.h
|
|
Open vSwitch CI |
aaf0be |
+++ b/ofproto/ofproto.h
|
|
Open vSwitch CI |
aaf0be |
@@ -311,6 +311,7 @@ int ofproto_port_dump_done(struct ofproto_port_dump *);
|
|
Open vSwitch CI |
aaf0be |
#define OFPROTO_MAX_IDLE_DEFAULT 10000 /* ms */
|
|
Open vSwitch CI |
aaf0be |
#define OFPROTO_MAX_REVALIDATOR_DEFAULT 500 /* ms */
|
|
Open vSwitch CI |
aaf0be |
#define OFPROTO_MIN_REVALIDATE_PPS_DEFAULT 5
|
|
Open vSwitch CI |
aaf0be |
+#define OFPROTO_OFFLOADED_STATS_DELAY 2000 /* ms */
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
const char *ofproto_port_open_type(const struct ofproto *,
|
|
Open vSwitch CI |
aaf0be |
const char *port_type);
|
|
Open vSwitch CI |
aaf0be |
@@ -340,6 +341,7 @@ void ofproto_set_flow_limit(unsigned limit);
|
|
Open vSwitch CI |
aaf0be |
void ofproto_set_max_idle(unsigned max_idle);
|
|
Open vSwitch CI |
aaf0be |
void ofproto_set_max_revalidator(unsigned max_revalidator);
|
|
Open vSwitch CI |
aaf0be |
void ofproto_set_min_revalidate_pps(unsigned min_revalidate_pps);
|
|
Open vSwitch CI |
aaf0be |
+void ofproto_set_offloaded_stats_delay(unsigned offloaded_stats_delay);
|
|
Open vSwitch CI |
aaf0be |
void ofproto_set_forward_bpdu(struct ofproto *, bool forward_bpdu);
|
|
Open vSwitch CI |
aaf0be |
void ofproto_set_mac_table_config(struct ofproto *, unsigned idle_time,
|
|
Open vSwitch CI |
aaf0be |
size_t max_entries);
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/log.c b/ovsdb/log.c
|
|
Open vSwitch CI |
db9a9b |
index e42f00246..fff7c6ba1 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/log.c
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/log.c
|
|
Open vSwitch CI |
db9a9b |
@@ -552,6 +552,23 @@ ovsdb_log_truncate(struct ovsdb_log *file)
|
|
Open vSwitch CI |
db9a9b |
return error;
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
+/* Removes all the data from the log by moving current offset to zero and
|
|
Open vSwitch CI |
db9a9b |
+ * truncating the file to zero bytes. After this operation the file is empty
|
|
Open vSwitch CI |
db9a9b |
+ * and in a write state. */
|
|
Open vSwitch CI |
db9a9b |
+struct ovsdb_error * OVS_WARN_UNUSED_RESULT
|
|
Open vSwitch CI |
db9a9b |
+ovsdb_log_reset(struct ovsdb_log *file)
|
|
Open vSwitch CI |
db9a9b |
+{
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_error_destroy(file->error);
|
|
Open vSwitch CI |
db9a9b |
+ file->offset = file->prev_offset = 0;
|
|
Open vSwitch CI |
db9a9b |
+ file->error = ovsdb_log_truncate(file);
|
|
Open vSwitch CI |
db9a9b |
+ if (file->error) {
|
|
Open vSwitch CI |
db9a9b |
+ file->state = OVSDB_LOG_WRITE_ERROR;
|
|
Open vSwitch CI |
db9a9b |
+ return ovsdb_error_clone(file->error);
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
+ file->state = OVSDB_LOG_WRITE;
|
|
Open vSwitch CI |
db9a9b |
+ return NULL;
|
|
Open vSwitch CI |
db9a9b |
+}
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
/* Composes a log record for 'json' by filling 'header' with a header line and
|
|
Open vSwitch CI |
db9a9b |
* 'data' with a data line (each ending with a new-line). To write the record
|
|
Open vSwitch CI |
db9a9b |
* to a file, write 'header' followed by 'data'.
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/log.h b/ovsdb/log.h
|
|
Open vSwitch CI |
db9a9b |
index 90714ea13..63e5681a0 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/log.h
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/log.h
|
|
Open vSwitch CI |
db9a9b |
@@ -66,6 +66,9 @@ struct ovsdb_error *ovsdb_log_read(struct ovsdb_log *, struct json **)
|
|
Open vSwitch CI |
db9a9b |
OVS_WARN_UNUSED_RESULT;
|
|
Open vSwitch CI |
db9a9b |
void ovsdb_log_unread(struct ovsdb_log *);
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
+struct ovsdb_error *ovsdb_log_reset(struct ovsdb_log *)
|
|
Open vSwitch CI |
db9a9b |
+ OVS_WARN_UNUSED_RESULT;
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
void ovsdb_log_compose_record(const struct json *, const char *magic,
|
|
Open vSwitch CI |
db9a9b |
struct ds *header, struct ds *data);
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
7eac84 |
diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
|
|
Open vSwitch CI |
7eac84 |
index 191befcae..bf5d083cc 100644
|
|
Open vSwitch CI |
7eac84 |
--- a/ovsdb/monitor.c
|
|
Open vSwitch CI |
7eac84 |
+++ b/ovsdb/monitor.c
|
|
Open vSwitch CI |
7eac84 |
@@ -474,6 +474,7 @@ ovsdb_monitor_add_column(struct ovsdb_monitor *dbmon,
|
|
Open vSwitch CI |
7eac84 |
enum ovsdb_monitor_selection select,
|
|
Open vSwitch CI |
7eac84 |
bool monitored)
|
|
Open vSwitch CI |
7eac84 |
{
|
|
Open vSwitch CI |
7eac84 |
+ struct ovsdb_monitor_change_set *mcs;
|
|
Open vSwitch CI |
7eac84 |
struct ovsdb_monitor_table *mt;
|
|
Open vSwitch CI |
7eac84 |
struct ovsdb_monitor_column *c;
|
|
Open vSwitch CI |
7eac84 |
|
|
Open vSwitch CI |
7eac84 |
@@ -484,6 +485,18 @@ ovsdb_monitor_add_column(struct ovsdb_monitor *dbmon,
|
|
Open vSwitch CI |
7eac84 |
return column->name;
|
|
Open vSwitch CI |
7eac84 |
}
|
|
Open vSwitch CI |
7eac84 |
|
|
Open vSwitch CI |
7eac84 |
+ mcs = dbmon->init_change_set;
|
|
Open vSwitch CI |
7eac84 |
+ if (mcs) {
|
|
Open vSwitch CI |
7eac84 |
+ /* A new column is going to be added to the monitor. Existing
|
|
Open vSwitch CI |
7eac84 |
+ * initial change set doesn't have it, so can no longer be used.
|
|
Open vSwitch CI |
7eac84 |
+ * Initial change set is never used by more than one session at
|
|
Open vSwitch CI |
7eac84 |
+ * the same time, so it's safe to destroy it here. */
|
|
Open vSwitch CI |
7eac84 |
+ ovs_assert(mcs->n_refs == 1);
|
|
Open vSwitch CI |
7eac84 |
+ ovsdb_monitor_json_cache_destroy(dbmon, mcs);
|
|
Open vSwitch CI |
7eac84 |
+ ovsdb_monitor_change_set_destroy(mcs);
|
|
Open vSwitch CI |
7eac84 |
+ dbmon->init_change_set = NULL;
|
|
Open vSwitch CI |
7eac84 |
+ }
|
|
Open vSwitch CI |
7eac84 |
+
|
|
Open vSwitch CI |
7eac84 |
if (mt->n_columns >= mt->allocated_columns) {
|
|
Open vSwitch CI |
7eac84 |
mt->columns = x2nrealloc(mt->columns, &mt->allocated_columns,
|
|
Open vSwitch CI |
7eac84 |
sizeof *mt->columns);
|
|
Open vSwitch CI |
7eac84 |
@@ -609,7 +622,10 @@ ovsdb_monitor_untrack_change_set(struct ovsdb_monitor *dbmon,
|
|
Open vSwitch CI |
7eac84 |
ovs_assert(mcs);
|
|
Open vSwitch CI |
7eac84 |
if (--mcs->n_refs == 0) {
|
|
Open vSwitch CI |
7eac84 |
if (mcs == dbmon->init_change_set) {
|
|
Open vSwitch CI |
7eac84 |
- dbmon->init_change_set = NULL;
|
|
Open vSwitch CI |
7eac84 |
+ /* The initial change set should exist as long as the
|
|
Open vSwitch CI |
7eac84 |
+ * monitor doesn't change. */
|
|
Open vSwitch CI |
7eac84 |
+ mcs->n_refs++;
|
|
Open vSwitch CI |
7eac84 |
+ return;
|
|
Open vSwitch CI |
7eac84 |
} else if (mcs == dbmon->new_change_set) {
|
|
Open vSwitch CI |
7eac84 |
dbmon->new_change_set = NULL;
|
|
Open vSwitch CI |
7eac84 |
}
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
|
|
Open vSwitch CI |
db9a9b |
index 33ca4910d..cb4671d51 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/ovsdb-server.c
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/ovsdb-server.c
|
|
Open vSwitch CI |
db9a9b |
@@ -573,8 +573,9 @@ close_db(struct server_config *config, struct db *db, char *comment)
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
-static void
|
|
Open vSwitch CI |
db9a9b |
-update_schema(struct ovsdb *db, const struct ovsdb_schema *schema, void *aux)
|
|
Open vSwitch CI |
db9a9b |
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
|
|
Open vSwitch CI |
db9a9b |
+update_schema(struct ovsdb *db, const struct ovsdb_schema *schema,
|
|
Open vSwitch CI |
db9a9b |
+ bool conversion_with_no_data, void *aux)
|
|
Open vSwitch CI |
db9a9b |
{
|
|
Open vSwitch CI |
db9a9b |
struct server_config *config = aux;
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
@@ -586,13 +587,27 @@ update_schema(struct ovsdb *db, const struct ovsdb_schema *schema, void *aux)
|
|
Open vSwitch CI |
db9a9b |
: xasprintf("database %s connected to storage", db->name)));
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
- ovsdb_replace(db, ovsdb_create(ovsdb_schema_clone(schema), NULL));
|
|
Open vSwitch CI |
db9a9b |
+ if (db->schema && conversion_with_no_data) {
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb *new_db = NULL;
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb_error *error;
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ error = ovsdb_convert(db, schema, &new_db);
|
|
Open vSwitch CI |
db9a9b |
+ if (error) {
|
|
Open vSwitch CI |
db9a9b |
+ /* Should never happen, because conversion should have been
|
|
Open vSwitch CI |
db9a9b |
+ * checked before writing the schema to the storage. */
|
|
Open vSwitch CI |
db9a9b |
+ return error;
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_replace(db, new_db);
|
|
Open vSwitch CI |
db9a9b |
+ } else {
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_replace(db, ovsdb_create(ovsdb_schema_clone(schema), NULL));
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
/* Force update to schema in _Server database. */
|
|
Open vSwitch CI |
db9a9b |
struct db *dbp = shash_find_data(config->all_dbs, db->name);
|
|
Open vSwitch CI |
db9a9b |
if (dbp) {
|
|
Open vSwitch CI |
db9a9b |
dbp->row_uuid = UUID_ZERO;
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
+ return NULL;
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
|
|
Open vSwitch CI |
db9a9b |
@@ -600,23 +615,30 @@ parse_txn(struct server_config *config, struct db *db,
|
|
Open vSwitch CI |
db9a9b |
const struct ovsdb_schema *schema, const struct json *txn_json,
|
|
Open vSwitch CI |
db9a9b |
const struct uuid *txnid)
|
|
Open vSwitch CI |
db9a9b |
{
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb_error *error = NULL;
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb_txn *txn = NULL;
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
if (schema) {
|
|
Open vSwitch CI |
db9a9b |
- /* We're replacing the schema (and the data). Destroy the database
|
|
Open vSwitch CI |
db9a9b |
- * (first grabbing its storage), then replace it with the new schema.
|
|
Open vSwitch CI |
db9a9b |
- * The transaction must also include the replacement data.
|
|
Open vSwitch CI |
db9a9b |
+ /* We're replacing the schema (and the data). If transaction includes
|
|
Open vSwitch CI |
db9a9b |
+ * replacement data, destroy the database (first grabbing its storage),
|
|
Open vSwitch CI |
db9a9b |
+ * then replace it with the new schema. If not, it's a conversion
|
|
Open vSwitch CI |
db9a9b |
+ * without data specified. In this case, convert the current database
|
|
Open vSwitch CI |
db9a9b |
+ * to a new schema instead.
|
|
Open vSwitch CI |
db9a9b |
*
|
|
Open vSwitch CI |
db9a9b |
* Only clustered database schema changes and snapshot installs
|
|
Open vSwitch CI |
db9a9b |
* go through this path.
|
|
Open vSwitch CI |
db9a9b |
*/
|
|
Open vSwitch CI |
db9a9b |
- ovs_assert(txn_json);
|
|
Open vSwitch CI |
db9a9b |
ovs_assert(ovsdb_storage_is_clustered(db->db->storage));
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
- struct ovsdb_error *error = ovsdb_schema_check_for_ephemeral_columns(
|
|
Open vSwitch CI |
db9a9b |
- schema);
|
|
Open vSwitch CI |
db9a9b |
+ error = ovsdb_schema_check_for_ephemeral_columns(schema);
|
|
Open vSwitch CI |
db9a9b |
+ if (error) {
|
|
Open vSwitch CI |
db9a9b |
+ return error;
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ error = update_schema(db->db, schema, txn_json == NULL, config);
|
|
Open vSwitch CI |
db9a9b |
if (error) {
|
|
Open vSwitch CI |
db9a9b |
return error;
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
- update_schema(db->db, schema, config);
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
if (txn_json) {
|
|
Open vSwitch CI |
db9a9b |
@@ -624,24 +646,25 @@ parse_txn(struct server_config *config, struct db *db,
|
|
Open vSwitch CI |
db9a9b |
return ovsdb_error(NULL, "%s: data without schema", db->filename);
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
- struct ovsdb_txn *txn;
|
|
Open vSwitch CI |
db9a9b |
- struct ovsdb_error *error;
|
|
Open vSwitch CI |
db9a9b |
-
|
|
Open vSwitch CI |
db9a9b |
error = ovsdb_file_txn_from_json(db->db, txn_json, false, &txn);
|
|
Open vSwitch CI |
db9a9b |
- if (!error) {
|
|
Open vSwitch CI |
db9a9b |
- ovsdb_txn_set_txnid(txnid, txn);
|
|
Open vSwitch CI |
db9a9b |
- log_and_free_error(ovsdb_txn_replay_commit(txn));
|
|
Open vSwitch CI |
db9a9b |
- }
|
|
Open vSwitch CI |
db9a9b |
- if (!error && !uuid_is_zero(txnid)) {
|
|
Open vSwitch CI |
db9a9b |
- db->db->prereq = *txnid;
|
|
Open vSwitch CI |
db9a9b |
- }
|
|
Open vSwitch CI |
db9a9b |
if (error) {
|
|
Open vSwitch CI |
db9a9b |
ovsdb_storage_unread(db->db->storage);
|
|
Open vSwitch CI |
db9a9b |
return error;
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
+ } else if (schema) {
|
|
Open vSwitch CI |
db9a9b |
+ /* We just performed conversion without data. Transaction history
|
|
Open vSwitch CI |
db9a9b |
+ * was destroyed. Commit a dummy transaction to set the txnid. */
|
|
Open vSwitch CI |
db9a9b |
+ txn = ovsdb_txn_create(db->db);
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
- return NULL;
|
|
Open vSwitch CI |
db9a9b |
+ if (txn) {
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_txn_set_txnid(txnid, txn);
|
|
Open vSwitch CI |
db9a9b |
+ error = ovsdb_txn_replay_commit(txn);
|
|
Open vSwitch CI |
db9a9b |
+ if (!error && !uuid_is_zero(txnid)) {
|
|
Open vSwitch CI |
db9a9b |
+ db->db->prereq = *txnid;
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
+ return error;
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
static void
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c
|
|
Open vSwitch CI |
db9a9b |
index 60f353197..e26536532 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/ovsdb-tool.c
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/ovsdb-tool.c
|
|
Open vSwitch CI |
db9a9b |
@@ -1006,7 +1006,8 @@ raft_header_to_standalone_log(const struct raft_header *h,
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
static void
|
|
Open vSwitch CI |
db9a9b |
-raft_record_to_standalone_log(const struct raft_record *r,
|
|
Open vSwitch CI |
db9a9b |
+raft_record_to_standalone_log(const char *db_file_name,
|
|
Open vSwitch CI |
db9a9b |
+ const struct raft_record *r,
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_log *db_log_data)
|
|
Open vSwitch CI |
db9a9b |
{
|
|
Open vSwitch CI |
db9a9b |
if (r->type == RAFT_REC_ENTRY) {
|
|
Open vSwitch CI |
db9a9b |
@@ -1018,7 +1019,40 @@ raft_record_to_standalone_log(const struct raft_record *r,
|
|
Open vSwitch CI |
db9a9b |
if (pa->n != 2) {
|
|
Open vSwitch CI |
db9a9b |
ovs_fatal(0, "Incorrect raft record array length");
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ struct json *schema_json = pa->elems[0];
|
|
Open vSwitch CI |
db9a9b |
struct json *data_json = pa->elems[1];
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ if (schema_json->type != JSON_NULL) {
|
|
Open vSwitch CI |
db9a9b |
+ /* This is a database conversion record. Reset the log and
|
|
Open vSwitch CI |
db9a9b |
+ * write the new schema. */
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb_schema *schema;
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ check_ovsdb_error(ovsdb_schema_from_json(schema_json, &schema));
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ if (data_json->type == JSON_NULL) {
|
|
Open vSwitch CI |
db9a9b |
+ /* We have a conversion request with no data. There is no
|
|
Open vSwitch CI |
db9a9b |
+ * other way as to read back what we have and convert. */
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb *old_db, *new_db;
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ check_ovsdb_error(ovsdb_log_commit_block(db_log_data));
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ old_db = ovsdb_file_read(db_file_name, false);
|
|
Open vSwitch CI |
db9a9b |
+ check_ovsdb_error(ovsdb_convert(old_db, schema, &new_db));
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_destroy(old_db);
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ pa->elems[1] = ovsdb_to_txn_json(
|
|
Open vSwitch CI |
db9a9b |
+ new_db, "converted by ovsdb-tool", true);
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_destroy(new_db);
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ json_destroy(data_json);
|
|
Open vSwitch CI |
db9a9b |
+ data_json = pa->elems[1];
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_schema_destroy(schema);
|
|
Open vSwitch CI |
db9a9b |
+ check_ovsdb_error(ovsdb_log_reset(db_log_data));
|
|
Open vSwitch CI |
db9a9b |
+ check_ovsdb_error(ovsdb_log_write(db_log_data, schema_json));
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
if (data_json->type != JSON_NULL) {
|
|
Open vSwitch CI |
db9a9b |
check_ovsdb_error(ovsdb_log_write(db_log_data, data_json));
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
@@ -1636,7 +1670,8 @@ do_compare_versions(struct ovs_cmdl_context *ctx)
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
static void
|
|
Open vSwitch CI |
db9a9b |
-do_convert_to_standalone(struct ovsdb_log *log, struct ovsdb_log *db_log_data)
|
|
Open vSwitch CI |
db9a9b |
+do_convert_to_standalone(const char *db_file_name,
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb_log *log, struct ovsdb_log *db_log_data)
|
|
Open vSwitch CI |
db9a9b |
{
|
|
Open vSwitch CI |
db9a9b |
for (unsigned int i = 0; ; i++) {
|
|
Open vSwitch CI |
db9a9b |
struct json *json;
|
|
Open vSwitch CI |
db9a9b |
@@ -1653,7 +1688,7 @@ do_convert_to_standalone(struct ovsdb_log *log, struct ovsdb_log *db_log_data)
|
|
Open vSwitch CI |
db9a9b |
} else {
|
|
Open vSwitch CI |
db9a9b |
struct raft_record r;
|
|
Open vSwitch CI |
db9a9b |
check_ovsdb_error(raft_record_from_json(&r, json));
|
|
Open vSwitch CI |
db9a9b |
- raft_record_to_standalone_log(&r, db_log_data);
|
|
Open vSwitch CI |
db9a9b |
+ raft_record_to_standalone_log(db_file_name, &r, db_log_data);
|
|
Open vSwitch CI |
db9a9b |
raft_record_uninit(&r);
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
json_destroy(json);
|
|
Open vSwitch CI |
db9a9b |
@@ -1676,7 +1711,7 @@ do_cluster_standalone(struct ovs_cmdl_context *ctx)
|
|
Open vSwitch CI |
db9a9b |
if (strcmp(ovsdb_log_get_magic(log), RAFT_MAGIC) != 0) {
|
|
Open vSwitch CI |
db9a9b |
ovs_fatal(0, "Database is not clustered db.\n");
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
- do_convert_to_standalone(log, db_log_data);
|
|
Open vSwitch CI |
db9a9b |
+ do_convert_to_standalone(db_file_name, log, db_log_data);
|
|
Open vSwitch CI |
db9a9b |
check_ovsdb_error(ovsdb_log_commit_block(db_log_data));
|
|
Open vSwitch CI |
db9a9b |
ovsdb_log_close(db_log_data);
|
|
Open vSwitch CI |
db9a9b |
ovsdb_log_close(log);
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/relay.c b/ovsdb/relay.c
|
|
Open vSwitch CI |
db9a9b |
index 9ff6ed8f3..94ffe01e5 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/relay.c
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/relay.c
|
|
Open vSwitch CI |
db9a9b |
@@ -301,6 +301,8 @@ static void
|
|
Open vSwitch CI |
db9a9b |
ovsdb_relay_parse_update(struct relay_ctx *ctx,
|
|
Open vSwitch CI |
db9a9b |
const struct ovsdb_cs_update_event *update)
|
|
Open vSwitch CI |
db9a9b |
{
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb_error *error = NULL;
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
if (!ctx->db) {
|
|
Open vSwitch CI |
db9a9b |
return;
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
@@ -308,15 +310,27 @@ ovsdb_relay_parse_update(struct relay_ctx *ctx,
|
|
Open vSwitch CI |
db9a9b |
if (update->monitor_reply && ctx->new_schema) {
|
|
Open vSwitch CI |
db9a9b |
/* There was a schema change. Updating a database with a new schema
|
|
Open vSwitch CI |
db9a9b |
* before processing monitor reply with the new data. */
|
|
Open vSwitch CI |
db9a9b |
- ctx->schema_change_cb(ctx->db, ctx->new_schema,
|
|
Open vSwitch CI |
db9a9b |
- ctx->schema_change_aux);
|
|
Open vSwitch CI |
db9a9b |
+ error = ctx->schema_change_cb(ctx->db, ctx->new_schema, false,
|
|
Open vSwitch CI |
db9a9b |
+ ctx->schema_change_aux);
|
|
Open vSwitch CI |
db9a9b |
+ if (error) {
|
|
Open vSwitch CI |
db9a9b |
+ /* Should never happen, but handle this case anyway. */
|
|
Open vSwitch CI |
db9a9b |
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
|
|
Open vSwitch CI |
db9a9b |
+ char *s = ovsdb_error_to_string_free(error);
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ VLOG_ERR_RL(&rl, "%s", s);
|
|
Open vSwitch CI |
db9a9b |
+ free(s);
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_cs_flag_inconsistency(ctx->cs);
|
|
Open vSwitch CI |
db9a9b |
+ return;
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
ovsdb_schema_destroy(ctx->new_schema);
|
|
Open vSwitch CI |
db9a9b |
ctx->new_schema = NULL;
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_cs_db_update *du;
|
|
Open vSwitch CI |
db9a9b |
- struct ovsdb_error *error = ovsdb_cs_parse_db_update(update->table_updates,
|
|
Open vSwitch CI |
db9a9b |
- update->version, &du);
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ error = ovsdb_cs_parse_db_update(update->table_updates,
|
|
Open vSwitch CI |
db9a9b |
+ update->version, &du);
|
|
Open vSwitch CI |
db9a9b |
if (!error) {
|
|
Open vSwitch CI |
db9a9b |
if (update->clear) {
|
|
Open vSwitch CI |
db9a9b |
error = ovsdb_relay_clear(ctx->db);
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/relay.h b/ovsdb/relay.h
|
|
Open vSwitch CI |
db9a9b |
index 390ea70c8..2d66b5e5f 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/relay.h
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/relay.h
|
|
Open vSwitch CI |
db9a9b |
@@ -23,8 +23,11 @@ struct json;
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb;
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_schema;
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
-typedef void (*schema_change_callback)(struct ovsdb *,
|
|
Open vSwitch CI |
db9a9b |
- const struct ovsdb_schema *, void *aux);
|
|
Open vSwitch CI |
db9a9b |
+typedef struct ovsdb_error *(*schema_change_callback)(
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb *,
|
|
Open vSwitch CI |
db9a9b |
+ const struct ovsdb_schema *,
|
|
Open vSwitch CI |
db9a9b |
+ bool conversion_with_no_data,
|
|
Open vSwitch CI |
db9a9b |
+ void *aux);
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
void ovsdb_relay_add_db(struct ovsdb *, const char *remote,
|
|
Open vSwitch CI |
db9a9b |
schema_change_callback schema_change_cb,
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/storage.c b/ovsdb/storage.c
|
|
Open vSwitch CI |
db9a9b |
index e8f95ce64..6c395106c 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/storage.c
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/storage.c
|
|
Open vSwitch CI |
db9a9b |
@@ -623,7 +623,7 @@ ovsdb_storage_store_snapshot(struct ovsdb_storage *storage,
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_write * OVS_WARN_UNUSED_RESULT
|
|
Open vSwitch CI |
db9a9b |
ovsdb_storage_write_schema_change(struct ovsdb_storage *storage,
|
|
Open vSwitch CI |
db9a9b |
- const struct json *schema,
|
|
Open vSwitch CI |
db9a9b |
+ const struct ovsdb_schema *schema,
|
|
Open vSwitch CI |
db9a9b |
const struct json *data,
|
|
Open vSwitch CI |
db9a9b |
const struct uuid *prereq,
|
|
Open vSwitch CI |
db9a9b |
struct uuid *resultp)
|
|
Open vSwitch CI |
db9a9b |
@@ -633,13 +633,23 @@ ovsdb_storage_write_schema_change(struct ovsdb_storage *storage,
|
|
Open vSwitch CI |
db9a9b |
if (storage->error) {
|
|
Open vSwitch CI |
db9a9b |
w->error = ovsdb_error_clone(storage->error);
|
|
Open vSwitch CI |
db9a9b |
} else if (storage->raft) {
|
|
Open vSwitch CI |
db9a9b |
- struct json *txn_json = json_array_create_2(json_clone(schema),
|
|
Open vSwitch CI |
db9a9b |
- json_clone(data));
|
|
Open vSwitch CI |
db9a9b |
- w->command = raft_command_execute(storage->raft, txn_json,
|
|
Open vSwitch CI |
db9a9b |
- prereq, &result);
|
|
Open vSwitch CI |
db9a9b |
- json_destroy(txn_json);
|
|
Open vSwitch CI |
db9a9b |
+ /* Clustered storage doesn't support ephemeral columns. */
|
|
Open vSwitch CI |
db9a9b |
+ w->error = ovsdb_schema_check_for_ephemeral_columns(schema);
|
|
Open vSwitch CI |
db9a9b |
+ if (!w->error) {
|
|
Open vSwitch CI |
db9a9b |
+ struct json *schema_json, *txn_json;
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ schema_json = ovsdb_schema_to_json(schema);
|
|
Open vSwitch CI |
db9a9b |
+ txn_json = json_array_create_2(schema_json, json_clone(data));
|
|
Open vSwitch CI |
db9a9b |
+ w->command = raft_command_execute(storage->raft, txn_json,
|
|
Open vSwitch CI |
db9a9b |
+ prereq, &result);
|
|
Open vSwitch CI |
db9a9b |
+ json_destroy(txn_json);
|
|
Open vSwitch CI |
db9a9b |
+ }
|
|
Open vSwitch CI |
db9a9b |
} else if (storage->log) {
|
|
Open vSwitch CI |
db9a9b |
- w->error = ovsdb_storage_store_snapshot__(storage, schema, data, 0);
|
|
Open vSwitch CI |
db9a9b |
+ struct json *schema_json = ovsdb_schema_to_json(schema);
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+ w->error = ovsdb_storage_store_snapshot__(storage, schema_json,
|
|
Open vSwitch CI |
db9a9b |
+ data, 0);
|
|
Open vSwitch CI |
db9a9b |
+ json_destroy(schema_json);
|
|
Open vSwitch CI |
db9a9b |
} else {
|
|
Open vSwitch CI |
db9a9b |
/* When 'error' and 'command' are both null, it indicates that the
|
|
Open vSwitch CI |
db9a9b |
* command is complete. This is fine since this unbacked storage drops
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/storage.h b/ovsdb/storage.h
|
|
Open vSwitch CI |
db9a9b |
index a1fdaa564..05f40ce93 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/storage.h
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/storage.h
|
|
Open vSwitch CI |
db9a9b |
@@ -85,7 +85,7 @@ struct ovsdb_error *ovsdb_storage_store_snapshot(struct ovsdb_storage *storage,
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_write *ovsdb_storage_write_schema_change(
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_storage *,
|
|
Open vSwitch CI |
db9a9b |
- const struct json *schema, const struct json *data,
|
|
Open vSwitch CI |
db9a9b |
+ const struct ovsdb_schema *, const struct json *data,
|
|
Open vSwitch CI |
db9a9b |
const struct uuid *prereq, struct uuid *result)
|
|
Open vSwitch CI |
db9a9b |
OVS_WARN_UNUSED_RESULT;
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/transaction.c b/ovsdb/transaction.c
|
|
Open vSwitch CI |
db9a9b |
index 03541af85..f01de2a34 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/transaction.c
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/transaction.c
|
|
Open vSwitch CI |
db9a9b |
@@ -1251,7 +1251,7 @@ ovsdb_txn_precheck_prereq(const struct ovsdb *db)
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_txn_progress *
|
|
Open vSwitch CI |
db9a9b |
ovsdb_txn_propose_schema_change(struct ovsdb *db,
|
|
Open vSwitch CI |
db9a9b |
- const struct json *schema,
|
|
Open vSwitch CI |
db9a9b |
+ const struct ovsdb_schema *schema,
|
|
Open vSwitch CI |
db9a9b |
const struct json *data)
|
|
Open vSwitch CI |
db9a9b |
{
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_txn_progress *progress = xzalloc(sizeof *progress);
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/transaction.h b/ovsdb/transaction.h
|
|
Open vSwitch CI |
db9a9b |
index 6b5bb7f24..9991f34d2 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/transaction.h
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/transaction.h
|
|
Open vSwitch CI |
db9a9b |
@@ -21,6 +21,7 @@
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
struct json;
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb;
|
|
Open vSwitch CI |
db9a9b |
+struct ovsdb_schema;
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_table;
|
|
Open vSwitch CI |
db9a9b |
struct uuid;
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
@@ -41,7 +42,7 @@ struct ovsdb_error *ovsdb_txn_propose_commit_block(struct ovsdb_txn *,
|
|
Open vSwitch CI |
db9a9b |
void ovsdb_txn_complete(struct ovsdb_txn *);
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
struct ovsdb_txn_progress *ovsdb_txn_propose_schema_change(
|
|
Open vSwitch CI |
db9a9b |
- struct ovsdb *, const struct json *schema, const struct json *data);
|
|
Open vSwitch CI |
db9a9b |
+ struct ovsdb *, const struct ovsdb_schema *, const struct json *data);
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
bool ovsdb_txn_progress_is_complete(const struct ovsdb_txn_progress *);
|
|
Open vSwitch CI |
db9a9b |
const struct ovsdb_error *ovsdb_txn_progress_get_error(
|
|
Open vSwitch CI |
db9a9b |
diff --git a/ovsdb/trigger.c b/ovsdb/trigger.c
|
|
Open vSwitch CI |
db9a9b |
index 01bb80e28..3c93ae580 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/ovsdb/trigger.c
|
|
Open vSwitch CI |
db9a9b |
+++ b/ovsdb/trigger.c
|
|
Open vSwitch CI |
db9a9b |
@@ -274,8 +274,8 @@ ovsdb_trigger_try(struct ovsdb_trigger *t, long long int now)
|
|
Open vSwitch CI |
db9a9b |
if (!error) {
|
|
Open vSwitch CI |
db9a9b |
error = ovsdb_convert(t->db, new_schema, &newdb);
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
- ovsdb_schema_destroy(new_schema);
|
|
Open vSwitch CI |
db9a9b |
if (error) {
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_schema_destroy(new_schema);
|
|
Open vSwitch CI |
db9a9b |
trigger_convert_error(t, error);
|
|
Open vSwitch CI |
db9a9b |
return false;
|
|
Open vSwitch CI |
db9a9b |
}
|
|
Open vSwitch CI |
db9a9b |
@@ -286,7 +286,8 @@ ovsdb_trigger_try(struct ovsdb_trigger *t, long long int now)
|
|
Open vSwitch CI |
db9a9b |
|
|
Open vSwitch CI |
db9a9b |
/* Propose the change. */
|
|
Open vSwitch CI |
db9a9b |
t->progress = ovsdb_txn_propose_schema_change(
|
|
Open vSwitch CI |
db9a9b |
- t->db, new_schema_json, txn_json);
|
|
Open vSwitch CI |
db9a9b |
+ t->db, new_schema, txn_json);
|
|
Open vSwitch CI |
db9a9b |
+ ovsdb_schema_destroy(new_schema);
|
|
Open vSwitch CI |
db9a9b |
json_destroy(txn_json);
|
|
Open vSwitch CI |
db9a9b |
t->reply = jsonrpc_create_reply(json_object_create(),
|
|
Open vSwitch CI |
db9a9b |
t->request->id);
|
|
Open vSwitch CI |
6b16ed |
diff --git a/python/ovs/stream.py b/python/ovs/stream.py
|
|
Open vSwitch CI |
6b16ed |
index ac5b0fd0c..b32341076 100644
|
|
Open vSwitch CI |
6b16ed |
--- a/python/ovs/stream.py
|
|
Open vSwitch CI |
6b16ed |
+++ b/python/ovs/stream.py
|
|
Open vSwitch CI |
6b16ed |
@@ -824,7 +824,8 @@ class SSLStream(Stream):
|
|
Open vSwitch CI |
6b16ed |
self.socket.do_handshake()
|
|
Open vSwitch CI |
6b16ed |
except ssl.SSLWantReadError:
|
|
Open vSwitch CI |
6b16ed |
return errno.EAGAIN
|
|
Open vSwitch CI |
6b16ed |
- except ssl.SSLSyscallError as e:
|
|
Open vSwitch CI |
6b16ed |
+ except (ssl.SSLSyscallError, ssl.SSLZeroReturnError,
|
|
Open vSwitch CI |
6b16ed |
+ ssl.SSLEOFError, OSError) as e:
|
|
Open vSwitch CI |
6b16ed |
return ovs.socket_util.get_exception_errno(e)
|
|
Open vSwitch CI |
6b16ed |
|
|
Open vSwitch CI |
6b16ed |
return 0
|
|
Open vSwitch CI |
7f2e72 |
diff --git a/tests/automake.mk b/tests/automake.mk
|
|
Open vSwitch CI |
7f2e72 |
index c8de3fe28..e39453cd1 100644
|
|
Open vSwitch CI |
7f2e72 |
--- a/tests/automake.mk
|
|
Open vSwitch CI |
7f2e72 |
+++ b/tests/automake.mk
|
|
Open vSwitch CI |
7f2e72 |
@@ -110,7 +110,8 @@ TESTSUITE_AT = \
|
|
Open vSwitch CI |
7f2e72 |
tests/mcast-snooping.at \
|
|
Open vSwitch CI |
7f2e72 |
tests/packet-type-aware.at \
|
|
Open vSwitch CI |
7f2e72 |
tests/nsh.at \
|
|
Open vSwitch CI |
7f2e72 |
- tests/drop-stats.at
|
|
Open vSwitch CI |
7f2e72 |
+ tests/drop-stats.at \
|
|
Open vSwitch CI |
7f2e72 |
+ tests/learning-switch.at
|
|
Open vSwitch CI |
7f2e72 |
|
|
Open vSwitch CI |
7f2e72 |
EXTRA_DIST += $(FUZZ_REGRESSION_TESTS)
|
|
Open vSwitch CI |
7f2e72 |
FUZZ_REGRESSION_TESTS = \
|
|
Open vSwitch CI |
aaf0be |
diff --git a/tests/classifier.at b/tests/classifier.at
|
|
Open vSwitch CI |
aaf0be |
index f652b5983..de2705653 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/tests/classifier.at
|
|
Open vSwitch CI |
aaf0be |
+++ b/tests/classifier.at
|
|
Open vSwitch CI |
aaf0be |
@@ -65,6 +65,94 @@ Datapath actions: 2
|
|
Open vSwitch CI |
aaf0be |
OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+AT_SETUP([flow classifier - lookup segmentation - final stage])
|
|
Open vSwitch CI |
aaf0be |
+OVS_VSWITCHD_START
|
|
Open vSwitch CI |
aaf0be |
+add_of_ports br0 1 2 3
|
|
Open vSwitch CI |
aaf0be |
+AT_DATA([flows.txt], [dnl
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=33,tcp,tp_dst=80,tcp_flags=+psh,action=output(2)
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=0,ip,action=drop
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=2 priority=16,icmp6,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=1000::1 ,action=output(1)
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=2 priority=0,ip,action=drop
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=3 action=resubmit(,1)
|
|
Open vSwitch CI |
aaf0be |
+table=1 in_port=3 priority=45,ct_state=+trk+rpl,ct_nw_proto=6,ct_tp_src=3/0x1,tcp,tp_dst=80,tcp_flags=+psh,action=output(2)
|
|
Open vSwitch CI |
aaf0be |
+table=1 in_port=3 priority=10,ip,action=drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80,tcp_flags=syn'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,tcp,in_port=1,nw_frag=no,tp_dst=80,tcp_flags=-psh
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80,tcp_flags=syn|ack'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,tcp,in_port=1,nw_frag=no,tp_dst=80,tcp_flags=-psh
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80,tcp_flags=ack|psh'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,tcp,in_port=1,nw_frag=no,tp_dst=80,tcp_flags=+psh
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: 2
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,tcp,in_port=1,nw_frag=no,tp_dst=80,tcp_flags=-psh
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=79'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,tcp,in_port=1,nw_frag=no,tp_dst=0x40/0xfff0,tcp_flags=-psh
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Having both the port and the tcp flags in the resulting megaflow below
|
|
Open vSwitch CI |
aaf0be |
+dnl is redundant, but that is how ports trie logic is implemented.
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=81'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,tcp,in_port=1,nw_frag=no,tp_dst=81,tcp_flags=-psh
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl nd_target is redundant in the megaflow below and it is also not relevant
|
|
Open vSwitch CI |
aaf0be |
+dnl for an icmp reply. Datapath may discard that match, but it is OK as long
|
|
Open vSwitch CI |
aaf0be |
+dnl as we have prerequisites (icmp_type) in the match as well.
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=2,eth_src=f6:d2:b0:19:5e:7b,eth_dst=d2:49:19:91:78:fe,dl_type=0x86dd,ipv6_src=1000::3,ipv6_dst=1000::4,nw_proto=58,nw_ttl=255,icmpv6_type=128,icmpv6_code=0"], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,icmp6,in_port=2,nw_ttl=255,nw_frag=no,icmp_type=0x80/0xfc,nd_target=::
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=2,eth_src=f6:d2:b0:19:5e:7b,eth_dst=d2:49:19:91:78:fe,dl_type=0x86dd,ipv6_src=1000::3,ipv6_dst=1000::4,nw_proto=58,nw_ttl=255,icmpv6_type=135,icmpv6_code=0"], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,icmp6,in_port=2,nw_ttl=255,nw_frag=no,icmp_type=0x87/0xff,icmp_code=0x0/0xff,nd_target=::
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=2,eth_src=f6:d2:b0:19:5e:7b,eth_dst=d2:49:19:91:78:fe,dl_type=0x86dd,ipv6_src=1000::3,ipv6_dst=1000::4,nw_proto=58,nw_ttl=255,icmpv6_type=135,icmpv6_code=0,nd_target=1000::1"], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,icmp6,in_port=2,nw_ttl=255,nw_frag=no,icmp_type=0x87/0xff,icmp_code=0x0/0xff,nd_target=1000::1
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: 1
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=2,eth_src=f6:d2:b0:19:5e:7b,eth_dst=d2:49:19:91:78:fe,dl_type=0x86dd,ipv6_src=1000::3,ipv6_dst=1000::4,nw_proto=58,nw_ttl=255,icmpv6_type=135,icmpv6_code=0,nd_target=1000::2"], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,icmp6,in_port=2,nw_ttl=255,nw_frag=no,icmp_type=0x87/0xff,icmp_code=0x0/0xff,nd_target=1000::2
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Check that ports' mask doesn't affect ct ports.
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=3,ct_state=trk|rpl,ct_nw_proto=6,ct_tp_src=3,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=80,tcp_flags=psh'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,ct_state=+rpl+trk,ct_nw_proto=6,ct_tp_src=0x1/0x1,eth,tcp,in_port=3,nw_frag=no,tp_dst=80,tcp_flags=+psh
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: 2
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=3,ct_state=trk|rpl,ct_nw_proto=6,ct_tp_src=3,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=79,tcp_flags=psh'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,ct_state=+rpl+trk,ct_nw_proto=6,ct_tp_src=0x1/0x1,eth,tcp,in_port=3,nw_frag=no,tp_dst=0x40/0xfff0,tcp_flags=+psh
|
|
Open vSwitch CI |
aaf0be |
+Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
+AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
AT_BANNER([flow classifier prefix lookup])
|
|
Open vSwitch CI |
aaf0be |
AT_SETUP([flow classifier - prefix lookup])
|
|
Open vSwitch CI |
aaf0be |
OVS_VSWITCHD_START
|
|
Open vSwitch CI |
fc879c |
diff --git a/tests/dpctl.at b/tests/dpctl.at
|
|
Open vSwitch CI |
fc879c |
index 7454a51ec..d2f1046f8 100644
|
|
Open vSwitch CI |
fc879c |
--- a/tests/dpctl.at
|
|
Open vSwitch CI |
fc879c |
+++ b/tests/dpctl.at
|
|
Open vSwitch CI |
fc879c |
@@ -135,3 +135,19 @@ AT_CHECK([ovs-appctl dpctl/dump-flows dummy@br0 | sort], [0], [dnl
|
|
Open vSwitch CI |
fc879c |
AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0])
|
|
Open vSwitch CI |
fc879c |
OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
fc879c |
AT_CLEANUP
|
|
Open vSwitch CI |
fc879c |
+
|
|
Open vSwitch CI |
fc879c |
+AT_SETUP([dpctl - ct-get-limits ct-del-limits])
|
|
Open vSwitch CI |
fc879c |
+OVS_VSWITCHD_START
|
|
Open vSwitch CI |
fc879c |
+AT_CHECK([ovs-appctl dpctl/ct-get-limits], [0], [default limit=0
|
|
Open vSwitch CI |
fc879c |
+])
|
|
Open vSwitch CI |
fc879c |
+AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=], [0], [default limit=0
|
|
Open vSwitch CI |
fc879c |
+])
|
|
Open vSwitch CI |
fc879c |
+AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=,], [0], [default limit=0
|
|
Open vSwitch CI |
fc879c |
+])
|
|
Open vSwitch CI |
fc879c |
+AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=x], [2], [],
|
|
Open vSwitch CI |
fc879c |
+ [ovs-vswitchd: invalid zone (Invalid argument)
|
|
Open vSwitch CI |
fc879c |
+ovs-appctl: ovs-vswitchd: server returned an error
|
|
Open vSwitch CI |
fc879c |
+])
|
|
Open vSwitch CI |
fc879c |
+AT_CHECK([ovs-appctl dpctl/ct-del-limits zone=])
|
|
Open vSwitch CI |
fc879c |
+OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
fc879c |
+AT_CLEANUP
|
|
Open vSwitch CI |
fc879c |
\ No newline at end of file
|
|
Open vSwitch CI |
7f2e72 |
diff --git a/tests/learning-switch.at b/tests/learning-switch.at
|
|
Open vSwitch CI |
7f2e72 |
new file mode 100644
|
|
Open vSwitch CI |
7f2e72 |
index 000000000..ac2fc1b80
|
|
Open vSwitch CI |
7f2e72 |
--- /dev/null
|
|
Open vSwitch CI |
7f2e72 |
+++ b/tests/learning-switch.at
|
|
Open vSwitch CI |
7f2e72 |
@@ -0,0 +1,23 @@
|
|
Open vSwitch CI |
7f2e72 |
+AT_BANNER([learning switch])
|
|
Open vSwitch CI |
7f2e72 |
+
|
|
Open vSwitch CI |
7f2e72 |
+### -----------------------------------------------------------------
|
|
Open vSwitch CI |
7f2e72 |
+### learning switch OpenFlow15 test case
|
|
Open vSwitch CI |
7f2e72 |
+### -----------------------------------------------------------------
|
|
Open vSwitch CI |
7f2e72 |
+
|
|
Open vSwitch CI |
7f2e72 |
+AT_SETUP([learning switch - OpenFlow15])
|
|
Open vSwitch CI |
7f2e72 |
+dnl Start ovs-testcontroller
|
|
Open vSwitch CI |
7f2e72 |
+AT_CHECK([ovs-testcontroller --no-chdir --detach punix:controller --pidfile -v ptcp:], [0], [ignore])
|
|
Open vSwitch CI |
7f2e72 |
+dnl Start ovs
|
|
Open vSwitch CI |
7f2e72 |
+OVS_VSWITCHD_START([dnl
|
|
Open vSwitch CI |
7f2e72 |
+ set bridge br0 datapath_type=dummy \
|
|
Open vSwitch CI |
7f2e72 |
+ protocols=OpenFlow15 -- \
|
|
Open vSwitch CI |
7f2e72 |
+ add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
|
|
Open vSwitch CI |
7f2e72 |
+ set-controller br0 tcp:127.0.0.1:6653])
|
|
Open vSwitch CI |
7f2e72 |
+AT_CHECK([
|
|
Open vSwitch CI |
7f2e72 |
+ ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a53400040011addc0a80a0ac0a80a1e08006f200a4d0001fc509a58000000002715020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
|
|
Open vSwitch CI |
7f2e72 |
+], [0], [ignore])
|
|
Open vSwitch CI |
7f2e72 |
+AT_CHECK([kill `cat ovs-testcontroller.pid`])
|
|
Open vSwitch CI |
7f2e72 |
+
|
|
Open vSwitch CI |
7f2e72 |
+OVS_WAIT_UNTIL([! test -e controller])
|
|
Open vSwitch CI |
7f2e72 |
+OVS_VSWITCHD_STOP(["/cannot find route for controller/d"])
|
|
Open vSwitch CI |
7f2e72 |
+AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
|
|
Open vSwitch CI |
aaf0be |
index fa6111c1e..6b58cabec 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/tests/ofproto-dpif.at
|
|
Open vSwitch CI |
aaf0be |
+++ b/tests/ofproto-dpif.at
|
|
Open vSwitch CI |
aaf0be |
@@ -849,7 +849,7 @@ table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,nw_frag=no,icmp_type=8,icmp_code=0'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
- [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,icmp,in_port=1,nw_src=192.168.0.1,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
Datapath actions: 10,set(ipv4(src=192.168.3.91)),11,set(ipv4(src=192.168.3.90)),13
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
@@ -912,7 +912,7 @@ AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_ds
|
|
Open vSwitch CI |
aaf0be |
# Must match on the source address to be able to restore it's value for
|
|
Open vSwitch CI |
aaf0be |
# the second bucket
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
- [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,icmp,in_port=1,nw_src=192.168.0.1,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
@@ -944,7 +944,7 @@ done
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/dp_hash(.*\/0xf)/dp_hash(0xXXXX\/0xf)/' | sed 's/packets.*actions:/actions:/' | strip_ufid | strip_used | sort], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
flow-dump from the main thread:
|
|
Open vSwitch CI |
aaf0be |
recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:hash(sym_l4(0)),recirc(0x1)
|
|
Open vSwitch CI |
aaf0be |
-recirc_id(0x1),dp_hash(0xXXXX/0xf),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=192.168.0.1,frag=no), actions:set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),10
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0x1),dp_hash(0xXXXX/0xf),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=192.168.0.1,proto=1,frag=no), actions:set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),10
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
@@ -959,7 +959,7 @@ AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_ds
|
|
Open vSwitch CI |
aaf0be |
# Must match on the source address to be able to restore it's value for
|
|
Open vSwitch CI |
aaf0be |
# the third bucket
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
- [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,icmp,in_port=1,nw_src=192.168.0.1,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
@@ -1536,17 +1536,17 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([tail -4 stdout], [0], [
|
|
Open vSwitch CI |
aaf0be |
Final flow: ip,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
-Megaflow: recirc_id=0,eth,ip,in_port=1,nw_ttl=2,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
+Megaflow: recirc_id=0,eth,ip,in_port=1,nw_proto=111,nw_ttl=2,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
Datapath actions: set(ipv4(ttl=1)),2,userspace(pid=0,controller(reason=2,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535)),4
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=3,frag=no)'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
- [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_ttl=3,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_proto=111,nw_ttl=3,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
- [Megaflow: recirc_id=0,eth,ipv6,in_port=1,nw_ttl=128,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,eth,ipv6,in_port=1,nw_proto=10,nw_ttl=128,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
@@ -1656,7 +1656,7 @@ AT_CHECK([ovs-vsctl -- \
|
|
Open vSwitch CI |
aaf0be |
--id=@q2 create Queue dscp=2], [0], [ignore])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([tail -2 stdout], [0],
|
|
Open vSwitch CI |
aaf0be |
- [Megaflow: recirc_id=0,skb_priority=0,eth,ip,in_port=9,nw_tos=252,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
+ [Megaflow: recirc_id=0,skb_priority=0,eth,icmp,in_port=9,nw_tos=252,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
Datapath actions: dnl
|
|
Open vSwitch CI |
aaf0be |
100,dnl
|
|
Open vSwitch CI |
aaf0be |
set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
|
|
Open vSwitch CI |
aaf0be |
@@ -11884,7 +11884,7 @@ ovs-ofctl dump-flows br0
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([tail -3 stdout], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
-Megaflow: recirc_id=0,eth,ip,reg0=0/0x1,in_port=1,nw_src=10.10.10.2,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
+Megaflow: recirc_id=0,eth,icmp,reg0=0/0x1,in_port=1,nw_src=10.10.10.2,nw_frag=no
|
|
Open vSwitch CI |
aaf0be |
Datapath actions: drop
|
|
Open vSwitch CI |
aaf0be |
Translation failed (Recursion too deep), packet is dropped.
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
diff --git a/tests/ofproto.at b/tests/ofproto.at
|
|
Open vSwitch CI |
aaf0be |
index a666bebca..2fa8486a8 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/tests/ofproto.at
|
|
Open vSwitch CI |
aaf0be |
+++ b/tests/ofproto.at
|
|
Open vSwitch CI |
aaf0be |
@@ -6538,3 +6538,185 @@ verify_deleted
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
OVS_VSWITCHD_STOP(["/
|
|
Open vSwitch CI |
aaf0be |
AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_SETUP([ofproto - implicit mask of ipv4 proto with invalid proto field])
|
|
Open vSwitch CI |
aaf0be |
+OVS_VSWITCHD_START
|
|
Open vSwitch CI |
aaf0be |
+add_of_ports br0 1 2
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_DATA([flows.txt], [dnl
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=90,ip,nw_dst=192.168.1.20,actions=mod_nw_dst:192.168.20.20,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=89,ip,nw_dst=192.168.1.21,actions=mod_nw_src:192.168.20.21,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=88,ip,nw_dst=192.168.1.10,actions=dec_ttl,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=87,ip,nw_dst=192.168.1.19,actions=mod_nw_ttl:8,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=86,ip,nw_dst=192.168.1.18,actions=mod_nw_ecn:2,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=85,ip,nw_dst=192.168.1.17,actions=mod_nw_tos:0x40,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=84,ip,nw_dst=192.168.1.16,actions=set_field:192.168.20.26->nw_dst,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=83,ip,nw_dst=192.168.1.15,actions=set_field:192.168.21.26->nw_src,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=82,ip,nw_dst=192.168.1.14,actions=set_field:0x40->nw_tos,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=0,actions=drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl del-flows br0])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send a proto 0 packet to try and poison the DP flow path
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 \
|
|
Open vSwitch CI |
aaf0be |
+ '5054000000075054000000050800450000548de140004000289fc0a801c4c0a8011408003bf60002001bbf080a640000000032ad010000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+flow-dump from the main thread:
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.1.20,proto=0,frag=no), packets:0, bytes:0, used:never, actions:2
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Send ICMP for mod nw_src and mod nw_dst
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.21,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.20,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will dec TTL
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.10,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will mod TTL
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.19,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will mod ECN
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.18,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will mod TOS
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.17,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will set DST
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.16,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will set SRC
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.15,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will set TOS
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.14,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-flows | sort], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+flow-dump from the main thread:
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.1.10,proto=1,ttl=64,frag=no), packets:0, bytes:0, used:never, actions:set(ipv4(ttl=63)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.1.14,proto=1,tos=0/0xfc,frag=no), packets:0, bytes:0, used:never, actions:set(ipv4(tos=0x40/0xfc)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.1.16,proto=1,frag=no), packets:0, bytes:0, used:never, actions:set(ipv4(dst=192.168.20.26)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.1.17,proto=1,tos=0/0xfc,frag=no), packets:0, bytes:0, used:never, actions:set(ipv4(tos=0x40/0xfc)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.1.18,proto=1,tos=0/0x3,frag=no), packets:0, bytes:0, used:never, actions:set(ipv4(tos=0x2/0x3)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.1.19,proto=1,ttl=64,frag=no), packets:0, bytes:0, used:never, actions:set(ipv4(ttl=8)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.1.20,proto=0,frag=no), packets:0, bytes:0, used:never, actions:2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.1.20,proto=1,frag=no), packets:0, bytes:0, used:never, actions:set(ipv4(dst=192.168.20.20)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.15,proto=1,frag=no), packets:0, bytes:0, used:never, actions:set(ipv4(src=192.168.21.26)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.1.21,proto=1,frag=no), packets:0, bytes:0, used:never, actions:set(ipv4(src=192.168.20.21)),2
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
+AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_SETUP([ofproto - implicit mask of ipv6 proto with HOPOPT field])
|
|
Open vSwitch CI |
aaf0be |
+OVS_VSWITCHD_START
|
|
Open vSwitch CI |
aaf0be |
+add_of_ports br0 1 2
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_DATA([flows.txt], [dnl
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=77,ip6,ipv6_dst=111:db8::3,actions=dec_ttl,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=76,ip6,ipv6_dst=111:db8::4,actions=mod_nw_ttl:8,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=75,ip6,ipv6_dst=111:db8::5,actions=mod_nw_ecn:2,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=74,ip6,ipv6_dst=111:db8::6,actions=mod_nw_tos:0x40,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=73,ip6,ipv6_dst=111:db8::7,actions=set_field:2112:db8::2->ipv6_dst,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=72,ip6,ipv6_dst=111:db8::8,actions=set_field:2112:db8::3->ipv6_src,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=72,ip6,ipv6_dst=111:db8::9,actions=set_field:44->ipv6_label,output=2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=0,actions=drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl del-flows br0])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send a proto 0 packet to try and poison the DP flow path
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x86dd),ipv6(src=2001:db8::1,dst=111:db8::3,proto=0,tclass=0,hlimit=64,frag=no)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+flow-dump from the main thread:
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(dst=111:db8::3,proto=0,hlimit=0,frag=no), packets:0, bytes:0, used:never, actions:userspace(pid=0,controller(reason=2,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Send ICMP for mod nw_src and mod nw_dst
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x86dd),ipv6(src=2001:db8::1,dst=111:db8::3,proto=1,tclass=0,hlimit=64,frag=no),icmpv6(type=0,code=8)'])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x86dd),ipv6(src=2001:db8::1,dst=111:db8::4,proto=1,tclass=0,hlimit=64,frag=no),icmpv6(type=0,code=8)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will dec TTL
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x86dd),ipv6(src=2001:db8::1,dst=111:db8::5,proto=1,tclass=0,hlimit=64,frag=no),icmpv6(type=0,code=8)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will mod TTL
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x86dd),ipv6(src=2001:db8::1,dst=111:db8::6,proto=1,tclass=0,hlimit=64,frag=no),icmpv6(type=0,code=8)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will mod ECN
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x86dd),ipv6(src=2001:db8::1,dst=111:db8::7,proto=1,tclass=0,hlimit=64,frag=no),icmpv6(type=0,code=8)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will mod TOS
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x86dd),ipv6(src=2001:db8::1,dst=111:db8::8,proto=1,tclass=0,hlimit=64,frag=no),icmpv6(type=0,code=8)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl send ICMP that will set LABEL
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x86dd),ipv6(src=2001:db8::1,dst=111:db8::9,proto=1,tclass=0,hlimit=64,frag=no),icmpv6(type=0,code=8)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-flows | sort], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+flow-dump from the main thread:
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(dst=111:db8::3,proto=0,hlimit=0,frag=no), packets:0, bytes:0, used:never, actions:userspace(pid=0,controller(reason=2,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(dst=111:db8::3,proto=1,hlimit=64,frag=no), packets:0, bytes:0, used:never, actions:set(ipv6(hlimit=63)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(dst=111:db8::4,proto=1,hlimit=64,frag=no), packets:0, bytes:0, used:never, actions:set(ipv6(hlimit=8)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(dst=111:db8::5,proto=1,tclass=0/0x3,frag=no), packets:0, bytes:0, used:never, actions:set(ipv6(tclass=0x2/0x3)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(dst=111:db8::6,proto=1,tclass=0/0xfc,frag=no), packets:0, bytes:0, used:never, actions:set(ipv6(tclass=0x40/0xfc)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(dst=111:db8::7,proto=1,frag=no), packets:0, bytes:0, used:never, actions:set(ipv6(dst=2112:db8::2)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(dst=111:db8::9,label=0,proto=1,frag=no), packets:0, bytes:0, used:never, actions:set(ipv6(label=0x2c)),2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(src=2001:db8::1,dst=111:db8::8,proto=1,frag=no), packets:0, bytes:0, used:never, actions:set(ipv6(src=2112:db8::3)),2
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
+AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_SETUP([ofproto - implicit mask of ARP OPer field])
|
|
Open vSwitch CI |
aaf0be |
+OVS_VSWITCHD_START
|
|
Open vSwitch CI |
aaf0be |
+add_of_ports br0 1 2
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_DATA([flows.txt], [dnl
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=77,arp,arp_sha=00:01:02:03:04:06,actions=set_field:0x1->arp_op,2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=76,arp,arp_sha=00:01:02:03:04:07,actions=set_field:00:02:03:04:05:06->arp_sha,2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=75,arp,arp_sha=00:01:02:03:04:08,actions=set_field:ff:00:00:00:00:ff->arp_tha,2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=74,arp,arp_sha=00:01:02:03:04:09,actions=set_field:172.31.110.26->arp_spa,2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=73,arp,arp_sha=00:01:02:03:04:0a,actions=set_field:172.31.110.10->arp_tpa,2
|
|
Open vSwitch CI |
aaf0be |
+table=0 in_port=1 priority=1,actions=drop
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl del-flows br0])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Send op == 0 packet
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 \
|
|
Open vSwitch CI |
aaf0be |
+ 'ffffffffffffaa55aa550000080600010800060400000001020304070c0a00010000000000000c0a0002'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+flow-dump from the main thread:
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0806),arp(op=0,sha=00:01:02:03:04:07), packets:0, bytes:0, used:never, actions:2
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Send op 2 -> set op
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0806),arp(sip=172.31.110.1,tip=172.31.110.25,op=2,sha=00:01:02:03:04:06,tha=ff:ff:ff:ff:ff:ff)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Send op 1 -> set SHA
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0806),arp(sip=172.31.110.1,tip=172.31.110.25,op=1,sha=00:01:02:03:04:07,tha=ff:ff:ff:ff:ff:ff)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Send op 1 -> set THA
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0806),arp(sip=172.31.110.1,tip=172.31.110.25,op=1,sha=00:01:02:03:04:08,tha=ff:ff:ff:ff:ff:ff)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Send op 1 -> set SIP
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0806),arp(sip=172.31.110.1,tip=172.31.110.25,op=1,sha=00:01:02:03:04:09,tha=ff:ff:ff:ff:ff:ff)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Send op 1 -> set TIP
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0806),arp(sip=172.31.110.1,tip=172.31.110.25,op=1,sha=00:01:02:03:04:0a,tha=ff:ff:ff:ff:ff:ff)'])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-flows | sort], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+flow-dump from the main thread:
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0806),arp(op=0,sha=00:01:02:03:04:07), packets:0, bytes:0, used:never, actions:2
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0806),arp(op=1,sha=00:01:02:03:04:07), packets:0, bytes:0, used:never, actions:userspace(pid=0,slow_path(action))
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0806),arp(op=1,sha=00:01:02:03:04:08,tha=ff:ff:ff:ff:ff:ff), packets:0, bytes:0, used:never, actions:userspace(pid=0,slow_path(action))
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0806),arp(op=2,sha=00:01:02:03:04:06), packets:0, bytes:0, used:never, actions:userspace(pid=0,slow_path(action))
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0806),arp(sip=172.31.110.1,op=1,sha=00:01:02:03:04:09), packets:0, bytes:0, used:never, actions:userspace(pid=0,slow_path(action))
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0806),arp(tip=172.31.110.25,op=1,sha=00:01:02:03:04:0a), packets:0, bytes:0, used:never, actions:userspace(pid=0,slow_path(action))
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
+AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
|
|
Open vSwitch CI |
aaf0be |
index a92156f00..a368bff6e 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/tests/ovs-vsctl.at
|
|
Open vSwitch CI |
aaf0be |
+++ b/tests/ovs-vsctl.at
|
|
Open vSwitch CI |
aaf0be |
@@ -425,6 +425,7 @@ AT_CHECK([RUN_OVS_VSCTL_ONELINE(
|
|
Open vSwitch CI |
aaf0be |
[add-port a a1],
|
|
Open vSwitch CI |
aaf0be |
[add-bond a bond0 a2 a3],
|
|
Open vSwitch CI |
aaf0be |
[br-set-external-id a key0 value0],
|
|
Open vSwitch CI |
aaf0be |
+ [add Bridge a external_ids key0=value1],
|
|
Open vSwitch CI |
aaf0be |
[set port a1 external-ids:key1=value1],
|
|
Open vSwitch CI |
aaf0be |
[set interface a2 external-ids:key2=value2],
|
|
Open vSwitch CI |
aaf0be |
[set interface a2 external-ids:key3=value3],
|
|
Open vSwitch CI |
aaf0be |
@@ -446,6 +447,7 @@ AT_CHECK([RUN_OVS_VSCTL_ONELINE(
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
key0=value0
|
|
Open vSwitch CI |
aaf0be |
value0
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
@@ -1071,13 +1073,9 @@ AT_CHECK([RUN_OVS_VSCTL([set controller br1 'connection-mode=xyz'])],
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([RUN_OVS_VSCTL([set controller br1 connection-mode:x=y])],
|
|
Open vSwitch CI |
aaf0be |
[1], [], [ovs-vsctl: cannot specify key to set for non-map column connection_mode
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
-AT_CHECK([RUN_OVS_VSCTL([add bridge br1 datapath_id x y -- show])],
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([RUN_OVS_VSCTL([add bridge br1 datapath_id x y])],
|
|
Open vSwitch CI |
aaf0be |
[1], [], [ovs-vsctl: "add" operation would put 2 values in column datapath_id of table Bridge but the maximum number is 1
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
-AT_CHECK([RUN_OVS_VSCTL([add bridge br1 datapath_id x y])], [1], [], [stderr])
|
|
Open vSwitch CI |
aaf0be |
-AT_CHECK([sed "/^.*|WARN|.*/d" < stderr], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
-ovs-vsctl: transaction error: {"details":"set must have 0 to 1 members but 2 are present","error":"syntax error","syntax":"[[\"set\",[\"x\",\"y\"]]]"}
|
|
Open vSwitch CI |
aaf0be |
-])
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([RUN_OVS_VSCTL([remove netflow `cat netflow-uuid` targets '"1.2.3.4:567"'])],
|
|
Open vSwitch CI |
aaf0be |
[1], [], [ovs-vsctl: "remove" operation would put 0 values in column targets of table NetFlow but the minimum number is 1
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
46abaa |
diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at
|
|
Open vSwitch CI |
46abaa |
index 5a7e76eaa..9d28672ef 100644
|
|
Open vSwitch CI |
46abaa |
--- a/tests/ovsdb-idl.at
|
|
Open vSwitch CI |
46abaa |
+++ b/tests/ovsdb-idl.at
|
|
Open vSwitch CI |
46abaa |
@@ -94,7 +94,7 @@ m4_define([OVSDB_CHECK_IDL_WRITE_CHANGED_ONLY_C],
|
|
Open vSwitch CI |
46abaa |
AT_CHECK([ovsdb_start_idltest])
|
|
Open vSwitch CI |
46abaa |
m4_if([$2], [], [],
|
|
Open vSwitch CI |
46abaa |
[AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
|
|
Open vSwitch CI |
46abaa |
- AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3],
|
|
Open vSwitch CI |
46abaa |
+ AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 --write-changed-only idl unix:socket $3],
|
|
Open vSwitch CI |
46abaa |
[0], [stdout], [ignore])
|
|
Open vSwitch CI |
46abaa |
AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
|
|
Open vSwitch CI |
46abaa |
[0], [$4])
|
|
Open vSwitch CI |
46abaa |
@@ -1216,7 +1216,7 @@ m4_define([OVSDB_CHECK_IDL_TRACK_WRITE_CHANGED_ONLY_C],
|
|
Open vSwitch CI |
46abaa |
AT_CHECK([ovsdb_start_idltest])
|
|
Open vSwitch CI |
46abaa |
m4_if([$2], [], [],
|
|
Open vSwitch CI |
46abaa |
[AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
|
|
Open vSwitch CI |
46abaa |
- AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c -w idl unix:socket $3],
|
|
Open vSwitch CI |
46abaa |
+ AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c --write-changed-only idl unix:socket $3],
|
|
Open vSwitch CI |
46abaa |
[0], [stdout], [ignore])
|
|
Open vSwitch CI |
46abaa |
AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
|
|
Open vSwitch CI |
46abaa |
[0], [$4])
|
|
Open vSwitch CI |
7eac84 |
diff --git a/tests/ovsdb-monitor.at b/tests/ovsdb-monitor.at
|
|
Open vSwitch CI |
7eac84 |
index 3b622b3ec..82b0e9362 100644
|
|
Open vSwitch CI |
7eac84 |
--- a/tests/ovsdb-monitor.at
|
|
Open vSwitch CI |
7eac84 |
+++ b/tests/ovsdb-monitor.at
|
|
Open vSwitch CI |
7eac84 |
@@ -1011,3 +1011,69 @@ row,action,name,number,_version
|
|
Open vSwitch CI |
7eac84 |
]], [ignore])
|
|
Open vSwitch CI |
7eac84 |
AT_CLEANUP
|
|
Open vSwitch CI |
7eac84 |
|
|
Open vSwitch CI |
7eac84 |
+AT_SETUP([monitor-cond initial reply with condition on non-monitored column])
|
|
Open vSwitch CI |
7eac84 |
+AT_KEYWORDS([ovsdb server monitor monitor-cond positive initial non-monitored])
|
|
Open vSwitch CI |
7eac84 |
+
|
|
Open vSwitch CI |
7eac84 |
+ordinal_schema > schema
|
|
Open vSwitch CI |
7eac84 |
+AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
|
|
Open vSwitch CI |
7eac84 |
+on_exit 'kill `cat ovsdb-server.pid`'
|
|
Open vSwitch CI |
7eac84 |
+AT_CAPTURE_FILE([ovsdb-server.log])
|
|
Open vSwitch CI |
7eac84 |
+AT_CHECK([ovsdb-server --detach --no-chdir --pidfile \
|
|
Open vSwitch CI |
7eac84 |
+ --remote=punix:socket --log-file db], [0], [ignore], [ignore])
|
|
Open vSwitch CI |
7eac84 |
+
|
|
Open vSwitch CI |
7eac84 |
+dnl Initialize the database content.
|
|
Open vSwitch CI |
7eac84 |
+for txn in m4_foreach([txn], [[[["ordinals",
|
|
Open vSwitch CI |
7eac84 |
+ {"op": "insert",
|
|
Open vSwitch CI |
7eac84 |
+ "table": "ordinals",
|
|
Open vSwitch CI |
7eac84 |
+ "row": {"number": 0, "name": "zero"}},
|
|
Open vSwitch CI |
7eac84 |
+ {"op": "insert",
|
|
Open vSwitch CI |
7eac84 |
+ "table": "ordinals",
|
|
Open vSwitch CI |
7eac84 |
+ "row": {"number": 1, "name": "one"}},
|
|
Open vSwitch CI |
7eac84 |
+ {"op": "insert",
|
|
Open vSwitch CI |
7eac84 |
+ "table": "ordinals",
|
|
Open vSwitch CI |
7eac84 |
+ "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
|
|
Open vSwitch CI |
7eac84 |
+ AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
|
|
Open vSwitch CI |
7eac84 |
+done
|
|
Open vSwitch CI |
7eac84 |
+
|
|
Open vSwitch CI |
7eac84 |
+dnl Start a first client that monitors only the column 'name'.
|
|
Open vSwitch CI |
7eac84 |
+on_exit 'kill `cat client-1.pid`'
|
|
Open vSwitch CI |
7eac84 |
+AT_CAPTURE_FILE([client-1.out])
|
|
Open vSwitch CI |
7eac84 |
+AT_CHECK([ovsdb-client -vjsonrpc --pidfile=client-1.pid --detach --no-chdir \
|
|
Open vSwitch CI |
7eac84 |
+ -d json monitor-cond --format=csv unix:socket \
|
|
Open vSwitch CI |
7eac84 |
+ ordinals '[[true]]' ordinals ["name"] \
|
|
Open vSwitch CI |
7eac84 |
+ > client-1.out 2> client-1.err], [0], [ignore], [ignore])
|
|
Open vSwitch CI |
7eac84 |
+dnl Wait for the initial monitor reply.
|
|
Open vSwitch CI |
7eac84 |
+OVS_WAIT_UNTIL([grep -q 'initial' client-1.out])
|
|
Open vSwitch CI |
7eac84 |
+
|
|
Open vSwitch CI |
7eac84 |
+dnl Start a second client that monitors the column 'name', but has a condition
|
|
Open vSwitch CI |
7eac84 |
+dnl on column 'number'.
|
|
Open vSwitch CI |
7eac84 |
+on_exit 'kill `cat client-2.pid`'
|
|
Open vSwitch CI |
7eac84 |
+AT_CAPTURE_FILE([client-2.out])
|
|
Open vSwitch CI |
7eac84 |
+AT_CHECK([ovsdb-client -vjsonrpc --pidfile=client-2.pid --detach --no-chdir \
|
|
Open vSwitch CI |
7eac84 |
+ -d json monitor-cond --format=csv unix:socket \
|
|
Open vSwitch CI |
7eac84 |
+ ordinals '[[["number", "!=", 1]]]' ordinals ["name"] \
|
|
Open vSwitch CI |
7eac84 |
+ > client-2.out 2> client-2.err], [0], [ignore], [ignore])
|
|
Open vSwitch CI |
7eac84 |
+dnl Wait for the initial monitor reply.
|
|
Open vSwitch CI |
7eac84 |
+OVS_WAIT_UNTIL([grep -q 'initial' client-2.out])
|
|
Open vSwitch CI |
7eac84 |
+
|
|
Open vSwitch CI |
7eac84 |
+OVSDB_SERVER_SHUTDOWN
|
|
Open vSwitch CI |
7eac84 |
+OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && \
|
|
Open vSwitch CI |
7eac84 |
+ test ! -e client-1.pid && test ! -e client-2.pid])
|
|
Open vSwitch CI |
7eac84 |
+
|
|
Open vSwitch CI |
7eac84 |
+dnl The first client should have all the names.
|
|
Open vSwitch CI |
7eac84 |
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < client-1.out | uuidfilt],
|
|
Open vSwitch CI |
7eac84 |
+ [0], [dnl
|
|
Open vSwitch CI |
7eac84 |
+row,action,name
|
|
Open vSwitch CI |
7eac84 |
+<0>,initial,"""one"""
|
|
Open vSwitch CI |
7eac84 |
+<1>,initial,"""two"""
|
|
Open vSwitch CI |
7eac84 |
+<2>,initial,"""zero"""
|
|
Open vSwitch CI |
7eac84 |
+])
|
|
Open vSwitch CI |
7eac84 |
+
|
|
Open vSwitch CI |
7eac84 |
+dnl The second client should not have the name 'one'.
|
|
Open vSwitch CI |
7eac84 |
+AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < client-2.out | uuidfilt],
|
|
Open vSwitch CI |
7eac84 |
+ [0], [dnl
|
|
Open vSwitch CI |
7eac84 |
+row,action,name
|
|
Open vSwitch CI |
7eac84 |
+<0>,initial,"""two"""
|
|
Open vSwitch CI |
7eac84 |
+<1>,initial,"""zero"""
|
|
Open vSwitch CI |
7eac84 |
+])
|
|
Open vSwitch CI |
7eac84 |
+AT_CLEANUP
|
|
Open vSwitch CI |
db9a9b |
diff --git a/tests/ovsdb-tool.at b/tests/ovsdb-tool.at
|
|
Open vSwitch CI |
db9a9b |
index 12ad6fb3f..5496ccda7 100644
|
|
Open vSwitch CI |
db9a9b |
--- a/tests/ovsdb-tool.at
|
|
Open vSwitch CI |
db9a9b |
+++ b/tests/ovsdb-tool.at
|
|
Open vSwitch CI |
db9a9b |
@@ -465,6 +465,7 @@ AT_SETUP([ovsdb-tool convert-to-standalone])
|
|
Open vSwitch CI |
db9a9b |
AT_KEYWORDS([ovsdb file positive])
|
|
Open vSwitch CI |
db9a9b |
ordinal_schema > schema
|
|
Open vSwitch CI |
db9a9b |
AT_CHECK([ovsdb-tool create-cluster db schema unix:s1.raft], [0], [stdout], [ignore])
|
|
Open vSwitch CI |
db9a9b |
+on_exit 'kill `cat ovsdb-server.pid`'
|
|
Open vSwitch CI |
db9a9b |
AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file db >/dev/null 2>&1])
|
|
Open vSwitch CI |
db9a9b |
for txn in m4_foreach([txn], [[[["ordinals",
|
|
Open vSwitch CI |
db9a9b |
{"op": "insert",
|
|
Open vSwitch CI |
db9a9b |
@@ -498,3 +499,71 @@ OVS_APP_EXIT_AND_WAIT([ovsdb-server])
|
|
Open vSwitch CI |
db9a9b |
# Make sure both standalone and cluster db data matches.
|
|
Open vSwitch CI |
db9a9b |
AT_CHECK([diff standalonedump clusterdump])
|
|
Open vSwitch CI |
db9a9b |
AT_CLEANUP
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+AT_SETUP([ovsdb-tool convert-to-standalone after schema conversion])
|
|
Open vSwitch CI |
db9a9b |
+AT_KEYWORDS([ovsdb file positive])
|
|
Open vSwitch CI |
db9a9b |
+ordinal_schema > schema
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([ovsdb-tool create-cluster db schema unix:s1.raft], [0], [stdout], [ignore])
|
|
Open vSwitch CI |
db9a9b |
+on_exit 'kill `cat ovsdb-server.pid`'
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket dnl
|
|
Open vSwitch CI |
db9a9b |
+ --log-file db >/dev/null 2>&1])
|
|
Open vSwitch CI |
db9a9b |
+for txn in m4_foreach([txn], [[[["ordinals",
|
|
Open vSwitch CI |
db9a9b |
+ {"op": "insert",
|
|
Open vSwitch CI |
db9a9b |
+ "table": "ordinals",
|
|
Open vSwitch CI |
db9a9b |
+ "row": {"number": 0, "name": "zero"}},
|
|
Open vSwitch CI |
db9a9b |
+ {"op": "insert",
|
|
Open vSwitch CI |
db9a9b |
+ "table": "ordinals",
|
|
Open vSwitch CI |
db9a9b |
+ "row": {"number": 1, "name": "one"}},
|
|
Open vSwitch CI |
db9a9b |
+ {"op": "insert",
|
|
Open vSwitch CI |
db9a9b |
+ "table": "ordinals",
|
|
Open vSwitch CI |
db9a9b |
+ "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
|
|
Open vSwitch CI |
db9a9b |
+ AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
|
|
Open vSwitch CI |
db9a9b |
+done
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+dnl Change the schema.
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([sed 's/5\.1\.3/5.1.4/' < schema > schema2])
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([sed -i'back' -e '/.*"number":.*/a \
|
|
Open vSwitch CI |
db9a9b |
+ "is_seven": {"type": "boolean"},
|
|
Open vSwitch CI |
db9a9b |
+ ' schema2])
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+dnl Convert the database.
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([ovsdb-client convert unix:socket schema2])
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+dnl Add a new row with a new column.
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([ovsdb-client transact unix:socket dnl
|
|
Open vSwitch CI |
db9a9b |
+ '[["ordinals",
|
|
Open vSwitch CI |
db9a9b |
+ {"op": "insert",
|
|
Open vSwitch CI |
db9a9b |
+ "table": "ordinals",
|
|
Open vSwitch CI |
db9a9b |
+ "row": {"number": 7, "name": "seven", "is_seven": true}
|
|
Open vSwitch CI |
db9a9b |
+ }]]'], [0], [ignore], [ignore])
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([ovsdb-client dump unix:socket > clusterdump])
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([uuidfilt clusterdump], [0], [dnl
|
|
Open vSwitch CI |
db9a9b |
+ordinals table
|
|
Open vSwitch CI |
db9a9b |
+_uuid is_seven name number
|
|
Open vSwitch CI |
db9a9b |
+------------------------------------ -------- ----- ------
|
|
Open vSwitch CI |
db9a9b |
+<0> false one 1
|
|
Open vSwitch CI |
db9a9b |
+<1> false two 2
|
|
Open vSwitch CI |
db9a9b |
+<2> false zero 0
|
|
Open vSwitch CI |
db9a9b |
+<3> true seven 7
|
|
Open vSwitch CI |
db9a9b |
+])
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+dnl Convert to standalone database from clustered database.
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK(ovsdb-tool cluster-to-standalone db1 db)
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+dnl Check it's a standalone db.
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([ovsdb-tool db-is-standalone db1])
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+dnl Dump the standalone db data.
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([ovsdb-server -vconsole:off -vfile -vvlog:off --detach --no-chdir dnl
|
|
Open vSwitch CI |
db9a9b |
+ --pidfile --log-file --remote=punix:db.sock db1])
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([ovsdb_client_wait ordinals connected])
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([ovsdb-client dump > standalonedump])
|
|
Open vSwitch CI |
db9a9b |
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
|
|
Open vSwitch CI |
db9a9b |
+
|
|
Open vSwitch CI |
db9a9b |
+dnl Make sure both standalone and cluster db data matches.
|
|
Open vSwitch CI |
db9a9b |
+AT_CHECK([diff standalonedump clusterdump])
|
|
Open vSwitch CI |
db9a9b |
+AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
diff --git a/tests/packet-type-aware.at b/tests/packet-type-aware.at
|
|
Open vSwitch CI |
aaf0be |
index 3b5c66fe5..d63528e69 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/tests/packet-type-aware.at
|
|
Open vSwitch CI |
aaf0be |
+++ b/tests/packet-type-aware.at
|
|
Open vSwitch CI |
aaf0be |
@@ -1021,7 +1021,7 @@ AT_CHECK([
|
|
Open vSwitch CI |
aaf0be |
], [0], [flow-dump from the main thread:
|
|
Open vSwitch CI |
aaf0be |
recirc_id(0),in_port(p0),packet_type(ns=0,id=0),eth(src=aa:bb:cc:00:00:02,dst=aa:bb:cc:00:00:01),eth_type(0x0800),ipv4(dst=20.0.0.1,proto=47,frag=no), packets:3, bytes:378, used:0.0s, actions:tnl_pop(gre_sys)
|
|
Open vSwitch CI |
aaf0be |
tunnel(src=20.0.0.2,dst=20.0.0.1,flags(-df-csum)),recirc_id(0),in_port(gre_sys),packet_type(ns=1,id=0x8847),eth_type(0x8847),mpls(label=999/0x0,tc=0/0,ttl=64/0x0,bos=1/1), packets:3, bytes:264, used:0.0s, actions:push_eth(src=00:00:00:00:00:00,dst=00:00:00:00:00:00),pop_mpls(eth_type=0x800),recirc(0x1)
|
|
Open vSwitch CI |
aaf0be |
-tunnel(src=20.0.0.2,dst=20.0.0.1,flags(-df-csum)),recirc_id(0x1),in_port(gre_sys),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(ttl=64,frag=no), packets:3, bytes:294, used:0.0s, actions:set(ipv4(ttl=63)),int-br
|
|
Open vSwitch CI |
aaf0be |
+tunnel(src=20.0.0.2,dst=20.0.0.1,flags(-df-csum)),recirc_id(0x1),in_port(gre_sys),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=1,ttl=64,frag=no), packets:3, bytes:294, used:0.0s, actions:set(ipv4(ttl=63)),int-br
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
ovs-appctl time/warp 1000
|
|
Open vSwitch CI |
772b08 |
diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at
|
|
Open vSwitch CI |
772b08 |
index 53fbc1320..3920f08a5 100644
|
|
Open vSwitch CI |
772b08 |
--- a/tests/system-dpdk-macros.at
|
|
Open vSwitch CI |
772b08 |
+++ b/tests/system-dpdk-macros.at
|
|
Open vSwitch CI |
772b08 |
@@ -42,7 +42,7 @@ m4_define([OVS_DPDK_START],
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_START_OVSDB()
|
|
Open vSwitch CI |
772b08 |
dnl Enable DPDK functionality
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true])
|
|
Open vSwitch CI |
772b08 |
- OVS_DPDK_START_VSWITCHD()
|
|
Open vSwitch CI |
772b08 |
+ OVS_DPDK_START_VSWITCHD($1)
|
|
Open vSwitch CI |
772b08 |
])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
# OVS_DPDK_START_OVSDB()
|
|
Open vSwitch CI |
772b08 |
@@ -72,7 +72,7 @@ m4_define([OVS_DPDK_START_OVSDB],
|
|
Open vSwitch CI |
772b08 |
#
|
|
Open vSwitch CI |
772b08 |
m4_define([OVS_DPDK_START_VSWITCHD],
|
|
Open vSwitch CI |
772b08 |
[dnl Change DPDK drivers log levels so that tests only catch errors
|
|
Open vSwitch CI |
772b08 |
- AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-extra=--log-level=pmd.*:error])
|
|
Open vSwitch CI |
772b08 |
+ AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-extra="--log-level=pmd.*:error $1"])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Start ovs-vswitchd.
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vswitchd --detach --no-chdir --pidfile --log-file -vvconn -vofproto_dpif -vunixctl], [0], [stdout], [stderr])
|
|
Open vSwitch CI |
772b08 |
diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at
|
|
Open vSwitch CI |
772b08 |
index cb6c6d590..0f58e8574 100644
|
|
Open vSwitch CI |
772b08 |
--- a/tests/system-dpdk.at
|
|
Open vSwitch CI |
772b08 |
+++ b/tests/system-dpdk.at
|
|
Open vSwitch CI |
772b08 |
@@ -32,7 +32,7 @@ dnl Check if EAL init is successful
|
|
Open vSwitch CI |
772b08 |
AT_SETUP([OVS-DPDK - EAL init])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([grep "DPDK Enabled - initializing..." ovs-vswitchd.log], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([grep "EAL" ovs-vswitchd.log], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([grep "DPDK Enabled - initialized" ovs-vswitchd.log], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
@@ -69,7 +69,7 @@ dnl Add vhost-user-client port
|
|
Open vSwitch CI |
772b08 |
AT_SETUP([OVS-DPDK - add vhost-user-client port])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Add userspace bridge and attach it to OVS
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
@@ -98,7 +98,7 @@ AT_SETUP([OVS-DPDK - ping vhost-user ports])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Find number of sockets
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([lscpu], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
@@ -174,7 +174,7 @@ AT_SETUP([OVS-DPDK - ping vhost-user-client ports])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Find number of sockets
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([lscpu], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
@@ -309,7 +309,7 @@ AT_SETUP([OVS-DPDK - Ingress policing create delete vport port])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Add userspace bridge and attach it to OVS and add ingress policer
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
@@ -352,7 +352,7 @@ AT_SETUP([OVS-DPDK - Ingress policing no policing rate])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Add userspace bridge and attach it to OVS and add ingress policer
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
@@ -393,7 +393,7 @@ AT_SETUP([OVS-DPDK - Ingress policing no policing burst])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Add userspace bridge and attach it to OVS and add ingress policer
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
@@ -465,7 +465,7 @@ AT_SETUP([OVS-DPDK - QoS create delete vport port])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Add userspace bridge and attach it to OVS and add egress policer
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
@@ -506,7 +506,7 @@ AT_SETUP([OVS-DPDK - QoS no cir])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Add userspace bridge and attach it to OVS and add egress policer
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
@@ -541,7 +541,7 @@ AT_SETUP([OVS-DPDK - QoS no cbs])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Add userspace bridge and attach it to OVS and add egress policer
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
@@ -661,7 +661,7 @@ AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Find number of sockets
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([lscpu], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
@@ -717,7 +717,7 @@ AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Find number of sockets
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([lscpu], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
@@ -856,7 +856,7 @@ AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Find number of sockets
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([lscpu], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
@@ -908,7 +908,7 @@ AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
dnl Find number of sockets
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([lscpu], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
@@ -963,7 +963,7 @@ dnl MFEX Autovalidator
|
|
Open vSwitch CI |
772b08 |
AT_SETUP([OVS-DPDK - MFEX Autovalidator])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep "True"], [], [dnl
|
|
Open vSwitch CI |
772b08 |
])
|
|
Open vSwitch CI |
772b08 |
@@ -996,7 +996,7 @@ dnl MFEX Autovalidator Fuzzy
|
|
Open vSwitch CI |
772b08 |
AT_SETUP([OVS-DPDK - MFEX Autovalidator Fuzzy])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([! ovs-appctl dpif-netdev/miniflow-parser-get | sed 1,4d | grep "True"], [], [dnl
|
|
Open vSwitch CI |
772b08 |
])
|
|
Open vSwitch CI |
772b08 |
@@ -1032,7 +1032,7 @@ AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], [])
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([$PYTHON3 $srcdir/mfex_fuzzy.py test_traffic.pcap 1], [], [stdout])
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START([--no-pci])
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=0x1])
|
|
Open vSwitch CI |
772b08 |
dnl Add userspace bridge and attach it to OVS
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev])
|
|
Open vSwitch CI |
772b08 |
@@ -1153,7 +1153,7 @@ AT_SETUP([OVS-DPDK - user configured mempool])
|
|
Open vSwitch CI |
772b08 |
AT_KEYWORDS([dpdk])
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_PRE_CHECK()
|
|
Open vSwitch CI |
772b08 |
OVS_DPDK_START_OVSDB()
|
|
Open vSwitch CI |
772b08 |
-OVS_DPDK_START_VSWITCHD()
|
|
Open vSwitch CI |
772b08 |
+OVS_DPDK_START_VSWITCHD([--no-pci])
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:shared-mempool-config=8000,6000,1500])
|
|
Open vSwitch CI |
772b08 |
AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true])
|
|
Open vSwitch CI |
aaf0be |
diff --git a/tests/system-interface.at b/tests/system-interface.at
|
|
Open vSwitch CI |
aaf0be |
index 784bada12..3bf339582 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/tests/system-interface.at
|
|
Open vSwitch CI |
aaf0be |
+++ b/tests/system-interface.at
|
|
Open vSwitch CI |
aaf0be |
@@ -63,3 +63,62 @@ AT_CHECK([
|
|
Open vSwitch CI |
aaf0be |
[stdout], [Device "br-p1" does not exist.]
|
|
Open vSwitch CI |
aaf0be |
)
|
|
Open vSwitch CI |
aaf0be |
AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_SETUP([interface - datapath ports garbage collection])
|
|
Open vSwitch CI |
aaf0be |
+OVS_CHECK_GENEVE()
|
|
Open vSwitch CI |
aaf0be |
+OVS_TRAFFIC_VSWITCHD_START()
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Not relevant for userspace datapath.
|
|
Open vSwitch CI |
aaf0be |
+AT_SKIP_IF([! ovs-appctl dpctl/show | grep -q ovs-system])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-vsctl add-port br0 tunnel_port dnl
|
|
Open vSwitch CI |
aaf0be |
+ -- set Interface tunnel_port dnl
|
|
Open vSwitch CI |
aaf0be |
+ type=geneve options:remote_ip=flow options:key=123])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ip link add ovs-veth0 type veth peer name ovs-veth1])
|
|
Open vSwitch CI |
aaf0be |
+on_exit 'ip link del ovs-veth0'
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-vsctl add-port br0 ovs-veth0])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+OVS_WAIT_UNTIL([ip link show | grep -q " genev_sys_[[0-9]]*: .* ovs-system "])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Store the output of ip link for geneve port to compare ifindex later.
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ip link show | grep " genev_sys_[[0-9]]*: .* ovs-system " > geneve.0])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/show | grep port], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+ port 0: ovs-system (internal)
|
|
Open vSwitch CI |
aaf0be |
+ port 1: br0 (internal)
|
|
Open vSwitch CI |
aaf0be |
+ port 2: genev_sys_6081 (geneve: packet_type=ptap)
|
|
Open vSwitch CI |
aaf0be |
+ port 3: ovs-veth0
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+OVS_APP_EXIT_AND_WAIT_BY_TARGET([ovs-vswitchd], [ovs-vswitchd.pid])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Check that geneve backing interface is still in the datapath.
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ip link show | grep " genev_sys_[[0-9]]*: .* ovs-system " | diff -u - geneve.0])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Remove the veth port from the database while ovs-vswitchd is down.
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-vsctl --no-wait del-port ovs-veth0])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Check that it is still tied to the OVS datapath.
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ip link show ovs-veth0 | grep -q ovs-system])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Bring ovs-vswitchd back up.
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-vswitchd --detach --no-chdir --pidfile --log-file -vdpif:dbg],
|
|
Open vSwitch CI |
aaf0be |
+ [0], [], [stderr])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Wait for the veth port to be removed from the datapath.
|
|
Open vSwitch CI |
aaf0be |
+OVS_WAIT_WHILE([ip link show ovs-veth0 | grep -q ovs-system])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/show | grep port], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+ port 0: ovs-system (internal)
|
|
Open vSwitch CI |
aaf0be |
+ port 1: br0 (internal)
|
|
Open vSwitch CI |
aaf0be |
+ port 2: genev_sys_6081 (geneve: packet_type=ptap)
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Check that geneve backing interface is still in the datapath and it wasn't
|
|
Open vSwitch CI |
aaf0be |
+dnl re-created, i.e. the ifindex is the same.
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ip link show | grep " genev_sys_[[0-9]]*: .* ovs-system " | diff -u - geneve.0])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+OVS_TRAFFIC_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
+AT_CLEANUP
|
|
Open vSwitch CI |
772b08 |
diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at
|
|
Open vSwitch CI |
772b08 |
index 11920e60b..1f9950f83 100644
|
|
Open vSwitch CI |
772b08 |
--- a/tests/system-kmod-macros.at
|
|
Open vSwitch CI |
772b08 |
+++ b/tests/system-kmod-macros.at
|
|
Open vSwitch CI |
772b08 |
@@ -224,3 +224,13 @@ m4_define([VSCTL_ADD_DATAPATH_TABLE],
|
|
Open vSwitch CI |
772b08 |
# or necessary for the userspace datapath as it is checking for a kernel
|
|
Open vSwitch CI |
772b08 |
# specific regression.
|
|
Open vSwitch CI |
772b08 |
m4_define([CHECK_L3L4_CONNTRACK_REASM])
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
+# OVS_CHECK_BAREUDP()
|
|
Open vSwitch CI |
772b08 |
+#
|
|
Open vSwitch CI |
772b08 |
+# The feature needs to be enabled in the kernel configuration (CONFIG_BAREUDP)
|
|
Open vSwitch CI |
772b08 |
+# to work.
|
|
Open vSwitch CI |
772b08 |
+m4_define([OVS_CHECK_BAREUDP],
|
|
Open vSwitch CI |
772b08 |
+[
|
|
Open vSwitch CI |
772b08 |
+ AT_SKIP_IF([! ip link add dev ovs_bareudp0 type bareudp dstport 6635 ethertype mpls_uc 2>&1 >/dev/null])
|
|
Open vSwitch CI |
772b08 |
+ AT_CHECK([ip link del dev ovs_bareudp0])
|
|
Open vSwitch CI |
772b08 |
+])
|
|
Open vSwitch CI |
772b08 |
diff --git a/tests/system-layer3-tunnels.at b/tests/system-layer3-tunnels.at
|
|
Open vSwitch CI |
772b08 |
index c37852b21..81123f730 100644
|
|
Open vSwitch CI |
772b08 |
--- a/tests/system-layer3-tunnels.at
|
|
Open vSwitch CI |
772b08 |
+++ b/tests/system-layer3-tunnels.at
|
|
Open vSwitch CI |
772b08 |
@@ -154,7 +154,7 @@ OVS_VSWITCHD_STOP
|
|
Open vSwitch CI |
772b08 |
AT_CLEANUP
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
AT_SETUP([layer3 - ping over MPLS Bareudp])
|
|
Open vSwitch CI |
772b08 |
-OVS_CHECK_MIN_KERNEL(5, 7)
|
|
Open vSwitch CI |
772b08 |
+OVS_CHECK_BAREUDP()
|
|
Open vSwitch CI |
772b08 |
OVS_TRAFFIC_VSWITCHD_START([_ADD_BR([br1])])
|
|
Open vSwitch CI |
772b08 |
ADD_NAMESPACES(at_ns0, at_ns1)
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
@@ -202,7 +202,7 @@ OVS_TRAFFIC_VSWITCHD_STOP
|
|
Open vSwitch CI |
772b08 |
AT_CLEANUP
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
AT_SETUP([layer3 - ping over Bareudp])
|
|
Open vSwitch CI |
772b08 |
-OVS_CHECK_MIN_KERNEL(5, 7)
|
|
Open vSwitch CI |
772b08 |
+OVS_CHECK_BAREUDP()
|
|
Open vSwitch CI |
772b08 |
OVS_TRAFFIC_VSWITCHD_START([_ADD_BR([br1])])
|
|
Open vSwitch CI |
772b08 |
ADD_NAMESPACES(at_ns0, at_ns1)
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
aaf0be |
diff --git a/tests/system-offloads-traffic.at b/tests/system-offloads-traffic.at
|
|
Open vSwitch CI |
aaf0be |
index d36da0580..8dd3bdf88 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/tests/system-offloads-traffic.at
|
|
Open vSwitch CI |
aaf0be |
+++ b/tests/system-offloads-traffic.at
|
|
Open vSwitch CI |
aaf0be |
@@ -742,3 +742,118 @@ recirc_id(<recirc>),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:29, bytes
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
OVS_TRAFFIC_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_SETUP([offloads - offload flow to none-offload])
|
|
Open vSwitch CI |
aaf0be |
+OVS_TRAFFIC_VSWITCHD_START([], [], [-- set Open_vSwitch . other_config:hw-offload=true])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ADD_NAMESPACES(at_ns0, at_ns1)
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24")
|
|
Open vSwitch CI |
aaf0be |
+ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24")
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_DATA([flows.txt], [dnl
|
|
Open vSwitch CI |
aaf0be |
+add in_port=ovs-p0,actions=ovs-p1
|
|
Open vSwitch CI |
aaf0be |
+add in_port=ovs-p1,actions=ovs-p0
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [ping -q -c 10 -i 0.1 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+10 packets transmitted, 10 received, 0% packet loss, time 0ms
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-flows type=tc | grep "eth_type(0x0800)" | sort | strip_recirc | strip_used], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(<recirc>),in_port(2),eth(),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:756, used:0.0s, actions:3
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(<recirc>),in_port(3),eth(),eth_type(0x0800),ipv4(frag=no), packets:9, bytes:756, used:0.0s, actions:2
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Here we use an output action with truncate, which will force a kernel flow.
|
|
Open vSwitch CI |
aaf0be |
+AT_DATA([flows2.txt], [dnl
|
|
Open vSwitch CI |
aaf0be |
+modify in_port=ovs-p0,actions=output(port=ovs-p1, max_len=128)
|
|
Open vSwitch CI |
aaf0be |
+modify in_port=ovs-p1,actions=output(port=ovs-p0, max_len=128)
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl add-flows br0 flows2.txt])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl revalidator/wait], [0])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [ping -q -c 10 -i 0.1 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+10 packets transmitted, 10 received, 0% packet loss, time 0ms
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-flows type=ovs | grep "eth_type(0x0800)" | sort | strip_recirc | strip_used], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(<recirc>),in_port(2),eth(),eth_type(0x0800),ipv4(frag=no), packets:10, bytes:980, used:0.0s, actions:trunc(128),3
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(<recirc>),in_port(3),eth(),eth_type(0x0800),ipv4(frag=no), packets:10, bytes:980, used:0.0s, actions:trunc(128),2
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl revalidator/wait], [0])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [ping -q -c 10 -i 0.1 -w 2 10.1.1.2 | FORMAT_PING], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+10 packets transmitted, 10 received, 0% packet loss, time 0ms
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-flows type=tc | grep "eth_type(0x0800)" | sort | strip_recirc | strip_used], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(<recirc>),in_port(2),eth(),eth_type(0x0800),ipv4(frag=no), packets:10, bytes:840, used:0.0s, actions:3
|
|
Open vSwitch CI |
aaf0be |
+recirc_id(<recirc>),in_port(3),eth(),eth_type(0x0800),ipv4(frag=no), packets:10, bytes:840, used:0.0s, actions:2
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl coverage/read-counter ukey_invalid_stat_reset], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+0
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+OVS_TRAFFIC_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
+AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_SETUP([offloads - delete ufid mapping if device not exist - offloads enabled])
|
|
Open vSwitch CI |
aaf0be |
+OVS_TRAFFIC_VSWITCHD_START([], [], [-- set Open_vSwitch . other_config:hw-offload=true])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ADD_NAMESPACES(at_ns0, at_ns1, at_ns2)
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Disable IPv6 to skip unexpected flow
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([sysctl -w net.ipv6.conf.br0.disable_ipv6=1], [0], [ignore])
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [sysctl -w net.ipv6.conf.all.disable_ipv6=1], [0], [ignore])
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns1], [sysctl -w net.ipv6.conf.all.disable_ipv6=1], [0], [ignore])
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns2], [sysctl -w net.ipv6.conf.all.disable_ipv6=1], [0], [ignore])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ADD_VETH(p0, at_ns0, br0, "10.1.1.1/24", "aa:1a:54:e9:c5:56")
|
|
Open vSwitch CI |
aaf0be |
+ADD_VETH(p1, at_ns1, br0, "10.1.1.2/24")
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [ping -q -c 2 -i 0.2 10.1.1.2 | FORMAT_PING], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+2 packets transmitted, 2 received, 0% packet loss, time 0ms
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Delete and add interface ovs-p0/p0
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ip link del dev ovs-p0])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ip link add p0 type veth peer name ovs-p0 || return 77])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ip link set p0 netns at_ns0])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ip link set dev ovs-p0 up])
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [ip addr add dev p0 "10.1.1.1/24"])
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [ip link set dev p0 up])
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [ip link set dev p0 address "aa:1a:54:e9:c5:56"])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl revalidator/purge], [0])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Generate flows to trigger the hmap expand once
|
|
Open vSwitch CI |
aaf0be |
+ADD_VETH(p2, at_ns2, br0, "10.1.1.3/24")
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [ping -q -c 2 -i 0.2 10.1.1.2 | FORMAT_PING], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+2 packets transmitted, 2 received, 0% packet loss, time 0ms
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+NS_CHECK_EXEC([at_ns0], [ping -q -c 2 -i 0.2 10.1.1.3 | FORMAT_PING], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+2 packets transmitted, 2 received, 0% packet loss, time 0ms
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl revalidator/purge], [0])
|
|
Open vSwitch CI |
aaf0be |
+dnl Fix purge fail occasionally
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl revalidator/purge], [0])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([test $(ovs-appctl dpctl/dump-flows | grep -c "eth_type(0x0800)") -eq 0], [0], [ignore])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+OVS_TRAFFIC_VSWITCHD_STOP(["/could not open network device ovs-p0/d
|
|
Open vSwitch CI |
aaf0be |
+/on nonexistent port/d
|
|
Open vSwitch CI |
aaf0be |
+/failed to flow_get/d
|
|
Open vSwitch CI |
aaf0be |
+/Failed to acquire udpif_key/d
|
|
Open vSwitch CI |
aaf0be |
+/No such device/d
|
|
Open vSwitch CI |
aaf0be |
+/failed to offload flow/d
|
|
Open vSwitch CI |
aaf0be |
+"])
|
|
Open vSwitch CI |
aaf0be |
+AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
diff --git a/tests/system-traffic.at b/tests/system-traffic.at
|
|
Open vSwitch CI |
aaf0be |
index 221d96aef..6678911b4 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/tests/system-traffic.at
|
|
Open vSwitch CI |
aaf0be |
+++ b/tests/system-traffic.at
|
|
Open vSwitch CI |
aaf0be |
@@ -2360,8 +2360,10 @@ priority=100,in_port=2,icmp,action=ct(zone=5,commit),1
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
+dp=$(ovs-appctl dpctl/dump-dps)
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
m4_foreach([FLUSH_CMD], [[ovs-appctl dpctl/flush-conntrack],
|
|
Open vSwitch CI |
aaf0be |
+ [ovs-appctl dpctl/flush-conntrack $dp],
|
|
Open vSwitch CI |
aaf0be |
[ovs-ofctl ct-flush br0]], [
|
|
Open vSwitch CI |
aaf0be |
AS_BOX([Testing with FLUSH_CMD])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
@@ -2504,8 +2506,48 @@ udp,orig=(src=10.1.1.2,dst=10.1.1.1,sport=2,dport=1),reply=(src=10.1.1.1,dst=10.
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([FLUSH_CMD zone=5 '' 'ct_nw_src=10.1.1.1'])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-appctl dpctl/dump-conntrack | grep "10\.1\.1\.1"], [1])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Test UDP from port 1 and 2, flush without arguments
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=1 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101010a0101020001000200080000 actions=resubmit(,0)"])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 "in_port=2 packet=50540000000a50540000000908004500001c000000000011a4cd0a0101020a0101010002000100080000 actions=resubmit(,0)"])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-conntrack | grep "10\.1\.1\.1" | sort], [0], [dnl
|
|
Open vSwitch CI |
aaf0be |
+udp,orig=(src=10.1.1.1,dst=10.1.1.2,sport=1,dport=2),reply=(src=10.1.1.2,dst=10.1.1.1,sport=2,dport=1)
|
|
Open vSwitch CI |
aaf0be |
+udp,orig=(src=10.1.1.2,dst=10.1.1.1,sport=2,dport=1),reply=(src=10.1.1.1,dst=10.1.1.2,sport=1,dport=2),zone=5
|
|
Open vSwitch CI |
aaf0be |
])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([FLUSH_CMD])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/dump-conntrack | grep "10\.1\.1\.1"], [1])
|
|
Open vSwitch CI |
aaf0be |
+])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+dnl Test flush with invalid arguments
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/flush-conntrack zone=invalid 'ct_nw_src=10.1.1.1' 'ct_nw_dst=10.1.1.1'], [2], [ignore], [stderr])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([grep -q "failed to parse zone" stderr])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/flush-conntrack zone=1 'ct_nw_src=10.1.1.1,invalid=invalid' 'ct_nw_dst=10.1.1.1'], [2], [ignore], [stderr])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([grep -q "invalid conntrack tuple field: invalid" stderr])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/flush-conntrack zone=1 'ct_nw_src=invalid' 'ct_nw_dst=10.1.1.1'], [2], [ignore], [stderr])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([grep -q "failed to parse field ct_nw_src" stderr])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/flush-conntrack zone=1 'ct_nw_src=10.1.1.1' 'ct_nw_dst=10.1.1.1' invalid], [2], [ignore], [stderr])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([grep -q "invalid arguments" stderr])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/flush-conntrack $dp zone=1 'ct_nw_src=10.1.1.1' 'ct_nw_dst=10.1.1.1' invalid], [2], [ignore], [stderr])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([grep -q "command takes at most 4 arguments" stderr])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-appctl dpctl/flush-conntrack $dp 'ct_nw_src=10.1.1.1' 'ct_nw_dst=10.1.1.1' invalid], [2], [ignore], [stderr])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([grep -q "invalid arguments" stderr])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl ct-flush br0 zone=1 'ct_nw_src=10.1.1.1' 'ct_nw_dst=10.1.1.1' invalid], [1], [ignore], [stderr])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([grep -q "command takes at most 4 arguments" stderr])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([ovs-ofctl ct-flush br0 'ct_nw_src=10.1.1.1' 'ct_nw_dst=10.1.1.1' invalid], [1], [ignore], [stderr])
|
|
Open vSwitch CI |
aaf0be |
+AT_CHECK([grep -q "Invalid arguments" stderr])
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
OVS_TRAFFIC_VSWITCHD_STOP
|
|
Open vSwitch CI |
aaf0be |
AT_CLEANUP
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
@@ -7220,7 +7262,7 @@ table=2,in_port=ovs-server,ip,ct_state=+trk+rpl,actions=output:ovs-client
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
rm server.pcap
|
|
Open vSwitch CI |
aaf0be |
-OVS_DAEMONIZE([tcpdump -l -U -i ovs-server -w server.pcap 2>tcpdump0_err], [tcpdump0.pid])
|
|
Open vSwitch CI |
aaf0be |
+NETNS_DAEMONIZE([server], [tcpdump -l -U -i server -w server.pcap 2>tcpdump0_err], [tcpdump0.pid])
|
|
Open vSwitch CI |
aaf0be |
OVS_WAIT_UNTIL([grep "listening" tcpdump0_err])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
dnl Send UDP client->server
|
|
Open vSwitch CI |
aaf0be |
@@ -7262,7 +7304,7 @@ dnl Check the ICMP error in reply direction
|
|
Open vSwitch CI |
aaf0be |
AT_CHECK([ovs-appctl dpctl/flush-conntrack zone=42])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
rm client.pcap
|
|
Open vSwitch CI |
aaf0be |
-OVS_DAEMONIZE([tcpdump -l -U -i ovs-client -w client.pcap 2>tcpdump1_err], [tcpdump1.pid])
|
|
Open vSwitch CI |
aaf0be |
+NETNS_DAEMONIZE([client], [tcpdump -l -U -i client -w client.pcap 2>tcpdump1_err], [tcpdump1.pid])
|
|
Open vSwitch CI |
aaf0be |
OVS_WAIT_UNTIL([grep "listening" tcpdump1_err])
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
dnl Send UDP client->server
|
|
Open vSwitch CI |
772b08 |
diff --git a/tests/system-userspace-macros.at b/tests/system-userspace-macros.at
|
|
Open vSwitch CI |
772b08 |
index b34a84775..40210f7fa 100644
|
|
Open vSwitch CI |
772b08 |
--- a/tests/system-userspace-macros.at
|
|
Open vSwitch CI |
772b08 |
+++ b/tests/system-userspace-macros.at
|
|
Open vSwitch CI |
772b08 |
@@ -325,3 +325,11 @@ m4_define([CHECK_L3L4_CONNTRACK_REASM],
|
|
Open vSwitch CI |
772b08 |
[
|
|
Open vSwitch CI |
772b08 |
AT_SKIP_IF([:])
|
|
Open vSwitch CI |
772b08 |
])
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
+# OVS_CHECK_BAREUDP()
|
|
Open vSwitch CI |
772b08 |
+#
|
|
Open vSwitch CI |
772b08 |
+# The userspace datapath does not support bareudp tunnels.
|
|
Open vSwitch CI |
772b08 |
+m4_define([OVS_CHECK_BAREUDP],
|
|
Open vSwitch CI |
772b08 |
+[
|
|
Open vSwitch CI |
772b08 |
+ AT_SKIP_IF([:])
|
|
Open vSwitch CI |
772b08 |
+])
|
|
Open vSwitch CI |
7f2e72 |
diff --git a/tests/testsuite.at b/tests/testsuite.at
|
|
Open vSwitch CI |
7f2e72 |
index cf4e3eadf..9d77a9f51 100644
|
|
Open vSwitch CI |
7f2e72 |
--- a/tests/testsuite.at
|
|
Open vSwitch CI |
7f2e72 |
+++ b/tests/testsuite.at
|
|
Open vSwitch CI |
7f2e72 |
@@ -77,3 +77,4 @@ m4_include([tests/packet-type-aware.at])
|
|
Open vSwitch CI |
7f2e72 |
m4_include([tests/nsh.at])
|
|
Open vSwitch CI |
7f2e72 |
m4_include([tests/drop-stats.at])
|
|
Open vSwitch CI |
7f2e72 |
m4_include([tests/pytest.at])
|
|
Open vSwitch CI |
7f2e72 |
+m4_include([tests/learning-switch.at])
|
|
Open vSwitch CI |
772b08 |
diff --git a/utilities/ovs-appctl-bashcomp.bash b/utilities/ovs-appctl-bashcomp.bash
|
|
Open vSwitch CI |
772b08 |
index 4384be8ae..0a9af1a18 100644
|
|
Open vSwitch CI |
772b08 |
--- a/utilities/ovs-appctl-bashcomp.bash
|
|
Open vSwitch CI |
772b08 |
+++ b/utilities/ovs-appctl-bashcomp.bash
|
|
Open vSwitch CI |
772b08 |
@@ -223,6 +223,13 @@ printf_stderr() {
|
|
Open vSwitch CI |
772b08 |
# The code below is taken from Peter Amidon. His change makes it more
|
|
Open vSwitch CI |
772b08 |
# robust.
|
|
Open vSwitch CI |
772b08 |
extract_bash_prompt() {
|
|
Open vSwitch CI |
772b08 |
+ # On Bash 4.4+ just use the @P expansion
|
|
Open vSwitch CI |
772b08 |
+ if ((BASH_VERSINFO[0] > 4 ||
|
|
Open vSwitch CI |
772b08 |
+ (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4))); then
|
|
Open vSwitch CI |
772b08 |
+ _BASH_PROMPT="${PS1@P}"
|
|
Open vSwitch CI |
772b08 |
+ return
|
|
Open vSwitch CI |
772b08 |
+ fi
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
local myPS1 v
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
myPS1="$(sed 's/Begin prompt/\\Begin prompt/; s/End prompt/\\End prompt/' <<< "$PS1")"
|
|
Open vSwitch CI |
aaf0be |
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
|
|
Open vSwitch CI |
aaf0be |
index eabec18a3..3ce4e82ec 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/utilities/ovs-ofctl.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/utilities/ovs-ofctl.c
|
|
Open vSwitch CI |
aaf0be |
@@ -3089,6 +3089,10 @@ ofctl_ct_flush(struct ovs_cmdl_context *ctx)
|
|
Open vSwitch CI |
aaf0be |
args--;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+ if (args > 0) {
|
|
Open vSwitch CI |
aaf0be |
+ ovs_fatal(0, "Invalid arguments");
|
|
Open vSwitch CI |
aaf0be |
+ }
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
open_vconn(ctx->argv[1], &vconn);
|
|
Open vSwitch CI |
aaf0be |
enum ofp_version version = vconn_get_version(vconn);
|
|
Open vSwitch CI |
aaf0be |
struct ofpbuf *msg = ofp_ct_match_encode(&match, pzone, version);
|
|
Open vSwitch CI |
bd45b6 |
diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
|
|
Open vSwitch CI |
bd45b6 |
index a49ec9f94..420c11eb8 100755
|
|
Open vSwitch CI |
bd45b6 |
--- a/utilities/ovs-tcpdump.in
|
|
Open vSwitch CI |
bd45b6 |
+++ b/utilities/ovs-tcpdump.in
|
|
Open vSwitch CI |
bd45b6 |
@@ -538,6 +538,17 @@ def main():
|
|
Open vSwitch CI |
bd45b6 |
print(data.decode('utf-8'))
|
|
Open vSwitch CI |
bd45b6 |
raise KeyboardInterrupt
|
|
Open vSwitch CI |
bd45b6 |
except KeyboardInterrupt:
|
|
Open vSwitch CI |
bd45b6 |
+ # If there is a pipe behind ovs-tcpdump (such as ovs-tcpdump
|
|
Open vSwitch CI |
bd45b6 |
+ # -i eth0 | grep "192.168.1.1"), the pipe is no longer available
|
|
Open vSwitch CI |
bd45b6 |
+ # after received Ctrl+C.
|
|
Open vSwitch CI |
bd45b6 |
+ # If we write data to an unavailable pipe, a pipe error will be
|
|
Open vSwitch CI |
bd45b6 |
+ # reported, so we turn off stdout to avoid subsequent flushing
|
|
Open vSwitch CI |
bd45b6 |
+ # of data into the pipe.
|
|
Open vSwitch CI |
bd45b6 |
+ try:
|
|
Open vSwitch CI |
bd45b6 |
+ sys.stdout.close()
|
|
Open vSwitch CI |
bd45b6 |
+ except IOError:
|
|
Open vSwitch CI |
bd45b6 |
+ pass
|
|
Open vSwitch CI |
bd45b6 |
+
|
|
Open vSwitch CI |
bd45b6 |
if pipes.poll() is None:
|
|
Open vSwitch CI |
bd45b6 |
pipes.terminate()
|
|
Open vSwitch CI |
bd45b6 |
|
|
Open vSwitch CI |
772b08 |
diff --git a/utilities/ovs-vsctl-bashcomp.bash b/utilities/ovs-vsctl-bashcomp.bash
|
|
Open vSwitch CI |
772b08 |
index fc8245bfb..c5ad24fb7 100644
|
|
Open vSwitch CI |
772b08 |
--- a/utilities/ovs-vsctl-bashcomp.bash
|
|
Open vSwitch CI |
772b08 |
+++ b/utilities/ovs-vsctl-bashcomp.bash
|
|
Open vSwitch CI |
772b08 |
@@ -413,6 +413,13 @@ _ovs_vsctl_get_PS1 () {
|
|
Open vSwitch CI |
772b08 |
return;
|
|
Open vSwitch CI |
772b08 |
fi
|
|
Open vSwitch CI |
772b08 |
|
|
Open vSwitch CI |
772b08 |
+ # On Bash 4.4+ just use the @P expansion
|
|
Open vSwitch CI |
772b08 |
+ if ((BASH_VERSINFO[0] > 4 ||
|
|
Open vSwitch CI |
772b08 |
+ (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4))); then
|
|
Open vSwitch CI |
772b08 |
+ printf '%s\n' "${PS1@P}"
|
|
Open vSwitch CI |
772b08 |
+ return
|
|
Open vSwitch CI |
772b08 |
+ fi
|
|
Open vSwitch CI |
772b08 |
+
|
|
Open vSwitch CI |
772b08 |
# Original inspiration from
|
|
Open vSwitch CI |
772b08 |
# http://stackoverflow.com/questions/10060500/bash-how-to-evaluate-ps1-ps2,
|
|
Open vSwitch CI |
772b08 |
# but changed quite a lot to make it more robust.
|
|
Open vSwitch CI |
aaf0be |
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
|
|
Open vSwitch CI |
aaf0be |
index bfb2adef1..0deca14b9 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/vswitchd/bridge.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/vswitchd/bridge.c
|
|
Open vSwitch CI |
aaf0be |
@@ -832,6 +832,9 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
|
|
Open vSwitch CI |
aaf0be |
ofproto_set_min_revalidate_pps(
|
|
Open vSwitch CI |
aaf0be |
smap_get_uint(&ovs_cfg->other_config, "min-revalidate-pps",
|
|
Open vSwitch CI |
aaf0be |
OFPROTO_MIN_REVALIDATE_PPS_DEFAULT));
|
|
Open vSwitch CI |
aaf0be |
+ ofproto_set_offloaded_stats_delay(
|
|
Open vSwitch CI |
aaf0be |
+ smap_get_uint(&ovs_cfg->other_config, "offloaded-stats-delay",
|
|
Open vSwitch CI |
aaf0be |
+ OFPROTO_OFFLOADED_STATS_DELAY));
|
|
Open vSwitch CI |
aaf0be |
ofproto_set_vlan_limit(smap_get_int(&ovs_cfg->other_config, "vlan-limit",
|
|
Open vSwitch CI |
aaf0be |
LEGACY_MAX_VLAN_HEADERS));
|
|
Open vSwitch CI |
aaf0be |
ofproto_set_bundle_idle_timeout(smap_get_uint(&ovs_cfg->other_config,
|
|
Open vSwitch CI |
aaf0be |
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
|
|
Open vSwitch CI |
aaf0be |
index 2b57fc0e3..1204805b1 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/vswitchd/vswitch.xml
|
|
Open vSwitch CI |
aaf0be |
+++ b/vswitchd/vswitch.xml
|
|
Open vSwitch CI |
aaf0be |
@@ -215,6 +215,19 @@
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
</column>
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ type='{"type": "integer", "minInteger": 0}'>
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ Set worst case delay (in ms) it might take before statistics of
|
|
Open vSwitch CI |
aaf0be |
+ offloaded flows are updated. Offloaded flows younger than this
|
|
Open vSwitch CI |
aaf0be |
+ delay will always be revalidated regardless of
|
|
Open vSwitch CI |
aaf0be |
+ <ref column="other_config" key="min-revalidate-pps"/>.
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ The default is 2000.
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ </column>
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
type='{"type": "boolean"}'>
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
@@ -6296,6 +6309,12 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \
|
|
Open vSwitch CI |
aaf0be |
translated to an ephemeral port. If there is no collision, no SNAT
|
|
Open vSwitch CI |
aaf0be |
is performed.
|
|
Open vSwitch CI |
aaf0be |
</column>
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
+ type='{"type": "boolean"}'>
|
|
Open vSwitch CI |
aaf0be |
+ True if the datapath supports CT flush OpenFlow Nicira extension
|
|
Open vSwitch CI |
aaf0be |
+ called NXT_CT_FLUSH . The NXT_CT_FLUSH
|
|
Open vSwitch CI |
aaf0be |
+ extensions allows to flush CT entries based on specified parameters.
|
|
Open vSwitch CI |
aaf0be |
+ </column>
|
|
Open vSwitch CI |
aaf0be |
</group>
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
<group title="Common Columns">
|
|
Open vSwitch CI |
aaf0be |
Submodule dpdk 9dae7a15a..3812e23f6:
|
|
Open vSwitch CI |
aaf0be |
diff --git a/dpdk/drivers/net/i40e/i40e_ethdev.c b/dpdk/drivers/net/i40e/i40e_ethdev.c
|
|
Open vSwitch CI |
aaf0be |
index 7726a89d99..a982e42264 100644
|
|
Open vSwitch CI |
aaf0be |
--- a/dpdk/drivers/net/i40e/i40e_ethdev.c
|
|
Open vSwitch CI |
aaf0be |
+++ b/dpdk/drivers/net/i40e/i40e_ethdev.c
|
|
Open vSwitch CI |
aaf0be |
@@ -387,7 +387,6 @@ static int i40e_set_default_mac_addr(struct rte_eth_dev *dev,
|
|
Open vSwitch CI |
aaf0be |
struct rte_ether_addr *mac_addr);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
static int i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
|
|
Open vSwitch CI |
aaf0be |
-static void i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
static int i40e_ethertype_filter_convert(
|
|
Open vSwitch CI |
aaf0be |
const struct rte_eth_ethertype_filter *input,
|
|
Open vSwitch CI |
aaf0be |
@@ -1711,6 +1710,11 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
|
|
Open vSwitch CI |
aaf0be |
*/
|
|
Open vSwitch CI |
aaf0be |
i40e_add_tx_flow_control_drop_filter(pf);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
+ /* Set the max frame size to 0x2600 by default,
|
|
Open vSwitch CI |
aaf0be |
+ * in case other drivers changed the default value.
|
|
Open vSwitch CI |
aaf0be |
+ */
|
|
Open vSwitch CI |
aaf0be |
+ i40e_aq_set_mac_config(hw, I40E_FRAME_SIZE_MAX, TRUE, false, 0, NULL);
|
|
Open vSwitch CI |
aaf0be |
+
|
|
Open vSwitch CI |
aaf0be |
/* initialize RSS rule list */
|
|
Open vSwitch CI |
aaf0be |
TAILQ_INIT(&pf->rss_config_list);
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
@@ -2328,7 +2332,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
|
|
Open vSwitch CI |
aaf0be |
uint32_t intr_vector = 0;
|
|
Open vSwitch CI |
aaf0be |
struct i40e_vsi *vsi;
|
|
Open vSwitch CI |
aaf0be |
uint16_t nb_rxq, nb_txq;
|
|
Open vSwitch CI |
aaf0be |
- uint16_t max_frame_size;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
hw->adapter_stopped = 0;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
@@ -2467,9 +2470,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
|
|
Open vSwitch CI |
aaf0be |
"please call hierarchy_commit() "
|
|
Open vSwitch CI |
aaf0be |
"before starting the port");
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
- max_frame_size = dev->data->mtu + I40E_ETH_OVERHEAD;
|
|
Open vSwitch CI |
aaf0be |
- i40e_set_mac_max_frame(dev, max_frame_size);
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
return I40E_SUCCESS;
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
tx_err:
|
|
Open vSwitch CI |
aaf0be |
@@ -2809,9 +2809,6 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
|
|
Open vSwitch CI |
aaf0be |
return i40e_phy_conf_link(hw, abilities, speed, false);
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
-#define CHECK_INTERVAL 100 /* 100ms */
|
|
Open vSwitch CI |
aaf0be |
-#define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
static __rte_always_inline void
|
|
Open vSwitch CI |
aaf0be |
update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
|
|
Open vSwitch CI |
aaf0be |
{
|
|
Open vSwitch CI |
aaf0be |
@@ -2878,6 +2875,8 @@ static __rte_always_inline void
|
|
Open vSwitch CI |
aaf0be |
update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
|
|
Open vSwitch CI |
aaf0be |
bool enable_lse, int wait_to_complete)
|
|
Open vSwitch CI |
aaf0be |
{
|
|
Open vSwitch CI |
aaf0be |
+#define CHECK_INTERVAL 100 /* 100ms */
|
|
Open vSwitch CI |
aaf0be |
+#define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */
|
|
Open vSwitch CI |
aaf0be |
uint32_t rep_cnt = MAX_REPEAT_TIME;
|
|
Open vSwitch CI |
aaf0be |
struct i40e_link_status link_status;
|
|
Open vSwitch CI |
aaf0be |
int status;
|
|
Open vSwitch CI |
aaf0be |
@@ -6738,7 +6737,6 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
|
|
Open vSwitch CI |
aaf0be |
if (!ret)
|
|
Open vSwitch CI |
aaf0be |
rte_eth_dev_callback_process(dev,
|
|
Open vSwitch CI |
aaf0be |
RTE_ETH_EVENT_INTR_LSC, NULL);
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
break;
|
|
Open vSwitch CI |
aaf0be |
default:
|
|
Open vSwitch CI |
aaf0be |
PMD_DRV_LOG(DEBUG, "Request %u is not supported yet",
|
|
Open vSwitch CI |
aaf0be |
@@ -12123,40 +12121,6 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
|
|
Open vSwitch CI |
aaf0be |
return ret;
|
|
Open vSwitch CI |
aaf0be |
}
|
|
Open vSwitch CI |
aaf0be |
|
|
Open vSwitch CI |
aaf0be |
-static void
|
|
Open vSwitch CI |
aaf0be |
-i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size)
|
|
Open vSwitch CI |
aaf0be |
-{
|
|
Open vSwitch CI |
aaf0be |
- struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
|
Open vSwitch CI |
aaf0be |
- uint32_t rep_cnt = MAX_REPEAT_TIME;
|
|
Open vSwitch CI |
aaf0be |
- struct rte_eth_link link;
|
|
Open vSwitch CI |
aaf0be |
- enum i40e_status_code status;
|
|
Open vSwitch CI |
aaf0be |
- bool can_be_set = true;
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
- /*
|
|
Open vSwitch CI |
aaf0be |
- * I40E_MEDIA_TYPE_BASET link up can be ignored
|
|
Open vSwitch CI |
aaf0be |
- * I40E_MEDIA_TYPE_BASET link down that hw->phy.media_type
|
|
Open vSwitch CI |
aaf0be |
- * is I40E_MEDIA_TYPE_UNKNOWN
|
|
Open vSwitch CI |
aaf0be |
- */
|
|
Open vSwitch CI |
aaf0be |
- if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET &&
|
|
Open vSwitch CI |
aaf0be |
- hw->phy.media_type != I40E_MEDIA_TYPE_UNKNOWN) {
|
|
Open vSwitch CI |
aaf0be |
- do {
|
|
Open vSwitch CI |
aaf0be |
- update_link_reg(hw, &link);
|
|
Open vSwitch CI |
aaf0be |
- if (link.link_status)
|
|
Open vSwitch CI |
aaf0be |
- break;
|
|
Open vSwitch CI |
aaf0be |
- rte_delay_ms(CHECK_INTERVAL);
|
|
Open vSwitch CI |
aaf0be |
- } while (--rep_cnt);
|
|
Open vSwitch CI |
aaf0be |
- can_be_set = !!link.link_status;
|
|
Open vSwitch CI |
aaf0be |
- }
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
- if (can_be_set) {
|
|
Open vSwitch CI |
aaf0be |
- status = i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL);
|
|
Open vSwitch CI |
aaf0be |
- if (status != I40E_SUCCESS)
|
|
Open vSwitch CI |
aaf0be |
- PMD_DRV_LOG(ERR, "Failed to set max frame size at port level");
|
|
Open vSwitch CI |
aaf0be |
- } else {
|
|
Open vSwitch CI |
aaf0be |
- PMD_DRV_LOG(ERR, "Set max frame size at port level not applicable on link down");
|
|
Open vSwitch CI |
aaf0be |
- }
|
|
Open vSwitch CI |
aaf0be |
-}
|
|
Open vSwitch CI |
aaf0be |
-
|
|
Open vSwitch CI |
aaf0be |
RTE_LOG_REGISTER_SUFFIX(i40e_logtype_init, init, NOTICE);
|
|
Open vSwitch CI |
aaf0be |
RTE_LOG_REGISTER_SUFFIX(i40e_logtype_driver, driver, NOTICE);
|
|
Open vSwitch CI |
aaf0be |
#ifdef RTE_ETHDEV_DEBUG_RX
|