Commit cf5b002f authored by Stephen Hemminger's avatar Stephen Hemminger

Merge branch 'master' into net-next

parents bc234301 25bc3d3d
......@@ -9,6 +9,7 @@
#include <unistd.h>
#include <sys/socket.h>
#include <string.h>
#include <errno.h>
#include "SNAPSHOT.h"
#include "utils.h"
......@@ -23,6 +24,8 @@ int show_stats;
int show_details;
int compress_vlans;
int timestamp;
char *batch_file;
int force;
const char *_SL_;
static void usage(void) __attribute__((noreturn));
......@@ -31,6 +34,7 @@ static void usage(void)
{
fprintf(stderr,
"Usage: bridge [ OPTIONS ] OBJECT { COMMAND | help }\n"
" bridge [ -force ] -batch filename\n"
"where OBJECT := { link | fdb | mdb | vlan | monitor }\n"
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] |\n"
" -o[neline] | -t[imestamp] | -n[etns] name |\n"
......@@ -71,6 +75,50 @@ static int do_cmd(const char *argv0, int argc, char **argv)
return -1;
}
static int batch(const char *name)
{
char *line = NULL;
size_t len = 0;
int ret = EXIT_SUCCESS;
if (name && strcmp(name, "-") != 0) {
if (freopen(name, "r", stdin) == NULL) {
fprintf(stderr,
"Cannot open file \"%s\" for reading: %s\n",
name, strerror(errno));
return EXIT_FAILURE;
}
}
if (rtnl_open(&rth, 0) < 0) {
fprintf(stderr, "Cannot open rtnetlink\n");
return EXIT_FAILURE;
}
cmdlineno = 0;
while (getcmdline(&line, &len, stdin) != -1) {
char *largv[100];
int largc;
largc = makeargs(line, largv, 100);
if (largc == 0)
continue; /* blank line */
if (do_cmd(largv[0], largc, largv)) {
fprintf(stderr, "Command failed %s:%d\n",
name, cmdlineno);
ret = EXIT_FAILURE;
if (!force)
break;
}
}
if (line)
free(line);
rtnl_close(&rth);
return ret;
}
int
main(int argc, char **argv)
{
......@@ -123,6 +171,14 @@ main(int argc, char **argv)
exit(-1);
} else if (matches(opt, "-compressvlans") == 0) {
++compress_vlans;
} else if (matches(opt, "-force") == 0) {
++force;
} else if (matches(opt, "-batch") == 0) {
argc--;
argv++;
if (argc <= 1)
usage();
batch_file = argv[1];
} else {
fprintf(stderr,
"Option \"%s\" is unknown, try \"bridge help\".\n",
......@@ -134,6 +190,9 @@ main(int argc, char **argv)
_SL_ = oneline ? "\\" : "\n";
if (batch_file)
return batch(batch_file);
if (rtnl_open(&rth, 0) < 0)
exit(1);
......
......@@ -287,7 +287,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)
if (strcmp(*argv, "name") == 0) {
NEXT_ARG();
}
if (matches(*argv, "help") == 0)
else if (matches(*argv, "help") == 0)
usage();
if (p->name[0])
duparg2("name", *argv);
......
......@@ -637,6 +637,25 @@ int print_linkinfo_brief(const struct sockaddr_nl *who,
return -1;
}
if (tb[IFLA_MASTER]) {
int master = *(int*)RTA_DATA(tb[IFLA_MASTER]);
if (filter.master > 0 && master != filter.master)
return -1;
}
else if (filter.master > 0)
return -1;
if (filter.kind) {
if (tb[IFLA_LINKINFO]) {
char *kind = parse_link_kind(tb[IFLA_LINKINFO]);
if (strcmp(kind, filter.kind))
return -1;
} else {
return -1;
}
}
if (n->nlmsg_type == RTM_DELLINK)
fprintf(fp, "Deleted ");
......@@ -1561,7 +1580,7 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
}
if (matches(*argv, "help") == 0)
else if (matches(*argv, "help") == 0)
usage();
if (filter_dev)
duparg2("dev", *argv);
......
......@@ -1148,8 +1148,7 @@ static int do_set(int argc, char **argv)
} else {
if (strcmp(*argv, "dev") == 0)
NEXT_ARG();
if (matches(*argv, "help") == 0)
else if (matches(*argv, "help") == 0)
usage();
if (dev)
......
......@@ -257,7 +257,7 @@ static int multiaddr_list(int argc, char **argv)
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
}
if (matches(*argv, "help") == 0)
else if (matches(*argv, "help") == 0)
usage();
if (filter.dev)
duparg2("dev", *argv);
......
......@@ -914,12 +914,31 @@ int makeargs(char *line, char *argv[], int maxargs)
char *cp;
int argc = 0;
for (cp = strtok(line, ws); cp; cp = strtok(NULL, ws)) {
for (cp = line + strspn(line, ws); *cp; cp += strspn(cp, ws)) {
if (argc >= (maxargs - 1)) {
fprintf(stderr, "Too many arguments to command\n");
exit(1);
}
/* word begins with quote */
if (*cp == '\'' || *cp == '"') {
char quote = *cp++;
argv[argc++] = cp;
/* find ending quote */
cp = strchr(cp, quote);
if (cp == NULL) {
fprintf(stderr, "Unterminated quoted string\n");
exit(1);
}
*cp++ = 0;
continue;
}
argv[argc++] = cp;
/* find end of word */
cp += strcspn(cp, ws);
*cp++ = 0;
}
argv[argc] = NULL;
......
......@@ -2,6 +2,7 @@ TARGETS = ip-address.8 ip-link.8 ip-route.8
MAN8PAGES = $(TARGETS) ip.8 arpd.8 lnstat.8 routel.8 rtacct.8 rtmon.8 rtpr.8 ss.8 \
tc.8 tc-bfifo.8 tc-bpf.8 tc-cbq.8 tc-cbq-details.8 tc-choke.8 tc-codel.8 \
tc-fq.8 \
tc-drr.8 tc-ematch.8 tc-fq_codel.8 tc-hfsc.8 tc-htb.8 tc-pie.8 \
tc-mqprio.8 tc-netem.8 tc-pfifo.8 tc-pfifo_fast.8 tc-prio.8 tc-red.8 \
tc-sfb.8 tc-sfq.8 tc-stab.8 tc-tbf.8 \
......@@ -9,7 +10,9 @@ MAN8PAGES = $(TARGETS) ip.8 arpd.8 lnstat.8 routel.8 rtacct.8 rtmon.8 rtpr.8 ss.
ip-addrlabel.8 ip-fou.8 ip-gue.8 ip-l2tp.8 \
ip-maddress.8 ip-monitor.8 ip-mroute.8 ip-neighbour.8 \
ip-netns.8 ip-ntable.8 ip-rule.8 ip-tunnel.8 ip-xfrm.8 \
ip-tcp_metrics.8 ip-netconf.8 ip-token.8
ip-tcp_metrics.8 ip-netconf.8 ip-token.8 \
tipc.8 tipc-bearer.8 tipc-link.8 tipc-media.8 tipc-nametable.8 \
tipc-node.8 tipc-socket.8
all: $(TARGETS)
......
......@@ -21,6 +21,7 @@ bridge \- show / manipulate bridge addresses and devices
\fB\-V\fR[\fIersion\fR] |
\fB\-s\fR[\fItatistics\fR] |
\fB\-n\fR[\fIetns\fR] name }
\fB\-b\fR[\fIatch\fR] filename }
.ti -8
.BR "bridge link set"
......@@ -137,6 +138,16 @@ to
.RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
.BR help " }"
.TP
.BR "\-b", " \-batch " <FILENAME>
Read commands from provided file or standard input and invoke them.
First failure will cause termination of bridge command.
.TP
.BR "\-force"
Don't terminate bridge command on errors in batch mode.
If there were any errors during execution of the commands, the application
return code will be non zero.
.SH BRIDGE - COMMAND SYNTAX
......@@ -297,6 +308,9 @@ link setting is configured on specified physical device
.BI master
link setting is configured on the software bridge (default)
.TP
.BR "\-t" , " \-timestamp"
display current time when using monitor option.
.SS bridge link show - list bridge port configuration.
......
......@@ -175,6 +175,10 @@ executes specified command over all objects, it depends if command supports this
.BR "\-c" , " -color"
Use color output.
.TP
.BR "\-t" , " \-timestamp"
display current time when using monitor option.
.SH IP - COMMAND SYNTAX
.SS
......
.TH FQ 8 "10 Sept 2015" "iproute2" "Linux"
.SH NAME
Fair Queuing (FQ) \- Traffic Pacing
.SH SYNOPSIS
.B tc qdisc ... fq
[
.B limit
PACKETS ] [
.B flow_limit
PACKETS ] [
.B quantum
BYTES ] [
.B initial_quantum
BYTES ] [
.B maxrate
RATE ] [
.B buckets
NUMBER ] [
.B pacing
|
.B nopacing
]
.SH DESCRIPTION
FQ (Fair Queue) is a classless packet scheduler meant to be mostly
used for locally generated traffic. It is designed to achieve per flow pacing.
FQ does flow separation, and is able to respect pacing requirements set by TCP stack.
All packets belonging to a socket are considered as a 'flow'.
For non local packets (router workload), packet rxhash is used as fallback.
An application can specify a maximum pacing rate using the
.B SO_MAX_PACING_RATE
setsockopt call. This packet scheduler adds delay between packets to
respect rate limitation set by TCP stack.
Dequeueing happens in a round-robin fashion.
A special FIFO queue is reserved for high priority packets (
.B TC_PRIO_CONTROL
priority), such packets are always dequeued first.
FQ is non-work-conserving.
TCP pacing is good for flows having idle times, as the congestion
window permits TCP stack to queue a possibly large number of packets.
This removes the 'slow start after idle' choice, badly hitting
large BDP flows and applications delivering chunks of data such as video streams.
.SH PARAMETERS
.SS limit
Hard limit on the real queue size. When this limit is reached, new packets
are dropped. If the value is lowered, packets are dropped so that the new limit is
met. Default is 10000 packets.
.SS flow_limit
Hard limit on the maximum number of packets queued per flow.
Default value is 100.
.SS quantum
The credit per dequeue RR round, i.e. the amount of bytes a flow is allowed to
dequeue at once. A larger value means a longer time period before the next flow
will be served.
Default is 2 * interface MTU bytes.
.SS initial_quantum
The initial sending rate credit, i.e. the amount of bytes a new flow is allowed
to dequeue initially.
This is specifically meant to allow using IW10 without added delay.
Default is 10 * interface MTU, i.e. 15140 for 'standard' ethernet.
.SS maxrate
Maximum sending rate of a flow. Default is unlimited.
Application specific setting via
.B SO_MAX_PACING_RATE
is ignored only if it is larger than this value.
.SS buckets
The size of the hash table used for flow lookups. Each bucket is assigned a
red-black tree for efficient collision sorting.
Default: 1024.
.SS [no]pacing
Enable or disable flow pacing. Default is enabled.
.SH EXAMPLES
#tc qdisc add dev eth0 root fq
.br
#tc -s -d qdisc
.br
qdisc fq 8003: dev eth0 root refcnt 2 limit 10000p flow_limit 100p buckets 1024 quantum 3028 initial_quantum 15140
Sent 503727981 bytes 1146972 pkt (dropped 0, overlimits 0 requeues 54452)
backlog 0b 0p requeues 54452
1289 flows (1289 inactive, 0 throttled)
0 gc, 31 highprio, 27411 throttled
.br
.SH SEE ALSO
.BR tc (8),
.BR socket (7)
.SH AUTHORS
FQ was written by Eric Dumazet.
......@@ -662,6 +662,7 @@ was written by Alexey N. Kuznetsov and added in Linux 2.2.
.BR tc-codel (8),
.BR tc-drr (8),
.BR tc-ematch (8),
.BR tc-fq (8),
.BR tc-fq_codel (8),
.BR tc-hfsc (7),
.BR tc-hfsc (8),
......
.TH TIPC-BEARER 8 "02 Jun 2015" "iproute2" "Linux"
./ For consistency, please keep padding right aligned.
./ For example '.B "foo " bar' and not '.B foo " bar"'
.SH NAME
tipc-bearer \- show or modify TIPC bearers
.SH SYNOPSIS
.ad l
.in +8
.ti -8
.B tipc bearer enable
.RB "[ " domain
.IR DOMAIN " ]"
.RB "[ " priority
.IR PRIORITY " ]"
.BR media
.br
.RB "{ { " eth " | " ib " } " device
.IR "DEVICE" " }"
.RB "|"
.br
.RB "{ " udp
.B name
.IR NAME
.B localip
.IR LOCALIP
.RB "[ " localport
.IR LOCALPORT " ]"
.RB "[ " remoteip
.IR REMOTEIP " ]"
.RB "[ " remoteport
.IR REMOTEPORT " ] }"
.br
.ti -8
.B tipc bearer disable media
.br
.RB "{ { " eth " | " ib " } " device
.IR DEVICE
.RB "|"
.br
.RB "{ " udp
.B name
.IR NAME
.B localip
.IR LOCALIP " } }"
.br
.ti -8
.B tipc bearer set
.RB "{ " "priority "
.IR PRIORITY
.RB "| " tolerance
.IR TOLERANCE
.RB "| " window
.IR WINDOW
.RB "} " media
.br
.RB "{ { " eth " | " ib " } " device
.IR "DEVICE" " }"
.RB "|"
.br
.RB "{ " udp
.B name
.IR NAME
.B localip
.IR LOCALIP " } }"
.br
.ti -8
.B tipc bearer get
.RB "{ " "priority" " | " tolerance " | " window " } " media
.br
.RB "{ { " eth " | " ib " } " device
.IR "DEVICE" " }"
.RB "|"
.br
.RB "{ " udp
.B name
.IR NAME
.B localip
.IR LOCALIP " } }"
.br
.ti -8
.B tipc bearer list
.br
.SH OPTIONS
Options (flags) that can be passed anywhere in the command chain.
.TP
.BR "\-h" , " --help"
Show help about last valid command. For example
.B tipc bearer --help
will show bearer help and
.B tipc --help
will show general help. The position of the option in the string is irrelevant.
.SH DESCRIPTION
.SS Bearer identification
.TP
.BI "media " MEDIA
.br
Specifies the TIPC media type for a particular bearer to operate on.
Different media types have different ways of identifying a unique bearer.
For example,
.BR "ib " "and " eth
identify a bearer with a
.I DEVICE
while
.B udp
identify a bearer with a
.IR "LOCALIP " "and a " NAME
.B ib
- Infiniband
.sp
.B eth
- Ethernet
.sp
.B udp
- User Datagram Protocol (UDP)
.sp
.TP
.BI "name " NAME
.br
Logical bearer identifier valid for bearers on
.B udp
media.
.TP
.BI "device " DEVICE
.br
Physical bearer device valid for bearers on
.B eth
and
.B ib
media.
.SS Bearer properties
.TP
.B domain
.br
The addressing domain (region) in which a bearer will establish links and accept
link establish requests.
.TP
.B priority
.br
Default link priority inherited by all links subsequently established over a
bearer. A single bearer can only host one link to a particular node. This means
the default link priority for a bearer typically affects which bearer to use
when communicating with a particular node in an multi bearer setup. For more
info about link priority see
.BR tipc-link (8)
.TP
.B tolerance
.br
Default link tolerance inherited by all links subsequently established over a
bearer. For more info about link tolerance see
.BR tipc-link (8)
.TP
.B window
.br
Default link window inherited by all links subsequently established over a
bearer. For more info about the link window size see
.BR tipc-link (8)
.SS UDP bearer options
.TP
.BI "localip " LOCALIP
.br
Specify a local IP v4/v6 address for a
.B udp
bearer.
.TP
.BI "localport " LOCALPORT
.br
Specify the local port for a
.B udp
bearer. The default port 6118 is used if no port is specified.
.TP
.BI "remoteip " REMOTEIP
.br
Specify a remote IP for a
.B udp
bearer. If no remote IP is specified a
.B udp
bearer runs in multicast mode and tries to auto-discover its neighbours.
The multicast IP address is generated based on the TIPC network ID. If a remote
IP is specified the
.B udp
bearer runs in point-to-point mode.
.TP
.BI "remoteport " REMOTEPORT
.br
Specify the remote port for a
.B udp
bearer. The default port 6118 is used if no port is specified.
.SH EXIT STATUS
Exit status is 0 if command was successful or a positive integer upon failure.
.SH SEE ALSO
.BR tipc (8),
.BR tipc-link (8),
.BR tipc-media (8),
.BR tipc-nametable (8),
.BR tipc-node (8),
.BR tipc-socket (8)
.br
.SH REPORTING BUGS
Report any bugs to the Network Developers mailing list
.B <netdev@vger.kernel.org>
where the development and maintenance is primarily done.
You do not have to be subscribed to the list to send a message there.
.SH AUTHOR
Richard Alpe <richard.alpe@ericsson.com>
.TH TIPC-LINK 8 "02 Jun 2015" "iproute2" "Linux"
./ For consistency, please keep padding right aligned.
./ For example '.B "foo " bar' and not '.B foo " bar"'
.SH NAME
tipc-link \- show links or modify link properties
.SH SYNOPSIS
.ad l
.in +8
.ti -8
.ti -8
.B tipc link set
.RB "{ " "priority "
.IR PRIORITY
.RB "| " tolerance
.IR TOLERANCE
.RB "| " window
.IR "WINDOW " }
.BI "link " LINK
.ti -8
.B tipc link get
.RB "{ " "priority" " | " tolerance " | " window " } " link
.I LINK
.ti -8
.B tipc link statistics
.RB "{ " "show " "[ " link
.I LINK
.RB "] | " "reset
.BI "link " "LINK "
.R }
.ti -8
.B tipc link list
.br
.SH OPTIONS
Options (flags) that can be passed anywhere in the command chain.
.TP
.BR "\-h" , " --help"
Show help about last valid command. For example
.B tipc link --help
will show link help and
.B tipc --help
will show general help. The position of the option in the string is irrelevant.
.SH DESCRIPTION
.SS Link statistics
.TP
.BR "ACTIVE " "link state"
.br
An
.B ACTIVE
link is serving traffic. Two links to the same node can become
.B ACTIVE
if they have the same link
.BR priority .
If there is more than two links with the same priority the additional links will
be put in
.B STANDBY
state.
.TP
.BR "STANDBY " "link state"
.br
A
.B STANDBY
link has lower link priority than an
.B ACTIVE
link. A
.B STANDBY
link has control traffic flowing and is ready to take over should the
.B ACTIVE
link(s) go down.
.TP
.B MTU
.br
The Maximum Transmission Unit. The two endpoints advertise their default or
configured
.B MTU
at initial link setup and will agree to use the lower of the two values should
they differ.
.TP
.B Packets
.br
The total amount of transmitted or received TIPC packets on a link. Including
.BR "fragmented " "and " "bundled " packets.
.TP
.B Fragments
.br
Represented in the form
.BR fragments / fragmented .
Where
.B fragmented
is the amount of data messages which have been broken into
.BR fragments .
Subsequently the
.B fragments
are the total amount of packets that the
.B fragmented
messages has been broken into.
.TP
.B Bundles
.br
Represented in the form
.BR bundles / bundled .
If a link becomes congested the link will attempt to bundle data from small
.B bundled
packets into
.B bundles
of full MTU size packets before they are transmitted.
.TP
.B Profile
.br
Shows the
.B average
packet size in octets/bytes for a
.B sample
of packets. It also shows the packet size distribution of the
.B sampled
packets in the intervals
0-64 bytes
.br
64-256 bytes
.br
256-1024 bytes
.br
1024-4096 bytes
.br
4096-16384 bytes
.br
16384-32768 bytes
.br
32768-66000 bytes
.TP
.B Message counters
.B states
- Number of link state messages
.sp
.B probes
- Link state messages with probe flag set. Typically sent when a link is idle
.sp
.B nacks
- Number of negative acknowledgement (NACK) packets sent and received by the
link
.sp
.B defs
- Number of packets received out of order
.sp
.B dups
- Number of duplicate packets received
.TP
.B Congestion link
The number of times an application has tried to send data when the TIPC link
was congested
.TP
.B Send queue
.B Max
is the maximum amount of messages that has resided in the out queue during the
statistics collection period of a link.
.B Avg
is the average outqueue size during the lifetime of a link.
.SS Link properties
.TP
.B priority
.br
The priority between logical TIPC links to a particular node. Link priority can
range from 0 (lowest) to 31 (highest).
.TP
.B tolerance
.br
Link tolerance specifies the maximum time in milliseconds that TIPC will allow
a communication problem to exist before taking the link down. The default value
is 1500 milliseconds.
.TP
.B window
.br
The link window controls how many unacknowledged messages a link endpoint can
have in its transmit queue before TIPC's congestion control mechanism is
activated.
.SH EXIT STATUS
Exit status is 0 if command was successful or a positive integer upon failure.
.SH SEE ALSO
.BR tipc (8),
.BR tipc-media (8),
.BR tipc-bearer (8),
.BR tipc-nametable (8),
.BR tipc-node (8),
.BR tipc-socket (8)
.br
.SH REPORTING BUGS
Report any bugs to the Network Developers mailing list
.B <netdev@vger.kernel.org>
where the development and maintenance is primarily done.
You do not have to be subscribed to the list to send a message there.
.SH AUTHOR
Richard Alpe <richard.alpe@ericsson.com>
.TH TIPC-MEDIA 8 "02 Jun 2015" "iproute2" "Linux"
./ For consistency, please keep padding right aligned.
./ For example '.B "foo " bar' and not '.B foo " bar"'
.SH NAME
tipc-media \- list or modify media properties
.SH SYNOPSIS
.ad l
.in +8
.ti -8
.ti -8
.B tipc media set
.RB "{ " "priority "
.IR PRIORITY
.RB "| " tolerance
.IR TOLERANCE
.RB "| " window
.IR "WINDOW " }
.BI "media " MEDIA
.ti -8
.B tipc media get
.RB "{ " "priority" " | " tolerance " | " window " } " media
.I MEDIA
.ti -8
.B tipc media list
.br
.SH OPTIONS
Options (flags) that can be passed anywhere in the command chain.
.TP
.BR "\-h" , " --help"
Show help about last valid command. For example
.B tipc media --help
will show media help and
.B tipc --help
will show general help. The position of the option in the string is irrelevant.
.SH DESCRIPTION
.SS Media properties
.TP
.B priority
.br
Default link priority inherited by all bearers subsequently enabled on a
media. For more info about link priority see
.BR tipc-link (8)
.TP
.B tolerance
.br
Default link tolerance inherited by all bearers subsequently enabled on a
media. For more info about link tolerance see
.BR tipc-link (8)
.TP
.B window
.br
Default link window inherited by all bearers subsequently enabled on a
media. For more info about link window see
.BR tipc-link (8)
.SH EXIT STATUS
Exit status is 0 if command was successful or a positive integer upon failure.
.SH SEE ALSO
.BR tipc (8),
.BR tipc-bearer (8),
.BR tipc-link (8),
.BR tipc-nametable (8),
.BR tipc-node (8),
.BR tipc-socket (8)
.br
.SH REPORTING BUGS
Report any bugs to the Network Developers mailing list
.B <netdev@vger.kernel.org>
where the development and maintenance is primarily done.
You do not have to be subscribed to the list to send a message there.
.SH AUTHOR
Richard Alpe <richard.alpe@ericsson.com>
.TH TIPC-NAMETABLE 8 "02 Jun 2015" "iproute2" "Linux"
./ For consistency, please keep padding right aligned.
./ For example '.B "foo " bar' and not '.B foo " bar"'
.SH NAME
tipc-nametable \- show TIPC nametable
.SH SYNOPSIS
.ad l
.in +8
.ti -8
.B tipc nametable show
.br
.SH OPTIONS
Options (flags) that can be passed anywhere in the command chain.
.TP
.BR "\-h" , " --help"
Show help about last valid command. For example
.B tipc nametable --help
will show nametable help and
.B tipc --help
will show general help. The position of the option in the string is irrelevant.
.SH DESCRIPTION
The nametable shows TIPC publication information.
.SS Nametable format
.TP
.B Type
.br
The 32-bit type field of the port name. The type field often indicates the class of service
provided by a port.
.TP
.B Lower
.br
The lower bound of the 32-bit instance field of the port name.
The instance field is often used as as a sub-class indicator.
.TP
.B Upper
.br
The upper bound of the 32-bit instance field of the port name.
The instance field is often used as as a sub-class indicator.
A difference in
.BR "lower " "and " upper
means the socket is bound to the port name range [lower,upper]
.TP
.B Port Identity
.br
The unique socket (port) identifier within the TIPC cluster. The
.B port identity
consists of a node identity followed by a socket reference number.
.TP
.B Publication
.br
The
.B publication
ID is a random number used internally to represent a publication.
.TP
.B Scope
.br
The publication
.B scope
specifies the visibility of a bound port name.
The
.B scope
can be specified to comprise three different domains:
.BR node ", " "cluster " "and " zone.
Applications residing within the specified
.B scope
can see and access the port using the displayed port name.
.SH EXIT STATUS
Exit status is 0 if command was successful or a positive integer upon failure.
.SH SEE ALSO
.BR tipc (8),
.BR tipc-bearer (8),
.BR tipc-link (8),
.BR tipc-media (8),
.BR tipc-node (8),
.BR tipc-socket (8)
.br
.SH REPORTING BUGS
Report any bugs to the Network Developers mailing list
.B <netdev@vger.kernel.org>
where the development and maintenance is primarily done.
You do not have to be subscribed to the list to send a message there.
.SH AUTHOR
Richard Alpe <richard.alpe@ericsson.com>
.TH TIPC-NODE 8 "02 Jun 2015" "iproute2" "Linux"
./ For consistency, please keep padding right aligned.
./ For example '.B "foo " bar' and not '.B foo " bar"'
.SH NAME
tipc-node \- modify and show local node parameters or list peer nodes
.SH SYNOPSIS
.ad l
.in +8
.ti -8
.B tipc node set
.RB "{ " "address "
.IR ADDRESS
.RB "| " netid
.IR NETID
.RB "} "
.ti -8
.B tipc node get
.RB "{ " "address" " | " netid " } "
.ti -8
.B tipc node list
.br
.SH OPTIONS
Options (flags) that can be passed anywhere in the command chain.
.TP
.BR "\-h" , " --help"
Show help about last valid command. For example
.B tipc node --help
will show node help and
.B tipc --help
will show general help. The position of the option in the string is irrelevant.
.SH DESCRIPTION
.SS Node parameters
.TP
.BI address
.br
The TIPC logical address. On the form x.y.z where x, y and z are unsigned
integers.
.TP
.BI netid
.br
Network identity. Can by used to create individual TIPC clusters on the same
media.
.SH EXIT STATUS
Exit status is 0 if command was successful or a positive integer upon failure.
.SH SEE ALSO
.BR tipc (8),
.BR tipc-bearer (8),
.BR tipc-link (8),
.BR tipc-media (8),
.BR tipc-nametable (8),
.BR tipc-socket (8)
.br
.SH REPORTING BUGS
Report any bugs to the Network Developers mailing list
.B <netdev@vger.kernel.org>
where the development and maintenance is primarily done.
You do not have to be subscribed to the list to send a message there.
.SH AUTHOR
Richard Alpe <richard.alpe@ericsson.com>
.TH TIPC-SOCKET 8 "02 Jun 2015" "iproute2" "Linux"
./ For consistency, please keep padding right aligned.
./ For example '.B "foo " bar' and not '.B foo " bar"'
.SH NAME
tipc-socket \- show TIPC socket (port) information
.SH SYNOPSIS
.ad l
.in +8
.ti -8
.B tipc socket list
.SH OPTIONS
Options (flags) that can be passed anywhere in the command chain.
.TP
.BR "\-h" , " --help"
Show help about last valid command. For example
.B tipc socket --help
will show socket help and
.B tipc --help
will show general help. The position of the option in the string is irrelevant.
.SH DESCRIPTION
A TIPC socket is represented by an unsigned integer.
.TP
.SS Bound state
A bound socket has a logical TIPC port name associated with it.
.TP
.SS Connected state
A connected socket is directly connected to another socket creating a point
to point connection between TIPC sockets. If the connection to X was made using
a logical port name Y that name will show up as
.BR "connected to " "X " "via " Y
.
.SH EXIT STATUS
Exit status is 0 if command was successful or a positive integer upon failure.
.SH SEE ALSO
.BR tipc (8),
.BR tipc-bearer (8)
.BR tipc-link (8),
.BR tipc-media (8),
.BR tipc-nametable (8),
.BR tipc-node (8),
.br
.SH REPORTING BUGS
Report any bugs to the Network Developers mailing list
.B <netdev@vger.kernel.org>
where the development and maintenance is primarily done.
You do not have to be subscribed to the list to send a message there.
.SH AUTHOR
Richard Alpe <richard.alpe@ericsson.com>
.TH TIPC 8 "02 Jun 2015" "iproute2" "Linux"
.SH NAME
tipc \- a TIPC configuration and management tool
.SH SYNOPSIS
.ad l
.in +8
.ti -8
.B tipc
.RI "[ " OPTIONS " ] " COMMAND " " ARGUMENTS "
.sp
.ti -8
.IR COMMAND " := { "
.BR bearer " | " link " | " media " | " nametable " | " node " | " socket " }
.sp
.ti -8
.IR OPTIONS " := { "
\fB\-h\fR[\fIhelp\fR] }
.SH DESCRIPTION
The Transparent Inter-Process Communication (TIPC) protocol offers total address
transparency between processes which allows applications in a clustered computer
environment to communicate quickly and reliably with each other, regardless of
their location within the cluster.
TIPC originated at the telecommunications manufacturer Ericsson. The first open
source version of TIPC was created in 2000 when Ericsson released its first
Linux version of TIPC. TIPC was introduced in the mainline Linux kernel in 2006
and is now widely used both within and outside of Ericsson.
.SH OPTIONS
.TP
.BR "\-h" , " --help"
Show help about last given command. For example
.B tipc bearer --help
will show bearer help and
.B tipc --help
will show general help. The position of the option in the string is irrelevant.
.SH COMMANDS
.TP
.B BEARER
- Show or modify TIPC bearers
.TP
.B LINK
- Show or modify TIPC links
.TP
.B MEDIA
- Show or modify TIPC media
.TP
.B NAMETABLE
- Show TIPC nametable
.TP
.B NODE
- Show or modify TIPC node parameters
.TP
.B SOCKET
- Show TIPC sockets
.SH ARGUMENTS
Command arguments are described in a command specific man page and typically
consists of nested commands along with key value pairs.
If no arguments are given a command typically shows its help text. The explicit
help option
.B -h
or
.B --help
can occur anywhere among the arguments and will show help for the last valid
command given.
.SH EXIT STATUS
Exit status is 0 if command was successful or a positive integer upon failure.
.SH SEE ALSO
.BR tipc-bearer (8),
.BR tipc-link (8),
.BR tipc-media (8),
.BR tipc-nametable (8),
.BR tipc-node (8),
.BR tipc-socket (8)
.br
.SH REPORTING BUGS
Report any bugs to the Network Developers mailing list
.B <netdev@vger.kernel.org>
where the development and maintenance is primarily done.
You do not have to be subscribed to the list to send a message there.
.SH AUTHOR
Richard Alpe <richard.alpe@ericsson.com>
......@@ -3782,12 +3782,6 @@ int main(int argc, char *argv[])
exit(0);
}
/* Now parse filter... */
if (argc == 0 && filter_fp) {
if (ssfilter_parse(&current_filter.f, 0, NULL, filter_fp))
usage();
}
while (argc > 0) {
if (strcmp(*argv, "state") == 0) {
NEXT_ARG();
......
/*
* Fair Queue
*
* Copyright (C) 2013 Eric Dumazet <edumazet@google.com>
* Copyright (C) 2013-2015 Eric Dumazet <edumazet@google.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -55,6 +55,7 @@ static void explain(void)
fprintf(stderr, " [ quantum BYTES ] [ initial_quantum BYTES ]\n");
fprintf(stderr, " [ maxrate RATE ] [ buckets NUMBER ]\n");
fprintf(stderr, " [ [no]pacing ] [ refill_delay TIME ]\n");
fprintf(stderr, " [ orphan_mask MASK]\n");
}
static unsigned int ilog2(unsigned int val)
......@@ -80,6 +81,7 @@ static int fq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
unsigned int maxrate;
unsigned int defrate;
unsigned int refill_delay;
unsigned int orphan_mask;
bool set_plimit = false;
bool set_flow_plimit = false;
bool set_quantum = false;
......@@ -87,6 +89,7 @@ static int fq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
bool set_maxrate = false;
bool set_defrate = false;
bool set_refill_delay = false;
bool set_orphan_mask = false;
int pacing = -1;
struct rtattr *tail;
......@@ -139,6 +142,13 @@ static int fq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
return -1;
}
set_initial_quantum = true;
} else if (strcmp(*argv, "orphan_mask") == 0) {
NEXT_ARG();
if (get_unsigned(&orphan_mask, *argv, 0)) {
fprintf(stderr, "Illegal \"initial_quantum\"\n");
return -1;
}
set_orphan_mask = true;
} else if (strcmp(*argv, "refill_delay") == 0) {
NEXT_ARG();
if (get_time(&refill_delay, *argv)) {
......@@ -191,7 +201,10 @@ static int fq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
&defrate, sizeof(defrate));
if (set_refill_delay)
addattr_l(n, 1024, TCA_FQ_FLOW_REFILL_DELAY,
&refill_delay, sizeof(refill_delay));
&refill_delay, sizeof(refill_delay));
if (set_orphan_mask)
addattr_l(n, 1024, TCA_FQ_ORPHAN_MASK,
&orphan_mask, sizeof(refill_delay));
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
return 0;
}
......@@ -204,6 +217,7 @@ static int fq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
int pacing;
unsigned int rate, quantum;
unsigned int refill_delay;
unsigned int orphan_mask;
SPRINT_BUF(b1);
if (opt == NULL)
......@@ -226,6 +240,11 @@ static int fq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
buckets_log = rta_getattr_u32(tb[TCA_FQ_BUCKETS_LOG]);
fprintf(f, "buckets %u ", 1U << buckets_log);
}
if (tb[TCA_FQ_ORPHAN_MASK] &&
RTA_PAYLOAD(tb[TCA_FQ_ORPHAN_MASK]) >= sizeof(__u32)) {
orphan_mask = rta_getattr_u32(tb[TCA_FQ_ORPHAN_MASK]);
fprintf(f, "orphan_mask %u ", orphan_mask);
}
if (tb[TCA_FQ_RATE_ENABLE] &&
RTA_PAYLOAD(tb[TCA_FQ_RATE_ENABLE]) >= sizeof(int)) {
pacing = rta_getattr_u32(tb[TCA_FQ_RATE_ENABLE]);
......
......@@ -36,6 +36,7 @@ int show_details = 0;
int show_raw = 0;
int show_pretty = 0;
int show_graph = 0;
int timestamp;
int batch_mode = 0;
int resolve_hosts = 0;
......@@ -311,6 +312,11 @@ int main(int argc, char **argv)
matches(argv[1], "-conf") == 0) {
NEXT_ARG();
conf_file = argv[1];
} else if (matches(argv[1], "-timestamp") == 0) {
timestamp++;
} else if (matches(argv[1], "-tshort") == 0) {
++timestamp;
++timestamp_short;
} else {
fprintf(stderr, "Option \"%s\" is unknown, try \"tc -help\".\n", argv[1]);
return -1;
......
......@@ -30,7 +30,7 @@ static void usage(void) __attribute__((noreturn));
static void usage(void)
{
fprintf(stderr, "Usage: tc monitor\n");
fprintf(stderr, "Usage: tc [-timestamp [-tshort] monitor\n");
exit(-1);
}
......@@ -41,6 +41,9 @@ static int accept_tcmsg(const struct sockaddr_nl *who,
{
FILE *fp = (FILE*)arg;
if (timestamp)
print_timestamp(fp);
if (n->nlmsg_type == RTM_NEWTFILTER || n->nlmsg_type == RTM_DELTFILTER) {
print_filter(who, n, arg);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment