Skip to content

Commit

Permalink
add Intel1g:report()
Browse files Browse the repository at this point in the history
  • Loading branch information
hb9cwp committed Jan 7, 2016
1 parent bf074d8 commit db5badf
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/apps/intel/intel1g.lua
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ function Intel1g:new(conf)
set32(r.CTRL_EXT, {AutoSpeedDetect = 12}) -- p.373
--set32(r.CTRL_EXT, {DriverLoaded = 28}) -- signal Device Driver Loaded

print("Waiting for link-up...")
print("Waiting for link...")
wait32(r.STATUS, {LinkUp=1}) -- wait for auto-neg. to complete
print("We have link-up!")
printMACstatus()
--printMACstatus()
end

-- Define shutdown function for the NIC itself
Expand All @@ -366,6 +366,15 @@ function Intel1g:new(conf)
clear32(r.CTRL, {SETLINKUP = 6}) -- take the link down
pci.set_bus_master(pciaddress, false) -- disable DMA
end

function self:report () -- for snabbmark, from SolarFlareNic:report()
print("report on Intel1g device", self.ifname)
for name,value in pairs(counters) do
print(string.format('%s: %d ', name, value))
end
print("\n")
end

end -- if not attach then

if txq then -- Transmitter
Expand Down
14 changes: 14 additions & 0 deletions src/program/snabbmark/README
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,17 @@ Usage:

Example usage with 10 million packets, packet size 128 bytes:
solarflare 10e6 128

snabbmark intel1g <npackets> <packet-size> [<timeout>]
Send the given number of packets through a Intel i210/i350 NIC. The test
assumes that the two Intel NICs are connected
back-to-back.

The optional <timeout> parameter can be used to specify a timeout in
seconds. If supplied the benchmark run for no longer than <timeout>
seconds.

Uses SNABB_PCI0 and SNABB_PCI1.

Example usage with 10 million packets, packet size 128 bytes:
sudo SNABB_PCI0="0000:02:00.0" SNABB_PCI1="0000:03:00.0" ./snabb snabbmark intel1g 10e6 128
4 changes: 2 additions & 2 deletions src/program/snabbmark/snabbmark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ receive_device.interface= "rx1GE"
local runtime = finish - start
local packets = link.stats(engine.app_table.source.output.tx).txpackets
engine.report()
-- engine.app_table[send_device.interface]:report()
-- engine.app_table[receive_device.interface]:report()
engine.app_table[send_device.interface]:report()
engine.app_table[receive_device.interface]:report()
print()
print(("Processed %.1f million packets in %.2f seconds (rate: %.1f Mpps, %.2f Gbit/s)."):format(packets / 1e6,
runtime, packets / runtime / 1e6,
Expand Down

0 comments on commit db5badf

Please sign in to comment.