Skip to content

Commit

Permalink
Merge pull request #966 from Igalia/intel-mp-noodle
Browse files Browse the repository at this point in the history
Use false instead of "off" to disable intel_mp txq/rxq
  • Loading branch information
wingo authored Sep 25, 2017
2 parents 6d058bb + 080e5ea commit bef976e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/apps/intel_mp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ specified but assumed to be broadly applicable.

*Optional*. The receive queue to attach to, numbered from 0. The default is 0.
When VMDq is enabled, this number is used to index a queue (0 or 1)
for the selected pool. Passing `"off"` will disable the receive queue.
for the selected pool. Passing `false` will disable the receive queue.

— Key **txq**

*Optional*. The transmit queue to attach to, numbered from 0. The default is 0.
Passing `"off"` will disable the transmit queue.
Passing `false` will disable the transmit queue.

— Key **vmdq**

Expand Down
10 changes: 3 additions & 7 deletions src/apps/intel_mp/intel_mp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,6 @@ function Intel:new (conf)
priority = conf.priority
}

-- txq/rxq have defaults so nil can't represent off state
if conf.txq == "off" then self.txq = nil end
if conf.rxq == "off" then self.rxq = nil end

local vendor = lib.firstline(self.path .. "/vendor")
local device = lib.firstline(self.path .. "/device")
local byid = byPciID[tonumber(device)]
Expand Down Expand Up @@ -576,7 +572,7 @@ function Intel:offset(reg, key)
end
function Intel:push ()
if not self.txq then return end
local li = self.input["input"]
local li = self.input.input
if li == nil then return end

while not empty(li) and self:can_transmit() do
Expand Down Expand Up @@ -607,15 +603,15 @@ function Intel:push ()

-- same code as in pull, but we only call it in case the rxq
-- is disabled for this app
if self.rxq and self.output["output"] then return end
if self.rxq and self.output.output then return end
if self.run_stats and self.sync_timer() then
self:sync_stats()
end
end

function Intel:pull ()
if not self.rxq then return end
local lo = self.output["output"]
local lo = self.output.output
if lo == nil then return end

local pkts = 0
Expand Down
4 changes: 2 additions & 2 deletions src/apps/intel_mp/test_10g_rxq_disable.snabb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ config.app(c, "n0", intel.Intel,

config.app(c, "n1", intel.Intel,
{ pciaddr = pciaddr1,
rxq = "off",
txq = "off",
rxq = false,
txq = false,
wait_for_link = true })

config.app(c, "source0", basic_apps.Source)
Expand Down
2 changes: 1 addition & 1 deletion src/apps/intel_mp/test_10g_sw_sem.snabb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local parse = require("core.lib").parse
local function new_intel (arg)
return intel.Intel:new(parse(arg, intel.Intel.config))
end
local nic = new_intel({pciaddr = pci0, rxq = "off", txq = "off"})
local nic = new_intel({pciaddr = pci0, rxq = false, txq = false})

nic:unlock_sw_sem()
nic:lock_sw_sem()
Expand Down

0 comments on commit bef976e

Please sign in to comment.