[PATCH net] ipv6: sr: remove cleanup flag and fix HMAC computation

2017-02-02 Thread David Lebrun
of IPv6 SR. [1] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-05 Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/uapi/linux/seg6.h | 9 +++-- net/ipv6/exthdrs.c| 31 +++ net/ipv6/seg6_hmac.c | 8 -

Re: [PATCH net-next] ipv6: add NUMA awareness to seg6_hmac_init_algo()

2017-01-21 Thread David Lebrun
cpu_to_node(cpu)); > if (!shash) > return -ENOMEM; > *per_cpu_ptr(algo->shashs, cpu) = shash; > > Thanks Acked-by: David Lebrun <david.leb...@uclouvain.be> signature.asc Description: OpenPGP digital signature

[PATCH net-next v2] ipv6: sr: add missing Kbuild export for header files

2017-01-15 Thread David Lebrun
Add missing IPv6-SR header files in include/uapi/linux/Kbuild. Also, prevent seg6_lwt_headroom() from being exported and add missing linux/types.h include. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/uapi/linux/Kbuild | 4 include/uapi/linux/

Re: [PATCH net] ipv6: seg6_genl_set_tunsrc() must check kmemdup() return value

2017-01-20 Thread David Lebrun
0 ("ipv6: sr: add code base for control plane support of > SR-IPv6") > Signed-off-by: Eric Dumazet <eduma...@google.com> > Cc: David Lebrun <david.leb...@uclouvain.be> > --- > net/ipv6/seg6.c |2 ++ > 1 file changed, 2 insert

Re: [RFC 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-09-01 Thread David Lebrun
On 08/31/2016 07:10 PM, Stephen Hemminger wrote: > Since these are for control operations why a mutex? I am not sure to understand the question. The spinlock is used on the RCU write side of the namespace-wide parameters to prevent concurrent writes. David signature.asc Description: OpenPGP

Re: [RFC 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-09-01 Thread David Lebrun
On 08/31/2016 04:51 PM, Nicolas Dichtel wrote: > Thanks for proposing this feature. It would be great to have it upstream. > Thanks for the feedback :) > [snip] >> +config IPV6_SEG6 >> +bool "IPv6: Segment Routing support" >> +depends on IPV6 >> +---help--- >> + Experimental

Re: [RFC 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-09-01 Thread David Lebrun
On 08/29/2016 05:31 PM, Roopa Prabhu wrote: > This looks fine. But, i am just trying to see if this can be rtnetlink. > Have you considered it already ?. > We would like to keep the API consistent or abstracted to accommodate SR-MPLS > in the > future too. so, any abstraction there will help. >

Re: [RFC 4/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels

2016-09-01 Thread David Lebrun
On 08/29/2016 04:52 PM, Roopa Prabhu wrote: > You will need to account for lwtunnel headroom ? > https://patchwork.ozlabs.org/patch/662632/ > > thanks, > Roopa Indeed, thanks David signature.asc Description: OpenPGP digital signature

[RFC 9/9] ipv6: sr: add support for SRH injection through setsockopt

2016-08-26 Thread David Lebrun
This patch adds support for per-socket SRH injection with the setsockopt system call through the IPPROTO_IPV6, IPV6_RTHDR options. The SRH is pushed through the ipv6_push_nfrag_opts function. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/Kconfig | 5 ++-- ne

[RFC 5/9] ipv6: sr: add core files for SR HMAC support

2016-08-26 Thread David Lebrun
. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_hmac.h | 6 + include/net/seg6_hmac.h| 61 ++ include/uapi/linux/seg6_hmac.h | 20 ++ net/ipv6/seg6_hmac.c | 432 + 4 files changed, 519 inse

[RFC 8/9] ipv6: add source address argument for ipv6_push_nfrag_opts

2016-08-26 Thread David Lebrun
This patch prepares for insertion of SRH through setsockopt(). The new source address argument is used when an HMAC field is present in the SRH, which must be filled. The HMAC signature process requires the source address as input text. Signed-off-by: David Lebrun <david.leb...@uclouvain

[RFC 7/9] ipv6: sr: add calls to verify and insert HMAC signatures

2016-08-26 Thread David Lebrun
This patch enables the verification of the HMAC signature for transiting SR-enabled packets, and its insertion on encapsulated/injected SRH. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c | 10 ++ net/ipv6/seg6_iptunnel.c | 17 ++

[RFC 3/9] ipv6: route: export symbol ip6_route_input

2016-08-26 Thread David Lebrun
The function ip6_route_input() is used in the seg6_iptunnel module and thus needs to be exported when CONFIG_IPV6_SEG6_IPTUNNEL=m Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/route.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/route.c b/net/ipv6/r

[RFC 6/9] ipv6: sr: implement API to control SR HMAC structures

2016-08-26 Thread David Lebrun
signature is incorrect will be dropped. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 3 + include/net/seg6.h| 10 +++ include/net/seg6_hmac.h | 1 + include/uapi/linux/ipv6.h | 1 + net/ipv6/Kconfig | 7 ++ net/ipv6/Ma

[RFC 4/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels

2016-08-26 Thread David Lebrun
ode encap', then the SRH would be directly inserted after the IPv6 header without outer encapsulation. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_iptunnel.h | 6 + include/net/seg6.h | 11 ++ include/uapi/linux/lwtunnel.h | 1 +

[RFC 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-08-26 Thread David Lebrun
return ENOTSUPP and will be implemented in a future patch. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_genl.h | 6 ++ include/net/netns/ipv6.h | 3 + include/net/seg6.h | 43 + include/uapi/linux/seg6_genl.h | 32 +++ ne

[RFC 0/9] add support for IPv6 Segment Routing

2016-08-26 Thread David Lebrun
tps://tools.ietf.org/html/draft-ietf-spring-segment-routing-09 [2] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-01 Any comment on the architecture, API and implementation would be very welcome. Regards, David Lebrun (9): ipv6: implement dataplane support for rthdr type 4 (Segment Rout

[RFC 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-08-26 Thread David Lebrun
. This patch does not provide support for HMAC-signed packets. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 3 + include/linux/seg6.h | 6 ++ include/uapi/linux/ipv6.h | 2 + include/uapi/linux/seg6.h | 46 +++ net/ipv6/K

Re: [PATCH v2 0/9] net: add support for IPv6 Segment Routing

2016-10-26 Thread David Lebrun
On 10/26/2016 05:54 PM, David Lebrun wrote: > struct ipv6_sr_hdr { > __u8nexthdr; > __u8hdrlen; > __u8type; > __u8segments_left; > __u8first_segment; > __be16 flags; > __u8reserved; >

[PATCH v2 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-10-26 Thread David Lebrun
. This patch does not provide support for HMAC-signed packets. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 1 + include/linux/seg6.h | 6 ++ include/uapi/linux/ipv6.h | 2 + include/uapi/linux/seg6.h | 48 net/ipv6/addr

[PATCH v2 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-26 Thread David Lebrun
return ENOTSUPP and will be implemented in a future patch. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_genl.h | 6 ++ include/net/netns/ipv6.h | 1 + include/net/seg6.h | 30 ++ include/uapi/linux/seg6_genl.h | 32 ++ ne

[PATCH v2 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels

2016-10-26 Thread David Lebrun
ode encap', then the SRH would be directly inserted after the IPv6 header without outer encapsulation. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_iptunnel.h | 6 + include/net/seg6.h | 1 + include/uapi/linux/lwtunnel.h

[PATCH v2 0/9] net: add support for IPv6 Segment Routing

2016-10-26 Thread David Lebrun
-256 as required by the IETF draft), but additional algorithms can be easily supported by simply adding an entry into an array. [1] https://tools.ietf.org/html/draft-ietf-spring-segment-routing-09 [2] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-02 David Le

[PATCH v2 4/9] ipv6: sr: add core files for SR HMAC support

2016-10-26 Thread David Lebrun
. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_hmac.h | 6 + include/net/seg6_hmac.h| 61 ++ include/uapi/linux/seg6_hmac.h | 20 ++ net/ipv6/Kconfig | 12 ++ net/ipv6/seg6_hmac.c

[PATCH v2 8/9] ipv6: sr: add support for SRH injection through setsockopt

2016-10-26 Thread David Lebrun
This patch adds support for per-socket SRH injection with the setsockopt system call through the IPPROTO_IPV6, IPV6_RTHDR options. The SRH is pushed through the ipv6_push_nfrag_opts function. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c

[PATCH v2 6/9] ipv6: sr: add calls to verify and insert HMAC signatures

2016-10-26 Thread David Lebrun
This patch enables the verification of the HMAC signature for transiting SR-enabled packets, and its insertion on encapsulated/injected SRH. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c | 10 ++ net/ipv6/seg6_iptunnel.c | 18 +++

[PATCH v2 5/9] ipv6: sr: implement API to control SR HMAC structure

2016-10-26 Thread David Lebrun
signature is incorrect will be dropped. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 3 + include/net/seg6.h| 10 +++ include/net/seg6_hmac.h | 1 + include/uapi/linux/ipv6.h | 1 + net/ipv6/Makefile | 1 + net/ipv6/addr

[PATCH v2 9/9] ipv6: sr: add documentation file for per-interface sysctls

2016-10-26 Thread David Lebrun
This patch adds documentation for some SR-related per-interface sysctls. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- Documentation/networking/seg6-sysctl.txt | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/networking/seg6-sysc

[PATCH v2 7/9] ipv6: add source address argument for ipv6_push_nfrag_opts

2016-10-26 Thread David Lebrun
This patch prepares for insertion of SRH through setsockopt(). The new source address argument is used when an HMAC field is present in the SRH, which must be filled. The HMAC signature process requires the source address as input text. Signed-off-by: David Lebrun <david.leb...@uclouvain

[PATCH net-next v3 0/9] net: add support for IPv6 Segment Routing

2016-10-27 Thread David Lebrun
/html/draft-ietf-6man-segment-routing-header-02 David Lebrun (9): ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header) ipv6: sr: add code base for control plane support of SR-IPv6 ipv6: sr: add support for SRH encapsulation and injection with lwtunnels ipv6: sr

[PATCH net-next v3 4/9] ipv6: sr: add core files for SR HMAC support

2016-10-27 Thread David Lebrun
. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_hmac.h | 6 + include/net/seg6_hmac.h| 61 ++ include/uapi/linux/seg6_hmac.h | 20 ++ net/ipv6/Kconfig | 12 ++ net/ipv6/seg6_hmac.c

[PATCH net-next v3 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-10-27 Thread David Lebrun
. This patch does not provide support for HMAC-signed packets. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 1 + include/linux/seg6.h | 6 ++ include/uapi/linux/ipv6.h | 2 + include/uapi/linux/seg6.h | 48 net/ipv6/addr

Re: [PATCH net-next v4 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels

2016-11-06 Thread David Lebrun
On 11/04/2016 05:26 PM, Tom Herbert wrote: >> + >> +int seg6_output(struct net *net, struct sock *sk, struct sk_buff *skb) >> +{ >> + struct dst_entry *orig_dst = skb_dst(skb); >> + struct dst_entry *dst = NULL; >> + struct seg6_lwt *slwt; >> + int err = -EINVAL; >> + >> +

[PATCH net-next v5 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-11-08 Thread David Lebrun
. This patch does not provide support for HMAC-signed packets. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 1 + include/linux/seg6.h | 6 ++ include/net/seg6.h| 36 ++ include/uapi/linux/ipv6.h | 2 + include/uapi/linu

[PATCH net-next v5 9/9] ipv6: sr: add documentation file for per-interface sysctls

2016-11-08 Thread David Lebrun
This patch adds documentation for some SR-related per-interface sysctls. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- Documentation/networking/seg6-sysctl.txt | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/networking/seg6-sysc

[PATCH net-next v5 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels

2016-11-08 Thread David Lebrun
AH. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_iptunnel.h | 6 + include/net/seg6.h | 6 + include/uapi/linux/lwtunnel.h | 1 + include/uapi/linux/seg6_iptunnel.h | 44 net/core/lwtunnel.c| 2 + net/ipv

[PATCH net-next v5 5/9] ipv6: sr: implement API to control SR HMAC structure

2016-11-08 Thread David Lebrun
This patch provides an implementation of the genetlink commands to associate a given HMAC key identifier with an hashing algorithm and a secret. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/seg6.c | 229

[PATCH net-next v5 7/9] ipv6: add source address argument for ipv6_push_nfrag_opts

2016-11-08 Thread David Lebrun
This patch prepares for insertion of SRH through setsockopt(). The new source address argument is used when an HMAC field is present in the SRH, which must be filled. The HMAC signature process requires the source address as input text. Signed-off-by: David Lebrun <david.leb...@uclouvain

[PATCH net-next v5 8/9] ipv6: sr: add support for SRH injection through setsockopt

2016-11-08 Thread David Lebrun
This patch adds support for per-socket SRH injection with the setsockopt system call through the IPPROTO_IPV6, IPV6_RTHDR options. The SRH is pushed through the ipv6_push_nfrag_opts function. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c

[PATCH net-next v5 6/9] ipv6: sr: add calls to verify and insert HMAC signatures

2016-11-08 Thread David Lebrun
This patch enables the verification of the HMAC signature for transiting SR-enabled packets, and its insertion on encapsulated/injected SRH. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c | 10 ++ net/ipv6/seg6_iptunnel.

[PATCH net-next v5 4/9] ipv6: sr: add core files for SR HMAC support

2016-11-08 Thread David Lebrun
is dropped is the signature is incorrect). Finally, a value of 1 means that any SR-enabled packet that does not contain an HMAC signature or whose signature is incorrect will be dropped. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 3 + include

[PATCH net-next v5 0/9] net: add support for IPv6 Segment Routing

2016-11-08 Thread David Lebrun
outing-09 [2] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-02 David Lebrun (9): ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header) ipv6: sr: add code base for control plane support of SR-IPv6 ipv6: sr: add support for SRH encapsulation and injection

[PATCH net-next v5 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-11-08 Thread David Lebrun
return ENOTSUPP and will be implemented in a future patch. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_genl.h | 6 ++ include/net/netns/ipv6.h | 1 + include/net/seg6.h | 16 +++ include/uapi/linux/seg6_genl.h | 32 ++ ne

Re: [PATCH net-next v5 0/9] net: add support for IPv6 Segment Routing

2016-11-10 Thread David Lebrun
On 11/10/2016 09:35 AM, Lorenzo Colitti wrote: > Not sure how to fix this. The following makes IPv6 work again, but I > suspect it mostly defeats the purpose of having SRH on by default: > > +#ifdef CONFIG_LWTUNNEL > err = seg6_iptunnel_init(); > if (err) > goto

[PATCH net-next] ipv6: sr: fix IPv6 initialization failure without lwtunnels

2016-11-10 Thread David Lebrun
;) Tested with various combinations of CONFIG_IPV6 and CONFIG_LWTUNNEL. Reported-by: Lorenzo Colitti <lore...@google.com> Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/Kconfig | 1 + net/ipv6/Makefile | 3 ++- net/ipv6/seg6.c | 8 3 files changed, 11 ins

[PATCH net-next v2] ipv6: sr: fix IPv6 initialization failure without lwtunnels

2016-11-10 Thread David Lebrun
pport for SRH encapsulation and injection with lwtunnels") Tested with various combinations of CONFIG_IPV6 and CONFIG_LWTUNNEL. Reported-by: Lorenzo Colitti <lore...@google.com> Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/Kconfig | 1 + net/ipv6/Makefile

Re: [PATCH net-next v5 0/9] net: add support for IPv6 Segment Routing

2016-11-10 Thread David Lebrun
On 11/10/2016 10:14 AM, Lorenzo Colitti wrote: > So you'd split SRH functionality in three parts? Core (default on), > lwtunnel (default off) and inline? > > It seems to me that once you've done the work to enable the core code > to work when CONFIG_LWTUNNEL is off, you can just enable/disable

Re: [PATCH net-next v5 0/9] net: add support for IPv6 Segment Routing

2016-11-10 Thread David Lebrun
On 11/10/2016 02:40 AM, David Miller wrote: > Series applied, but I wonder if using a Kconfig knob for the INLINE thing > is overkill. Thanks :) The Kconfig knob was a response to the concern that direct header insertion breaks things. Moreover, if the IETF decides that direct header insertion

Re: [PATCH 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels

2016-10-18 Thread David Lebrun
On 10/17/2016 07:17 PM, Tom Herbert wrote: >> > + err = ip6_dst_lookup(net, sk, , ); > Please look at the use of dst_cache that I added in ila_lwt.c, I think > the SR has similar properties and might be able to use dst_cache which > is a significant performance improvement when source

Re: [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-18 Thread David Lebrun
On 10/17/2016 07:07 PM, Tom Herbert wrote: >> +static inline void seg6_pernet_lock(struct net *net) >> +{ >> + mutex_lock(_pernet(net)->lock); >> +} >> + >> +static inline void seg6_pernet_unlock(struct net *net) >> +{ >> + mutex_unlock(_pernet(net)->lock); >> +} >> + > IMO it's better

Re: [PATCH 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-10-18 Thread David Lebrun
On 10/17/2016 07:01 PM, Tom Herbert wrote: >> +struct ipv6_sr_hdr { >> + __u8nexthdr; >> + __u8hdrlen; >> + __u8type; >> + __u8segments_left; >> + __u8first_segment; >> + __be16 flags; > > Bad alignment for 16 bit field could be unpleasant

Re: [PATCH 4/9] ipv6: sr: add core files for SR HMAC support

2016-10-18 Thread David Lebrun
On 10/17/2016 07:24 PM, Tom Herbert wrote: > A lot of this looks generic and potentially useful in other cases > where we we want to do HMAC over some headers (I'm thinking GUE can > probably use some of this for header authentication). Might be nice to > split out the generic pieces at some

Re: [PATCH 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-10-20 Thread David Lebrun
On 10/17/2016 07:01 PM, Tom Herbert wrote: >> > + >> > + if (skb->ip_summed == CHECKSUM_COMPLETE) >> > + skb->ip_summed = CHECKSUM_NONE; >> > + > Because the packet is being changed? Would it make sense to update the > checksum complete value based on the changes being made.

Re: [PATCH net-next v2] ipv6: sr: fix IPv6 initialization failure without lwtunnels

2016-11-15 Thread David Lebrun
On 11/14/2016 03:22 PM, Roopa Prabhu wrote: > I prefer option b). most LWTUNNEL encaps are done this way. > > seg6 and seg6_iptunnel is new segment routing code and can be under > CONFIG_IPV6_SEG6 which depends on CONFIG_LWTUNNEL and CONFIG_IPV6. > CONFIG_IPV6_SEG6_HMAC could then depend on

Re: [PATCH net-next 1/1] ipv6: sr: add option to control lwtunnel support

2016-11-23 Thread David Lebrun
On 11/23/2016 08:34 AM, Roopa Prabhu wrote: > I can't seem to reproduce the problem you are seeing. still trying.. > I don't have CONFIG_LWTUNNEL set nor any of the other SEG6 configs. > My CONFIG_IPV6 is on and compiled as a module. I have also tried disabling it. > If you can send me the config,

[RFC PATCH net-next] ipv6: implement consistent hashing for equal-cost multipath routing

2016-11-24 Thread David Lebrun
CONFIG_IPV6_MPCONSIST_BUCKETSIZE. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/net/ip6_fib.h | 20 net/ipv6/Kconfig | 26 + net/ipv6/Makefile | 1 + net/ipv6/ip6_ecmp.c | 263 ++ net/ipv6/ip6_fib.c| 18 +++

Re: [RFC PATCH net-next] ipv6: implement consistent hashing for equal-cost multipath routing

2016-11-28 Thread David Lebrun
On 11/28/2016 05:22 PM, David Miller wrote: > Thanks for trying to solve this problem. > > But we really don't want this to be Kconfig gated. If we decide to > support this it should be a run-time selectable option. Every > distribution on the planet is going to turn your Kconfig option on, so

Re: [RFC PATCH net-next] ipv6: implement consistent hashing for equal-cost multipath routing

2016-11-28 Thread David Lebrun
On 11/28/2016 09:32 PM, David Miller wrote: > When I was working on the routing cache removal in ipv4 I compared > using a stupid O(1) hash lookup of the FIB entries vs. the O(log n) > fib_trie stuff actually in use. > > It did make a difference. > > This is a lookup that can be invoked 20

[PATCH net-next 1/1] ipv6: sr: add option to control lwtunnel support

2016-11-15 Thread David Lebrun
UNNEL={y,n}. Reported-by: Lorenzo Colitti <lore...@google.com> Suggested-by: Roopa Prabhu <ro...@cumulusnetworks.com> Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/Kconfig | 13 - net/ipv6/Makefile | 5 +++-- net/ipv6/seg6.c | 8 3 files

[PATCH net-next] lwtunnel: subtract tunnel headroom from mtu on output redirect

2016-11-16 Thread David Lebrun
Prabhu <ro...@cumulusnetworks.com> Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/net/lwtunnel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/net/lwtunnel.h b/include/net/lwtunnel.h index 82e76fe..d4c1c75 100644 --- a/include/net/lwtu

Re: Cannot set IPv6 address

2016-11-16 Thread David Lebrun
: enable CONFIG_LWTUNNEL or apply patch in attachment David From 51775d7223b6d5bd16cb5d09df9ba494fac8ffda Mon Sep 17 00:00:00 2001 From: David Lebrun <david.leb...@uclouvain.be> Date: Tue, 15 Nov 2016 14:57:52 +0100 Subject: [PATCH net-next 1/1] ipv6: sr: add option to control lwtunne

Re: [PATCH net-next v2] ipv6: sr: fix IPv6 initialization failure without lwtunnels

2016-11-13 Thread David Lebrun
On 11/13/2016 06:23 AM, David Miller wrote: > This seems like such a huge mess, quite frankly. > > IPV6-SR has so many strange dependencies, a weird Kconfig option that is > simply controlling what a responsible sysadmin should be allow to do if > he chooses anyways. > > Every distribution is

[PATCH net-next v3 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-27 Thread David Lebrun
return ENOTSUPP and will be implemented in a future patch. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_genl.h | 6 ++ include/net/netns/ipv6.h | 1 + include/net/seg6.h | 33 +++ include/uapi/linux/seg6_genl.h | 32 +++ ne

[PATCH net-next v3 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels

2016-10-27 Thread David Lebrun
ode encap', then the SRH would be directly inserted after the IPv6 header without outer encapsulation. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_iptunnel.h | 6 + include/net/seg6.h | 3 + include/uapi/linux/lwtunnel.h

[PATCH net-next v3 9/9] ipv6: sr: add documentation file for per-interface sysctls

2016-10-27 Thread David Lebrun
This patch adds documentation for some SR-related per-interface sysctls. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- Documentation/networking/seg6-sysctl.txt | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/networking/seg6-sysc

[PATCH net-next v3 7/9] ipv6: add source address argument for ipv6_push_nfrag_opts

2016-10-27 Thread David Lebrun
This patch prepares for insertion of SRH through setsockopt(). The new source address argument is used when an HMAC field is present in the SRH, which must be filled. The HMAC signature process requires the source address as input text. Signed-off-by: David Lebrun <david.leb...@uclouvain

[PATCH net-next v3 8/9] ipv6: sr: add support for SRH injection through setsockopt

2016-10-27 Thread David Lebrun
This patch adds support for per-socket SRH injection with the setsockopt system call through the IPPROTO_IPV6, IPV6_RTHDR options. The SRH is pushed through the ipv6_push_nfrag_opts function. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c

[PATCH net-next v3 6/9] ipv6: sr: add calls to verify and insert HMAC signatures

2016-10-27 Thread David Lebrun
This patch enables the verification of the HMAC signature for transiting SR-enabled packets, and its insertion on encapsulated/injected SRH. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c | 10 ++ net/ipv6/seg6_iptunnel.c | 18 +++

[PATCH net-next v3 5/9] ipv6: sr: implement API to control SR HMAC structure

2016-10-27 Thread David Lebrun
signature is incorrect will be dropped. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 3 + include/net/seg6.h| 6 ++ include/net/seg6_hmac.h | 1 + include/uapi/linux/ipv6.h | 1 + net/ipv6/Makefile | 1 + net/ipv6/addr

[PATCH net-next v4 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-11-04 Thread David Lebrun
. This patch does not provide support for HMAC-signed packets. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 1 + include/linux/seg6.h | 6 ++ include/net/seg6.h| 36 ++ include/uapi/linux/ipv6.h | 2 + include/uapi/linu

[PATCH net-next v4 0/9] net: add support for IPv6 Segment Routing

2016-11-04 Thread David Lebrun
f-spring-segment-routing-09 [2] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-02 David Lebrun (9): ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header) ipv6: sr: add code base for control plane support of SR-IPv6 ipv6: sr: add support for S

[PATCH net-next v4 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-11-04 Thread David Lebrun
return ENOTSUPP and will be implemented in a future patch. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_genl.h | 6 ++ include/net/netns/ipv6.h | 1 + include/net/seg6.h | 16 +++ include/uapi/linux/seg6_genl.h | 32 ++ ne

[PATCH net-next v4 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels

2016-11-04 Thread David Lebrun
ode encap', then the SRH would be directly inserted after the IPv6 header without outer encapsulation. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_iptunnel.h | 6 + include/net/seg6.h | 3 + include/uapi/linux/lwtunnel.h

[PATCH net-next v4 8/9] ipv6: sr: add support for SRH injection through setsockopt

2016-11-04 Thread David Lebrun
This patch adds support for per-socket SRH injection with the setsockopt system call through the IPPROTO_IPV6, IPV6_RTHDR options. The SRH is pushed through the ipv6_push_nfrag_opts function. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c

[PATCH net-next v4 6/9] ipv6: sr: add calls to verify and insert HMAC signatures

2016-11-04 Thread David Lebrun
This patch enables the verification of the HMAC signature for transiting SR-enabled packets, and its insertion on encapsulated/injected SRH. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c | 10 ++ net/ipv6/seg6_iptunnel.

[PATCH net-next v4 5/9] ipv6: sr: implement API to control SR HMAC structure

2016-11-04 Thread David Lebrun
This patch provides an implementation of the genetlink commands to associate a given HMAC key identifier with an hashing algorithm and a secret. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/seg6.c | 229

[PATCH net-next v4 9/9] ipv6: sr: add documentation file for per-interface sysctls

2016-11-04 Thread David Lebrun
This patch adds documentation for some SR-related per-interface sysctls. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- Documentation/networking/seg6-sysctl.txt | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/networking/seg6-sysc

[PATCH net-next v4 7/9] ipv6: add source address argument for ipv6_push_nfrag_opts

2016-11-04 Thread David Lebrun
This patch prepares for insertion of SRH through setsockopt(). The new source address argument is used when an HMAC field is present in the SRH, which must be filled. The HMAC signature process requires the source address as input text. Signed-off-by: David Lebrun <david.leb...@uclouvain

[PATCH 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-10-17 Thread David Lebrun
. This patch does not provide support for HMAC-signed packets. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 3 + include/linux/seg6.h | 6 ++ include/uapi/linux/ipv6.h | 2 + include/uapi/linux/seg6.h | 46 +++ net/ipv6/K

Re: [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-17 Thread David Lebrun
On 10/17/2016 05:00 PM, David Miller wrote: > Please ordre local variables from longest to shortest line (AKA reverse > christmas tree layout). > > Please audit your entire submission for this problem. > >> +val = (struct in6_addr *)nla_data(info->attrs[SEG6_ATTR_DST]); > > Please remove

[PATCH 0/9] net: add support for IPv6 Segment Routing

2016-10-17 Thread David Lebrun
tps://tools.ietf.org/html/draft-ietf-spring-segment-routing-09 [2] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-02 David Lebrun (9): ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header) ipv6: sr: add code base for control plane support of SR-IPv6 ipv6: sr:

[PATCH 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels

2016-10-17 Thread David Lebrun
ode encap', then the SRH would be directly inserted after the IPv6 header without outer encapsulation. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_iptunnel.h | 6 + include/net/seg6.h | 7 + include/uapi/linux/lwtunnel.h | 1 +

[PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6

2016-10-17 Thread David Lebrun
return ENOTSUPP and will be implemented in a future patch. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_genl.h | 6 ++ include/net/netns/ipv6.h | 3 + include/net/seg6.h | 41 include/uapi/linux/seg6_genl.h | 33 +++ ne

[PATCH 4/9] ipv6: sr: add core files for SR HMAC support

2016-10-17 Thread David Lebrun
. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6_hmac.h | 6 + include/net/seg6_hmac.h| 61 ++ include/uapi/linux/seg6_hmac.h | 20 ++ net/ipv6/seg6_hmac.c | 432 + 4 files changed, 519 inse

[PATCH 5/9] ipv6: sr: implement API to control SR HMAC structures

2016-10-17 Thread David Lebrun
signature is incorrect will be dropped. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/ipv6.h | 1 + include/net/seg6.h| 5 +- include/net/seg6_hmac.h | 1 + include/uapi/linux/ipv6.h | 1 + net/ipv6/Makefile | 2 +- net/ipv6/addr

[PATCH 7/9] ipv6: add source address argument for ipv6_push_nfrag_opts

2016-10-17 Thread David Lebrun
This patch prepares for insertion of SRH through setsockopt(). The new source address argument is used when an HMAC field is present in the SRH, which must be filled. The HMAC signature process requires the source address as input text. Signed-off-by: David Lebrun <david.leb...@uclouvain

Re: [PATCH 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)

2016-10-17 Thread David Lebrun
On 10/17/2016 04:57 PM, David Miller wrote: > Please don't use packed, it results in extremely inefficient code on > several architectures. > > You can simply declare the flags as two 8-bit pieces and all will work > out fine. Noted, will do signature.asc Description: OpenPGP digital

[PATCH 8/9] ipv6: sr: add support for SRH injection through setsockopt

2016-10-17 Thread David Lebrun
This patch adds support for per-socket SRH injection with the setsockopt system call through the IPPROTO_IPV6, IPV6_RTHDR options. The SRH is pushed through the ipv6_push_nfrag_opts function. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c

[PATCH 6/9] ipv6: sr: add calls to verify and insert HMAC signatures

2016-10-17 Thread David Lebrun
This patch enables the verification of the HMAC signature for transiting SR-enabled packets, and its insertion on encapsulated/injected SRH. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/exthdrs.c | 6 ++ net/ipv6/seg6_iptunnel.c | 13 + 2

[PATCH 9/9] ipv6: sr: add documentation file for per-interface sysctls

2016-10-17 Thread David Lebrun
This patch adds documentation for some SR-related per-interface sysctls. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- Documentation/networking/seg6-sysctl.txt | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/networking/seg6-sysc

[PATCH iproute2 2/3] ip: add ip sr command to control SR-IPv6 internal structures

2017-01-10 Thread David Lebrun
This patch add commands to support the tunnel source properties ("ip sr tunsrc") and the HMAC key -> secret, algorithm binding ("ip sr hmac"). Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- ip/Makefile| 2 +- ip/ip.c| 3 +- ip/ip_

[PATCH iproute2 3/3] iproute: add support for SR-IPv6 lwtunnel encapsulation

2017-01-10 Thread David Lebrun
This patch adds support for SEG6 encapsulation type ("ip route add ... encap seg6 ..."). Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- ip/iproute.c | 6 +- ip/iproute_lwtunnel.c | 160 ++ 2 files changed

[PATCH iproute2 0/3] add support for IPv6 Segment Routing

2017-01-10 Thread David Lebrun
Control of internal SR structures: tunnel source ("ip sr tunsrc") and HMAC ("ip sr hmac"). HMAC support enables to map an HMAC Key ID to a pair of algorithm + secret. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> David Lebrun (3): sr: add header files for

[PATCH iproute2 1/3] sr: add header files for SR-IPv6

2017-01-10 Thread David Lebrun
This patch add the necessary header files to interface with the SR-IPv6 kernel implementation. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- include/linux/seg6.h | 54 +++ include/linux/seg6_genl.h

[PATCH net] ipv6: sr: fix BUG in HMAC init when preemption is enabled

2017-01-10 Thread David Lebrun
in seg6_hmac_init() and seg6_hmac_exit(). BHs are re-enabled for the call to crypto_alloc_shash. Indeed, this function might call try_module_get(), which cannot be called in atomic context. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/seg6_hmac.c | 15 ---

Re: [PATCH net v2] ipv6: sr: fix several BUGs when preemption is enabled

2017-01-12 Thread David Lebrun
On 01/12/2017 09:26 PM, David Lebrun wrote: > From: Vivien Didelot <vivien.dide...@savoirfairelinux.com> No idea where does that come from, resending patch. Sorry about that Vivien. David signature.asc Description: OpenPGP digital signature

[PATCH net v3] ipv6: sr: fix several BUGs when preemption is enabled

2017-01-12 Thread David Lebrun
also call smp_processor_id(), generating a similar trace. This patch uses raw_cpu_ptr() in seg6_hmac_init() rather than this_cpu_ptr() and disable preemption when using dst_cache_* functions. Signed-off-by: David Lebrun <david.leb...@uclouvain.be> --- net/ipv6/seg6_hmac.c | 2 +- ne

Re: [PATCH net-next] ipv6: sr: static percpu allocation for hmac_ring

2017-01-12 Thread David Lebrun
> Signed-off-by: Eric Dumazet <eduma...@google.com> > Cc: David Lebrun <david.leb...@uclouvain.be> > --- > net/ipv6/seg6_hmac.c | 43 ++--- > 1 file changed, 3 insertions(+), 40 deletions(-) > > d

[PATCH net v2] ipv6: sr: fix several BUGs when preemption is enabled

2017-01-12 Thread David Lebrun
460260] [] entry_SYSCALL64_slow_path+0x25/0x25 Moreover, dst_cache_* functions also call smp_processor_id(), generating a similar trace. This patch uses raw_cpu_ptr() in seg6_hmac_init() rather than this_cpu_ptr() and disable preemption when using dst_cache_* functions. Signed-off-by: David Lebrun <

Re: [PATCH iproute2 1/3] sr: add header files for SR-IPv6

2017-01-12 Thread David Lebrun
On 01/10/2017 07:33 PM, Stephen Hemminger wrote: > I get all headers from santized kernel headers generated by > $ make headers_install > but the segmentation stuff is missing. > > When you added segment routing headers you forgot to export them. > Please send a patch to

  1   2   >