Skip to content

Commit

Permalink
Merge PR #604 (snabbnfv promisc mode) into next
Browse files Browse the repository at this point in the history
Added the requirement that only one port is defined when promiscuous
mode is being used. This is simply because the best semantics for
other cases is not immediately clear to me and I want to avoid
adopting a dodgy behavior that we will break later.
  • Loading branch information
lukego committed Sep 14, 2015
1 parent 6c0545d commit 0a3e398
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/program/snabbnfv/nfvconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ function load (file, pciaddr, sockpath)
local name = port_name(t)
local NIC = name.."_NIC"
local Virtio = name.."_Virtio"
local vmdq = true
if not t.mac_address then
if #ports ~= 1 then
error("multiple ports defined but promiscuous mode requested for port: "..name)
end
vmdq = false
end
config.app(c, NIC, require(device_info.driver).driver,
{pciaddr = pciaddr,
vmdq = true,
vmdq = vmdq,
macaddr = mac_address,
vlan = vlan})
config.app(c, Virtio, VhostUser, {socket_path=sockpath:format(t.port_id)})
Expand Down

0 comments on commit 0a3e398

Please sign in to comment.