Skip to content

Commit

Permalink
Merge PR #911 (snabbnfv: keep support for {rx,tx}_police_gbps) into m…
Browse files Browse the repository at this point in the history
…ax-next
  • Loading branch information
eugeneia committed Nov 2, 2016
2 parents 3305b41 + 1ada400 commit 3e0642f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/program/snabbnfv/nfvconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ function load (file, pciaddr, sockpath, soft_bench)
io_links = virtual_ether_mux.configure(c, ports, {bench = soft_bench})
end
for i,t in ipairs(ports) do
-- Backwards compatibity / deprecated fields
for deprecated, current in pairs({tx_police_gbps = "tx_police",
rx_police_gbps = "rx_police"}) do
if t[deprecated] and not t[current] then
print("Warning: "..deprecated.." is deprecated, use "..current.." instead.")
t[current] = t[deprecated]
end
end
-- Backwards compatability end
local name = port_name(t)
local Virtio = name.."_Virtio"
config.app(c, Virtio, VhostUser,
Expand Down Expand Up @@ -134,4 +143,7 @@ function selftest ()
engine.configure(load(confpath, pcideva, "/dev/null"))
engine.main({duration = 0.25})
end
local c = load("program/snabbnfv/test_fixtures/nfvconfig/test_functions/deprecated.port", pcideva, "/dev/null")
assert(c.apps["Test_TxLimit"])
assert(c.apps["Test_RxLimit"])
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
{ port_id = "Test",
rx_police_gbps = 1,
tx_police_gbps = 1
},
}

0 comments on commit 3e0642f

Please sign in to comment.