Skip to content

Commit

Permalink
Merge pull request #514 from SnabbCo/next
Browse files Browse the repository at this point in the history
Merge branch 'next' for release v2015.07 "Lime"
  • Loading branch information
eugeneia committed Jul 2, 2015
2 parents 9379c35 + 85d3bb9 commit 256706d
Show file tree
Hide file tree
Showing 99 changed files with 1,977 additions and 1,807 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install_compute_node: install
install -D src/scripts/sysv/init.d/snabb-nfv-sync-agent ${PREFIX}/etc/init.d/snabb-nfv-sync-agent
install -D src/scripts/sysv/default/snabb-nfv-sync-agent ${PREFIX}/etc/default/snabb-nfv-sync-agent

$(LUAJIT): check_luajit deps/luajit/Makefile
$(LUAJIT): check_luajit
@echo 'Building LuaJIT'
@(cd deps/luajit && \
$(MAKE) PREFIX=`pwd`/usr/local \
Expand Down
2 changes: 1 addition & 1 deletion deps/pflua
Submodule pflua updated 39 files
+2 −2 doc/icmp-or-tcp-or-udp.md
+3 −2 doc/icmp6-or-ip.md
+14 −2 doc/proto-47.md
+4 −4 doc/src-host-192.68.1.1-and-less-100.md
+1 −0 env
+6 −4 src/pf/anf.lua
+8 −4 src/pf/backend.lua
+62 −50 src/pf/expand.lua
+20 −3 src/pf/libpcap.lua
+68 −53 src/pf/optimize.lua
+151 −79 src/pf/parse.lua
+2 −0 src/pf/ssa.lua
+9 −0 src/pf/utils.lua
+9 −1 tests/Makefile
+6 −0 tests/ir-reg/opt-bug120-rangecheck-opt.ir
+17 −0 tests/ir-reg/opt-bug120-rangecheck-unopt.ir
+7 −0 tests/ir-reg/opt-bug120-rangecheck.sh
+6 −0 tests/ir-reg/opt-bug126-invalidopt.sh
+90 −0 tests/ir-reg/opt-bug126-opt.ir
+238 −0 tests/ir-reg/opt-bug126-unopt.ir
+3 −0 tests/pflang-reg/pl-bug129-flipportrange.sh
+3 −0 tests/pflang-reg/pl-bug130-allreject
+3 −0 tests/pflang-reg/pl-bug131-notlen-igrp
+3 −0 tests/pflang-reg/pl-bug131-notlen-rarp
+3 −0 tests/pflang-reg/pl-bug131-notlen-tcpport
+1 −1 tests/pflang-reg/pl-bug132-icmp6_or_ip
+1 −1 tests/pflang-reg/pl-bug132-icmp6_or_portrange
+1 −1 tests/pflang-reg/pl-bug132-not_icmp6
+3 −0 tests/pflang-reg/pl-bug139-multioctet.sh
+3 −0 tests/pflang-reg/pl-bug171-arpindexing_or_tcp
+1 −1 tests/pflang-reg/pl-bug182-icmp_or_arp
+3 −0 tests/pflang-reg/pl-bug205-greater1_or_less1
+262 −0 tests/pfquickcheck/pflang.lua
+45 −0 tests/properties/pflua_pipelines_match.lua
+9 −1 tools/Makefile
+3 −2 tools/pflua-expand
+174 −0 tools/pflua-pipelines-match
+0 −52 tools/pipe-lua-libpcap-match
+0 −85 tools/pipe-unopt-opt-match
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ E= @echo

# Required submodule versions.
# Defined here to detect version mismatches at build time.
LUAJIT_VSN := "v2.0.3-328-g04dc64b"
LUAJIT_VSN := "v2.0.4-306-gfe56522"
LJSYSCALL_VSN := "v0.10-65-g7081d97"
PFLUA_VSN := "13b194e7a214faae5c3d2916a998418fc841dbc2"
PFLUA_VSN := "27523953c03745d4c4fbbcf81f676bc774e4329e"

TEST_SKIPPED="43"

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions src/apps/basic/basic_apps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Join:new()
return setmetatable({}, {__index=Join})
end

function Join:push ()
function Join:push ()
for _, inport in ipairs(self.input) do
for n = 1,math.min(link.nreadable(inport), link.nwritable(self.output.out)) do
transmit(self.output.out, receive(inport))
Expand Down Expand Up @@ -105,11 +105,11 @@ function Tee:push ()
for _ = 1, math.min(link.nreadable(i), maxoutput) do
local p = receive(i)
maxoutput = maxoutput - 1
do local output = self.output
for k = 1, #output do
transmit(output[k], k == #output and p or packet.clone(p))
end
end
do local output = self.output
for k = 1, #output do
transmit(output[k], k == #output and p or packet.clone(p))
end
end
end
end
end
Expand Down
16 changes: 8 additions & 8 deletions src/apps/bridge/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
--
-- config = { ports = { <free-port1>, <free-port2>, ... },
-- split_horizon_groups = {
-- <sh_group1> = { <shg1-port1>, <shg1-port2>, ...},
-- <sh_group1> = { <shg1-port1>, <shg1-port2>, ...},
-- ...},
-- config = { <bridge-specific-config> } }
--
Expand Down Expand Up @@ -60,27 +60,27 @@ function bridge:new (arg)
local ports = {}
local function add_port(port, group)
assert(not ports[port],
self:name()..": duplicate definition of port "..port)
self:name()..": duplicate definition of port "..port)
ports[port] = group
end
for _, port in ipairs(conf.ports) do
add_port(port, '')
end
if conf.split_horizon_groups then
for group, ports in pairs(conf.split_horizon_groups) do
for _, port in ipairs(ports) do
add_port(port, group)
end
for _, port in ipairs(ports) do
add_port(port, group)
end
end
end
local src_ports, dst_ports = {}, {}
for sport, sgroup in pairs(ports) do
table.insert(src_ports, sport)
dst_ports[sport] = {}
for dport, dgroup in pairs(ports) do
if not (sport == dport or (sgroup ~= '' and sgroup == dgroup)) then
table.insert(dst_ports[sport], dport)
end
if not (sport == dport or (sgroup ~= '' and sgroup == dgroup)) then
table.insert(dst_ports[sport], dport)
end
end
end
o._src_ports = src_ports
Expand Down
16 changes: 8 additions & 8 deletions src/apps/bridge/flooding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ function bridge:push()
local src_port = src_ports[i]
local l_in = self.input[src_port]
while not empty(l_in) do
local ports = dst_ports[src_port]
local p = receive(l_in)
transmit(output[ports[1]], p)
local j = 2
while ports[j] do
transmit(output[ports[j]], clone(p))
j = j + 1
end
local ports = dst_ports[src_port]
local p = receive(l_in)
transmit(output[ports[1]], p)
local j = 2
while ports[j] do
transmit(output[ports[j]], clone(p))
j = j + 1
end
end
i = i + 1
end
Expand Down
86 changes: 43 additions & 43 deletions src/apps/bridge/learning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- bridge" using a Bloom filter (provided by lib.bloom_filter) to
-- store the set of MAC source addresses of packets arriving on each
-- port.
--
--
-- Two Bloom storage cells called mac_table and mac_shadow are
-- allocated for each port connected to the bridge. For each packet
-- arriving on a port, the MAC source address is stored in both cells.
Expand Down Expand Up @@ -66,14 +66,14 @@ bridge = subClass(bridge_base)
bridge._name = "learning bridge"

local default_config = { mac_table_size = 1000, fp_rate = 0.001,
timeout = 60, verbose = false }
timeout = 60, verbose = false }

function bridge:new (arg)
local o = bridge:superClass().new(self, arg)
local conf = o._conf
for k, v in pairs(default_config) do
if not conf[k] then
conf[k] = v
conf[k] = v
end
end
local bf = bloom:new(conf.mac_table_size, conf.fp_rate)
Expand All @@ -84,30 +84,30 @@ function bridge:new (arg)
o._filters = {}
for _, port in ipairs(o._src_ports) do
o._filters[port] = { mac_table = bf:cell_new(),
mac_shadow = bf:cell_new(),
mac_address = bf:item_new()
}
mac_shadow = bf:cell_new(),
mac_address = bf:item_new()
}

end
o._eth_dst = bf:item_new()

timer.activate(timer.new("mac_learn_timeout",
function (t)
if conf.verbose then
print("MAC learning timeout")
print("Table usage per port:")
end
for port, filter in pairs(o._filters) do
bf:cell_copy(filter.mac_shadow, filter.mac_table)
bf:cell_clear(filter.mac_shadow)
if conf.verbose then
print(string.format("\t%s: %02.2f%%", port,
100*bf:cell_usage(filter.mac_table)))
end
end
end,
conf.timeout *1e9, 'repeating')
)
function (t)
if conf.verbose then
print("MAC learning timeout")
print("Table usage per port:")
end
for port, filter in pairs(o._filters) do
bf:cell_copy(filter.mac_shadow, filter.mac_table)
bf:cell_clear(filter.mac_shadow)
if conf.verbose then
print(string.format("\t%s: %02.2f%%", port,
100*bf:cell_usage(filter.mac_table)))
end
end
end,
conf.timeout *1e9, 'repeating')
)

-- Caches for various cdata pointer objects to avoid boxing in the
-- push() loop
Expand Down Expand Up @@ -141,7 +141,7 @@ function bridge:push()
mem[0] = packet.data(p[0])
local is_mcast = ethernet:is_mcast(mem[0])
if not is_mcast then
bf:store_value(mem, 6, eth_dst)
bf:store_value(mem, 6, eth_dst)
end

-- Store the source MAC address in the active and shadow
Expand All @@ -151,32 +151,32 @@ function bridge:push()
mem[0] = mem[0] + 6
bf:store_value(mem, 6, mac_address, filter.mac_table)
bf:store_item(mac_address, filter.mac_shadow)

local ports = dst_ports[src_port]
local copy = false
local j = 1
while ports[j] do
local dst_port = ports[j]
if is_mcast or bf:check_item(eth_dst, filters[dst_port].mac_table) then
if not copy then
transmit(self.output[dst_port], p[0])
copy = true
else
transmit(self.output[dst_port], clone(p[0]))
end
end
j = j + 1
local dst_port = ports[j]
if is_mcast or bf:check_item(eth_dst, filters[dst_port].mac_table) then
if not copy then
transmit(self.output[dst_port], p[0])
copy = true
else
transmit(self.output[dst_port], clone(p[0]))
end
end
j = j + 1
end
if not copy then
-- The source MAC address is unknown, flood the packet to
-- all ports
local output = self.output
transmit(output[ports[1]], p[0])
local j = 2
while ports[j] do
transmit(output[ports[j]], clone(p[0]))
j = j + 1
end
-- The source MAC address is unknown, flood the packet to
-- all ports
local output = self.output
transmit(output[ports[1]], p[0])
local j = 2
while ports[j] do
transmit(output[ports[j]], clone(p[0]))
j = j + 1
end
end
end -- of while not empty(l_in)
if self._port_index == self._nsrc_ports then
Expand Down
Loading

0 comments on commit 256706d

Please sign in to comment.