Re: [PATCHv2 bpf 1/2] bpf: Support sk lookup in netns with id 0

2018-11-30 Thread Nicolas Dichtel
Le 30/11/2018 à 01:29, Joe Stringer a écrit : > David Ahern and Nicolas Dichtel report that the handling of the netns id > 0 is incorrect for the BPF socket lookup helpers: rather than finding > the netns with id 0, it is resolving to the current netns. This renders > the netns_id 0

[PATCH net] tun: forbid iface creation with rtnl ops

2018-11-29 Thread Nicolas Dichtel
This panic occurs because dev->netdev_ops is not set by tun_setup(). But to have something usable, it will require more than just setting netdev_ops. Fixes: f019a7a594d9 ("tun: Implement ip link del tunXXX") CC: Eric W. Biederman Signed-off-by: Nicolas Dichtel --- drivers/net/tun.c

Re: [PATCH net-next] tun: implement carrier change

2018-11-29 Thread Nicolas Dichtel
Le 28/11/2018 à 22:48, Andrew Lunn a écrit : > On Wed, Nov 28, 2018 at 07:12:56PM +0100, Nicolas Dichtel wrote: >> The userspace may need to control the carrier state. > > Hi Nicolas Hi Andrew, > > Could you explain your user case a bit more. > > Are you runn

[PATCH net-next] tun: implement carrier change

2018-11-28 Thread Nicolas Dichtel
The userspace may need to control the carrier state. Signed-off-by: Nicolas Dichtel Signed-off-by: Didier Pallard --- drivers/net/tun.c | 27 ++- include/uapi/linux/if_tun.h | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/net

Re: [PATCH bpf] bpf: Support sk lookup in netns with id 0

2018-11-27 Thread Nicolas Dichtel
Le 26/11/2018 à 23:08, David Ahern a écrit : > On 11/26/18 2:27 PM, Joe Stringer wrote: >> @@ -2405,6 +2407,9 @@ enum bpf_func_id { >> /* BPF_FUNC_perf_event_output for sk_buff input context. */ >> #define BPF_F_CTXLEN_MASK (0xfULL << 32) >> >> +/* BPF_FUNC_sk_lookup_tcp and

[PATCH net-next v4 2/5] netns: introduce 'struct net_fill_args'

2018-11-26 Thread Nicolas Dichtel
This is a preparatory work. To avoid having to much arguments for the function rtnl_net_fill(), a new structure is defined. Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern --- net/core/net_namespace.c | 48 1 file changed, 34 insertions(+), 14

[PATCH net-next v4 0/5] Ease to interpret net-nsid

2018-11-26 Thread Nicolas Dichtel
The goal of this series is to ease the interpretation of nsid received in netlink messages from other netns (when the user uses NETLINK_F_LISTEN_ALL_NSID). After this series, with a patched iproute2: $ ip netns add foo $ ip netns add bar $ touch /var/run/netns/init_net $ mount --bind

[PATCH net-next v4 4/5] netns: enable to specify a nsid for a get request

2018-11-26 Thread Nicolas Dichtel
Combined with NETNSA_TARGET_NSID, it enables to "translate" a nsid from one netns to a nsid of another netns. This is useful when using NETLINK_F_LISTEN_ALL_NSID because it helps the user to interpret a nsid received from an other netns. Signed-off-by: Nicolas Dichtel Reviewed-by: D

[PATCH net-next v4 1/5] netns: remove net arg from rtnl_net_fill()

2018-11-26 Thread Nicolas Dichtel
This argument is not used anymore. Fixes: cab3c8ec8d57 ("netns: always provide the id to rtnl_net_fill()") Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern --- net/core/net_namespace.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git

[PATCH net-next v4 3/5] netns: add support of NETNSA_TARGET_NSID

2018-11-26 Thread Nicolas Dichtel
Like it was done for link and address, add the ability to perform get/dump in another netns by specifying a target nsid attribute. Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern --- include/uapi/linux/net_namespace.h | 1 + net/core/net_namespace.c | 86

[PATCH net-next v4 5/5] netns: enable to dump full nsid translation table

2018-11-26 Thread Nicolas Dichtel
Like the previous patch, the goal is to ease to convert nsids from one netns to another netns. A new attribute (NETNSA_CURRENT_NSID) is added to the kernel answer when NETNSA_TARGET_NSID is provided, thus the user can easily convert nsids. Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern

[PATCH net-next v3 4/5] netns: enable to specify a nsid for a get request

2018-11-22 Thread Nicolas Dichtel
Combined with NETNSA_TARGET_NSID, it enables to "translate" a nsid from one netns to a nsid of another netns. This is useful when using NETLINK_F_LISTEN_ALL_NSID because it helps the user to interpret a nsid received from an other netns. Signed-off-by: Nicolas Dichtel Reviewed-by: D

[PATCH net-next v3 1/5] netns: remove net arg from rtnl_net_fill()

2018-11-22 Thread Nicolas Dichtel
This argument is not used anymore. Fixes: cab3c8ec8d57 ("netns: always provide the id to rtnl_net_fill()") Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern --- net/core/net_namespace.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git

[PATCH net-next v3 2/5] netns: introduce 'struct net_fill_args'

2018-11-22 Thread Nicolas Dichtel
This is a preparatory work. To avoid having to much arguments for the function rtnl_net_fill(), a new structure is defined. Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern --- net/core/net_namespace.c | 48 1 file changed, 34 insertions(+), 14

[PATCH net-next v3 5/5] netns: enable to dump full nsid translation table

2018-11-22 Thread Nicolas Dichtel
Like the previous patch, the goal is to ease to convert nsids from one netns to another netns. A new attribute (NETNSA_CURRENT_NSID) is added to the kernel answer when NETNSA_TARGET_NSID is provided, thus the user can easily convert nsids. Signed-off-by: Nicolas Dichtel --- include/uapi/linux

[PATCH net-next v3 0/5] Ease to interpret net-nsid

2018-11-22 Thread Nicolas Dichtel
The goal of this series is to ease the interpretation of nsid received in netlink messages from other netns (when the user uses NETLINK_F_LISTEN_ALL_NSID). After this series, with a patched iproute2: $ ip netns add foo $ ip netns add bar $ touch /var/run/netns/init_net $ mount --bind

[PATCH net-next v3 3/5] netns: add support of NETNSA_TARGET_NSID

2018-11-22 Thread Nicolas Dichtel
Like it was done for link and address, add the ability to perform get/dump in another netns by specifying a target nsid attribute. Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern --- include/uapi/linux/net_namespace.h | 1 + net/core/net_namespace.c | 86

patchwork bug?

2018-11-22 Thread Nicolas Dichtel
Not sure if it's the right place to post that. When I try to list patches with filters, something like this: http://patchwork.ozlabs.org/project/netdev/list/?series==2036=*==both=34 I can see only page 1. When I click on '2', the page 1 is still displayed and the page numerotation is removed.

Re: [PATCH net-next v2 5/5] netns: enable to dump full nsid translation table

2018-11-22 Thread Nicolas Dichtel
Le 22/11/2018 à 17:40, David Ahern a écrit : > On 11/22/18 8:50 AM, Nicolas Dichtel wrote: >> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c >> index dd25fb22ad45..25030e0317a2 100644 >> --- a/net/core/net_namespace.c >> +++ b/net/core/net_name

[PATCH net-next v2 0/5] Ease to interpret net-nsid

2018-11-22 Thread Nicolas Dichtel
The goal of this series is to ease the interpretation of nsid received in netlink messages from other netns (when the user uses NETLINK_F_LISTEN_ALL_NSID). After this series, with a patched iproute2: $ ip netns add foo $ ip netns add bar $ touch /var/run/netns/init_net $ mount --bind

[PATCH net-next v2 3/5] netns: add support of NETNSA_TARGET_NSID

2018-11-22 Thread Nicolas Dichtel
Like it was done for link and address, add the ability to perform get/dump in another netns by specifying a target nsid attribute. Signed-off-by: Nicolas Dichtel --- include/uapi/linux/net_namespace.h | 1 + net/core/net_namespace.c | 86 ++ 2 files

[PATCH net-next v2 1/5] netns: remove net arg from rtnl_net_fill()

2018-11-22 Thread Nicolas Dichtel
This argument is not used anymore. Fixes: cab3c8ec8d57 ("netns: always provide the id to rtnl_net_fill()") Signed-off-by: Nicolas Dichtel --- net/core/net_namespace.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/net/core/net_namespace.c

[PATCH net-next v2 2/5] netns: introduce 'struct net_fill_args'

2018-11-22 Thread Nicolas Dichtel
This is a preparatory work. To avoid having to much arguments for the function rtnl_net_fill(), a new structure is defined. Signed-off-by: Nicolas Dichtel --- net/core/net_namespace.c | 48 1 file changed, 34 insertions(+), 14 deletions(-) diff --git

[PATCH net-next v2 4/5] netns: enable to specify a nsid for a get request

2018-11-22 Thread Nicolas Dichtel
Combined with NETNSA_TARGET_NSID, it enables to "translate" a nsid from one netns to a nsid of another netns. This is useful when using NETLINK_F_LISTEN_ALL_NSID because it helps the user to interpret a nsid received from an other netns. Signed-off-by: Nicolas Dichtel ---

[PATCH net-next v2 5/5] netns: enable to dump full nsid translation table

2018-11-22 Thread Nicolas Dichtel
Like the previous patch, the goal is to ease to convert nsids from one netns to another netns. A new attribute (NETNSA_CURRENT_NSID) is added to the kernel answer when NETNSA_TARGET_NSID is provided, thus the user can easily convert nsids. Signed-off-by: Nicolas Dichtel --- include/uapi/linux

Re: [PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-22 Thread Nicolas Dichtel
Le 21/11/2018 à 22:07, David Ahern a écrit : > On 11/21/18 1:58 PM, Nicolas Dichtel wrote: >> The target-nsid is not stored in net_cb (not needed). ref_net is set only if >> tgt_net comes from TARGET_NSID. I can add a comment. > > ref_net is added by this patch and it i

Re: [PATCH net-next 4/4] netns: enable to dump full nsid translation table

2018-11-21 Thread Nicolas Dichtel
Le 21/11/2018 à 19:09, David Ahern a écrit : > On 11/21/18 4:01 AM, Nicolas Dichtel wrote: >> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c >> index 92730905886c..fc568cd0b560 100644 >> --- a/net/core/net_namespace.c >> +++ b/net/core/net_name

Re: [PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-21 Thread Nicolas Dichtel
Le 21/11/2018 à 19:05, David Ahern a écrit : > On 11/21/18 4:01 AM, Nicolas Dichtel wrote: >> static int rtnl_net_dumpid(struct sk_buff *skb, struct netlink_callback *cb) >> { >> -struct net *net = sock_net(skb->sk); >> struct rtnl_net_dump_cb net_cb

Re: [PATCH bpf-next v2] filter: add BPF_ADJ_ROOM_DATA mode to bpf_skb_adjust_room()

2018-11-21 Thread Nicolas Dichtel
Le 20/11/2018 à 02:06, Daniel Borkmann a écrit : > On 11/13/2018 05:35 PM, Nicolas Dichtel wrote: >> This new mode enables to add or remove an l2 header in a programmatic way >> with cls_bpf. >> For example, it enables to play with mpls headers. >> >> Signed-

[PATCH net-next 1/4] netns: remove net arg from rtnl_net_fill()

2018-11-21 Thread Nicolas Dichtel
This argument is not used anymore. Fixes: cab3c8ec8d57 ("netns: always provide the id to rtnl_net_fill()") Signed-off-by: Nicolas Dichtel --- net/core/net_namespace.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/core/net_namespace.c b/net/core/net_n

[PATCH net-next 4/4] netns: enable to dump full nsid translation table

2018-11-21 Thread Nicolas Dichtel
Like the previous patch, the goal is to ease to convert nsids from one netns to another netns. A new attribute (NETNSA_CURRENT_NSID) is added to the kernel answer when NETNSA_TARGET_NSID is provided, thus the user can easily convert nsids. Signed-off-by: Nicolas Dichtel --- include/uapi/linux

[PATCH net-next 0/4] Ease to interpret net-nsid

2018-11-21 Thread Nicolas Dichtel
The goal of this series is to ease the interpretation of nsid received in netlink messages from other netns (when the user uses NETLINK_F_LISTEN_ALL_NSID). After this series, with a patched iproute2: $ ip netns add foo $ ip netns add bar $ touch /var/run/netns/init_net $ mount --bind

[PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-21 Thread Nicolas Dichtel
Like it was done for link and address, add the ability to perform get/dump in another netns by specifying a target nsid attribute. Signed-off-by: Nicolas Dichtel --- include/uapi/linux/net_namespace.h | 1 + net/core/net_namespace.c | 97 -- 2 files

[PATCH net-next 3/4] netns: enable to specify a nsid for a get request

2018-11-21 Thread Nicolas Dichtel
Combined with NETNSA_TARGET_NSID, it enables to "translate" a nsid from one netns to a nsid of another netns. This is useful when using NETLINK_F_LISTEN_ALL_NSID because it helps the user to interpret a nsid received from an other netns. Signed-off-by: Nicolas Dichtel ---

[PATCH iproute2] ipnetns: parse nsid as a signed integer

2018-11-21 Thread Nicolas Dichtel
Don't confuse the user, nsid is a signed integer, this kind of command should return an error: 'ip netns set foo 0x'. Also, a valid value is a positive value. To let the kernel chooses a value, the keyword 'auto' must be used. Signed-off-by: Nicolas Dichtel --- ip/ipnetns.c | 8

Re: netns_id in bpf_sk_lookup_{tcp,udp}

2018-11-20 Thread Nicolas Dichtel
Le 20/11/2018 à 16:46, David Ahern a écrit : > On 11/20/18 2:05 AM, Nicolas Dichtel wrote: >> Le 20/11/2018 à 00:46, David Ahern a écrit : [snip] >>> Seems like alloc_netid() should error out if reqid < -1 (-1 being the >>> NETNSA_NSID_NOT_ASSIGNED flag)

Re: netns_id in bpf_sk_lookup_{tcp,udp}

2018-11-20 Thread Nicolas Dichtel
blem, which parses an unsigned and silently cast it to a signed value. -8< >From 79bac98bfd0acbf2526a3427d5aba96564844209 Mon Sep 17 00:00:00 2001 From: Nicolas Dichtel Date: Tue, 20 Nov 2018 09:59:46 +0100 Subject: ipnetns: parse nsid as a signed integer Don't confuse

Re: netns_id in bpf_sk_lookup_{tcp,udp}

2018-11-19 Thread Nicolas Dichtel
Le 19/11/2018 à 20:54, David Ahern a écrit : > On 11/19/18 12:47 PM, Joe Stringer wrote: >> On Mon, 19 Nov 2018 at 10:39, David Ahern wrote: >>> >>> On 11/19/18 11:36 AM, Joe Stringer wrote: Hi David, thanks for pointing this out. This is more of an oversight through iterations,

Re: [RFC v1 1/3] udp_tunnel: add config option to bind to a device

2018-11-14 Thread Nicolas Dichtel
Le 14/11/2018 à 10:31, Alexis Bauvin a écrit : > UDP tunnel sockets are always opened unbound to a specific device. This > patch allow the socket to be bound on a custom device, which > incidentally makes UDP tunnels VRF-aware if binding to an l3mdev. > > Signed-off-by: Alexis Bauvin >

[PATCH bpf-next v2] filter: add BPF_ADJ_ROOM_DATA mode to bpf_skb_adjust_room()

2018-11-13 Thread Nicolas Dichtel
This new mode enables to add or remove an l2 header in a programmatic way with cls_bpf. For example, it enables to play with mpls headers. Signed-off-by: Nicolas Dichtel Acked-by: Martin KaFai Lau --- v2: use skb_set_network_header() include/uapi/linux/bpf.h | 3 ++ net/core/filter.c

Re: [PATCH bpf-next] filter: add BPF_ADJ_ROOM_DATA mode to bpf_skb_adjust_room()

2018-11-10 Thread Nicolas Dichtel
Le 09/11/2018 à 19:51, Martin Lau a écrit : > On Thu, Nov 08, 2018 at 04:11:37PM +0100, Nicolas Dichtel wrote: [snip] >> +static int bpf_skb_data_shrink(struct sk_buff *skb, u32 len) >> +{ >> +unsigned short hhlen = skb->dev->header_ops ? >> +

[PATCH bpf-next] filter: add BPF_ADJ_ROOM_DATA mode to bpf_skb_adjust_room()

2018-11-08 Thread Nicolas Dichtel
This new mode enables to add or remove an l2 header in a programmatic way with cls_bpf. For example, it enables to play with mpls headers. Signed-off-by: Nicolas Dichtel --- include/uapi/linux/bpf.h | 3 ++ net/core/filter.c | 54 ++ tools

Re: [PATCH bpf] bpf: fix doc of bpf_skb_adjust_room() in uapi

2018-10-18 Thread Nicolas Dichtel
Le 18/10/2018 à 06:49, Alexei Starovoitov a écrit : > On Wed, Oct 17, 2018 at 04:24:48PM +0200, Nicolas Dichtel wrote: >> len_diff is signed. >> >> Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)") >> CC: Quentin Monnet >> Signed-

[PATCH bpf] bpf: fix doc of bpf_skb_adjust_room() in uapi

2018-10-17 Thread Nicolas Dichtel
len_diff is signed. Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)") CC: Quentin Monnet Signed-off-by: Nicolas Dichtel --- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH net 1/2] geneve, vxlan: Don't check skb_dst() twice

2018-10-15 Thread Nicolas Dichtel
Le 15/10/2018 à 13:08, Stefano Brivio a écrit : > On Mon, 15 Oct 2018 12:19:41 +0200 > Nicolas Dichtel wrote: > >> Le 12/10/2018 à 23:53, Stefano Brivio a écrit : >>> Commit f15ca723c1eb ("net: don't call update_pmtu unconditionally") avoids >>> t

Re: [PATCH net 1/2] geneve, vxlan: Don't check skb_dst() twice

2018-10-15 Thread Nicolas Dichtel
Le 12/10/2018 à 23:53, Stefano Brivio a écrit : > Commit f15ca723c1eb ("net: don't call update_pmtu unconditionally") avoids > that we try updating PMTU for a non-existent destination, but didn't clean > up cases where the check was already explicit. Drop those redundant checks. Yes, I leave them

Re: [PATCH net] ip6_tunnel: Don't update PMTU on tunnels with collect_md

2018-10-15 Thread Nicolas Dichtel
Le 12/10/2018 à 18:34, Stefano Brivio a écrit : > On Fri, 12 Oct 2018 17:58:55 +0200 > Nicolas Dichtel wrote: [snip] >> Could you explain in your commit log which problem your patch fixes? > > Nothing really. > > The change in f15ca723c1eb looked accidental and I thought

Re: [PATCH net] ip6_tunnel: Don't update PMTU on tunnels with collect_md

2018-10-12 Thread Nicolas Dichtel
Le 12/10/2018 à 14:32, Stefano Brivio a écrit : > Commit 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 > tunnels") introduced a check to avoid updating PMTU when > collect_md mode is enabled. > > Later, commit f15ca723c1eb ("net: don't call update_pmtu > unconditionally") dropped this

Re: [PATCH net 1/2] selftests: pmtu: maximum MTU for vti4 is 2^16-1-20

2018-08-30 Thread Nicolas Dichtel
> Fixes: 82612de1c98e ("ip_tunnel: restore binding to ifaces with a large mtu") > Signed-off-by: Sabrina Dubroca > Acked-by: Stefano Brivio Thanks for fixing this. Acked-by: Nicolas Dichtel

Re: [PATCH iproute2 v2 1/2] ip: display netns name instead of nsid

2018-06-06 Thread Nicolas Dichtel
Le 05/06/2018 à 18:52, Stephen Hemminger a écrit : > On Tue, 5 Jun 2018 15:08:30 +0200 > Nicolas Dichtel wrote: > >> >> +char *get_name_from_nsid(int nsid) >> +{ >> +struct nsid_cache *c; >> + >> +netns_nsid_socket_ini

[PATCH iproute2 v2 1/2] ip: display netns name instead of nsid

2018-06-05 Thread Nicolas Dichtel
When iproute2 has a name for the nsid, let's display it. It's more user friendly than a number. Signed-off-by: Nicolas Dichtel --- ip/ip_common.h | 1 + ip/ipaddress.c | 20 +++- ip/ipnetns.c | 14 ++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git

[PATCH iproute2 v2 0/2] display netns name instead of nsid

2018-06-05 Thread Nicolas Dichtel
After these patches, the iproute2 name of netns is displayed instead of the nsid. It's easier to read/understand. v1 -> v2: - open netns socket and init netns map only when needed ip/ip_common.h | 3 +++ ip/ipaddress.c | 20 +++- ip/iplink.c| 18 --

[PATCH iproute2 v2 2/2] iplink: enable to specify a name for the link-netns

2018-06-05 Thread Nicolas Dichtel
The 'link-netnsid' argument needs a number. Add 'link-netns' when the user wants to use the iproute2 netns name instead of the nsid. Example: ip link add ipip1 link-netns foo type ipip remote 10.16.0.121 local 10.16.0.249 Signed-off-by: Nicolas Dichtel --- ip/ip_common.h | 2 ++ ip/iplink.c

[PATCH iproute2 1/2] ip: display netns name instead of nsid

2018-06-04 Thread Nicolas Dichtel
When iproute2 has a name for the nsid, let's display it. It's more user friendly than a number. Signed-off-by: Nicolas Dichtel --- ip/ip_common.h | 1 + ip/ipaddress.c | 23 ++- ip/ipnetns.c | 10 ++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git

[PATCH iproute2 0/2] display netns name instead of nsid

2018-06-04 Thread Nicolas Dichtel
[PATCH iproute2 0/2] display netns name instead of nsid After these patches, the iproute2 name of netns is displayed instead of the nsid. It's easier to read/understand. ip/ip_common.h | 3 +++ ip/ipaddress.c | 23 ++- ip/iplink.c| 18 -- ip/ipnetns.c

[PATCH iproute2 2/2] iplink: enable to specify a name for the link-netns

2018-06-04 Thread Nicolas Dichtel
The 'link-netnsid' argument needs a number. Add 'link-netns' when the user wants to use the iproute2 netns name instead of the nsid. Example: ip link add ipip1 link-netns foo type ipip remote 10.16.0.121 local 10.16.0.249 Signed-off-by: Nicolas Dichtel --- ip/ip_common.h | 2 ++ ip/iplink.c

Re: [PATCH net v2 0/2] ip[6] tunnels: fix mtu calculations

2018-06-04 Thread Nicolas Dichtel
Le 01/06/2018 à 19:57, David Miller a écrit : [snip] > I think the 0xfff8 value might come from the requirement that ipv6 > fragments need to be a multiple of 8 bytes long. > Oh, thanks for the explanation!

Re: [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support

2018-06-01 Thread Nicolas Dichtel
Le 31/05/2018 à 17:51, Nicolas Dichtel a écrit : > Le 31/05/2018 à 17:46, Stephen Hemminger a écrit : >> On Thu, 31 May 2018 16:28:48 +0200 > [snip] >> This makes sense. All of linkinfo that is present should be displayed. >> >> Both netns and ifindex are rea

Re: [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support

2018-05-31 Thread Nicolas Dichtel
Le 31/05/2018 à 17:46, Stephen Hemminger a écrit : > On Thu, 31 May 2018 16:28:48 +0200 [snip] > This makes sense. All of linkinfo that is present should be displayed. > > Both netns and ifindex are really unsigned values. Use __u32 and print_uint. Ok. > Also why not convert numeric values to

Re: [PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support

2018-05-31 Thread Nicolas Dichtel
Oops, I use an old email for Stephen, sorry. Regards, Nicolas Le 31/05/2018 à 16:28, Nicolas Dichtel a écrit : > Parse and display those attributes. > Example: > ip l a type dummy > ip netns add foo > ip monitor link& > ip l s dummy1 netns foo > Deleted 6: dummy1:

[PATCH iproute2] ip: IFLA_NEW_NETNSID/IFLA_NEW_IFINDEX support

2018-05-31 Thread Nicolas Dichtel
Parse and display those attributes. Example: ip l a type dummy ip netns add foo ip monitor link& ip l s dummy1 netns foo Deleted 6: dummy1: mtu 1500 qdisc noop state DOWN group default link/ether 66:af:3a:3f:a0:89 brd ff:ff:ff:ff:ff:ff new-nsid 0 new-ifindex 6 Signed-off-by: Nicolas Dic

[PATCH net v2 2/2] ip6_tunnel: remove magic mtu value 0xFFF8

2018-05-31 Thread Nicolas Dichtel
I don't know where this value comes from (probably a copy and paste and paste and paste ...). Let's use standard values which are a bit greater. Link: https://git.kernel.org/pub/scm/linux/kernel/git/davem/netdev-vger-cvs.git/commit/?id=e5afd356a411a Signed-off-by: Nicolas Dichtel --- net/ipv6

[PATCH net v2 0/2] ip[6] tunnels: fix mtu calculations

2018-05-31 Thread Nicolas Dichtel
The first patch restores the possibility to bind an ip4 tunnel to an interface whith a large mtu. The second patch was spotted after the first fix. I also target it to net because it fixes the max mtu value that can be used for ipv6 tunnels. v2: remove the 0xfff8 in ip_tunnel_newlink()

[PATCH net v2 1/2] ip_tunnel: restore binding to ifaces with a large mtu

2018-05-31 Thread Nicolas Dichtel
chata CC: Ido Schimmel Link: https://git.kernel.org/pub/scm/linux/kernel/git/davem/netdev-vger-cvs.git/commit/?id=e5afd356a411a Fixes: f6cc9c054e77 ("ip_tunnel: Emit events for post-register MTU changes") Signed-off-by: Nicolas Dichtel Reviewed-by: Ido Schimmel --- net/ipv4/ip_tunnel.

Re: [PATCH net 1/2] ip_tunnel: restore binding to ifaces with a large mtu

2018-05-31 Thread Nicolas Dichtel
Le 30/05/2018 à 22:29, Ido Schimmel a écrit : [snip] > There is another instance of this magic number in the file, but it's > written in lower case so you might have missed it - see > ip_tunnel_newlink(). Can you please take care of it in v2? Good catch, thank you. Will send a v2.

[PATCH net 1/2] ip_tunnel: restore binding to ifaces with a large mtu

2018-05-30 Thread Nicolas Dichtel
chata CC: Ido Schimmel Link: https://git.kernel.org/pub/scm/linux/kernel/git/davem/netdev-vger-cvs.git/commit/?id=e5afd356a411a Fixes: f6cc9c054e77 ("ip_tunnel: Emit events for post-register MTU changes") Signed-off-by: Nicolas Dichtel --- net/ipv4/ip_tunnel.c | 6 +++--- 1 file chan

[PATCH net 2/2] ip6_tunnel: remove magic mtu value 0xFFF8

2018-05-30 Thread Nicolas Dichtel
I don't know where this value comes from (probably a copy and paste and paste and paste ...). Let's use standard values which are a bit greater. Link: https://git.kernel.org/pub/scm/linux/kernel/git/davem/netdev-vger-cvs.git/commit/?id=e5afd356a411a Signed-off-by: Nicolas Dichtel --- net/ipv6

[PATCH net 0/2] ip[6] tunnels: fix mtu calculations

2018-05-30 Thread Nicolas Dichtel
The first patch restores the possibility to bind an ip4 tunnel to an interface whith a large mtu. The second patch was spotted after the first fix. I also target it to net because it fixes the max mtu value that can be used for ipv6 tunnels. net/ipv4/ip_tunnel.c | 6 +++---

Re: [PATCH net-next] fib_rules: rename FRA_PROTOCOL to FRA_ORIGINATOR

2018-03-21 Thread Nicolas Dichtel
Le 21/03/2018 à 16:15, David Miller a écrit : > From: David Ahern > Date: Wed, 21 Mar 2018 09:00:09 -0600 > >> The rule->proto value is not used as a selector. It is passed in, stored >> on a rule and returned to userspace. It is book keeping only so an admin >> has some idea

Re: [PATCH net-next] fib_rules: rename FRA_PROTOCOL to FRA_ORIGINATOR

2018-03-21 Thread Nicolas Dichtel
Le 20/03/2018 à 18:27, David Ahern a écrit : > On 3/20/18 11:04 AM, Nicolas Dichtel wrote: >> As the comment said, this attribute defines the originator of the rule, >> it's not really a (network) protocol. >> Let's rename it accordingly to avoid confusion (difference be

[PATCH net-next] fib_rules: rename FRA_PROTOCOL to FRA_ORIGINATOR

2018-03-20 Thread Nicolas Dichtel
As the comment said, this attribute defines the originator of the rule, it's not really a (network) protocol. Let's rename it accordingly to avoid confusion (difference between FRA_PROTOCOL and FRA_IP_PROTO was not obvious). CC: Donald Sharp <sha...@cumulusnetworks.com> Signed-off-by: N

[PATCH net] netlink: avoid a double skb free in genlmsg_mcast()

2018-03-14 Thread Nicolas Dichtel
k> Signed-off-by: Nicolas Dichtel <nicolas.dich...@6wind.com> --- net/netlink/genetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 6f02499ef007..b9ce82c9440f 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/

Re: [PATCH RFC net-next 5/7] net/ipv6: Add support for path selection using hash of 5-tuple

2018-02-13 Thread Nicolas Dichtel
Le 13/02/2018 à 22:02, David Ahern a écrit : > On 2/13/18 1:59 PM, Nicolas Dichtel wrote: >> Le 13/02/2018 à 21:35, David Ahern a écrit : >>> On 2/13/18 1:31 PM, Nicolas Dichtel wrote: >>>> Le 13/02/2018 à 01:06, David Ahern a écrit : >>>>> Som

Re: [PATCH RFC net-next 5/7] net/ipv6: Add support for path selection using hash of 5-tuple

2018-02-13 Thread Nicolas Dichtel
Le 13/02/2018 à 21:35, David Ahern a écrit : > On 2/13/18 1:31 PM, Nicolas Dichtel wrote: >> Le 13/02/2018 à 01:06, David Ahern a écrit : >>> Some operators prefer IPv6 path selection to use a standard 5-tuple >>> hash rather than just an L3 hash with the flow the

Re: [PATCH RFC net-next 5/7] net/ipv6: Add support for path selection using hash of 5-tuple

2018-02-13 Thread Nicolas Dichtel
Le 13/02/2018 à 01:06, David Ahern a écrit : > Some operators prefer IPv6 path selection to use a standard 5-tuple > hash rather than just an L3 hash with the flow the label. To that end > add support to IPv6 for multipath hash policy similar to bf4e0a3db97eb > ("net: ipv4: add support for ECMP

[PATCH net] netlink: ensure to loop over all netns in genlmsg_multicast_allns()

2018-02-06 Thread Nicolas Dichtel
in the future, I didn't take the assumption that nlmsg_multicast() returns only 0 or -ESRCH. Fixes: 134e63756d5f ("genetlink: make netns aware") CC: Johannes Berg <johannes.b...@intel.com> Signed-off-by: Nicolas Dichtel <nicolas.dich...@6wind.com> --- net/netlink/genetlink.c | 1

Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK

2018-01-26 Thread Nicolas Dichtel
Le 26/01/2018 à 09:36, Jiri Benc a écrit : > On Fri, 26 Jan 2018 00:34:51 +0100, Nicolas Dichtel wrote: >> Why meaningful? The user knows that the answer is like if if was done in >> another >> netns. It enables to have only one netlink socket instead of one per netns. >

Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK

2018-01-25 Thread Nicolas Dichtel
Le 25/01/2018 à 23:30, Jiri Benc a écrit : > On Thu, 25 Jan 2018 15:20:59 +0100, Nicolas Dichtel wrote: >> Hmm, I don't agree. For me, it would be the correct answer. If user has a >> socket >> in ns_a and targets a RTM_GETLINK in ns_b, the answer he gets should be like

Re: [PATCH net] net: don't call update_pmtu unconditionally

2018-01-25 Thread Nicolas Dichtel
Le 25/01/2018 à 22:28, David Miller a écrit : > From: Nicolas Dichtel <nicolas.dich...@6wind.com> > Date: Thu, 25 Jan 2018 19:03:03 +0100 > >> Some dst_ops (e.g. md_dst_ops)) doesn't set this handler. It may result to: >> "BUG: unable to handle kernel NULL pointe

[PATCH net] net: don't call update_pmtu unconditionally

2018-01-25 Thread Nicolas Dichtel
tx path") Fixes: a93bf0ff4490 ("vxlan: update skb dst pmtu on tx path") CC: Roman Kapl <c...@rkapl.cz> CC: Xin Long <lucien@gmail.com> Signed-off-by: Nicolas Dichtel <nicolas.dich...@6wind.com> --- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 3 +-- drivers/net/g

Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK

2018-01-25 Thread Nicolas Dichtel
Le 24/01/2018 à 17:35, Jiri Benc a écrit : > On Wed, 24 Jan 2018 16:24:34 +0100, Nicolas Dichtel wrote: >> I wonder if it would be possible to do something in the netlink framework, >> like >> NETLINK_LISTEN_ALL_NSID. >> Having some ancillary data at the netlink socke

[PATCH net-next 2/2] dev: advertise the new ifindex when the netns iface changes

2018-01-25 Thread Nicolas Dichtel
The goal is to let the user follow an interface that moves to another netns. CC: Jiri Benc <jb...@redhat.com> CC: Christian Brauner <christian.brau...@ubuntu.com> Signed-off-by: Nicolas Dichtel <nicolas.dich...@6wind.com> --- include/linux/rtnetlink.h| 5 +++-- include/ua

[PATCH net-next 0/2] Ease to follow an interface that moves to another netns

2018-01-25 Thread Nicolas Dichtel
The goal of this series is to ease the user to follow an interface that moves to another netns. After this series, with a patched iproute2: $ ip netns bar foo $ ip monitor link & $ ip link set dummy0 netns foo Deleted 5: dummy0: mtu 1500 qdisc noop state DOWN group default

[PATCH net-next 1/2] dev: always advertise the new nsid when the netns iface changes

2018-01-25 Thread Nicolas Dichtel
The user should be able to follow any interface that moves to another netns. There is no reason to hide physical interfaces. CC: Jiri Benc <jb...@redhat.com> CC: Christian Brauner <christian.brau...@ubuntu.com> Signed-off-by: Nicolas Dichtel <nicolas.dich...@6wind.com> ---

Re: [PATCH] net: make sure skb_dst is valid before using

2018-01-24 Thread Nicolas Dichtel
Le 24/01/2018 à 10:49, Roman Kapl a écrit : > On 01/24/2018 10:16 AM, Xin Long wrote: >> On Wed, Jan 24, 2018 at 6:42 AM, Roman Kapl wrote: >>> Tunnel devices often use skb_dst(skb)->ops, but ops are not implemented >>> for metadata tunnel destinations. Use skb_valid_dst to check

Re: [PATCH net-next 0/3 V1] rtnetlink: enable IFLA_IF_NETNSID for RTM_{DEL,SET}LINK

2018-01-24 Thread Nicolas Dichtel
Hi, Le 24/01/2018 à 15:26, Christian Brauner a écrit : > Hi, > > Based on the previous discussion this enables passing a IFLA_IF_NETNSID > property along with RTM_SETLINK and RTM_DELLINK requests. The patch for > RTM_NEWLINK will be sent out in a separate patch since there are more >

Re: [PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd

2018-01-24 Thread Nicolas Dichtel
Le 23/01/2018 à 18:08, Jiri Benc a écrit : > On Tue, 23 Jan 2018 17:37:11 +0100, Nicolas Dichtel wrote: >> When a virtual interface moves to another netns, the netlink RTM_DELLINK >> message >> contains the attribute IFLA_NEW_NETNSID, which identifies where the interface &

Re: [PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd

2018-01-23 Thread Nicolas Dichtel
Le 23/01/2018 à 13:22, Jiri Benc a écrit : > (Christian, I'm adding back the netdev list, there's no reason not to > have the discussion in open.) > > On Tue, 23 Jan 2018 12:42:19 +0100, Christian Brauner wrote: >> Thanks for the comments and discussion. Sorry, for not going through the >> list

Re: [PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd

2018-01-23 Thread Nicolas Dichtel
Le 23/01/2018 à 11:26, Wolfgang Bumiller a écrit : > On Tue, Jan 23, 2018 at 10:30:09AM +0100, Jiri Benc wrote: >> On Mon, 22 Jan 2018 23:25:41 +0100, Christian Brauner wrote: >>> This is not necessarily true in scenarios where I move a network device >>> via RTM_NEWLINK + IFLA_NET_NS_PID into a

Re: [PATCH net-next 1/1] rtnetlink: request RTM_GETLINK by pid or fd

2018-01-23 Thread Nicolas Dichtel
Le 22/01/2018 à 23:06, Jiri Benc a écrit : [snip] > Btw, we have one missing piece here: when an interface is moved to a > name space that does not have netnsid attached, we want to find out > where the interface was moved to. But there's currently no reliable way > to do it. For veth, the other

Re: [PATCH 2/2] Revert "xfrm: Fix stack-out-of-bounds read in xfrm_state_find."

2018-01-08 Thread Nicolas Dichtel
Le 05/01/2018 à 18:17, David Miller a écrit : [snip] > I will in my next batch of stable submissions. > Thank you!

Re: [PATCH 2/2] Revert "xfrm: Fix stack-out-of-bounds read in xfrm_state_find."

2018-01-05 Thread Nicolas Dichtel
Le 23/12/2017 à 17:09, Steffen Klassert a écrit : > On Sat, Dec 23, 2017 at 10:56:12AM -0500, David Miller wrote: >> From: Steffen Klassert >> Date: Sat, 23 Dec 2017 10:22:17 +0100 >> >>> On Thu, Nov 16, 2017 at 11:00:40AM +0100, Steffen Klassert wrote: This

Re: [PATCH net v2] netns, rtnetlink: fix struct net reference leak

2017-12-23 Thread Nicolas Dichtel
; Fixes: 317f4810e45e ("rtnl: allow to create device with IFLA_LINK_NETNSID > set") > Fixes: 79e1ad148c84 ("rtnetlink: use netnsid to query interface") > CC: Jiri Benc <jb...@redhat.com> > CC: Nicolas Dichtel <nicolas.dich...@6wind.com> > CC: Jason A. D

Re: [PATCH net] rtnetlink: fix struct net reference leak

2017-12-22 Thread Nicolas Dichtel
Le 21/12/2017 à 23:18, Craig Gallek a écrit : > From: Craig Gallek > > The below referenced commit extended the RTM_GETLINK interface to > allow querying by netns id. The netnsid property was previously > defined as a signed integer, but this patch assumes that the user >

Re: [PATCH] net: Fix double free and memory corruption in get_net_ns_by_id()

2017-12-20 Thread Nicolas Dichtel
t seem to be unlikely. > The patch fixes the problem in standard way. > > (Also, there is possible problem in peernet2id_alloc(), which requires > check for net::count under nsid_lock and maybe_get_net(peer), but > in current stable kernel it's used under rtnl_lock() and it has to be > safe. Op

Re: [PATCH net] sit: update frag_off info

2017-11-30 Thread Nicolas Dichtel
older than this patch (before git ages), but it probably doesn't matter. > Reported-by: Jianlin Shi <ji...@redhat.com> > Signed-off-by: Hangbin Liu <liuhang...@gmail.com> Acked-by: Nicolas Dichtel <nicolas.dich...@6wind.com>

Re: [iproute PATCH] link_gre6: Detect invalid encaplimit values

2017-11-30 Thread Nicolas Dichtel
.@nwl.cc> Good catch! Acked-by: Nicolas Dichtel <nicolas.dich...@6wind.com>

Re: [RFC] [PATCH] netns: Fix race in virtual interface bringup

2017-11-16 Thread Nicolas Dichtel
Le 15/11/2017 à 20:04, Dan Rue a écrit : > Adding CC netdev > > Can someone comment on the expected behavior of this test case? > > Here's the isolated test: > > ip netns del tst_net_ns0 > ip netns del tst_net_ns1 > ip netns add tst_net_ns0 > ip netns add tst_net_ns1 > ip

Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default

2017-11-15 Thread Nicolas Dichtel
Le 15/11/2017 à 11:25, David Miller a écrit : > From: Nicolas Dichtel <nicolas.dich...@6wind.com> > Date: Wed, 15 Nov 2017 11:17:28 +0100 > >> I saw that you pushed this patch in net-next instead of net. Is it >> intentional? >> I was expecting to see it in net,

Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default

2017-11-15 Thread Nicolas Dichtel
Le 14/11/2017 à 14:21, Nicolas Dichtel a écrit : > With commits 35e015e1f577 and a2d3f3e33853, the global 'accept_dad' flag > is also taken into account (default value is 1). If either global or > per-interface flag is non-zero, DAD will be enabled on a given interface. > > This

  1   2   3   4   5   6   >