* [PATCH iproute2] ip: extend "ip-address" man page to reflect the recent flag extensions
From: Heiner Kallweit @ 2014-12-24 22:11 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
Extend "ip-address" man page to reflect the recent extension of
allowing to list addresses with flags tentative, deprecated, dadfailed
not being set.
Signed-off-by: Heiner Kallweit <heiner.kallweit@web.de>
---
man/man8/ip-address.8.in | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/man/man8/ip-address.8.in b/man/man8/ip-address.8.in
index 3cfc56a..d33b1ed 100644
--- a/man/man8/ip-address.8.in
+++ b/man/man8/ip-address.8.in
@@ -50,8 +50,9 @@ ip-address \- protocol address management
.ti -8
.IR FLAG " := "
-.RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
-tentative " | " deprecated " | " dadfailed " | " temporary " ]"
+.RB "[ " permanent " | " dynamic " | " secondary " | " primary " | \
+[ - ] " tentative " | [ - ] " deprecated " | [ - ] " dadfailed " | "\
+temporary " ]"
.SH "DESCRIPTION"
The
@@ -178,15 +179,29 @@ addresses.
address detection.
.TP
+.B -tentative
+(IPv6 only) only list addresses which are not in the process of
+duplicate address detection currently.
+
+.TP
.B deprecated
(IPv6 only) only list deprecated addresses.
.TP
+.B -deprecated
+(IPv6 only) only list addresses not being deprecated.
+
+.TP
.B dadfailed
(IPv6 only) only list addresses which have failed duplicate
address detection.
.TP
+.B -dadfailed
+(IPv6 only) only list addresses which have not failed duplicate
+address detection.
+
+.TP
.B temporary
(IPv6 only) only list temporary addresses.
--
2.2.1
^ permalink raw reply related
* Re: [PATCH iproute2] ip: allow ip address show to list addresses with certain flags not being set
From: Heiner Kallweit @ 2014-12-24 22:10 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20141224121649.3ef9d61d@urahara>
Am 24.12.2014 um 21:16 schrieb Stephen Hemminger:
> On Mon, 22 Dec 2014 20:18:43 +0100
> Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
>> Sometimes it's needed to have "ip address show" list only addresses
>> with certain flags not being set, e.g. in network scripts.
>> As an example one might want to exclude addresses in "tentative"
>> or "deprecated" state.
>>
>> Support listing addresses with flags tentative, deprecated, dadfailed
>> not being set by prefixing the respective flag with a minus.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>
> Applied, but please send another patch to update manual page.
>
OK, man patch update follows ..
Heiner
^ permalink raw reply
* Re: [PATCH iproute2 v3] tc: Show classes in tree view
From: Vadim Kochan @ 2014-12-24 21:09 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Vadim Kochan, netdev
In-Reply-To: <20141224121416.77a7a713@urahara>
On Wed, Dec 24, 2014 at 12:14:16PM -0800, Stephen Hemminger wrote:
> On Wed, 24 Dec 2014 02:46:16 +0200
> Vadim Kochan <vadim4j@gmail.com> wrote:
>
> > From: Vadim Kochan <vadim4j@gmail.com>
> >
> > Added new '-t[ree]' which shows classes dependency
> > in the tree view. Meanwhile only generic stats info
> > is supported.
> >
> > e.g.:
> >
> > $ tc/tc -t class show dev tap0
> > +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> > | +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> > | +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> > | | +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> > | |
> > | +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> > |
> > +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> > +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> > +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> > +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> >
> > $ tc/tc -t -s class show dev tap0
> > +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> > | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> > | | rate 0bit 0pps backlog 0b 0p requeues 0
> > | |
> > | +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> > | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> > | | rate 0bit 0pps backlog 0b 0p requeues 0
> > | |
> > | +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> > | | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> > | | | rate 0bit 0pps backlog 0b 0p requeues 0
> > | | |
> > | | +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> > | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> > | | rate 0bit 0pps backlog 0b 0p requeues 0
> > | |
> > | +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> > | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> > | rate 0bit 0pps backlog 0b 0p requeues 0
> > |
> > +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> > | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> > | rate 0bit 0pps backlog 0b 0p requeues 0
> > |
> > +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> > | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> > | rate 0bit 0pps backlog 0b 0p requeues 0
> > |
> > +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> > | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> > | rate 0bit 0pps backlog 0b 0p requeues 0
> > |
> > +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> > Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> > rate 0bit 0pps backlog 0b 0p requeues 0
> >
> > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> > ---
> > Changes v3:
> > Fixed wrong brackets style
> >
> > Changes v2:
> > Removed "Date:" from commit message which was added by mistake.
> >
> > Changes RFC -> PATCH:
> > #1 get rid of INIT_HLIST_NODE
> > #2 added sample output to commit message
> > #3 use "show_tree=1" instead of "show_tree++"
> > #4 no need update include/hlist.h (because of #1)
> > #5 changed a little tree output: parentheses around class id instead of qdisc name
> >
> > tc/tc.c | 5 +-
> > tc/tc_class.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> > tc/tc_common.h | 2 +
> > 3 files changed, 165 insertions(+), 3 deletions(-)
>
> I don't get strict about checkpatch. But ran this patch through and there are some minor
> things that would be good to fix.
> 1. Split long lines like:
> WARNING: line over 80 characters
> #198: FILE: tc/tc_class.c:219:
> +static void tree_cls_show(FILE *fp, char *buf, struct hlist_head *root_list, int level)
>
> 2. Don't use variable name 'childs', makes sense to call it children instead??
>
> 3. Don't use space before * as in:
> ERROR: "foo * bar" should be "foo *bar"
> #285: FILE: tc/tc_class.c:305:
> + struct rtattr * tb[TCA_MAX+1] = {};
>
>
>
>
I will fix them.
^ permalink raw reply
* Re: [PATCH iproute2 2/4] ip: Allow to easy change network namespace
From: Vadim Kochan @ 2014-12-24 21:07 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Vadim Kochan, netdev
In-Reply-To: <20141224123522.15370a16@urahara>
On Wed, Dec 24, 2014 at 12:35:22PM -0800, Stephen Hemminger wrote:
> On Sat, 13 Dec 2014 19:55:32 +0200
> Vadim Kochan <vadim4j@gmail.com> wrote:
>
> > From: Vadim Kochan <vadim4j@gmail.com>
> >
> > Added new '-netns' option to simplify executing following cmd:
> >
> > ip netns exec NETNS ip OPTIONS COMMAND OBJECT
> >
> > to
> >
> > ip -n[etns] NETNS OPTIONS COMMAND OBJECT
> >
> > e.g.:
> >
> > ip -net vnet0 link add br0 type bridge
> > ip -n vnet0 link
> >
> > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
>
> Needs to be rebased against current upstream code.
> Will not apply clean any more.
>
> Please resubmit whole patch series.
Done, fixed conflicts in ip usage func.
Regards,
^ permalink raw reply
* [PATCH iproute2 v2 4/4] tc: Allow to easy change network namespace
From: Vadim Kochan @ 2014-12-24 21:04 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan, Jiri Pirko
In-Reply-To: <1419455051-23397-1-git-send-email-vadim4j@gmail.com>
From: Vadim Kochan <vadim4j@gmail.com>
Added new '-netns' option to simplify executing following cmd:
ip netns exec NETNS tc OPTIONS COMMAND OBJECT
to
tc -n[etns] NETNS OPTIONS COMMAND OBJECT
e.g.:
tc -net vnet0 qdisc
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
man/man8/tc.8 | 65 +++++++++++++++++++++++++++++++++++++++++++++--------------
tc/Makefile | 5 +++++
tc/tc.c | 8 +++++++-
3 files changed, 62 insertions(+), 16 deletions(-)
diff --git a/man/man8/tc.8 b/man/man8/tc.8
index 8d794de..d8f974f 100644
--- a/man/man8/tc.8
+++ b/man/man8/tc.8
@@ -2,7 +2,9 @@
.SH NAME
tc \- show / manipulate traffic control settings
.SH SYNOPSIS
-.B tc qdisc [ add | change | replace | link | delete ] dev
+.B tc
+.RI "[ " OPTIONS " ]"
+.B qdisc [ add | change | replace | link | delete ] dev
DEV
.B
[ parent
@@ -13,7 +15,9 @@ qdisc-id ] qdisc
[ qdisc specific parameters ]
.P
-.B tc class [ add | change | replace | delete ] dev
+.B tc
+.RI "[ " OPTIONS " ]"
+.B class [ add | change | replace | delete ] dev
DEV
.B parent
qdisc-id
@@ -22,7 +26,9 @@ class-id ] qdisc
[ qdisc specific parameters ]
.P
-.B tc filter [ add | change | replace | delete ] dev
+.B tc
+.RI "[ " OPTIONS " ]"
+.B filter [ add | change | replace | delete ] dev
DEV
.B [ parent
qdisc-id
@@ -35,21 +41,28 @@ priority filtertype
flow-id
.B tc
+.RI "[ " OPTIONS " ]"
.RI "[ " FORMAT " ]"
.B qdisc show [ dev
DEV
.B ]
.P
.B tc
+.RI "[ " OPTIONS " ]"
.RI "[ " FORMAT " ]"
.B class show dev
DEV
.P
-.B tc filter show dev
+.B tc
+.RI "[ " OPTIONS " ]"
+.B filter show dev
DEV
.P
-.B tc [ -force ] -b\fR[\fIatch\fR] \fB[ filename ]
+.ti 8
+.IR OPTIONS " := {"
+\fB[ -force ] -b\fR[\fIatch\fR] \fB[ filename ] \fR|
+\fB[ \fB-n\fR[\fIetns\fR] name \fB] \fR}
.ti 8
.IR FORMAT " := {"
@@ -407,6 +420,38 @@ link
Only available for qdiscs and performs a replace where the node
must exist already.
+.SH OPTIONS
+
+.TP
+.BR "\-b", " \-b filename", " \-batch", " \-batch filename"
+read commands from provided file or standard input and invoke them.
+First failure will cause termination of tc.
+
+.TP
+.BR "\-force"
+don't terminate tc on errors in batch mode.
+If there were any errors during execution of the commands, the application return code will be non zero.
+
+.TP
+.BR "\-n" , " \-net" , " \-netns " <NETNS>
+switches
+.B tc
+to the specified network namespace
+.IR NETNS .
+Actually it just simplifies executing of:
+
+.B ip netns exec
+.IR NETNS
+.B tc
+.RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
+.BR help " }"
+
+to
+
+.B tc
+.RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
+.BR help " }"
+
.SH FORMAT
The show command has additional formatting options:
@@ -430,16 +475,6 @@ decode filter offset and mask values to equivalent filter commands based on TCP/
.BR "\-iec"
print rates in IEC units (ie. 1K = 1024).
-.TP
-.BR "\-b", " \-b filename", " \-batch", " \-batch filename"
-read commands from provided file or standard input and invoke them.
-First failure will cause termination of tc.
-
-.TP
-.BR "\-force"
-don't terminate tc on errors in batch mode.
-If there were any errors during execution of the commands, the application return code will be non zero.
-
.SH HISTORY
.B tc
was written by Alexey N. Kuznetsov and added in Linux 2.2.
diff --git a/tc/Makefile b/tc/Makefile
index 830c97d..9412094 100644
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -3,6 +3,11 @@ TCOBJ= tc.o tc_qdisc.o tc_class.o tc_filter.o tc_util.o \
m_ematch.o emp_ematch.yacc.o emp_ematch.lex.o
include ../Config
+
+ifeq ($(IP_CONFIG_SETNS),y)
+ CFLAGS += -DHAVE_SETNS
+endif
+
SHARED_LIBS ?= y
TCMODULES :=
diff --git a/tc/tc.c b/tc/tc.c
index 9b50e74..ea4ba10 100644
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -29,6 +29,7 @@
#include "utils.h"
#include "tc_util.h"
#include "tc_common.h"
+#include "namespace.h"
int show_stats = 0;
int show_details = 0;
@@ -185,7 +186,8 @@ static void usage(void)
fprintf(stderr, "Usage: tc [ OPTIONS ] OBJECT { COMMAND | help }\n"
" tc [-force] -batch filename\n"
"where OBJECT := { qdisc | class | filter | action | monitor }\n"
- " OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -p[retty] | -b[atch] [filename] }\n");
+ " OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -p[retty] | -b[atch] [filename] | "
+ "-n[etns] name }\n");
}
static int do_cmd(int argc, char **argv)
@@ -293,6 +295,10 @@ int main(int argc, char **argv)
if (argc <= 1)
usage();
batch_file = argv[1];
+ } else if (matches(argv[1], "-netns") == 0) {
+ NEXT_ARG();
+ if (netns_switch(argv[1]))
+ return -1;
} else {
fprintf(stderr, "Option \"%s\" is unknown, try \"tc -help\".\n", argv[1]);
return -1;
--
2.1.3
^ permalink raw reply related
* [PATCH iproute2 v2 3/4] bridge: Allow to easy change network namespace
From: Vadim Kochan @ 2014-12-24 21:04 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan, Jiri Pirko
In-Reply-To: <1419455051-23397-1-git-send-email-vadim4j@gmail.com>
From: Vadim Kochan <vadim4j@gmail.com>
Added new '-netns' option to simplify executing following cmd:
ip netns exec NETNS bridge OPTIONS COMMAND OBJECT
to
bridge -n[etns] NETNS OPTIONS COMMAND OBJECT
e.g.:
bridge -net vnet0 fdb
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
bridge/Makefile | 4 ++++
bridge/bridge.c | 7 ++++++-
man/man8/bridge.8 | 23 ++++++++++++++++++++++-
3 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/bridge/Makefile b/bridge/Makefile
index 1fb8320..9800753 100644
--- a/bridge/Makefile
+++ b/bridge/Makefile
@@ -2,6 +2,10 @@ BROBJ = bridge.o fdb.o monitor.o link.o mdb.o vlan.o
include ../Config
+ifeq ($(IP_CONFIG_SETNS),y)
+ CFLAGS += -DHAVE_SETNS
+endif
+
all: bridge
bridge: $(BROBJ) $(LIBNETLINK)
diff --git a/bridge/bridge.c b/bridge/bridge.c
index ee08f90..5fcc552 100644
--- a/bridge/bridge.c
+++ b/bridge/bridge.c
@@ -13,6 +13,7 @@
#include "SNAPSHOT.h"
#include "utils.h"
#include "br_common.h"
+#include "namespace.h"
struct rtnl_handle rth = { .fd = -1 };
int preferred_family = AF_UNSPEC;
@@ -31,7 +32,7 @@ static void usage(void)
"Usage: bridge [ OPTIONS ] OBJECT { COMMAND | help }\n"
"where OBJECT := { link | fdb | mdb | vlan | monitor }\n"
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] |\n"
-" -o[neline] | -t[imestamp] \n");
+" -o[neline] | -t[imestamp] | -n[etns] name }\n");
exit(-1);
}
@@ -112,6 +113,10 @@ main(int argc, char **argv)
preferred_family = AF_INET;
} else if (strcmp(opt, "-6") == 0) {
preferred_family = AF_INET6;
+ } else if (matches(opt, "-netns") == 0) {
+ NEXT_ARG();
+ if (netns_switch(argv[1]))
+ exit(-1);
} else {
fprintf(stderr, "Option \"%s\" is unknown, try \"bridge help\".\n", opt);
exit(-1);
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
index af31d41..cb3fb46 100644
--- a/man/man8/bridge.8
+++ b/man/man8/bridge.8
@@ -19,7 +19,8 @@ bridge \- show / manipulate bridge addresses and devices
.ti -8
.IR OPTIONS " := { "
\fB\-V\fR[\fIersion\fR] |
-\fB\-s\fR[\fItatistics\fR] }
+\fB\-s\fR[\fItatistics\fR] |
+\fB\-n\fR[\fIetns\fR] name }
.ti -8
.BR "bridge link set"
@@ -112,6 +113,26 @@ output more information. If this option
is given multiple times, the amount of information increases.
As a rule, the information is statistics or some time values.
+.TP
+.BR "\-n" , " \-net" , " \-netns " <NETNS>
+switches
+.B bridge
+to the specified network namespace
+.IR NETNS .
+Actually it just simplifies executing of:
+
+.B ip netns exec
+.IR NETNS
+.B bridge
+.RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
+.BR help " }"
+
+to
+
+.B bridge
+.RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
+.BR help " }"
+
.SH BRIDGE - COMMAND SYNTAX
--
2.1.3
^ permalink raw reply related
* [PATCH iproute2 v2 2/4] ip: Allow to easy change network namespace
From: Vadim Kochan @ 2014-12-24 21:04 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan, Jiri Pirko
In-Reply-To: <1419455051-23397-1-git-send-email-vadim4j@gmail.com>
From: Vadim Kochan <vadim4j@gmail.com>
Added new '-netns' option to simplify executing following cmd:
ip netns exec NETNS ip OPTIONS COMMAND OBJECT
to
ip -n[etns] NETNS OPTIONS COMMAND OBJECT
e.g.:
ip -net vnet0 link add br0 type bridge
ip -n vnet0 link
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
ip/ip.c | 7 ++++++-
man/man8/ip.8 | 23 ++++++++++++++++++++++-
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/ip/ip.c b/ip/ip.c
index 9b90707..61cc9c3 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -22,6 +22,7 @@
#include "SNAPSHOT.h"
#include "utils.h"
#include "ip_common.h"
+#include "namespace.h"
int preferred_family = AF_UNSPEC;
int human_readable = 0;
@@ -54,7 +55,7 @@ static void usage(void)
" -4 | -6 | -I | -D | -B | -0 |\n"
" -l[oops] { maximum-addr-flush-attempts } |\n"
" -o[neline] | -t[imestamp] | -t[short] | -b[atch] [filename] |\n"
-" -rc[vbuf] [size]}\n");
+" -rc[vbuf] [size] | -n[etns] name }\n");
exit(-1);
}
@@ -265,6 +266,10 @@ int main(int argc, char **argv)
rcvbuf = size;
} else if (matches(opt, "-help") == 0) {
usage();
+ } else if (matches(opt, "-netns") == 0) {
+ NEXT_ARG();
+ if (netns_switch(argv[1]))
+ exit(-1);
} else {
fprintf(stderr, "Option \"%s\" is unknown, try \"ip -help\".\n", opt);
exit(-1);
diff --git a/man/man8/ip.8 b/man/man8/ip.8
index 2d42e98..0bae59e 100644
--- a/man/man8/ip.8
+++ b/man/man8/ip.8
@@ -31,7 +31,8 @@ ip \- show / manipulate routing, devices, policy routing and tunnels
\fB\-r\fR[\fIesolve\fR] |
\fB\-f\fR[\fIamily\fR] {
.BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | "
-\fB\-o\fR[\fIneline\fR] }
+\fB\-o\fR[\fIneline\fR] |
+\fB\-n\fR[\fIetns\fR] name }
.SH OPTIONS
@@ -134,6 +135,26 @@ the output.
use the system's name resolver to print DNS names instead of
host addresses.
+.TP
+.BR "\-n" , " \-net" , " \-netns " <NETNS>
+switches
+.B ip
+to the specified network namespace
+.IR NETNS .
+Actually it just simplifies executing of:
+
+.B ip netns exec
+.IR NETNS
+.B ip
+.RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
+.BR help " }"
+
+to
+
+.B ip
+.RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
+.BR help " }"
+
.SH IP - COMMAND SYNTAX
.SS
--
2.1.3
^ permalink raw reply related
* [PATCH iproute2 v2 1/4] lib: Add netns_switch func for change network namespace
From: Vadim Kochan @ 2014-12-24 21:04 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan, Jiri Pirko
In-Reply-To: <1419455051-23397-1-git-send-email-vadim4j@gmail.com>
From: Vadim Kochan <vadim4j@gmail.com>
New netns_switch func moved to the lib/namespace.c from ip/ipnetns.c
so it can be used from the other tools for fast switching
network namespace.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
include/namespace.h | 46 +++++++++++++++++++++++
ip/ipnetns.c | 106 ++--------------------------------------------------
lib/Makefile | 6 ++-
lib/namespace.c | 86 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 140 insertions(+), 104 deletions(-)
create mode 100644 include/namespace.h
create mode 100644 lib/namespace.c
diff --git a/include/namespace.h b/include/namespace.h
new file mode 100644
index 0000000..2f13e65
--- /dev/null
+++ b/include/namespace.h
@@ -0,0 +1,46 @@
+#ifndef __NAMESPACE_H__
+#define __NAMESPACE_H__ 1
+
+#include <sched.h>
+#include <sys/mount.h>
+#include <errno.h>
+
+#define NETNS_RUN_DIR "/var/run/netns"
+#define NETNS_ETC_DIR "/etc/netns"
+
+#ifndef CLONE_NEWNET
+#define CLONE_NEWNET 0x40000000 /* New network namespace (lo, device, names sockets, etc) */
+#endif
+
+#ifndef MNT_DETACH
+#define MNT_DETACH 0x00000002 /* Just detach from the tree */
+#endif /* MNT_DETACH */
+
+/* sys/mount.h may be out too old to have these */
+#ifndef MS_REC
+#define MS_REC 16384
+#endif
+
+#ifndef MS_SLAVE
+#define MS_SLAVE (1 << 19)
+#endif
+
+#ifndef MS_SHARED
+#define MS_SHARED (1 << 20)
+#endif
+
+#ifndef HAVE_SETNS
+static int setns(int fd, int nstype)
+{
+#ifdef __NR_setns
+ return syscall(__NR_setns, fd, nstype);
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
+#endif /* HAVE_SETNS */
+
+extern int netns_switch(char *netns);
+
+#endif /* __NAMESPACE_H__ */
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 1c8aa02..519d518 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -17,42 +17,7 @@
#include "utils.h"
#include "ip_common.h"
-
-#define NETNS_RUN_DIR "/var/run/netns"
-#define NETNS_ETC_DIR "/etc/netns"
-
-#ifndef CLONE_NEWNET
-#define CLONE_NEWNET 0x40000000 /* New network namespace (lo, device, names sockets, etc) */
-#endif
-
-#ifndef MNT_DETACH
-#define MNT_DETACH 0x00000002 /* Just detach from the tree */
-#endif /* MNT_DETACH */
-
-/* sys/mount.h may be out too old to have these */
-#ifndef MS_REC
-#define MS_REC 16384
-#endif
-
-#ifndef MS_SLAVE
-#define MS_SLAVE (1 << 19)
-#endif
-
-#ifndef MS_SHARED
-#define MS_SHARED (1 << 20)
-#endif
-
-#ifndef HAVE_SETNS
-static int setns(int fd, int nstype)
-{
-#ifdef __NR_setns
- return syscall(__NR_setns, fd, nstype);
-#else
- errno = ENOSYS;
- return -1;
-#endif
-}
-#endif /* HAVE_SETNS */
+#include "namespace.h"
static int usage(void)
{
@@ -101,42 +66,12 @@ static int netns_list(int argc, char **argv)
return 0;
}
-static void bind_etc(const char *name)
-{
- char etc_netns_path[MAXPATHLEN];
- char netns_name[MAXPATHLEN];
- char etc_name[MAXPATHLEN];
- struct dirent *entry;
- DIR *dir;
-
- snprintf(etc_netns_path, sizeof(etc_netns_path), "%s/%s", NETNS_ETC_DIR, name);
- dir = opendir(etc_netns_path);
- if (!dir)
- return;
-
- while ((entry = readdir(dir)) != NULL) {
- if (strcmp(entry->d_name, ".") == 0)
- continue;
- if (strcmp(entry->d_name, "..") == 0)
- continue;
- snprintf(netns_name, sizeof(netns_name), "%s/%s", etc_netns_path, entry->d_name);
- snprintf(etc_name, sizeof(etc_name), "/etc/%s", entry->d_name);
- if (mount(netns_name, etc_name, "none", MS_BIND, NULL) < 0) {
- fprintf(stderr, "Bind %s -> %s failed: %s\n",
- netns_name, etc_name, strerror(errno));
- }
- }
- closedir(dir);
-}
-
static int netns_exec(int argc, char **argv)
{
/* Setup the proper environment for apps that are not netns
* aware, and execute a program in that environment.
*/
- const char *name, *cmd;
- char net_path[MAXPATHLEN];
- int netns;
+ const char *cmd;
if (argc < 1) {
fprintf(stderr, "No netns name specified\n");
@@ -146,45 +81,10 @@ static int netns_exec(int argc, char **argv)
fprintf(stderr, "No command specified\n");
return -1;
}
-
- name = argv[0];
cmd = argv[1];
- snprintf(net_path, sizeof(net_path), "%s/%s", NETNS_RUN_DIR, name);
- netns = open(net_path, O_RDONLY | O_CLOEXEC);
- if (netns < 0) {
- fprintf(stderr, "Cannot open network namespace \"%s\": %s\n",
- name, strerror(errno));
- return -1;
- }
-
- if (setns(netns, CLONE_NEWNET) < 0) {
- fprintf(stderr, "setting the network namespace \"%s\" failed: %s\n",
- name, strerror(errno));
- return -1;
- }
- if (unshare(CLONE_NEWNS) < 0) {
- fprintf(stderr, "unshare failed: %s\n", strerror(errno));
- return -1;
- }
- /* Don't let any mounts propagate back to the parent */
- if (mount("", "/", "none", MS_SLAVE | MS_REC, NULL)) {
- fprintf(stderr, "\"mount --make-rslave /\" failed: %s\n",
- strerror(errno));
+ if (netns_switch(argv[0]))
return -1;
- }
- /* Mount a version of /sys that describes the network namespace */
- if (umount2("/sys", MNT_DETACH) < 0) {
- fprintf(stderr, "umount of /sys failed: %s\n", strerror(errno));
- return -1;
- }
- if (mount(name, "/sys", "sysfs", 0, NULL) < 0) {
- fprintf(stderr, "mount of /sys failed: %s\n",strerror(errno));
- return -1;
- }
-
- /* Setup bind mounts for config files in /etc */
- bind_etc(name);
fflush(stdout);
diff --git a/lib/Makefile b/lib/Makefile
index a42b885..66f89f1 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,8 +1,12 @@
include ../Config
+ifeq ($(IP_CONFIG_SETNS),y)
+ CFLAGS += -DHAVE_SETNS
+endif
+
CFLAGS += -fPIC
-UTILOBJ=utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o inet_proto.o
+UTILOBJ=utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o inet_proto.o namespace.o
NLOBJ=libgenl.o ll_map.o libnetlink.o
diff --git a/lib/namespace.c b/lib/namespace.c
new file mode 100644
index 0000000..1554ce0
--- /dev/null
+++ b/lib/namespace.c
@@ -0,0 +1,86 @@
+/*
+ * namespace.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <fcntl.h>
+#include <dirent.h>
+
+#include "utils.h"
+#include "namespace.h"
+
+static void bind_etc(const char *name)
+{
+ char etc_netns_path[MAXPATHLEN];
+ char netns_name[MAXPATHLEN];
+ char etc_name[MAXPATHLEN];
+ struct dirent *entry;
+ DIR *dir;
+
+ snprintf(etc_netns_path, sizeof(etc_netns_path), "%s/%s", NETNS_ETC_DIR, name);
+ dir = opendir(etc_netns_path);
+ if (!dir)
+ return;
+
+ while ((entry = readdir(dir)) != NULL) {
+ if (strcmp(entry->d_name, ".") == 0)
+ continue;
+ if (strcmp(entry->d_name, "..") == 0)
+ continue;
+ snprintf(netns_name, sizeof(netns_name), "%s/%s", etc_netns_path, entry->d_name);
+ snprintf(etc_name, sizeof(etc_name), "/etc/%s", entry->d_name);
+ if (mount(netns_name, etc_name, "none", MS_BIND, NULL) < 0) {
+ fprintf(stderr, "Bind %s -> %s failed: %s\n",
+ netns_name, etc_name, strerror(errno));
+ }
+ }
+ closedir(dir);
+}
+
+int netns_switch(char *name)
+{
+ char net_path[MAXPATHLEN];
+ int netns;
+
+ snprintf(net_path, sizeof(net_path), "%s/%s", NETNS_RUN_DIR, name);
+ netns = open(net_path, O_RDONLY | O_CLOEXEC);
+ if (netns < 0) {
+ fprintf(stderr, "Cannot open network namespace \"%s\": %s\n",
+ name, strerror(errno));
+ return -1;
+ }
+
+ if (setns(netns, CLONE_NEWNET) < 0) {
+ fprintf(stderr, "setting the network namespace \"%s\" failed: %s\n",
+ name, strerror(errno));
+ return -1;
+ }
+
+ if (unshare(CLONE_NEWNS) < 0) {
+ fprintf(stderr, "unshare failed: %s\n", strerror(errno));
+ return -1;
+ }
+ /* Don't let any mounts propagate back to the parent */
+ if (mount("", "/", "none", MS_SLAVE | MS_REC, NULL)) {
+ fprintf(stderr, "\"mount --make-rslave /\" failed: %s\n",
+ strerror(errno));
+ return -1;
+ }
+ /* Mount a version of /sys that describes the network namespace */
+ if (umount2("/sys", MNT_DETACH) < 0) {
+ fprintf(stderr, "umount of /sys failed: %s\n", strerror(errno));
+ return -1;
+ }
+ if (mount(name, "/sys", "sysfs", 0, NULL) < 0) {
+ fprintf(stderr, "mount of /sys failed: %s\n",strerror(errno));
+ return -1;
+ }
+
+ /* Setup bind mounts for config files in /etc */
+ bind_etc(name);
+ return 0;
+}
--
2.1.3
^ permalink raw reply related
* [PATCH iproute2 v2 0/4] Switch network ns w/o 'netns exec' for iproute2 tools
From: Vadim Kochan @ 2014-12-24 21:04 UTC (permalink / raw)
To: netdev; +Cc: Vadim Kochan
From: Vadim Kochan <vadim4j@gmail.com>
This series adds new -n[etns] option to ip, tc & bridge tools which
allows to easy and faster switch to specified network namespace. So instead of:
ip netns exec NETNS { ip | tc | bridge } OBJECT COMMAND
it will be possible do the same by:
{ ip | tc | bridge } -n[etns] NETNS OBJECT COMMAND
I skipped misc tools and will work on them later.
Vadim Kochan (4):
lib: Add netns_switch func for change network namespace
ip: Allow to easy change network namespace
bridge: Allow to easy change network namespace
tc: Allow to easy change network namespace
bridge/Makefile | 4 ++
bridge/bridge.c | 7 +++-
include/namespace.h | 46 +++++++++++++++++++++++
ip/ip.c | 7 +++-
ip/ipnetns.c | 106 ++--------------------------------------------------
lib/Makefile | 6 ++-
lib/namespace.c | 86 ++++++++++++++++++++++++++++++++++++++++++
man/man8/bridge.8 | 23 +++++++++++-
man/man8/ip.8 | 23 +++++++++++-
man/man8/tc.8 | 65 ++++++++++++++++++++++++--------
tc/Makefile | 5 +++
tc/tc.c | 8 +++-
12 files changed, 262 insertions(+), 124 deletions(-)
create mode 100644 include/namespace.h
create mode 100644 lib/namespace.c
--
2.1.3
^ permalink raw reply
* [ANNOUNCE] iproute2 v3.18
From: Stephen Hemminger @ 2014-12-24 20:55 UTC (permalink / raw)
To: netdev; +Cc: lkml
Just in time for those last minute gifts!
Update to iproute2 for 3.18
Lots of activity around switching, ss command output and usual
set of documentation fixes. Vadim has also revived the long ignored
tests.
Source:
http://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-3.18.0.tar.gz
Repository:
git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
Report problems (or enhancements) to the netdev@vger.kernel.org mailing list.
---
Alexey Andriyanov (1):
iproute2: ip6_tunnel mode bugfixes: any,vti6
Christian Hesse (3):
ip-link: add switch to show human readable output
ip-link: fix column alignment
ip-link: in human readable output use dynamic precision length
Daniel Borkmann (1):
ss: output dctcp diag information
Dave Taht (1):
iproute2: Add support for babel protocol table entry
Eric Dumazet (2):
netlink: extend buffers to 16K
iproute2/nstat: Bug in displaying icmp stats
Florian Westphal (1):
utils: relax strtoX checking in get_time_rtt
Heiner Kallweit (1):
ip: allow ip address show to list addresses with certain flags not being set
Jiri Pirko (2):
add bridge_slave device support
add bridge master device support
Masatake YAMATO (1):
man: ip-link: fix a typo
Nicolas Dichtel (2):
man: update doc after support of ESN and anti-replay window
ipaddress: enable -details option
Nikita Edward Baruzdin (1):
iproute2: Add support for CAN presume-ack feature
Or Gerlitz (1):
ip-link: Document IPoIB link type in the man page
Pavel Simerda (1):
ip route: don't assume default route
Scott Feldman (1):
bridge/fdb: fix statistics output spacing
Stephen Hemminger (15):
update headers to 3.17.0 net-next
Update kernel headers to 3.18-rc2
ip: add iec formatted option and cleanup code
update if_bridge
rt_dsfield: fix Expedited Forwarding PHB
tunnel: decode ESP tunnel type
tc: minor spelling fixes
ip-link: fix unterminated string in manpage
add local version of linux/in6.h
need libc-compat.h for new in6.h
if_bridge: remove in6.h
rt_names can't be const
resolve header file conflict betwen linux/in6.h and netinet/in.h
whitespace cleanup
v3.18.0
Tom Herbert (5):
ip fou: Support to configure foo-over-udp RX
ip link ipip: Add support to configure FOU and GUE
ip link gre: Add support to configure FOU and GUE
iproute2: Man pages for fou and gue
vxlan: Add support for enabling UDP checksums
Vadim Kochan (4):
ip link: Allow to filter devices by master dev
ss: Dont show netlink and packet sockets by default
ip lib: Added shorter timestamp option
ip link: Show devices by type
dingzhi (1):
xfrm: add support of ESN and anti-replay window
vadimk (24):
man ip-link: Fixed missing 'up' option in 'ip link show' synopsis
doc make: Add *.pdf files to the 'clean' target
gitignore: Ignore 'doc' files generated at runtime
man ip: Add missing '-details' option
tests: Skip cls-testbed.t if tests/cls dir does not exist
tests: Allow to run tests recursively
doc ip-cref: Added missing ip options
ss: Identify more netlink protocol names
ip monitor: Allow to filter events by dev
tests: Move tc related tests to testsuite/tests/tc folder
ip netns: Identify netns for the current process
ss: Remove checking SS_CLOSE state for packet and netlink
ss: Fixed broken output for Netlink 'Peer Address:Port' column
ss: Refactor to use macro for define diag nl request
man ip-link: Add description for 'help' command
ss: Use generic handle_netlink_request for packet
configure: Add check for the doc tools
man ip-link: Fix indentation for 'ip link show' options
ip monitor: Fix issue when timestamp is printed w/o msg
ss: Fix layout/output issues introduced by regression
lib names: Use CONFDIR for specify 'group' file path
lib names: Add helper func for parse id and name from file
ss: Use nl_proto_a2n for filtering by netlink proto
ss: Use rtnl_dump_filter in handle_netlink_request
^ permalink raw reply
* Re: [PATCH iproute2 2/4] ip: Allow to easy change network namespace
From: Vadim Kochan @ 2014-12-24 20:33 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Vadim Kochan, netdev
In-Reply-To: <20141224123522.15370a16@urahara>
On Wed, Dec 24, 2014 at 12:35:22PM -0800, Stephen Hemminger wrote:
> On Sat, 13 Dec 2014 19:55:32 +0200
> Vadim Kochan <vadim4j@gmail.com> wrote:
>
> > From: Vadim Kochan <vadim4j@gmail.com>
> >
> > Added new '-netns' option to simplify executing following cmd:
> >
> > ip netns exec NETNS ip OPTIONS COMMAND OBJECT
> >
> > to
> >
> > ip -n[etns] NETNS OPTIONS COMMAND OBJECT
> >
> > e.g.:
> >
> > ip -net vnet0 link add br0 type bridge
> > ip -n vnet0 link
> >
> > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
>
> Needs to be rebased against current upstream code.
> Will not apply clean any more.
>
> Please resubmit whole patch series.
And add Signed-off for Jiri as he was add it for each patch ?
^ permalink raw reply
* Re: [patch iproute2 3/6] bridge/fdb: add flag/indication for FDB entry synced from offload device
From: Stephen Hemminger @ 2014-12-24 20:39 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, jeffrey.t.kirsher, vyasevic, xiyou.wangcong,
john.r.fastabend, edumazet, jhs, sfeldma, f.fainelli, roopa,
linville, jasowang, ebiederm, nicolas.dichtel, ryazanov.s.a,
buytenh, aviadr, nbd, alexei.starovoitov, Neil.Jerram, ronye,
simon.horman, alexander.h.duyck, john.ronciak, mleitner, shrijeet,
gospo, bcrl, hemal
In-Reply-To: <1417683438-10935-4-git-send-email-jiri@resnulli.us>
On Thu, 4 Dec 2014 09:57:15 +0100
Jiri Pirko <jiri@resnulli.us> wrote:
> From: Scott Feldman <sfeldma@gmail.com>
>
> Add NTF_EXT_LEARNED flag to neigh flags to indicate FDB entry learned by
> device has been learned externally to bridge FDB. For these entries,
> add "external" annotation in bridge fdb show output:
>
> 00:02:00:00:03:00 dev swp2 used 2/2 master br0 external
> 00:02:00:00:03:00 dev swp2 self permanent
>
> In the example above, 00:02:00:00:03:00 is shown twice on dev swp2. The
> first entry if from the bridge (master) and is marked as "external" by
> the offload device. The second entry is from the brport offload device (self),
> and was learned by the device.
>
> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Does not apply to current code.
Please resubmit (with out the change to neighbour.h which is already there).
^ permalink raw reply
* Re: [patch iproute2 4/6] bridge/link: add new offload hwmode swdev
From: Stephen Hemminger @ 2014-12-24 20:37 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, nhorman, andy, tgraf, dborkman, ogerlitz, jesse,
pshelar, azhou, ben, jeffrey.t.kirsher, vyasevic, xiyou.wangcong,
john.r.fastabend, edumazet, jhs, sfeldma, f.fainelli, roopa,
linville, jasowang, ebiederm, nicolas.dichtel, ryazanov.s.a,
buytenh, aviadr, nbd, alexei.starovoitov, Neil.Jerram, ronye,
simon.horman, alexander.h.duyck, john.ronciak, mleitner, shrijeet,
gospo, bcrl, hemal
In-Reply-To: <1417683438-10935-5-git-send-email-jiri@resnulli.us>
On Thu, 4 Dec 2014 09:57:16 +0100
Jiri Pirko <jiri@resnulli.us> wrote:
> From: Scott Feldman <sfeldma@gmail.com>
>
> To support full-featured switch devices offloading bridge funtionality,
> add new hwmode 'swdev'. Like 'vepa' and 'veb', 'swdev' indicated bridge
> port functionality is being offloaded to hardware.
>
> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Please resubmit when the functionality is in net-next.
^ permalink raw reply
* Re: [PATCH iproute2 2/4] ip: Allow to easy change network namespace
From: Stephen Hemminger @ 2014-12-24 20:35 UTC (permalink / raw)
To: Vadim Kochan; +Cc: netdev
In-Reply-To: <1418493334-23142-3-git-send-email-vadim4j@gmail.com>
On Sat, 13 Dec 2014 19:55:32 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:
> From: Vadim Kochan <vadim4j@gmail.com>
>
> Added new '-netns' option to simplify executing following cmd:
>
> ip netns exec NETNS ip OPTIONS COMMAND OBJECT
>
> to
>
> ip -n[etns] NETNS OPTIONS COMMAND OBJECT
>
> e.g.:
>
> ip -net vnet0 link add br0 type bridge
> ip -n vnet0 link
>
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Needs to be rebased against current upstream code.
Will not apply clean any more.
Please resubmit whole patch series.
^ permalink raw reply
* Re: [PATCH v3 iproute2] bridge link: add option 'self'
From: Stephen Hemminger @ 2014-12-24 20:30 UTC (permalink / raw)
To: Scott Feldman
Cc: Roopa Prabhu, Jiří Pírko, Jamal Hadi Salim,
Benjamin LaHaise, Thomas Graf, john fastabend, John Linville,
vyasevic@redhat.com, Netdev, David S. Miller,
shm@cumulusnetworks.com, Andy Gospodarek
In-Reply-To: <CAE4R7bCDTmR_zaVredZNzviaXc1YzXtSAK3dYj+BekiW9OKSpQ@mail.gmail.com>
On Sat, 6 Dec 2014 09:12:51 -0800
Scott Feldman <sfeldma@gmail.com> wrote:
> Signed-of-by: Scott Feldman <sfeldma@gmail.com>
>
> On Sat, Dec 6, 2014 at 12:21 AM, <roopa@cumulusnetworks.com> wrote:
> > From: Roopa Prabhu <roopa@cumulusnetworks.com>
> >
> > Currently self is set internally only if hwmode is set.
> > This makes it necessary for the hw to have a mode.
> > There is no hwmode really required to go to hardware. So, introduce
> > self for anybody who wants to target hardware.
> >
> > v1 -> v2
> > - fix a few bugs. Initialize flags to zero: this was required to
> > keep the current behaviour unchanged.
> >
> > v2 -> v3
> > - fix comment
> >
> > Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Applied to post 3.18 current tree.
^ permalink raw reply
* Re: [PATCH iproute2] ip link: use addattr_nest()/addattr_nest_end()
From: Stephen Hemminger @ 2014-12-24 20:27 UTC (permalink / raw)
To: Duan Jiong; +Cc: netdev
In-Reply-To: <549130AD.6090407@cn.fujitsu.com>
On Wed, 17 Dec 2014 15:28:45 +0800
Duan Jiong <duanj.fnst@cn.fujitsu.com> wrote:
>
> Use addattr_nest() and addattr_nest_end() to simplify the code.
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Applied to latest (which is after 3.18.0)
^ permalink raw reply
* Re: [PATCH] openvswitch: fix odd_ptr_err.cocci warnings
From: David Miller @ 2014-12-24 20:18 UTC (permalink / raw)
To: pshelar; +Cc: fengguang.wu, kbuild-all, dev, netdev, linux-kernel
In-Reply-To: <CALnjE+qNmBekeS_vbSx23myvocShRE1mZ6nHew3Hr=dQt=rHSw@mail.gmail.com>
From: Pravin Shelar <pshelar@nicira.com>
Date: Wed, 24 Dec 2014 10:49:22 -0800
> On Tue, Dec 23, 2014 at 10:41 PM, kbuild test robot
> <fengguang.wu@intel.com> wrote:
>> net/openvswitch/vport-gre.c:188:5-11: inconsistent IS_ERR and PTR_ERR, PTR_ERR on line 189
>>
>> PTR_ERR should access the value just tested by IS_ERR
>>
>> Semantic patch information:
>> There can be false positives in the patch case, where it is the call
>> IS_ERR that is wrong.
>>
>> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
>>
>> CC: Pravin B Shelar <pshelar@nicira.com>
>> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>
> Thanks for the fix.
>
> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH iproute2] ip: allow ip address show to list addresses with certain flags not being set
From: Stephen Hemminger @ 2014-12-24 20:16 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: netdev
In-Reply-To: <54986E93.4030108@gmail.com>
On Mon, 22 Dec 2014 20:18:43 +0100
Heiner Kallweit <hkallweit1@gmail.com> wrote:
> Sometimes it's needed to have "ip address show" list only addresses
> with certain flags not being set, e.g. in network scripts.
> As an example one might want to exclude addresses in "tentative"
> or "deprecated" state.
>
> Support listing addresses with flags tentative, deprecated, dadfailed
> not being set by prefixing the respective flag with a minus.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Applied, but please send another patch to update manual page.
^ permalink raw reply
* Re: [PATCH iproute2 v3] tc: Show classes in tree view
From: Stephen Hemminger @ 2014-12-24 20:14 UTC (permalink / raw)
To: Vadim Kochan; +Cc: netdev
In-Reply-To: <1419381976-23986-1-git-send-email-vadim4j@gmail.com>
On Wed, 24 Dec 2014 02:46:16 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:
> From: Vadim Kochan <vadim4j@gmail.com>
>
> Added new '-t[ree]' which shows classes dependency
> in the tree view. Meanwhile only generic stats info
> is supported.
>
> e.g.:
>
> $ tc/tc -t class show dev tap0
> +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> | +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> | +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> | | +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> | |
> | +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> |
> +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
>
> $ tc/tc -t -s class show dev tap0
> +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> | | rate 0bit 0pps backlog 0b 0p requeues 0
> | |
> | +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> | | rate 0bit 0pps backlog 0b 0p requeues 0
> | |
> | +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> | | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> | | | rate 0bit 0pps backlog 0b 0p requeues 0
> | | |
> | | +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> | | rate 0bit 0pps backlog 0b 0p requeues 0
> | |
> | +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> | rate 0bit 0pps backlog 0b 0p requeues 0
> |
> +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
> | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> | rate 0bit 0pps backlog 0b 0p requeues 0
> |
> +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
> | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> | rate 0bit 0pps backlog 0b 0p requeues 0
> |
> +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
> | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> | rate 0bit 0pps backlog 0b 0p requeues 0
> |
> +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
> Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
> rate 0bit 0pps backlog 0b 0p requeues 0
>
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> ---
> Changes v3:
> Fixed wrong brackets style
>
> Changes v2:
> Removed "Date:" from commit message which was added by mistake.
>
> Changes RFC -> PATCH:
> #1 get rid of INIT_HLIST_NODE
> #2 added sample output to commit message
> #3 use "show_tree=1" instead of "show_tree++"
> #4 no need update include/hlist.h (because of #1)
> #5 changed a little tree output: parentheses around class id instead of qdisc name
>
> tc/tc.c | 5 +-
> tc/tc_class.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> tc/tc_common.h | 2 +
> 3 files changed, 165 insertions(+), 3 deletions(-)
I don't get strict about checkpatch. But ran this patch through and there are some minor
things that would be good to fix.
1. Split long lines like:
WARNING: line over 80 characters
#198: FILE: tc/tc_class.c:219:
+static void tree_cls_show(FILE *fp, char *buf, struct hlist_head *root_list, int level)
2. Don't use variable name 'childs', makes sense to call it children instead??
3. Don't use space before * as in:
ERROR: "foo * bar" should be "foo *bar"
#285: FILE: tc/tc_class.c:305:
+ struct rtattr * tb[TCA_MAX+1] = {};
^ permalink raw reply
* Re: [PATCH iproute2 v2] ip lib: Added shorter timestamp option
From: Stephen Hemminger @ 2014-12-24 20:09 UTC (permalink / raw)
To: Vadim Kochan; +Cc: netdev
In-Reply-To: <1419286438-21504-1-git-send-email-vadim4j@gmail.com>
On Tue, 23 Dec 2014 00:13:58 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:
> From: Vadim Kochan <vadim4j@gmail.com>
>
> Added another timestamp format to look like more logging info:
>
> [2014-12-22T22:36:50.489 ] 2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
> link/ether 3c:97:0e:a3:86:2e brd ff:ff:ff:ff:ff:ff
>
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Applied with some minor changes, the code was initializing more than necessary.
^ permalink raw reply
* Re: [PATCH 00/10] Split UFO into v4 and v6 versions.
From: Michael S. Tsirkin @ 2014-12-24 18:59 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, Vladislav Yasevich, stefanha, virtualization
In-Reply-To: <1419444680.4705.129.camel@decadent.org.uk>
On Wed, Dec 24, 2014 at 07:11:20PM +0100, Ben Hutchings wrote:
> On Thu, 2014-12-18 at 00:28 -0500, Jason Wang wrote:
> >
> > ----- Original Message -----
> > > UFO support in the kernel applies to both IPv4 and IPv6 protocols
> > > with the same device feature. However some devices may not be able
> > > to support one of the offloads. For this we split the UFO offload
> > > feature into 2 pieces. NETIF_F_UFO now controlls the IPv4 part and
> > > this series introduces NETIF_F_UFO6.
> > >
> > > As a result of this work, we can now re-enable NETIF_F_UFO on
> > > virtio_net devices and restore UDP over IPv4 performance for guests.
> > > We also continue to support legacy guests that assume that UFO6
> > > support included into UFO(4).
> > >
> > > Without this work, migrating a guest to a 3.18 kernel fails.
> > >
> >
> > This series eliminate the ambiguous NETIF_F_UFO.
> >
> > But VIRTIO_NET_F_{HOST|GUEST}_UFO and VIRTIO_NET_F_HDR_GSO_UDP is still
> > ambigious. I know it was used to keep compatibility for legacy guest. But
> > what's the future plan? Differentiate UFOv4 and UFOv6 in virtio features and
> > gso type in vnet header looks sufficient?
> [...]
>
> The IPv6 fragmentation ID needs to be added to the vnet header, to do
> UFOv6 properly. If it wasn't for that lack, we wouldn't have to split
> the feature flag.
>
> Ben.
Right.
I think a good plan is as follows:
1. add code generating IDs on rx path for virtio,
and re-enable UFO (4+6).
2. Ben's patch doing similar things for tun/macvtap
3. similarly for packet sockets
above seem appropriate for stable
4. 4+6 split, to make it easier for drivers
to identify when fragment ID is needed
5. extend vnet header, and add ways to enable it,
when enabled, use that to pass
fragment ID for tun/virtio/vhost/macvtap/packet socket
4 is what this patchset does.
> --
> Ben Hutchings
> If more than one person is responsible for a bug, no one is at fault.
^ permalink raw reply
* Re: [PATCH] openvswitch: fix odd_ptr_err.cocci warnings
From: Pravin Shelar @ 2014-12-24 18:49 UTC (permalink / raw)
To: kbuild test robot
Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev,
kbuild-all-JC7UmRfGjtg, LKML
In-Reply-To: <20141224064138.GA11360@athens>
On Tue, Dec 23, 2014 at 10:41 PM, kbuild test robot
<fengguang.wu@intel.com> wrote:
> net/openvswitch/vport-gre.c:188:5-11: inconsistent IS_ERR and PTR_ERR, PTR_ERR on line 189
>
> PTR_ERR should access the value just tested by IS_ERR
>
> Semantic patch information:
> There can be false positives in the patch case, where it is the call
> IS_ERR that is wrong.
>
> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
>
> CC: Pravin B Shelar <pshelar@nicira.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Thanks for the fix.
Acked-by: Pravin B Shelar <pshelar@nicira.com>
> ---
>
> vport-gre.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/net/openvswitch/vport-gre.c
> +++ b/net/openvswitch/vport-gre.c
> @@ -186,7 +186,7 @@ static int gre_tnl_send(struct vport *vp
> /* Push Tunnel header. */
> skb = __build_header(skb, tunnel_hlen);
> if (IS_ERR(skb)) {
> - err = PTR_ERR(rt);
> + err = PTR_ERR(skb);
> skb = NULL;
> goto err_free_rt;
> }
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev
^ permalink raw reply
* Re: [PATCH 00/10] Split UFO into v4 and v6 versions.
From: Ben Hutchings @ 2014-12-24 18:11 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, Vladislav Yasevich, virtualization, stefanha, mst
In-Reply-To: <586203981.237162.1418880532523.JavaMail.zimbra@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1359 bytes --]
On Thu, 2014-12-18 at 00:28 -0500, Jason Wang wrote:
>
> ----- Original Message -----
> > UFO support in the kernel applies to both IPv4 and IPv6 protocols
> > with the same device feature. However some devices may not be able
> > to support one of the offloads. For this we split the UFO offload
> > feature into 2 pieces. NETIF_F_UFO now controlls the IPv4 part and
> > this series introduces NETIF_F_UFO6.
> >
> > As a result of this work, we can now re-enable NETIF_F_UFO on
> > virtio_net devices and restore UDP over IPv4 performance for guests.
> > We also continue to support legacy guests that assume that UFO6
> > support included into UFO(4).
> >
> > Without this work, migrating a guest to a 3.18 kernel fails.
> >
>
> This series eliminate the ambiguous NETIF_F_UFO.
>
> But VIRTIO_NET_F_{HOST|GUEST}_UFO and VIRTIO_NET_F_HDR_GSO_UDP is still
> ambigious. I know it was used to keep compatibility for legacy guest. But
> what's the future plan? Differentiate UFOv4 and UFOv6 in virtio features and
> gso type in vnet header looks sufficient?
[...]
The IPv6 fragmentation ID needs to be added to the vnet header, to do
UFOv6 properly. If it wasn't for that lack, we wouldn't have to split
the feature flag.
Ben.
--
Ben Hutchings
If more than one person is responsible for a bug, no one is at fault.
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Re: [PATCH] net: wireless: rtlwifi: rtl8723be: phy.c: Remove unused function
From: Kalle Valo @ 2014-12-24 16:59 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Larry Finger, Chaoming Li, John W. Linville, linux-wireless,
netdev, linux-kernel
In-Reply-To: <1419116358-13223-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> writes:
> Remove the function rtl8723be_phy_get_txpower_level() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Thanks, applied to wireless-drivers-next.git.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH] net: wireless: rtlwifi: rtl8192ee: trx.c: Remove unused function
From: Kalle Valo @ 2014-12-24 16:56 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Larry Finger, Chaoming Li, John W. Linville, Greg Kroah-Hartman,
Rasmus Villemoes, Joe Perches,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1419079694-32476-1-git-send-email-rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org>
Rickard Strandqvist <rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org> writes:
> Remove the function rtl92ee_get_available_desc() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org>
Thanks, applied to wireless-drivers-next.git.
But I simplified the patch title:
commit 9898b77536b8569be2704964d3c519ef070e4a27
Author: Rickard Strandqvist <rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org>
Date: Sat Dec 20 13:48:14 2014 +0100
rtlwifi: rtl8192ee: trx.c: Remove unused function
--
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox