[iproute PATCH v2 6/8] man: tc-skbedit.8: Elaborate a bit on TX queues

2016-03-22 Thread Phil Sutter
Signed-off-by: Phil Sutter --- man/man8/tc-skbedit.8 | 12 1 file changed, 12 insertions(+) diff --git a/man/man8/tc-skbedit.8 b/man/man8/tc-skbedit.8 index b585a4d4253ba..e6902960eee27 100644 --- a/man/man8/tc-skbedit.8 +++ b/man/man8/tc-skbedit.8 @@ -17,6 +17,18 @@ The action

[iproute PATCH v2 4/8] man: tc-mirred.8: Reword man page a bit, add generic mirror example

2016-03-22 Thread Phil Sutter
Signed-off-by: Phil Sutter --- man/man8/tc-mirred.8 | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/man/man8/tc-mirred.8 b/man/man8/tc-mirred.8 index 52d98bc416563..bba96e0e5d8c0 100644 --- a/man/man8/tc-mirred.8 +++ b/man/man8/tc-mirred.8

[iproute PATCH v2 0/8] Follow-up to my action man pages series

2016-03-22 Thread Phil Sutter
The following patch series aims at addressing feedback provided by Jamal and Alexei. Thanks a lot for your input! Changes since v1: - Rebased onto current master. - Dropped some leftover TODO note from tc-skbedit.8 Phil Sutter (8): doc/tc-filters.tex: Drop overly subjective paragraphs tc

[iproute PATCH v2 8/8] man: tc-vlan.8: Describe CONTROL option

2016-03-22 Thread Phil Sutter
This should be made generic and part of a common tc-actions man page. Though leave it here for now to not confuse readers of the example which uses it. Signed-off-by: Phil Sutter --- man/man8/tc-vlan.8 | 56 +- 1 file changed, 55 insertions

[iproute PATCH v3] Use ARRAY_SIZE macro everywhere

2016-03-22 Thread Phil Sutter
adjustment was to include utils.h in misc/nstat.c to make the macro known there. Signed-off-by: Phil Sutter --- Changes since v1: - Rebased onto current master to avoid merge conflicts. Changes since v2: - Patch recreated from scratch. --- bridge/link.c | 2 +- misc/nstat.c | 2 +- misc/ss.c

[iproute PATCH 5/7] lib/utils: introduce format_host_rta()

2016-03-22 Thread Phil Sutter
This simple macro eases calling format_host() with data from an rt_attr pointer. Signed-off-by: Phil Sutter --- include/utils.h | 2 ++ ip/ipaddress.c| 20 ip/ipaddrlabel.c | 5 ++--- ip/ipneigh.c | 4 +--- ip/iproute.c | 33

[iproute PATCH 0/7] Refactor some internal library functions

2016-03-22 Thread Phil Sutter
The following series is a result of reviewing color output support and some formatting helpers usually used with struct rtattr fields. Phil Sutter (7): color: introduce color helpers and COLOR_CLEAR ipaddress: colorize peer, broadcast and anycast addresses as well make format_host non

[iproute PATCH 3/7] make format_host non-reentrant by default

2016-03-22 Thread Phil Sutter
There are only three users which require it to be reentrant, the rest is fine without. Instead, provide a reentrant format_host_r() for users which need it. Signed-off-by: Phil Sutter --- bridge/fdb.c | 4 +--- include/utils.h | 3 ++- ip/ip6tunnel.c| 2 +- ip

[iproute PATCH 6/7] lib/utils: introduce rt_addr_n2a_rta()

2016-03-22 Thread Phil Sutter
This simple macro eases calling rt_addr_n2a() with data from an rt_attr pointer. Signed-off-by: Phil Sutter --- include/utils.h | 2 ++ ip/iplink_bond.c | 4 +--- ip/ipmroute.c | 8 ++-- ip/ipprefix.c | 14 +++--- ip/iproute.c | 20

[iproute PATCH 7/7] lib/ll_addr: improve ll_addr_n2a() a bit

2016-03-22 Thread Phil Sutter
) size_t for the parameter. Signed-off-by: Phil Sutter --- lib/ll_addr.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/ll_addr.c b/lib/ll_addr.c index 2ce9abfbb8c69..465ed6fa4d9a2 100644 --- a/lib/ll_addr.c +++ b/lib/ll_addr.c @@ -41,18 +41,9 @@ const

[iproute PATCH 4/7] utils: make rt_addr_n2a() non-reentrant by default

2016-03-22 Thread Phil Sutter
There is only a single user who needs it to be reentrant (not really, but it's safer like this), add rt_addr_n2a_r() for it to use. Signed-off-by: Phil Sutter --- include/utils.h | 3 ++- ip/ip6tunnel.c| 2 +- ip/iplink_bond.c | 5 + ip/ipmroute.c

[iproute PATCH 2/7] ipaddress: colorize peer, broadcast and anycast addresses as well

2016-03-22 Thread Phil Sutter
Signed-off-by: Phil Sutter --- ip/ipaddress.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 7aab8e781eae8..90d7b1096c3aa 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -862,7 +862,8 @@ int

[iproute PATCH 1/7] color: introduce color helpers and COLOR_CLEAR

2016-03-22 Thread Phil Sutter
a fallback default of uncolored output. Signed-off-by: Phil Sutter --- include/color.h | 5 - ip/ipaddress.c | 47 +-- lib/color.c | 30 +- 3 files changed, 46 insertions(+), 36 deletions(-) diff --git a/include

Re: [PATCH net-next v3.16]r8169: Correct value from speed 10 on MII_BMCR

2016-03-25 Thread Phil Sutter
Hi, Your patch submissions are getting better, also good to see you're finally using git-send-email. A few things need to be corrected though: Subject line: - The 'vNN' part in brackets is supposed to be the reroll-count (see 'git format-patch -h' for details), not kernel version. You're supp

Re: [PATCH net-next v3.16]r8169: Correct value from speed 10 on MII_BMCR

2016-03-25 Thread Phil Sutter
On Fri, Mar 25, 2016 at 11:53:25PM +0100, Francois Romieu wrote: > Phil Sutter : > [...] > > Your patch submissions are getting better, also good to see you're > > finally using git-send-email. A few things need to be corrected though: > > > > #define BMCR_R

ss filter problem

2016-03-29 Thread Phil Sutter
Hi, I am trying to fix a bug in ss filter code, but feel quite lost right now. The issue is this: | ss -nl -f inet '( sport = :22 )' prints not only listening sockets (as requested by -l flag), but established ones as well (reproduce by opening ssh connection to 127.0.0.1 before calling above).

Re: rhashtable - rhashtable_insert_fast failed

2016-06-04 Thread Phil Sutter
[Cc'ing other interested parties, therefore full-quoting.] Hi Helge, On Fri, Jun 03, 2016 at 10:22:26PM +0200, Helge Deller wrote: > Hi Phil, > > I'm testing 4.7.0-rc1-64bit on a parisc/hppa machine and get > those message with CONFIG_TEST_RHASHTABLE=y. > > Is this expected/normal ? No, this s

[iproute PATCHv2] ipaddress: Allow listing addresses by type

2016-06-09 Thread Phil Sutter
Vadim Kochan Signed-off-by: Phil Sutter --- Note that I am not exactly fond of the changes here. When discovering that I would have to split the synopsis of 'show' from 'save' and 'flush', I wanted to extend 'flush' to support the added selectors as well. S

[iproute PATCH 6/9] tc: m_xt: Get rid of rargc in parse_ipt()

2016-06-10 Thread Phil Sutter
No need to copy the passed parameter, it's changed only once right before function return. Signed-off-by: Phil Sutter --- tc/m_xt.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tc/m_xt.c b/tc/m_xt.c index c42f3bda4e8f4..61fc437dfc907 100644 --- a/tc/m_xt.c +++

[iproute PATCH 8/9] tc: m_xt: Simplify argc adjusting in parse_ipt()

2016-06-10 Thread Phil Sutter
And while at it, also improve the error message in case too few parameters have been given. Signed-off-by: Phil Sutter --- tc/m_xt.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tc/m_xt.c b/tc/m_xt.c index 55ebadf2cf50a..f449c9d1a6638 100644 --- a/tc

[iproute PATCH 9/9] tc: m_xt: Introduce get_xtables_target_opts()

2016-06-10 Thread Phil Sutter
This pulls common code from parse_ipt() and print_ipt() functions together. While here, also fix for incorrect use of the global 'optarg' variable in print_ipt(). Signed-off-by: Phil Sutter --- tc/m_xt.c | 58 +- 1 file c

[iproute PATCH 2/9] tc: m_xt: Fix segfault when adding multiple actions at once

2016-06-10 Thread Phil Sutter
n one filter with action -j MARK.") but in parse_ipt() instead of print_ipt(). Signed-off-by: Phil Sutter --- tc/m_xt.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tc/m_xt.c b/tc/m_xt.c index 62ec6d7f18e73..45d86d66248d4 100644 --- a/tc/m_xt.c +++ b

[iproute PATCH 7/9] tc: m_xt: Get rid of iargc variable in parse_ipt()

2016-06-10 Thread Phil Sutter
After dropping the unused decrement of argc in the function's tail, it can fully take over what iargc has been used for. Signed-off-by: Phil Sutter --- tc/m_xt.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tc/m_xt.c b/tc/m_xt.c index 61fc437dfc907..55ebadf2

[iproute PATCH 3/9] tc: m_xt: Fix indenting

2016-06-10 Thread Phil Sutter
By exiting early if xtables_find_target() fails, one indenting level can be dropped. Some of the wrongly indented code then happens to sit at the right spot by accident which is why this patch is smaller than expected. Signed-off-by: Phil Sutter --- tc/m_xt.c | 54

[iproute PATCH 4/9] tc: m_xt: Get rid of one indentation level in parse_ipt()

2016-06-10 Thread Phil Sutter
Signed-off-by: Phil Sutter --- tc/m_xt.c | 91 +++ 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/tc/m_xt.c b/tc/m_xt.c index 5a629c442ac3a..b3731086c717b 100644 --- a/tc/m_xt.c +++ b/tc/m_xt.c @@ -298,6 +298,7

[iproute PATCH 1/9] tc: m_xt: Prevent segfault with standard targets

2016-06-10 Thread Phil Sutter
lly useful anyway), but at least it doesn't crash anymore. Signed-off-by: Phil Sutter --- tc/m_xt.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tc/m_xt.c b/tc/m_xt.c index c3f866df14749..62ec6d7f18e73 100644 --- a/tc/m_xt.c +++ b/tc/m_xt.c @@ -250,8 +250,1

[iproute PATCH 0/9] tc: m_xt: Two fixes and a smaller review

2016-06-10 Thread Phil Sutter
The first two patches of this series fix segfaults when calling tc in a specific way. Basically they are caused by some libxtables quirks the xt action did not cover. The remaining patches are more or less cosmetic code cleanups. Phil Sutter (9): tc: m_xt: Prevent segfault with standard

[iproute PATCH 5/9] tc: m_xt: Drop unused variable fw in parse_ipt()

2016-06-10 Thread Phil Sutter
Signed-off-by: Phil Sutter --- tc/m_xt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tc/m_xt.c b/tc/m_xt.c index b3731086c717b..c42f3bda4e8f4 100644 --- a/tc/m_xt.c +++ b/tc/m_xt.c @@ -120,7 +120,6 @@ static int parse_ipt(struct action_util *a, int *argc_p, char

[iproute PATCH] man: ip-link: Document query_rss option

2016-06-10 Thread Phil Sutter
Doc text shamelessly stolen from the introducing commit's message (6c55c8c4617c5 ['ip link set vf: Added "query_rss" command']). Signed-off-by: Phil Sutter --- man/man8/ip-link.8.in | 5 + 1 file changed, 5 insertions(+) diff --git a/man/man8/ip-link.8.in b/ma

[iproute PATCH 0/2] Two cosmetic fixes in tc/m_action.c

2016-06-14 Thread Phil Sutter
Found these when doing something else. Shouldn't cause any functional change. Phil Sutter (2): tc: m_action: Fix for field init before memset tc: m_action: Drop unused variable nladdr in tc_action_gd() tc/m_action.c | 15 +++ 1 file changed, 3 insertions(+), 12 dele

[iproute PATCH 1/2] tc: m_action: Fix for field init before memset

2016-06-14 Thread Phil Sutter
From: Phil Sutter Initializing req.t.tca_family before setting the whole req object to zero using memset does not make sense. Instead initialize the field after calling memset. Note that this change has no functional effect since AF_UNSPEC is defined to 0 anyway, so this fix is a purely

[iproute PATCH 2/2] tc: m_action: Drop unused variable nladdr in tc_action_gd()

2016-06-14 Thread Phil Sutter
From: Phil Sutter This has been there since the introduction of tc/m_action.c back in 2004 and was apparently never in use. Signed-off-by: Phil Sutter --- tc/m_action.c | 4 1 file changed, 4 deletions(-) diff --git a/tc/m_action.c b/tc/m_action.c index 1b34370f4ec09..fd324090db1f2

[iproute PATCH v2 0/2] Two cosmetic fixes in tc/m_action.c

2016-06-15 Thread Phil Sutter
Found these when doing something else. Shouldn't cause any functional change. Changes since v1: - Replace patch 1/2 with a better solution as suggested by Stephen Hemminger. Phil Sutter (2): tc: m_action: Use C99 style initializers for struct req tc: m_action: Drop unused variable n

[iproute PATCH v2 2/2] tc: m_action: Drop unused variable nladdr in tc_action_gd()

2016-06-15 Thread Phil Sutter
This has been there since the introduction of tc/m_action.c back in 2004 and was apparently never in use. Signed-off-by: Phil Sutter --- tc/m_action.c | 4 1 file changed, 4 deletions(-) diff --git a/tc/m_action.c b/tc/m_action.c index f97ed2e775012..ea16817aefd4f 100644 --- a/tc

[iproute PATCH v2 1/2] tc: m_action: Use C99 style initializers for struct req

2016-06-15 Thread Phil Sutter
Instead of initializing fields after (or sometimes even before) zeroing the whole struct via memset(), initialize the whole thing at declaration time. Signed-off-by: Phil Sutter --- tc/m_action.c | 46 +++--- 1 file changed, 23 insertions(+), 23 deletions

[iproute PATCH 0/2] Check MAC address length when changing it

2016-06-16 Thread Phil Sutter
. While patch 1 makes sure that in the second case above missing parts are padded with zero, patch 2 implements a real solution for both by comparing new and old address lengths prior to accepting the input. For VFs it is simply assumed that the length must match that of the PF's address. Phil S

[iproute PATCH 2/2] iplink: Check address length via netlink

2016-06-16 Thread Phil Sutter
assuming same length as PF device. Note that at least for VFs the check can't be done in kernel space since struct ifla_vf_mac lacks a length field and due to netlink padding the exact size can't be communicated to the kernel. Signed-off-by: Phil Sutter --- ip/ipl

[iproute PATCH 1/2] iplink: Add missing variable initialization

2016-06-16 Thread Phil Sutter
Without this, we might feed garbage to the kernel when the address is shorter than expected. Signed-off-by: Phil Sutter --- ip/iplink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/iplink.c b/ip/iplink.c index d2e586b6d1332..4cb9bab66b916 100644 --- a/ip/iplink.c +++ b

[iproute PATCH 3/3] No need to initialize rtattr fields before parsing

2016-06-17 Thread Phil Sutter
Since parse_rtattr_flags() calls memset already, there is no need for callers to do so themselves. Signed-off-by: Phil Sutter --- ip/ipaddress.c | 2 +- tc/tc_class.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index afb115e5f592a

[iproute PATCH 2/3] Replace malloc && memset by calloc

2016-06-17 Thread Phil Sutter
This only replaces occurrences where the newly allocated memory is cleared completely afterwards, as in other cases it is a theoretical performance hit although code would be cleaner this way. Signed-off-by: Phil Sutter --- genl/genl.c| 3 +-- lib/names.c| 7 ++- misc

[iproute PATCH 1/3] Use C99 style initializers everywhere

2016-06-17 Thread Phil Sutter
get rid of them, too. Signed-off-by: Phil Sutter --- bridge/fdb.c | 29 +++-- bridge/link.c| 16 +++ bridge/mdb.c | 19 - bridge/vlan.c| 19 - genl/ctrl.c | 48 + ip/ip6tunnel.c | 10 ++--- ip/ipaddress.c | 31

[iproute PATCH 0/3] Big C99 style initializer rework

2016-06-17 Thread Phil Sutter
The first patch changes the code to use C99 style initializers where applicable, mainly as an alternative to calling memset() and optionally initializing individual fields afterwards. The remaining patches contain some fallout from compiling the first one. Phil Sutter (3): Use C99 style

Re: [iproute PATCH 1/3] Use C99 style initializers everywhere

2016-06-17 Thread Phil Sutter
Hi, [Replying to multiple mails at once due to laziness.] On Fri, Jun 17, 2016 at 06:09:20PM +0200, Daniel Borkmann wrote: > Hmm, seems like a lot of stuff ... It is. At some point I thought about maybe hack something in cocci instead, but that would probably have taken longer given the code div

[iproute PATCH] ip-link: Support printing VF trust setting

2016-03-31 Thread Phil Sutter
This adds a new item to VF lines of a PF, stating whether the VF is trusted or not. Signed-off-by: Phil Sutter --- ip/ipaddress.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 3998d8cec4ab2..2f1d55c115dde 100644 --- a/ip/ipaddress.c +++ b/ip

Re: [PATCH net] tuntap: restore default qdisc

2016-04-08 Thread Phil Sutter
fault qdisc by setting tx_queue_len in tun_setup(). > > Fixes: f84bb1eac027 ("net: fix IFF_NO_QUEUE for drivers using alloc_netdev") > Cc: Phil Sutter > Signed-off-by: Jason Wang Acked-by: Phil Sutter

[iproute PATCH 1/2] ss: Drop silly assignment

2016-04-13 Thread Phil Sutter
An expression of the form '(a | b) & b' will evaluate to the value of b for any value of a or b. Signed-off-by: Phil Sutter --- misc/ss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/ss.c b/misc/ss.c index 38cf3312a746e..d6090018c5dbb 100644 --- a/m

[iproute PATCH 2/2] ss: Fix accidental state filter override

2016-04-13 Thread Phil Sutter
ones, as well. Fix this by reusing the formerly ineffective call to filter_states_set() to restore the state filter as it was before the call to filter_af_set(). Signed-off-by: Phil Sutter --- misc/ss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/ss.c b/misc/ss.c

[iproute PATCH 0/2] Minor ss filter fix and review

2016-04-13 Thread Phil Sutter
While looking for a solution to the problem described in patch 2/2, I discovered the overly complicated assignment in filter_states_set() which is simplified in patch 1/2. Phil Sutter (2): ss: Drop silly assignment ss: Fix accidental state filter override misc/ss.c | 5 +++-- 1 file changed

Re: [PATCHv3 net-next 1/6] sctp: add sctp_info dump api for sctp_diag

2016-04-14 Thread Phil Sutter
Hi Xin Long, On Thu, Apr 14, 2016 at 03:35:30PM +0800, Xin Long wrote: > sctp_diag will dump some important details of sctp's assoc or ep, we use > sctp_info to describe them, sctp_get_sctp_info to get them, and export > it to sctp_diag.ko. > > v2->v3: > - we will not use list_for_each_safe in s

Re: [PATCH iproute2 0/4] add MACsec support

2016-04-14 Thread Phil Sutter
he somewhat intricate man page markup: Acked-by: Phil Sutter

Re: Deleting child qdisc doesn't reset parent to default qdisc?

2016-04-14 Thread Phil Sutter
On Thu, Apr 14, 2016 at 08:01:39AM -0700, Eric Dumazet wrote: > On Thu, 2016-04-14 at 16:44 +0200, Jiri Kosina wrote: > > Hi, > > > > I've came across the behavior where adding a child qdisc and then deleting > > it again makes the networking dysfunctional (I guess that's because all of > > a su

Re: Deleting child qdisc doesn't reset parent to default qdisc?

2016-04-14 Thread Phil Sutter
On Thu, Apr 14, 2016 at 08:44:40AM -0700, Eric Dumazet wrote: > On Thu, 2016-04-14 at 17:34 +0200, Jiri Kosina wrote: > > On Thu, 14 Apr 2016, Phil Sutter wrote: > > > > > OTOH some qdiscs (CBQ, DRR, DSMARK, HFSC, HTB, QFQ) assign the default > > > one upon deleti

[PATCH net-next 0/2] Minor IFF_NO_QUEUE conversion follow-up

2016-04-15 Thread Phil Sutter
y grep'ing back then, no idea why. Phil Sutter (2): staging: rtl8188eu: Convert to using IFF_NO_QUEUE openvswitch: Convert to using IFF_NO_QUEUE drivers/staging/rtl8188eu/os_dep/mon.c | 2 +- net/openvswitch/vport-internal_dev.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) -- 2.8.0

[PATCH net-next 1/2] staging: rtl8188eu: Convert to using IFF_NO_QUEUE

2016-04-15 Thread Phil Sutter
Cc: Jakub Sitnicki Signed-off-by: Phil Sutter --- drivers/staging/rtl8188eu/os_dep/mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c index 63bb87593af0c..d976e5e18d50e 100644 --- a/drivers

[PATCH net-next 2/2] openvswitch: Convert to using IFF_NO_QUEUE

2016-04-15 Thread Phil Sutter
Cc: Pravin Shelar Signed-off-by: Phil Sutter --- net/openvswitch/vport-internal_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index 7c8b90bf0e540..2ee48e447b724 100644 --- a/net

Re: [PATCHv3 net-next 1/6] sctp: add sctp_info dump api for sctp_diag

2016-04-18 Thread Phil Sutter
On Fri, Apr 15, 2016 at 05:28:58PM -0400, David Miller wrote: > Feedback was given here not to mix the changelog and the commit message. > > And I want to explicitly state that I totally and _COMPLETELY_ disagree > with this. > > It is absolutely essential information and belongs in the commit me

[iproute PATCH v2 5/7] Makefile: Allow to override CC

2016-06-21 Thread Phil Sutter
This makes it easier to build iproute2 with a custom compiler. While at it, make HOSTCC default to the value of CC if not explicitly set elsewhere. Signed-off-by: Phil Sutter --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index

[iproute PATCH v2 6/7] misc/ifstat: simplify unsigned value comparison

2016-06-21 Thread Phil Sutter
s always false due to limited range of data type Signed-off-by: Phil Sutter --- misc/ifstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/ifstat.c b/misc/ifstat.c index abbb4e732fcef..9a44da487599e 100644 --- a/misc/ifstat.c +++ b/misc/ifstat.c @@ -539,7 +539,7 @@ sta

[iproute PATCH v2 4/7] No need to initialize rtattr fields before parsing

2016-06-21 Thread Phil Sutter
Since parse_rtattr_flags() calls memset already, there is no need for callers to do so themselves. Signed-off-by: Phil Sutter --- ip/ipaddress.c | 2 +- tc/tc_class.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index afb115e5f592a

[iproute PATCH v2 0/7] Big C99 style initializer rework

2016-06-21 Thread Phil Sutter
gi-bin/git/gitweb.cgi?p=iproute2.git;a=shortlog;h=refs/heads/c99_init Phil Sutter (7): tc: m_action: Improve conversion to C99 style initializers Use C99 style initializers everywhere Replace malloc && memset by calloc No need to initialize rtattr fields before parsing Makefile: Al

[iproute PATCH v2 1/7] tc: m_action: Improve conversion to C99 style initializers

2016-06-21 Thread Phil Sutter
initialized at the same time. Fixes: a0a73b298a579 ("tc: m_action: Use C99 style initializers for struct req") Signed-off-by: Phil Sutter --- tc/m_action.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tc/m_action.c b/tc/m_action.c index ea1

[iproute PATCH v2 3/7] Replace malloc && memset by calloc

2016-06-21 Thread Phil Sutter
This only replaces occurrences where the newly allocated memory is cleared completely afterwards, as in other cases it is a theoretical performance hit although code would be cleaner this way. Signed-off-by: Phil Sutter --- genl/genl.c| 3 +-- lib/names.c| 7 ++- misc

[iproute PATCH v2 7/7] ip/tcp_metrics: Simplify process_msg a bit

2016-06-21 Thread Phil Sutter
By combining the attribute extraction and check for existence, the additional indentation level in the 'else' clause can be avoided. In addition to that, common actions for 'daddr' are combined since the function returns if neither of the branches are taken. Signed-off-by:

[iproute PATCH v2 2/7] Use C99 style initializers everywhere

2016-06-21 Thread Phil Sutter
ter fields for parse_rtattr*() were just dropped since they are not needed. The changes here allowed the compiler to discover some unused variables, so get rid of them, too. Signed-off-by: Phil Sutter --- Changes since v1: - Dropped former changes to tc/tc_bpf.c as they are incompatible to older

Re: [iproute PATCH v2 2/7] Use C99 style initializers everywhere

2016-06-21 Thread Phil Sutter
On Tue, Jun 21, 2016 at 10:24:37AM -0600, David Ahern wrote: > On 6/21/16 10:18 AM, Phil Sutter wrote: > > This big patch was compiled by vimgrepping for memset calls and changing > > to C99 initializer if applicable. One notable exception is the > > initialization of union bp

Re: [iproute PATCH v2 7/7] ip/tcp_metrics: Simplify process_msg a bit

2016-06-21 Thread Phil Sutter
On Tue, Jun 21, 2016 at 09:53:43AM -0700, Stephen Hemminger wrote: > On Tue, 21 Jun 2016 18:18:41 +0200 > Phil Sutter wrote: > > > By combining the attribute extraction and check for existence, the > > additional indentation level in the 'else' clause can be avoide

Re: [iproute PATCH v2 2/7] Use C99 style initializers everywhere

2016-06-21 Thread Phil Sutter
On Tue, Jun 21, 2016 at 11:13:11AM -0600, David Ahern wrote: > On 6/21/16 11:03 AM, Phil Sutter wrote: > >> I downloaded CentOS 5 and 6. iproute2 fails to compile on CentOS 5.11; > >> ip command builds on 6.8 but with a flurry of redefinition errors > >> (

Re: [iproute PATCH v2 2/7] Use C99 style initializers everywhere

2016-06-22 Thread Phil Sutter
Hi Jakub, On Wed, Jun 22, 2016 at 11:12:14AM +0200, Jakub Sitnicki wrote: > On Tue, Jun 21, 2016 at 06:18 PM CEST, Phil Sutter wrote: > > This big patch was compiled by vimgrepping for memset calls and changing > > to C99 initializer if applicable. One notable exception is the >

[iproute PATCH] Fix MAC address length check

2016-06-22 Thread Phil Sutter
I forgot to change the variable in the conditional, too. Fixes: 8fe58d58941f4 ("iplink: Check address length via netlink") Signed-off-by: Phil Sutter --- ip/iplink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/iplink.c b/ip/iplink.c index 68e5faea3581d..b1f

Re: [iproute PATCH v2 7/7] ip/tcp_metrics: Simplify process_msg a bit

2016-06-22 Thread Phil Sutter
On Wed, Jun 22, 2016 at 01:34:13PM +0200, Jakub Sitnicki wrote: > On Tue, Jun 21, 2016 at 06:18 PM CEST, Phil Sutter wrote: [...] > > - a = attrs[TCP_METRICS_ATTR_ADDR_IPV4]; > > - if (a) { > > + if ((a = attrs[TCP_METRICS_ATTR_ADDR_IPV4])) { > > Copy th

Re: [iproute PATCH v2 7/7] ip/tcp_metrics: Simplify process_msg a bit

2016-06-22 Thread Phil Sutter
Hi David, On Wed, Jun 22, 2016 at 01:00:08PM +, David Laight wrote: > From: Jakub Sitnicki > > Sent: 22 June 2016 12:34 > ... > > > - a = attrs[TCP_METRICS_ATTR_ADDR_IPV4]; > > > - if (a) { > > > + if ((a = attrs[TCP_METRICS_ATTR_ADDR_IPV4])) { > > > > Copy the pointer inside the branch? > >

[iproute PATCH v3 4/6] No need to initialize rtattr fields before parsing

2016-06-23 Thread Phil Sutter
Since parse_rtattr_flags() calls memset already, there is no need for callers to do so themselves. Signed-off-by: Phil Sutter --- ip/ipaddress.c | 2 +- tc/tc_class.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 62856f2c26eba

[iproute PATCH v3 0/6] Big C99 style initializer rework

2016-06-23 Thread Phil Sutter
ks valid in general. - A warning made me look at ip/tcp_metrics.c and I found a minor code simplification (patch 7). Phil Sutter (6): tc: m_action: Improve conversion to C99 style initializers Use C99 style initializers everywhere Replace malloc && memset by calloc No need

[iproute PATCH v3 3/6] Replace malloc && memset by calloc

2016-06-23 Thread Phil Sutter
This only replaces occurrences where the newly allocated memory is cleared completely afterwards, as in other cases it is a theoretical performance hit although code would be cleaner this way. Signed-off-by: Phil Sutter --- Changes since v2: - Fix checkpatch errors. --- genl/genl.c| 3

[iproute PATCH v3 2/6] Use C99 style initializers everywhere

2016-06-23 Thread Phil Sutter
ter fields for parse_rtattr*() were just dropped since they are not needed. The changes here allowed the compiler to discover some unused variables, so get rid of them, too. Signed-off-by: Phil Sutter --- Changes since v2: - Flatten initializers. - Leave a final comma in place. - Fix checkpatch warni

[iproute PATCH v3 1/6] tc: m_action: Improve conversion to C99 style initializers

2016-06-23 Thread Phil Sutter
t the same time. Fixes: a0a73b298a579 ("tc: m_action: Use C99 style initializers for struct req") Signed-off-by: Phil Sutter --- Changes since v2: - Don't drop the "superfluous" comma. - Flatten initializers. Changes since v1: - Created this patch. --- tc/m_action.c | 23 +

[iproute PATCH v3 5/6] Makefile: Allow to override CC

2016-06-23 Thread Phil Sutter
This makes it easier to build iproute2 with a custom compiler. While at it, make HOSTCC default to the value of CC if not explicitly set elsewhere. Signed-off-by: Phil Sutter --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index

[iproute PATCH v3 6/6] misc/ifstat: simplify unsigned value comparison

2016-06-23 Thread Phil Sutter
s always false due to limited range of data type Signed-off-by: Phil Sutter --- misc/ifstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/ifstat.c b/misc/ifstat.c index abbb4e732fcef..9a44da487599e 100644 --- a/misc/ifstat.c +++ b/misc/ifstat.c @@ -539,7 +539,7 @@ sta

[iproute PATCH] man: ip-address, ip-link: Document 'type' quirk

2016-06-24 Thread Phil Sutter
This covers the fact that calling 'ip {link|addr} show type foobar' does not return an error. Signed-off-by: Phil Sutter --- man/man8/ip-address.8.in | 6 ++ man/man8/ip-link.8.in| 6 ++ 2 files changed, 12 insertions(+) diff --git a/man/man8/ip-address.8.in b/man/man8/ip

Re: [iproute PATCH v3 0/6] Big C99 style initializer rework

2016-06-24 Thread Phil Sutter
Hi, On Fri, Jun 24, 2016 at 09:17:07AM +, David Laight wrote: > From: Phil Sutter > > Sent: 23 June 2016 18:34 > > > > This is v3 of my C99-style initializer related patch series. > ... > > It would be interesting to know how this affect the kernel code size?

Re: [iproute PATCH v3 6/6] misc/ifstat: simplify unsigned value comparison

2016-06-24 Thread Phil Sutter
On Fri, Jun 24, 2016 at 09:20:32AM +, David Laight wrote: > From: Phil Sutter > > Sent: 23 June 2016 18:34 > > > > By directly comparing the value of both unsigned variables, casting to > > signed becomes unnecessary. > > > > This also fixes for compili

Re: [iproute PATCH v3 0/6] Big C99 style initializer rework

2016-06-27 Thread Phil Sutter
Hi, On Mon, Jun 27, 2016 at 10:59:12AM -0700, Stephen Hemminger wrote: > On Thu, 23 Jun 2016 17:34:08 + > Phil Sutter wrote: > > > This is v3 of my C99-style initializer related patch series. The changes > > since v2 are: [...] > > I like the idea and it makes c

[iproute PATCH 1/2] ip-address: Support filtering by slave type, too

2016-06-28 Thread Phil Sutter
complete since it does not allow to match on type and slave type at the same time, but it doesn't prevent implementing a dedicated slave_type match, either. Signed-off-by: Phil Sutter --- ip/ipaddress.c | 52 ++-- 1 file changed, 30 insertions(+

[iproute PATCH 2/2] ip-address: Align type list in help and man page

2016-06-28 Thread Phil Sutter
This adds missing entries on both sides until they are identical. Signed-off-by: Phil Sutter --- ip/ipaddress.c | 6 +++--- man/man8/ip-address.8.in | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 56f68eb21c0fc

[iproute PATCH 0/2] ip-address: fix type list inconsistencies

2016-06-28 Thread Phil Sutter
, actually things are quite messed up: - Lists are not sorted, it's easy to miss something. - The type list is duplicated four times as ip-link help and man page contain it, too. - The kernel supports more types than listed here. - We can't add but match on all types the kernel supports. P

[iproute PATCH v4] Use ARRAY_SIZE macro everywhere

2016-06-28 Thread Phil Sutter
adjustment was to include utils.h in misc/nstat.c to make the macro known there. Signed-off-by: Phil Sutter --- Changes since v3: - Rebased again. - added missing include in misc/nstat.c. Changes since v2: - Patch recreated from scratch. Changes since v1: - Rebased onto current master to avoid merge

Re: [iproute PATCH v3 0/6] Big C99 style initializer rework

2016-06-28 Thread Phil Sutter
On Mon, Jun 27, 2016 at 02:10:49PM -0700, Stephen Hemminger wrote: > On Mon, 27 Jun 2016 20:23:02 +0200 > Phil Sutter wrote: > > > Hi, > > > > On Mon, Jun 27, 2016 at 10:59:12AM -0700, Stephen Hemminger wrote: > > > On Thu, 23 Jun 2016 17:

Re: [iproute PATCH v3 0/6] Big C99 style initializer rework

2016-06-28 Thread Phil Sutter
On Tue, Jun 28, 2016 at 11:37:43AM -0600, David Ahern wrote: > On 6/28/16 11:37 AM, Phil Sutter wrote: > >>> I saw these too with gcc-3.4.6 but not with 5.3.0. It appears to be a > >>> gcc bug[1]. One possible workaround is to match the brace level of the > >>&g

Re: [iproute PATCH v3 0/6] Big C99 style initializer rework

2016-06-28 Thread Phil Sutter
On Tue, Jun 28, 2016 at 11:59:04AM -0600, David Ahern wrote: > On 6/28/16 11:58 AM, Phil Sutter wrote: > >> since .ifr_qlen is already referenced in that function seems like your > >> suggestion above (struct ifreq ifr = { .ifr_qlen = 0 };) should be > >> acceptab

[iproute PATCH] ip-address: constify match_link_kind arg

2016-06-30 Thread Phil Sutter
Since the function won't ever change the data 'kind' is pointing at, it can sanely be made const. Fixes: e0513807f6dbb ("ip-address: Support filtering by slave type, too") Suggested-by: Stephen Hemminger Signed-off-by: Phil Sutter --- ip/ipaddress.c | 2 +- 1 file c

Re: [iproute PATCH 1/2] ipaddress: Simplify vf_info parsing

2016-07-01 Thread Phil Sutter
On Wed, Jun 01, 2016 at 03:36:09PM -0700, Greg Rose wrote: > On Wed, Jun 1, 2016 at 3:07 PM, Phil Sutter wrote: > > On Wed, Jun 01, 2016 at 03:00:08PM -0700, Greg Rose wrote: > >> On Wed, Jun 1, 2016 at 1:03 PM, Phil Sutter wrote: > >> > Not sure whether I misinter

[iproute PATCH 2/2] ipnetns: Make netns mount points private

2016-07-05 Thread Phil Sutter
mount points shared again. Signed-off-by: Phil Sutter --- ip/ipnetns.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ip/ipnetns.c b/ip/ipnetns.c index 1cefe73c68bfc..acaedd5894e6c 100644 --- a/ip/ipnetns.c +++ b/ip/ipnetns.c @@ -636,7 +636,7 @@ static int netns_add(int

[iproute PATCH 0/2] Netns performance improvements

2016-07-05 Thread Phil Sutter
tem shared. Phil Sutter (2): ipnetns: Move NETNS_RUN_DIR into it's own propagation group ipnetns: Make netns mount points private ip/ipnetns.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.8.2

[iproute PATCH 1/2] ipnetns: Move NETNS_RUN_DIR into it's own propagation group

2016-07-05 Thread Phil Sutter
en shared again, it will move to it's own propagation group which will still allow for netns mounts to propagate between mount namespaces but gets rid of the double netns entry at the same time. Signed-off-by: Phil Sutter --- ip/ipnetns.c | 5 + 1 file changed, 5 insertions(+) diff --git

Re: [iproute PATCH 0/2] Netns performance improvements

2016-07-05 Thread Phil Sutter
Hi, On Tue, Jul 05, 2016 at 04:42:51PM +0200, Phil Sutter wrote: > Stress-testing OpenStack Neutron revealed poor performance of 'ip netns' > when dealing with a high amount of namespaces. The cause of this lies in > the combination of how iproute2 mounts NETNS_RUN_DIR

[iproute PATCHv2 0/2] Netns performance improvements

2016-07-05 Thread Phil Sutter
tem shared. Changes since v1: - Added Suggested-by tag to patches. Phil Sutter (2): ipnetns: Move NETNS_RUN_DIR into it's own propagation group ipnetns: Make netns mount points private ip/ipnetns.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.8.2

[iproute PATCHv2 1/2] ipnetns: Move NETNS_RUN_DIR into it's own propagation group

2016-07-05 Thread Phil Sutter
en shared again, it will move to it's own propagation group which will still allow for netns mounts to propagate between mount namespaces but gets rid of the double netns entry at the same time. Suggested-by: Miklos Szeredi Signed-off-by: Phil Sutter --- ip/ipnetns.c | 5 + 1 file c

[iproute PATCHv2 2/2] ipnetns: Make netns mount points private

2016-07-05 Thread Phil Sutter
mount points shared again. Suggested-by: Miklos Szeredi Signed-off-by: Phil Sutter --- ip/ipnetns.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ip/ipnetns.c b/ip/ipnetns.c index 1cefe73c68bfc..acaedd5894e6c 100644 --- a/ip/ipnetns.c +++ b/ip/ipnetns.c @@ -636,7

Re: [iproute PATCH 0/2] Netns performance improvements

2016-07-05 Thread Phil Sutter
Hi Eric, Thanks for your quick and insightful reply rightfully pointing out the lack of rationale behind this change. So let me try to catch up: On Tue, Jul 05, 2016 at 09:44:00AM -0500, Eric W. Biederman wrote: > Phil Sutter writes: > > > Stress-testing OpenStack Neutron r

[iproute PATCH] ipl2tp: Print help even on systems without l2tp support

2016-02-24 Thread Phil Sutter
Signed-off-by: Phil Sutter --- ip/ipl2tp.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c index f050880eef02a..3e3b21ddfb7fe 100644 --- a/ip/ipl2tp.c +++ b/ip/ipl2tp.c @@ -720,6 +720,9 @@ static int do_show(int argc, char **argv) int

<    1   2   3   4   5   6   7   8   9   10   >