From 766849aa7539a80d6a5e906d13fdb7b3749b098e Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Mon, 5 Aug 2019 01:00:19 -0700 Subject: QoS store config for the tap interface Change-Id: I2afb963256321988cb15ea66418a6565532a6022 Signed-off-by: Neale Ranns --- src/VppUplink.cpp | 10 +++++----- src/test/VppManager_test.cpp | 20 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/VppUplink.cpp b/src/VppUplink.cpp index fcaddf7..a14652b 100644 --- a/src/VppUplink.cpp +++ b/src/VppUplink.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "VppSpineProxy.hpp" #include "VppUplink.hpp" @@ -38,7 +38,7 @@ namespace VPP /** * THe DSCP and VLAN CoS value opflex wants for its control packets */ -const static u8 opflex_cp_dscp = 5; +const static QoS::bits_t opflex_cp_dscp = 5; static const std::string UPLINK_KEY = "__uplink__"; @@ -121,10 +121,10 @@ Uplink::configure_tap(const route::prefix_t &pfx) VOM::OM::write(UPLINK_KEY, ipPunt); /** - * record the QoS bits for packets from the TAP + * store the QoS bits for packets from the TAP */ - QoS::record qr(itf, QoS::source_t::IP); - OM::write(UPLINK_KEY, qr); + QoS::store qs(itf, QoS::source_t::IP, opflex_cp_dscp); + OM::write(UPLINK_KEY, qs); } void diff --git a/src/test/VppManager_test.cpp b/src/test/VppManager_test.cpp index 335eb5f..ea5f407 100644 --- a/src/test/VppManager_test.cpp +++ b/src/test/VppManager_test.cpp @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include "VppManager.hpp" #include "opflexagent/test/ModbFixture.h" @@ -710,7 +710,23 @@ BOOST_FIXTURE_TEST_CASE(start, VppStitchedManagerFixture) outputs[ii][jj] = 5; } } - WAIT_FOR_MATCH(QoS::map(1, outputs)); + QoS::map qem(1, outputs); + WAIT_FOR_MATCH(qem); + WAIT_FOR_MATCH(QoS::mark(v_sub, qem, QoS::source_t::IP)); + + /* + * complete the DHCP process and expect the TAP configs + */ + do_dhcp(); + + host = boost::asio::ip::address::from_string("192.168.1.1"); + route::prefix_t pfx(host, 24); + mac_address_t tap_mac("00:00:de:ad:be:ef"); + interface *v_tap = new tap_interface("tap0", + interface::admin_state_t::UP, + pfx, tap_mac); + WAIT_FOR_MATCH(*v_tap); + WAIT_FOR_MATCH(QoS::store(*v_tap, QoS::source_t::IP, 5)); } BOOST_FIXTURE_TEST_CASE(endpoint_group_add_del, VppStitchedManagerFixture) -- cgit 1.2.3-korg