Skip to content

Commit

Permalink
Remove redundant checks for link in push and pull methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola 'tekNico' Larosa authored and takikawa committed Aug 16, 2017
1 parent 9615f89 commit 7217501
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/apps/intel_mp/intel_mp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,8 @@ end
function Intel:push ()
if not self.txq then return end
local li = self.input["input"]
assert(li, "intel_mp:push: no input link")
if li == nil then return end
-- assert(li, "intel_mp:push: no input link")

while not link.empty(li) and self:ringnext(self.tdt) ~= self.tdh do
local p = link.receive(li)
Expand Down Expand Up @@ -617,7 +618,8 @@ end
function Intel:pull ()
if not self.rxq then return end
local lo = self.output["output"]
assert(lo, "intel_mp:pull: output link required")
if lo == nil then return end
-- assert(lo, "intel_mp:pull: output link required")

local pkts = 0
while band(self.rxdesc[self.rdt].status, 0x01) == 1 and pkts < engine.pull_npackets do
Expand Down
2 changes: 1 addition & 1 deletion src/apps/intel_mp/testrecv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function test(pciaddr, qno, vmdq, poolno, macaddr, vlan)

if master then
for _,v in pairs(counters[nic.driver]) do
print(string.format("%s %d", v, tonumber(nic.r[v]() - before[v])/duration))
print(string.format("%s %d", v, tonumber(nic.r[v]() - before[v])/duration))
end
end
main.exit(0)
Expand Down
3 changes: 2 additions & 1 deletion src/apps/intel_mp/testvlan.snabb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ config.app(c, "pcap", pcap.PcapReader, pcapfile)
config.app(c, "nic1", intel.Intel,
{pciaddr=pciaddr1,
txq = 0,
ndescriptors=2048, wait_for_link = true})
ndescriptors=2048,
wait_for_link = true})
config.app(c, "nic2", intel.Intel,
{pciaddr=pciaddr2,
vmdq = true,
Expand Down

0 comments on commit 7217501

Please sign in to comment.