Fix Idle count
[samplevnf.git] / VNFs / DPPD-PROX / flow_gen / flow_gen_4ports.lua
1 --
2 -- Copyright (c) 2010-2017 Intel Corporation
3 --
4 -- Licensed under the Apache License, Version 2.0 (the "License");
5 -- you may not use this file except in compliance with the License.
6 -- You may obtain a copy of the License at
7 --
8 --     http://www.apache.org/licenses/LICENSE-2.0
9 --
10 -- Unless required by applicable law or agreed to in writing, software
11 -- distributed under the License is distributed on an "AS IS" BASIS,
12 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 -- See the License for the specific language governing permissions and
14 -- limitations under the License.
15 --
16
17 dofile("bundle_maker.lua")
18
19 if (test_system_id == nil) then
20    error("test_system_id not set")
21 end
22
23 offset = 8 * test_system_id
24
25 c_2s0, s_3s0   = setup_bundles(128 + offset, ss)
26 c_4s0, s_5s0   = setup_bundles(129 + offset, ss)
27 c_2s0h, s_3s0h = setup_bundles(130 + offset, ss)
28 c_4s0h, s_5s0h = setup_bundles(131 + offset, ss)
29
30 c_6s0, s_7s0   = setup_bundles(132 + offset, ss)
31 c_8s0, s_9s0   = setup_bundles(133 + offset, ss)
32 c_6s0h, s_7s0h = setup_bundles(134 + offset, ss)
33 c_8s0h, s_9s0h = setup_bundles(135 + offset, ss)
34
35 ----------------
36
37 c_2s1, s_3s1   = setup_bundles(64 + offset, ss)
38 c_4s1, s_5s1   = setup_bundles(65 + offset, ss)
39 c_2s1h, s_3s1h = setup_bundles(66 + offset, ss)
40 c_4s1h, s_5s1h = setup_bundles(67 + offset, ss)
41
42 c_6s1, s_7s1   = setup_bundles(68 + offset, ss)
43 c_8s1, s_9s1   = setup_bundles(69 + offset, ss)
44 c_6s1h, s_7s1h = setup_bundles(70 + offset, ss)
45 c_8s1h, s_9s1h = setup_bundles(71 + offset, ss)
46
47 if (max_setup_rate == nil) then
48    error("max_setup_rate not set")
49 end
50
51 if (connections == nil) then
52    error("connections not set")
53 end
54
55 port_a_clients="2s0,4s0,2s0h,4s0h,6s0,8s0,6s0h,8s0h"
56 port_b_servers="3s0,5s0,3s0h,5s0h,7s0,9s0,7s0h,9s0h"
57
58
59 port_c_clients="2s1,4s1,2s1h,4s1h,6s1,8s1,6s1h,8s1h"
60 port_d_servers="3s1,5s1,3s1h,5s1h,7s1,9s1,7s1h,9s1h"
61
62 all_clients = port_a_clients
63    .. "," .. port_c_clients
64
65 all_servers = port_b_servers
66    .. "," .. port_d_servers
67
68 all_workers =  all_clients .. "," .. all_servers
69
70 all_ld = "1s0,1s0h,1s1,1s1h"
71
72 client_port_count = 2;
73
74 bps = 1250000000/task_count(port_a_clients)
75 msr = max_setup_rate/client_port_count/task_count(port_a_clients)
76 conn = connections/client_port_count/task_count(port_a_clients)
77
78 mempool_size = connections
79 if (mempool_size > 100000) then
80    mempool_size = 100000
81 elseif (mempool_size < 2048) then
82    mempool_size = 2048
83 end