Skip to content

Commit

Permalink
program.ipfix.stats: use global counters when per-queue stats are not…
Browse files Browse the repository at this point in the history
… available

The current Mellanox driver does not support per-queue stats. ipfix
stats now falls back to the global counters.
  • Loading branch information
alexandergall committed Apr 1, 2020
1 parent 3647611 commit 72f5482
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/program/ipfix/stats/stats.lua
Expand Up @@ -53,13 +53,18 @@ local function pci_stats(indent, path)
end
end
table.sort(qids)
for _, i in ipairs(qids) do
local name = "q"..i.."_"
local rxdrops = read(pci[name..'rxdrops'])
format(indent+2, "Queue #"..i)
format(indent+4, "rxpackets %s", read(pci[name..'rxpackets'], true))
format(indent+4, "rxdrops %s", comma_value(rxdrops))
rxdrops_total = rxdrops_total + rxdrops

if #qids == 0 then
rxdrops_total = read(pci['rxdrop'])
else
for _, i in ipairs(qids) do
local name = "q"..i.."_"
local rxdrops = read(pci[name..'rxdrops'])
format(indent+2, "Queue #"..i)
format(indent+4, "rxpackets %s", read(pci[name..'rxpackets'], true))
format(indent+4, "rxdrops %s", comma_value(rxdrops))
rxdrops_total = rxdrops_total + rxdrops
end
end
local rxpackets = read(pci.rxpackets)
format(indent+2, "Total")
Expand Down

0 comments on commit 72f5482

Please sign in to comment.