-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Allocate mpls label serially in dpdk mode
Mpls label were allocated at steps of 16 for dpdk mode removing the same. Closes-bug:#1554940 Change-Id: I257f5b5484da58c4f8c2b1d78fe5e92c1a8f5dd2
- Loading branch information
Showing
5 changed files
with
192 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "base/os.h" | ||
#include "test/test_cmn_util.h" | ||
|
||
void RouterIdDepInit(Agent *agent) { | ||
} | ||
|
||
class MplsTest : public ::testing::Test { | ||
|
||
virtual void SetUp() { | ||
agent_ = Agent::GetInstance(); | ||
client->WaitForIdle(); | ||
} | ||
|
||
virtual void TearDown() { | ||
client->WaitForIdle(); | ||
} | ||
protected: | ||
Agent *agent_; | ||
}; | ||
|
||
TEST_F(MplsTest, agent_dpdk_mode) { | ||
uint16_t label1 = agent_->mpls_table()->AllocLabel(); | ||
uint16_t label2 = agent_->mpls_table()->AllocLabel(); | ||
|
||
EXPECT_TRUE(label1 == MplsTable::kStartLabel); | ||
EXPECT_TRUE(label2 == MplsTable::kStartLabel + 1); | ||
|
||
agent_->mpls_table()->FreeLabel(label1); | ||
agent_->mpls_table()->FreeLabel(label2); | ||
} | ||
|
||
int main(int argc, char *argv[]) { | ||
GETUSERARGS(); | ||
client = TestInit(DEFAULT_VNSW_DPDK_CONFIG_FILE, | ||
ksync_init, true, true, true, | ||
AgentParam::kAgentStatsInterval, | ||
AgentParam::kFlowStatsInterval, true, false); | ||
int ret = RUN_ALL_TESTS(); | ||
client->WaitForIdle(); | ||
TestShutdown(); | ||
return ret; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
# | ||
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. | ||
# | ||
# Vnswad configuration options | ||
# | ||
|
||
[CONTROL-NODE] | ||
# IP address to be used to connect to control-node. If IP is not configured | ||
# for server1, value provided by discovery service will be used. | ||
server=127.0.0.1 | ||
|
||
[DEFAULT] | ||
# IP address and port to be used to connect to collector. If these are not | ||
# configured, value provided by discovery service will be used. Multiple | ||
# IP:port strings separated by space can be provided | ||
# collectors=127.0.0.1:8086 | ||
|
||
# Agent mode : can be vrouter / tsn / tor | ||
# agent_mode= | ||
|
||
# Aging time for flow-records in seconds | ||
# flow_cache_timeout=0 | ||
|
||
# Hostname of compute-node. If this is not configured value from `hostname` | ||
# will be taken | ||
# hostname= | ||
|
||
# Http server port for inspecting vnswad state (useful for debugging) | ||
# http_server_port=8085 | ||
|
||
# Category for logging. Default value is '*' | ||
# log_category= | ||
|
||
# Local log file name | ||
log_file=vrouter.log | ||
|
||
# Log severity levels. Possible values are SYS_EMERG, SYS_ALERT, SYS_CRIT, | ||
# SYS_ERR, SYS_WARN, SYS_NOTICE, SYS_INFO and SYS_DEBUG. Default is SYS_DEBUG | ||
# log_level=SYS_DEBUG | ||
|
||
# Enable/Disable local file logging. Possible values are 0 (disable) and 1 (enable) | ||
# log_local=0 | ||
|
||
# Encapsulation type for tunnel. Possible values are MPLSoGRE, MPLSoUDP, VXLAN | ||
# tunnel_type= | ||
|
||
# Execute agent in headless mode where it does not flush config and route on losing | ||
# connection with control node. In turn it continues with last good config. | ||
# Possible values are true and false | ||
# headless= | ||
|
||
# DHCP relay mode (true or false) to determine if a DHCP request in fabric | ||
# interface with an unconfigured IP should be relayed or not | ||
# dhcp_relay_mode= | ||
|
||
#Mode in which vrouter is running, possible values include dpdk, nic or empty | ||
platform=dpdk | ||
|
||
# Agent base directory | ||
agent_base_directory=. | ||
|
||
[DISCOVERY] | ||
# IP address and port of discovery server | ||
# port=5998 | ||
# server=127.0.0.1 | ||
|
||
# Number of control-nodes info to be provided by Discovery service. Possible | ||
# values are 1 and 2 | ||
# max_control_nodes=1 | ||
|
||
[DNS] | ||
# IP address and port to be used to connect to dns-node. Maximum of 2 IP | ||
# addresses (separated by a space) can be provided. If no IP is configured then | ||
# the value provided by discovery service will be used. | ||
server=127.0.0.1:53 | ||
|
||
[HYPERVISOR] | ||
# Hypervisor type. Possible values are kvm, xen and vmware | ||
# type=kvm | ||
|
||
# Link-local IP address and prefix in ip/prefix_len format (for xen) | ||
# xen_ll_ip= | ||
|
||
# Link-local interface name when hypervisor type is Xen | ||
# xen_ll_interface= | ||
|
||
# Physical interface name when hypervisor type is vmware | ||
# vmware_physical_interface= | ||
|
||
[FLOWS] | ||
# Maximum flows allowed per VM (given as % of maximum system flows) | ||
max_vm_flows=100 | ||
# Maximum number of link-local flows allowed across all VMs | ||
max_system_linklocal_flows=3 | ||
# Maximum number of link-local flows allowed per VM | ||
max_vm_linklocal_flows=2 | ||
|
||
[METADATA] | ||
# Shared secret for metadata proxy service | ||
metadata_proxy_secret=contrail | ||
|
||
[NETWORKS] | ||
# control-channel IP address used by WEB-UI to connect to vnswad to fetch | ||
# required information | ||
# control_network_ip= | ||
|
||
[VIRTUAL-HOST-INTERFACE] | ||
# name of virtual host interface | ||
name=vhost0 | ||
|
||
# IP address and prefix in ip/prefix_len format | ||
ip=10.1.1.1/24 | ||
|
||
# Gateway IP address for virtual host | ||
gateway=10.1.1.254 | ||
|
||
# Physical interface name to which virtual host interface maps to | ||
physical_interface=vnet0 | ||
|
||
[GATEWAY-0] | ||
# Name of the routing_instance for which the gateway is being configured | ||
# routing_instance=default-domain:admin:public:public | ||
|
||
# Gateway interface name | ||
# interface=vgw | ||
|
||
# Virtual network ip blocks for which gateway service is required. | ||
# ip_blocks=1.1.1.1/24 | ||
|
||
[GATEWAY-1] | ||
# Name of the routing_instance for which the gateway is being configured | ||
# routing_instance=default-domain:admin:public1:public1 | ||
|
||
# Gateway interface name | ||
# interface=vgw1 | ||
|
||
# Virtual network ip blocks for which gateway service is required. | ||
# ip_blocks=2.2.1.0/24, 2.2.2.0/24 | ||
|
||
# Routes to be exported in routing_instance | ||
# routes= 10.10.10.1/24, 11.11.11.1/24 | ||
|