Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snabbnfv: Improve --help usage printouts #418

Merged
merged 1 commit into from
Mar 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/program/snabbnfv/README
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Usage:
snabbnfv fuzz

Use --help for per-command usage.
Example:
snabbnfv traffic --help
23 changes: 22 additions & 1 deletion src/program/snabbnfv/neutron_sync_agent/README
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
neutron-sync-agent
snabbnfv neutron-sync-agent [OPTIONS]

Poll the neutron-sync-master for new database configurations and
translate them into snabbnfv traffic process configuration files.

-s DIR, --snabb-dir DIR
Output snabbnfv traffic config files to DIR.
Default: $SNABB_DIR
-h HOST, --sync-host HOST
Connect to snabbnfv-sync-master on HOST.
Default: $SYNC_HOST
-p PATH, --sync-path PATH
Use PATH on snabbnfv-sync-master.
Default: $SYNC_PATH
-d DIR, --neutron-dir DIR
Store temporary Neutron database dumps in DIR.
Default: $NEUTRON_DIR
-i SECONDS, --interval SECONDS
Sleep for SECONDS between sync requests.
Default: $SYNC_INTERVAL or 1
-h, --help
Print this help message and exit.
26 changes: 25 additions & 1 deletion src/program/snabbnfv/neutron_sync_master/README
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
snabbnfv neutron-sync-master
snabbnfv neutron-sync-master [OPTIONS]

Poll the Neutron database for configuration updates and make these
available to snabbnfv-sync-agent processes running on other hosts.

-u USER, --user USER
MySQL username for Neutron DB.
Default: $DB_USER
-p PASS, --password PASS
MySQL password for Neutron DB.
Default: $DB_PASSWORD
-D DB, --neutron-database DB
MySQL database name for Neutron DB.
Default: $DB_NEUTRON or "neutron_ml2"
-m HOST, --mysql-host HOST
MySQL hostname.
Default: $DB_HOST or "localhost"
-l ADDRESS, --listen-address ADDRESS
Listen on ADDRESS for sync-agent connections.
Default: $SYNC_LISTEN_HOST or "127.0.0.1"
-i SECONDS, --interval SECONDS
Sleep for SECONDS between database snapshots.
Default: $SYNC_INTERVAL or "1"
-h, --help
Print this help message and exit.
63 changes: 35 additions & 28 deletions src/program/snabbnfv/traffic/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,44 @@ snabbnfv traffic [OPTIONS] <pci-address> <config-file> <socket-path>

-B NPACKETS, --benchmark NPACKETS
Benchmark processing NPACKETS.
-h, --help
Print brief command-line usage information.
-H, --long-help
Print long usage information including
configuration file format.

Process traffic between Neutron ports and a physical NIC.

In benchmark mode, measure the throughput for the first <npackets> and
then report and terminate.

<config-file> lists all of the virtual machine ports. The file is in
Lua source format and returns an array of ports:

return { <port-1>, ..., <port-n> }

Each port is defined by a range of properties which correspond to the
configuration parameters of the underlying apps (Intel10G, VhostUser,
PacketFilter, RateLimiter, nd_light and SimpleKeyedTunnel):

port := { port_id = <id>, -- A unique string
mac_address = <mac-address>, -- As for Intel10G
vlan = <vlan-id>, -- ..
ingress_filter = <rules>, -- As for PacketFilter
egress_filter = <rules>, -- ..
tunnel = <tunnel-conf>,
rx_police_gbps = <n>, -- Allowed input rate in Gbps
tx_police_gbps = <n> } -- Allowed output rate in Gbps

The tunnel section deviates a little from SimpleKeyedTunnel's
terminology:

tunnel := { type = "L2TPv3", -- The only type (for now)
local_cookie = <cookie>, -- As for SimpleKeyedTunnel
remote_cookie = <cookie>, -- ..
next_hop = <ip-address>, -- Gateway IP
local_ip = <ip-address>, -- ~ `local_address'
remote_ip = <ip-address>, -- ~ `remote_address'
session = <32bit-int> -- ~ `session_id' }
CONFIG FILE FORMAT:

<config-file> contains a list of all of the virtual machine ports. The
file is in Lua source format and returns an array of ports:

return { <port-1>, ..., <port-n> }

Each port is defined by a range of properties which correspond to the
configuration parameters of the underlying apps (Intel10G, VhostUser,
PacketFilter, RateLimiter, nd_light and SimpleKeyedTunnel):

port := { port_id = <id>, -- A unique string
mac_address = <mac-address>, -- As for Intel10G
vlan = <vlan-id>, -- ..
ingress_filter = <rules>, -- As for PacketFilter
egress_filter = <rules>, -- ..
tunnel = <tunnel-conf>,
rx_police_gbps = <n>, -- Allowed input rate in Gbps
tx_police_gbps = <n> } -- Allowed output rate in Gbps

The tunnel section deviates a little from SimpleKeyedTunnel's
terminology:

tunnel := { type = "L2TPv3", -- The only type (for now)
local_cookie = <cookie>, -- As for SimpleKeyedTunnel
remote_cookie = <cookie>, -- ..
next_hop = <ip-address>, -- Gateway IP
local_ip = <ip-address>, -- ~ `local_address'
remote_ip = <ip-address>, -- ~ `remote_address'
session = <32bit-int> -- ~ `session_id' }
15 changes: 11 additions & 4 deletions src/program/snabbnfv/traffic/traffic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ local ffi = require("ffi")
local C = ffi.C

local long_opts = {
benchmark = "B"
benchmark = "B",
help = "h",
["long-help"] = "H"
}

function run (args)
local opt = {}
local benchpackets
function opt.B (arg) benchpackets = tonumber(arg) end
lib.dogetopt(args, opt, "B:", long_opts)
function opt.B (arg) benchpackets = tonumber(arg) end
function opt.h (arg) print(short_usage()) main.exit(1) end
function opt.H (arg) print(long_usage()) main.exit(1) end
lib.dogetopt(args, opt, "hHB:", long_opts)
if #args == 3 then
local pciaddr, confpath, sockpath = unpack(args)
if benchpackets then
Expand All @@ -27,11 +31,14 @@ function run (args)
else
print("Wrong number of arguments: " .. tonumber(#args))
print()
print(usage)
print(short_usage())
main.exit(1)
end
end

function short_usage () return (usage:gsub("%s*CONFIG FILE FORMAT:.*", "")) end
function long_usage () return usage end

-- Run in real traffic mode.
function traffic (pciaddr, confpath, sockpath)
engine.log = true
Expand Down