Re: [RFC v2 PATCH 5/5] seg6: Leverage ip6_parse_tlv

2019-06-08 Thread David Lebrun
On 07/06/2019 19:55, Tom Herbert wrote: ... @@ -387,8 +416,24 @@ static int ipv6_srh_rcv(struct sk_buff *skb) return -1; } + tlvoff = seg6_tlv_offset(hdr); + tlvlen = ipv6_optlen((struct ipv6_opt_hdr *)hdr) - tlvoff; + + if (tlvlen) { +

Re: [RFC v2 PATCH 0/5] seg6: Segment routing fixes

2019-06-08 Thread David Lebrun
On 07/06/2019 19:55, Tom Herbert wrote: This patch set includes fixes to bring the segment routing implementation into conformance with the latest version of the draft (draft-ietf-6man-segment-routing-header-19). Also, segment routing receive function calls ip6_parse to properly parse TLVs in par

Re: [RFC v2 PATCH 4/5] seg6: Add sysctl limits for segment routing header

2019-06-08 Thread David Lebrun
On 07/06/2019 19:55, Tom Herbert wrote: + .procname = "max_srh_tlvs_length", Should this be "max_srh_opts_length" to be consistent with the rest of the naming ?

Re: [RFC v2 PATCH 3/5] ipv6: Paramterize TLV parsing

2019-06-08 Thread David Lebrun
On 07/06/2019 19:55, Tom Herbert wrote: + bool (*unknown_opt)(struct sk_buff *skb, int optoff, + bool disallow_unknowns)) What about changing this boolean argument to 'allow_unknowns' (here, in ip6_tlvopt_unknown() and ip6_par

Re: [RFC v2 PATCH 2/5] seg6: Obsolete unused SRH flags

2019-06-08 Thread David Lebrun
On 07/06/2019 19:55, Tom Herbert wrote: + int len = ((srh->hdrlen + 1) << 8) - off; You want << 3 instead of << 8.

Re: [RFC v2 PATCH 1/5] seg6: Fix TLV definitions

2019-06-08 Thread David Lebrun
On 07/06/2019 19:55, Tom Herbert wrote: -#define SR6_TLV_PADDING4 From a uapi perspective, should we rather keep the definition and mark it as obsoleted as for the rest of the TLV types ? Note that I'm fine with both.

Re: [net-next v3] ipv6: sr: Compute flowlabel for outer IPv6 header of seg6 encap mode

2018-04-25 Thread David Lebrun
On 04/24/2018 07:23 PM, Ahmed Abdelsalam wrote: Signed-off-by: Ahmed Abdelsalam Acked-by: David Lebrun

Re: [PATCH] [net] ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts

2018-04-20 Thread David Lebrun
xes: 8936ef7604c11 ipv6: sr: fix NULL pointer dereference when setting encap source address Signed-off-by: Ahmed Abdelsalam Acked-by: David Lebrun

Re: [PATCH net-next RFC 0/5] ipv6: sr: introduce seg6local End.BPF action

2018-04-03 Thread David Lebrun
On 04/03/2018 02:40 PM, David Lebrun wrote: On 04/03/2018 12:16 PM, Mathieu Xhonneux wrote: In patch 2 I was a bit concerned that: +   struct seg6_bpf_srh_state *srh_state = (struct seg6_bpf_srh_state *) +  &skb->cb; would not colli

Re: [PATCH net-next RFC 0/5] ipv6: sr: introduce seg6local End.BPF action

2018-04-03 Thread David Lebrun
aft. Do you plan to disclose such End.BPF action in the draft as well? This is something I've discussed with David Lebrun (the author of the Segment Routing implementation). There's no plan to disclose an End.BPF action as-is in the draft, since eBPF is really specific to Linux, and

[PATCH net] ipv6: sr: fix seg6 encap performances with TSO enabled

2018-03-29 Thread David Lebrun
From: David Lebrun Enabling TSO can lead to abysmal performances when using seg6 in encap mode, such as with the ixgbe driver. This patch adds a call to iptunnel_handle_offloads() to remove the encapsulation bit if needed. Before: root@comp4-seg6bpf:~# iperf3 -c fc00::55 Connecting to host fc00

Re: [PATCH net] ipv6: sr: fix scheduling in RCU when creating seg6 lwtunnel state

2018-03-20 Thread David Lebrun
On 20/03/18 15:07, Eric Dumazet wrote: This is not the proper fix. Control path holds RTNL and can sleeep if needed. RCU should be avoided in lwtunnel_build_state() +Roopa In lwtunnel_build_state(), the RCU protects the lwtunnel_encap_ops "ops" which is rcu-dereferenced. Moreover, the lwtu

[PATCH net] ipv6: sr: fix NULL pointer dereference when setting encap source address

2018-03-20 Thread David Lebrun
From: David Lebrun When using seg6 in encap mode, we call ipv6_dev_get_saddr() to set the source address of the outer IPv6 header, in case none was specified. Using skb->dev can lead to BUG() when it is in an inconsistent state. This patch uses the net_device attached to the skb's dst

[PATCH net] ipv6: sr: fix scheduling in RCU when creating seg6 lwtunnel state

2018-03-20 Thread David Lebrun
From: David Lebrun The seg6_build_state() function is called with RCU read lock held, so we cannot use GFP_KERNEL. This patch uses GFP_ATOMIC instead. [ 92.770271] = [ 92.770628] WARNING: suspicious RCU usage [ 92.770921] 4.16.0-rc4+ #12 Not tainted

Re: [net-next] ipv6: sr: export some functions of seg6local

2018-01-02 Thread David Lebrun
On 12/29/2017 09:09 PM, Ahmed Abdelsalam wrote: > Some functions of seg6local are very useful to process SRv6 > encapsulated packets. > > This patch exports some functions of seg6local that are useful and > can be re-used at different parts of the kernel. > > The set of exported functions are: >

[PATCH net] ipv6: sr: remove duplicate routing header type check

2017-09-10 Thread David Lebrun
From: David Lebrun As seg6_validate_srh() already checks that the Routing Header type is correct, it is not necessary to do it again in get_srh(). Fixes: 5829d70b ("ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200") Signed-off-by: David Lebrun --- net/ipv6/s

Re: [PATCH net] ipv6: sr: remove duplicate routing header type check

2017-09-10 Thread David Lebrun
Please ignore this one, resending with proper From lines. David

[PATCH net] ipv6: sr: remove duplicate routing header type check

2017-09-10 Thread David Lebrun
From: David Lebrun From: David Lebrun As seg6_validate_srh() already checks that the Routing Header type is correct, it is not necessary to do it again in get_srh(). Fixes: 5829d70b ("ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200") Signed-off-by: David Lebrun

Re: [PATCH v2] ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200"

2017-08-30 Thread David Lebrun
d-off-by: Ahmed Abdelsalam Note that this patch applies to net-next. Acked-by: David Lebrun signature.asc Description: OpenPGP digital signature

[PATCH iproute2 net-next v2 2/2] man: add documentation for seg6 l2encap mode

2017-08-28 Thread David Lebrun
This patch adds documentation for the seg6 L2ENCAP encapsulation mode. Signed-off-by: David Lebrun --- man/man8/ip-route.8.in | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in index 11dd9d0..803de3b 100644 --- a/man/man8/ip

[PATCH iproute2 net-next v2 0/2] Add support for seg6 l2encap mode

2017-08-28 Thread David Lebrun
This patch series adds support for the new L2ENCAP mode for SRv6 encapsulations. v2: use a name/value table for encap modes David Lebrun (2): iproute: add support for seg6 l2encap mode man: add documentation for seg6 l2encap mode ip/iproute_lwtunnel.c | 41

[PATCH iproute2 net-next v2 1/2] iproute: add support for seg6 l2encap mode

2017-08-28 Thread David Lebrun
This patch adds support for the L2ENCAP seg6 mode, enabling to encapsulate L2 frames within SRv6 packets. Signed-off-by: David Lebrun --- ip/iproute_lwtunnel.c | 41 ++--- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/ip/iproute_lwtunnel.c b

Re: [PATCH iproute2 net-next 1/2] iproute: add support for seg6 l2encap mode

2017-08-28 Thread David Lebrun
On 08/28/2017 08:07 PM, Stephen Hemminger wrote: > Since these values probably will grow over time, it would make > sense to have this a name/value table. I wasn't sure if it was worth it for 3 values. I do not foresee a large growth either, but I will send a v2 will a table anyway David signa

[PATCH iproute2 net-next 2/2] man: add documentation for seg6 l2encap mode

2017-08-28 Thread David Lebrun
This patch adds documentation for the seg6 L2ENCAP encapsulation mode. Signed-off-by: David Lebrun --- man/man8/ip-route.8.in | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in index 11dd9d0..803de3b 100644 --- a/man/man8/ip

[PATCH iproute2 net-next 1/2] iproute: add support for seg6 l2encap mode

2017-08-28 Thread David Lebrun
This patch adds support for the L2ENCAP seg6 mode, enabling to encapsulate L2 frames within SRv6 packets. Signed-off-by: David Lebrun --- ip/iproute_lwtunnel.c | 39 --- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/ip/iproute_lwtunnel.c b

[PATCH iproute2 net-next 0/2] Add support for seg6 l2encap mode

2017-08-28 Thread David Lebrun
This patch series adds support for the new L2ENCAP mode for SRv6 encapsulations. David Lebrun (2): iproute: add support for seg6 l2encap mode man: add documentation for seg6 l2encap mode ip/iproute_lwtunnel.c | 39 --- man/man8/ip-route.8.in | 6

Re: [PATCH] ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200"

2017-08-28 Thread David Lebrun
On 08/28/2017 07:20 PM, Ahmed Abdelsalam wrote: > This patch fixes the get_srh(), so it gets the segment routing header > regardless of its position in the chain of the extension headers in IPv6 > packet, and makes sure that the IPv6 routing extension header is of > Type 4. Ahmed, You need to ini

[PATCH net-next v2 5/5] ipv6: sr: implement additional seg6local actions

2017-08-25 Thread David Lebrun
. - SEG6_LOCAL_ACTION_END_DX4: decapsulate an IPv4 packet and forward it, possibly to the specified next-hop. - SEG6_LOCAL_ACTION_END_DT6: decapsulate an IPv6 packet and forward it to the next-hop looked up in the specified routing table. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 147

[PATCH net-next v2 4/5] ipv6: sr: add helper functions for seg6local

2017-08-25 Thread David Lebrun
next segment. The lookup_nexthop() function helps select the next-hop for the processed SR packets. It supports an optional next-hop address to route the packet specifically through it, and an optional routing table to use. Signed-off-by: David Lebrun --- net/ipv6/Kconfig | 1 + net/ipv6

[PATCH net-next v2 2/5] ipv6: sr: add support for encapsulation of L2 frames

2017-08-25 Thread David Lebrun
resulting packet looks like IPv6 -> SRH -> Ethernet -> original L3 payload. The next header field of the SRH is set to NEXTHDR_NONE. [1] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-01 Signed-off-by: David Lebrun --- include/uapi/linux/seg6_iptunn

[PATCH net-next v2 1/5] ipv6: sr: add support for ip4ip6 encapsulation

2017-08-25 Thread David Lebrun
encap segs fc00::1,fc00::2 dev eth0 Signed-off-by: David Lebrun --- include/net/seg6.h | 3 ++- net/ipv6/seg6_iptunnel.c | 47 +-- net/ipv6/seg6_local.c| 2 +- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/include/net/seg6

[PATCH net-next v2 0/5] net: updates for IPv6 Segment Routing

2017-08-25 Thread David Lebrun
three patches update the seg6local lightweight tunnel, and mainly implement four new actions: End.T, End.DX2, End.DX4 and End.DT6. David Lebrun (5): ipv6: sr: add support for ip4ip6 encapsulation ipv6: sr: add support for encapsulation of L2 frames ipv6: sr: enforce IPv6 packets for seg6local

[PATCH net-next v2 3/5] ipv6: sr: enforce IPv6 packets for seg6local lwt

2017-08-25 Thread David Lebrun
This patch ensures that the seg6local lightweight tunnel is used solely with IPv6 routes and processes only IPv6 packets. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 8 1 file changed, 8 insertions(+) diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index 609b94e

[PATCH net-next 5/5] ipv6: sr: implement additional seg6local actions

2017-08-23 Thread David Lebrun
. - SEG6_LOCAL_ACTION_END_DX4: decapsulate an IPv4 packet and forward it, possibly to the specified next-hop. - SEG6_LOCAL_ACTION_END_DT6: decapsulate an IPv6 packet and forward it to the next-hop looked up in the specified routing table. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 147

[PATCH net-next 4/5] ipv6: sr: add helper functions for seg6local

2017-08-23 Thread David Lebrun
next segment. The lookup_nexthop() function helps select the next-hop for the processed SR packets. It supports an optional next-hop address to route the packet specifically through it, and an optional routing table to use. Signed-off-by: David Lebrun --- net/ipv6/Kconfig | 1 + net/ipv6

[PATCH net-next 2/5] ipv6: sr: add support for encapsulation of L2 frames

2017-08-23 Thread David Lebrun
resulting packet looks like IPv6 -> SRH -> Ethernet -> original L3 payload. The next header field of the SRH is set to NEXTHDR_NONE. [1] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-01 Signed-off-by: David Lebrun --- include/uapi/linux/seg6_iptunn

[PATCH net-next 0/5] net: updates for IPv6 Segment Routing

2017-08-23 Thread David Lebrun
. The last three patches update the seg6local lightweight tunnel, and mainly implement four new actions: End.T, End.DX2, End.DX4 and End.DT6. David Lebrun (5): ipv6: sr: add support for ip4ip6 encapsulation ipv6: sr: add support for encapsulation of L2 frames ipv6: sr: enforce IPv6 packets for

[PATCH net-next 1/5] ipv6: sr: add support for ip4ip6 encapsulation

2017-08-23 Thread David Lebrun
encap segs fc00::1,fc00::2 dev eth0 Signed-off-by: David Lebrun --- include/net/seg6.h | 3 ++- net/ipv6/seg6_iptunnel.c | 47 +-- net/ipv6/seg6_local.c| 2 +- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/include/net/seg6

[PATCH net-next 3/5] ipv6: sr: enforce IPv6 packets for seg6local lwt

2017-08-23 Thread David Lebrun
This patch ensures that the seg6local lightweight tunnel is used solely with IPv6 routes and processes only IPv6 packets. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 8 1 file changed, 8 insertions(+) diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index 609b94e

[PATCH iproute2 net-next v2 2/3] iproute: add support for SRv6 local segment processing

2017-08-09 Thread David Lebrun
This patch adds support for the seg6local lightweight tunnel ("ip route add ... encap seg6local ..."). Signed-off-by: David Lebrun --- ip/iproute.c | 2 +- ip/iproute_lwtunnel.c | 208 ++ 2 files changed, 209 insertions(+),

[PATCH iproute2 net-next v2 3/3] man: add documentation for seg6local lwt

2017-08-09 Thread David Lebrun
This patch adds documentation in the ip-route man page about the seg6local lightweight tunnel. Signed-off-by: David Lebrun --- man/man8/ip-route.8.in | 62 +- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/man/man8/ip-route.8.in b

[PATCH iproute2 net-next v2 0/3] Add support for SRv6 local segment processing

2017-08-09 Thread David Lebrun
This patch series adds support and documentation for the seg6local lightweight tunnel, enabling to perform operations to SR-enabled packets based on their active segment. v2: use a table for action names Signed-off-by: David Lebrun David Lebrun (3): iproute: add helper functions for SRH

[PATCH iproute2 net-next v2 1/3] iproute: add helper functions for SRH processing

2017-08-09 Thread David Lebrun
This patch adds two helper functions to print and parse Segment Routing Headers. Signed-off-by: David Lebrun --- ip/iproute_lwtunnel.c | 124 +- 1 file changed, 72 insertions(+), 52 deletions(-) diff --git a/ip/iproute_lwtunnel.c b/ip

Re: [PATCH iproute2 net-next 2/3] iproute: add support for SRv6 local segment processing

2017-08-09 Thread David Lebrun
On 08/09/2017 04:43 PM, Stephen Hemminger wrote: > Why is this not a table instead of code? Fair point, will send a v2. David signature.asc Description: OpenPGP digital signature

[PATCH iproute2 net-next 1/3] iproute: add helper functions for SRH processing

2017-08-09 Thread David Lebrun
This patch adds two helper functions to print and parse Segment Routing Headers. Signed-off-by: David Lebrun --- ip/iproute_lwtunnel.c | 124 +- 1 file changed, 72 insertions(+), 52 deletions(-) diff --git a/ip/iproute_lwtunnel.c b/ip

[PATCH iproute2 net-next 2/3] iproute: add support for SRv6 local segment processing

2017-08-09 Thread David Lebrun
This patch adds support for the seg6local lightweight tunnel ("ip route add ... encap seg6local ..."). Signed-off-by: David Lebrun --- ip/iproute.c | 2 +- ip/iproute_lwtunnel.c | 238 ++ 2 files changed, 239 insertions(+),

[PATCH iproute2 net-next 0/3] Add support for SRv6 local segment processing

2017-08-09 Thread David Lebrun
This patch series adds support and documentation for the seg6local lightweight tunnel, enabling to perform operations to SR-enabled packets based on their active segment. Signed-off-by: David Lebrun David Lebrun (3): iproute: add helper functions for SRH processing iproute: add support for

[PATCH iproute2 net-next 3/3] man: add documentation for seg6local lwt

2017-08-09 Thread David Lebrun
This patch adds documentation in the ip-route man page about the seg6local lightweight tunnel. Signed-off-by: David Lebrun --- man/man8/ip-route.8.in | 62 +- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/man/man8/ip-route.8.in b

[PATCH net-next v2 5/5] ipv6: sr: implement several seg6local actions

2017-08-05 Thread David Lebrun
IPv6 header, containing the specified SRH. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 271 ++ 1 file changed, 271 insertions(+) diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index ab1fc1b..147680e 100644 --- a/net/ipv6

[PATCH net-next v2 2/5] ipv6: sr: export SRH insertion functions

2017-08-05 Thread David Lebrun
This patch exports the seg6_do_srh_encap() and seg6_do_srh_inline() functions. It also removes the CONFIG_IPV6_SEG6_INLINE knob that enabled the compilation of seg6_do_srh_inline(). This function is now built-in. Signed-off-by: David Lebrun --- include/net/seg6.h | 2 ++ net/ipv6/Kconfig

[PATCH net-next v2 3/5] ipv6: sr: define core operations for seg6local lightweight tunnel

2017-08-05 Thread David Lebrun
er is associated to three function pointers, in seg6_action_params[]. All actions defined in seg6_local.h are detailed in [1]. [1] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-01 Signed-off-by: David Lebrun --- include/linux/seg6_local.h | 6 + include/net

[PATCH net-next v2 4/5] ipv6: sr: add rtnetlink functions for seg6local action parameters

2017-08-05 Thread David Lebrun
parameter defines an egress interface index. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 211 +- 1 file changed, 193 insertions(+), 18 deletions(-) diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index 53615d7..ab1fc1b 100644 --- a

[PATCH net-next v2 0/5] ipv6: sr: add support for advanced local segment processing

2017-08-05 Thread David Lebrun
ly defined rtnetlink attributes. The fifth patch implements a few SRH processing operations, including End and End.X. [1] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-07 [2] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-01 David Lebrun (5): ipv6: sr:

[PATCH net-next v2 1/5] ipv6: sr: allow SRH insertion with arbitrary segments_left value

2017-08-05 Thread David Lebrun
SRHs with an arbitrary active segment. Signed-off-by: David Lebrun --- net/ipv6/exthdrs.c | 4 ++-- net/ipv6/seg6.c| 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 3cec529..9551613 100644 --- a/net/ipv6/exthdrs.c +++ b/net

[PATCH net-next 5/5] ipv6: sr: implement several seg6local actions

2017-08-04 Thread David Lebrun
IPv6 header, containing the specified SRH. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 271 ++ 1 file changed, 271 insertions(+) diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index ab1fc1b..147680e 100644 --- a/net/ipv6

[PATCH net-next 4/5] ipv6: sr: add rtnetlink functions for seg6local action parameters

2017-08-04 Thread David Lebrun
parameter defines an egress interface index. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 211 +- 1 file changed, 193 insertions(+), 18 deletions(-) diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index 53615d7..ab1fc1b 100644 --- a

[PATCH net-next 0/5] ipv6: sr: add support for advanced local segment processing

2017-08-04 Thread David Lebrun
tes. The fifth patch implements a few SRH processing operations, including End and End.X. [1] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-07 [2] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-01 David Lebrun (5): ipv6: sr: allow SRH inse

[PATCH net-next 3/5] ipv6: sr: define core operations for seg6local lightweight tunnel

2017-08-04 Thread David Lebrun
er is associated to three function pointers, in seg6_action_params[]. All actions defined in seg6_local.h are detailed in [1]. [1] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-01 Signed-off-by: David Lebrun --- include/linux/seg6_local.h | 6 + include/net

[PATCH net-next 1/5] ipv6: sr: allow SRH insertion with arbitrary segments_left value

2017-08-04 Thread David Lebrun
SRHs with an arbitrary active segment. Signed-off-by: David Lebrun --- net/ipv6/exthdrs.c | 4 ++-- net/ipv6/seg6.c| 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 3cec529..9551613 100644 --- a/net/ipv6/exthdrs.c +++ b/net

[PATCH net-next 2/5] ipv6: sr: export SRH insertion functions

2017-08-04 Thread David Lebrun
This patch exports the seg6_do_srh_encap() and seg6_do_srh_inline() functions. It also removes the CONFIG_IPV6_SEG6_INLINE knob that enabled the compilation of seg6_do_srh_inline(). This function is now built-in. Signed-off-by: David Lebrun --- include/net/seg6.h | 2 ++ net/ipv6/Kconfig

[RFC PATCH net-next 5/5] ipv6: sr: implement several seg6local actions

2017-07-30 Thread David Lebrun
. - SEG6_LOCAL_ACTION_END_B6: insert the specified SRH directly after the IPv6 header of the packet. - SEG6_LOCAL_ACTION_END_B6_ENCAP: encapsulate the packet within an outer IPv6 header, containing the specified SRH. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 176

[RFC PATCH net-next 2/5] ipv6: sr: export SRH insertion functions

2017-07-30 Thread David Lebrun
This patch exports the seg6_do_srh_encap() and seg6_do_srh_inline() functions. It also removes the CONFIG_IPV6_SEG6_INLINE knob that enabled the compilation of seg6_do_srh_inline(). This function is now built-in. Signed-off-by: David Lebrun --- include/net/seg6.h | 2 ++ net/ipv6/Kconfig

[RFC PATCH net-next 4/5] ipv6: sr: add rtnetlink functions for seg6local action parameters

2017-07-30 Thread David Lebrun
parameter defines an egress interface index. Signed-off-by: David Lebrun --- net/ipv6/seg6_local.c | 211 +- 1 file changed, 193 insertions(+), 18 deletions(-) diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index 53615d7..ab1fc1b 100644 --- a

[RFC PATCH net-next 3/5] ipv6: sr: define core operations for seg6local lightweight tunnel

2017-07-30 Thread David Lebrun
er is associated to three function pointers, in seg6_action_params[]. All actions defined in seg6_local.h are detailed in [1]. [1] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-01 Signed-off-by: David Lebrun --- include/linux/seg6_local.h | 6 + include/net

[RFC PATCH net-next 0/5] ipv6: sr: add support for advanced local segment processing

2017-07-30 Thread David Lebrun
tes. The fifth patch implements a few SRH processing operations, including End and End.X. [1] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-07 [2] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-01 David Lebrun (5): ipv6: sr: allow SRH insertion with arb

[RFC PATCH net-next 1/5] ipv6: sr: allow SRH insertion with arbitrary segments_left value

2017-07-30 Thread David Lebrun
SRHs with an arbitrary active segment. Signed-off-by: David Lebrun --- net/ipv6/exthdrs.c | 4 ++-- net/ipv6/seg6.c| 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 4996d73..3b7d369 100644 --- a/net/ipv6/exthdrs.c +++ b/net

[PATCH iproute2 net] iproute: fix compilation issue with older glibc

2017-06-16 Thread David Lebrun
If a header that includes linux/in6.h is included before iproute's utils.h, then iproute2 fails to compile on older glibc versions. Fixes: e8493916a8ede9970732e33ea52d30b83071f401 ("iproute: add support for SR-IPv6 lwtunnel encapsulation") Reported-by: Daniel Borkmann Signe

Re: [PATCH iproute2 net] ip: lwtunnel: remove definition of __USE_KERNEL_IPV6_DEFS

2017-05-15 Thread David Lebrun
On 05/15/2017 01:13 PM, David Lebrun wrote: > When __USE_KERNEL_IPV6_DEFS is set, netinet/in.h will not define structures > such as in6_addr. This is useful when linux/in6.h is also included. > However, older glibc versions do not support this switch. > > This patch allows iprou

Re: [PATCH net v2] ipv6: sr: fix user space compilation error with old glibc

2017-05-15 Thread David Lebrun
On 05/15/2017 04:09 PM, David Miller wrote: > Please, no. > > The reason we put together a method by which glibc and the kernel can > stay out of eachother's way in header files is exactly so that we > don't need ifdefs that conditionally do netinet/in.h vs. using the > kernel header. > > There a

[PATCH iproute2 net] ip: lwtunnel: remove definition of __USE_KERNEL_IPV6_DEFS

2017-05-15 Thread David Lebrun
kernel net-next patch that updates include/linux/seg6.h. Fixes: e8493916a8ede9970732e33ea52d30b83071f401 ("iproute: add support for SR-IPv6 lwtunnel encapsulation") Reported-by: Daniel Borkmann Signed-off-by: David Lebrun --- ip/iproute_lwtunnel.c | 3 --- 1 file changed, 3 deletions(-)

[PATCH net v2] ipv6: sr: fix user space compilation error with old glibc

2017-05-15 Thread David Lebrun
rrors") Reported-by: Daniel Borkmann Signed-off-by: David Lebrun --- include/uapi/linux/seg6.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/uapi/linux/seg6.h b/include/uapi/linux/seg6.h index 7278511..4055ff3 100644 --- a/include/uapi/linux/seg6.h +++ b/include/uapi/li

Re: [PATCH net] ipv6: sr: fix user space compilation error with old glibc

2017-05-15 Thread David Lebrun
On 05/15/2017 12:53 PM, David Lebrun wrote: > I can fix the issue with a simpler ifdef. The simpler ifdef works fine, but a patch to iproute2 is still needed. David signature.asc Description: OpenPGP digital signature

Re: [PATCH net] ipv6: sr: fix user space compilation error with old glibc

2017-05-15 Thread David Lebrun
On 05/15/2017 12:43 PM, Daniel Borkmann wrote: > > Okay, thanks! Mmmh actually I can fix this without sending a patch to iproute2. Handling the __USE_KERNEL_IPV6_DEFS case in seg6.h is wrong, as it is already performed in netinet/in.h. I can fix the issue with a simpler ifdef. Will send v2. Dav

Re: [PATCH net] ipv6: sr: fix user space compilation error with old glibc

2017-05-15 Thread David Lebrun
On 05/15/2017 12:05 PM, Daniel Borkmann wrote: > > Or, is there still another fix for iproute2 coming after this has > landed? Yes, I will submit the fix to iproute2 once this one has been applied, so that I can reference it. David signature.asc Description: OpenPGP digital signature

[PATCH net] ipv6: sr: fix user space compilation error with old glibc

2017-05-15 Thread David Lebrun
fail to compile with older glibc versions. This patch ensures that including seg6.h will work in any case. Fixes: ea3ebc73b46fbdb049dafd47543bb22efaa09c8e ("uapi: fix linux/seg6.h and linux/seg6_iptunnel.h userspace compilation errors") Reported-by: Daniel Borkmann Signed-off-by: Da

Re: iproute2 build error due to sr-ipv6 lwtunnel

2017-05-15 Thread David Lebrun
On 05/14/2017 03:26 PM, Daniel Borkmann wrote: > > David, are you still looking into fixing this? Sorry, I left the issue on the side and then forgot about it. Could you try the following iproute2 patch ? Thanks diff --git a/include/linux/seg6.h b/include/linux/seg6.h index 0715279..dd28017 100

Re: iproute2 build error due to sr-ipv6 lwtunnel

2017-05-04 Thread David Lebrun
On 05/04/2017 11:13 AM, Daniel Borkmann wrote: > Hi David, > > I'm getting the following build error from e8493916a8ed ("iproute: > add support for SR-IPv6 lwtunnel encapsulation"). Reverting your > commit makes iproute2 build again for me. Please take a look. Hi Daniel, This is because linux/se

[PATCH net] ipv6: sr: fix double free of skb after handling invalid SRH

2017-04-19 Thread David Lebrun
The icmpv6_param_prob() function already does a kfree_skb(), this patch removes the duplicate one. Fixes: 1ababeba4a21f3dba3da3523c670b207fb2feb62 ("ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)") Reported-by: Dan Carpenter Cc: Dan Carpenter Signed-off

[PATCH net] ipv6: sr: fix out-of-bounds access in SRH validation

2017-04-18 Thread David Lebrun
This patch fixes an out-of-bounds access in seg6_validate_srh() when the trailing data is less than sizeof(struct sr6_tlv). Reported-by: Andrey Konovalov Cc: Andrey Konovalov Signed-off-by: David Lebrun --- net/ipv6/seg6.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv6/seg6.c

Re: net/ipv6: slab-out-of-bounds read in seg6_validate_srh

2017-04-18 Thread David Lebrun
On 04/18/2017 04:54 PM, Andrey Konovalov wrote: > Hi, > > I've got the following error report while fuzzing the kernel with syzkaller. > > On commit 4f7d029b9bf009fbee76bb10c0c4351a1870d2f3 (4.11-rc7). > > A reproducer and .config are attached. > > ==

[PATCH net-next 1/1] ipv6: sr: fix BUG due to headroom too small after SRH push

2017-04-16 Thread David Lebrun
ad only if necessary") Signed-off-by: David Lebrun --- net/ipv6/seg6_iptunnel.c | 8 1 file changed, 8 insertions(+) diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c index 7436a4a..6a49549 100644 --- a/net/ipv6/seg6_iptunnel.c +++ b/net/ipv6/seg6_iptunnel.c @@ -265,6 +265,

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

2017-04-15 Thread David Lebrun
This patch adds support for SEG6 encapsulation type ("ip route add ... encap seg6 ..."). Signed-off-by: David Lebrun --- ip/iproute.c | 6 +- ip/iproute_lwtunnel.c | 154 ++ 2 files changed, 158 insertions(+), 2 deletions(-)

[PATCH iproute2 net-next v2 1/3] ip: add ip sr command to control SR-IPv6 internal structures

2017-04-15 Thread David Lebrun
This patch adds 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 --- ip/Makefile| 2 +- ip/ip.c| 3 +- ip/ip_common.h | 1

[PATCH iproute2 net-next v2 3/3] man: add documentation for IPv6 SR commands

2017-04-15 Thread David Lebrun
This patch adds information about seg6 encapsulation in the ip-route manual, as well as the ip-sr manual page. Signed-off-by: David Lebrun --- man/man8/ip-route.8.in | 39 +++-- man/man8/ip-sr.8 | 58 ++ 2 files

[PATCH iproute2 net-next v2 0/3] Add support for IPv6 Segment Routing

2017-04-15 Thread David Lebrun
This patch series adds support and documentation in iproute2 for encapsulation with IPv6 SR, and for control of HMAC mappings. v2: fix bad types and indentation Signed-off-by: David Lebrun David Lebrun (3): ip: add ip sr command to control SR-IPv6 internal structures iproute: add support

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

2017-04-14 Thread David Lebrun
This patch adds support for SEG6 encapsulation type ("ip route add ... encap seg6 ..."). Signed-off-by: David Lebrun --- ip/iproute.c | 6 +- ip/iproute_lwtunnel.c | 154 ++ 2 files changed, 158 insertions(+), 2 deletions(-)

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

2017-04-14 Thread David Lebrun
This patch adds 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 --- ip/Makefile| 2 +- ip/ip.c| 3 +- ip/ip_common.h | 1

[PATCH iproute2 net-next 3/3] man: add documentation for IPv6 SR commands

2017-04-14 Thread David Lebrun
This patch adds information about seg6 encapsulation in the ip-route manual, as well as the ip-sr manual page. Signed-off-by: David Lebrun --- man/man8/ip-route.8.in | 39 +++-- man/man8/ip-sr.8 | 58 ++ 2 files

[PATCH iproute2 net-next 0/3] Add support for IPv6 Segment Routing

2017-04-14 Thread David Lebrun
This patch series adds support and documentation in iproute2 for encapsulation with IPv6 SR, and for control of HMAC mappings. Signed-off-by: David Lebrun David Lebrun (3): ip: add ip sr command to control SR-IPv6 internal structures iproute: add support for SR-IPv6 lwtunnel encapsulation

[PATCH net-next] ipv6: sr: select DST_CACHE by default

2017-03-27 Thread David Lebrun
When CONFIG_IPV6_SEG6_LWTUNNEL is selected, automatically select DST_CACHE. This allows to remove multiple ifdefs. Signed-off-by: David Lebrun --- net/ipv6/Kconfig | 1 + net/ipv6/seg6_iptunnel.c | 18 -- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a

Re: [PATCH net-next 0/2] Performances improvement for IPv6 Segment Routing

2017-03-25 Thread David Lebrun
On 03/24/2017 10:48 PM, David Miller wrote: > Series applied, thanks. > > I think you should make SEG6_IPTUNNEL select DST_CACHE and then remove all of > these ugly ifdefs. Thanks Agreed, I'll submit a patch for that :) David signature.asc Description: OpenPGP digital signature

[PATCH net-next 0/2] Performances improvement for IPv6 Segment Routing

2017-03-24 Thread David Lebrun
(9424744000bps) errors: 0 David Lebrun (2): ipv6: sr: expand skb head only if necessary ipv6: sr: use dst_cache in seg6_input net/ipv6/seg6_iptunnel.c | 31 --- 1 file changed, 28 insertions(+), 3 deletions(-) -- 2.10.2

[PATCH net-next 1/2] ipv6: sr: expand skb head only if necessary

2017-03-24 Thread David Lebrun
: David Lebrun --- net/ipv6/seg6_iptunnel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c index 8558225..dda2c51 100644 --- a/net/ipv6/seg6_iptunnel.c +++ b/net/ipv6/seg6_iptunnel.c @@ -105,7 +105,7 @@ static int

[PATCH net-next 2/2] ipv6: sr: use dst_cache in seg6_input

2017-03-24 Thread David Lebrun
) 884006pps 7072Mb/sec (7072048000bps) errors: 0 Performances after the patch: Result: OK: 4774543(c4774084+d459) usec, 500 (1000byte,0frags) 1047220pps 8377Mb/sec (837776bps) errors: 0 Signed-off-by: David Lebrun --- net/ipv6/seg6_iptunnel.c | 27 ++- 1 file

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

2017-02-02 Thread David Lebrun
IPv6 SR. [1] https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-05 Signed-off-by: David Lebrun --- include/uapi/linux/seg6.h | 9 +++-- net/ipv6/exthdrs.c| 31 +++ net/ipv6/seg6_hmac.c | 8 3 files changed, 10 insertions

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

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

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

2017-01-20 Thread David Lebrun
ode base for control plane support of > SR-IPv6") > Signed-off-by: Eric Dumazet > Cc: David Lebrun > --- > net/ipv6/seg6.c |2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c > index > b172d85c650a376f541ea05d72046c7

[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 --- include/uapi/linux/Kbuild | 4 include/uapi/linux/seg6.h | 2 ++ include/uapi/linux

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

2017-01-13 Thread David Lebrun
Add missing IPv6-SR header files in include/uapi/linux/Kbuild. Also, prevent seg6_lwt_headroom() from being exported. Signed-off-by: David Lebrun --- include/uapi/linux/Kbuild | 4 include/uapi/linux/seg6_iptunnel.h | 4 2 files changed, 8 insertions(+) diff --git a/include

[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 --- net/ipv6/seg6_hmac.c | 2 +- net/ipv6/seg6_iptunnel.c | 4 2

  1   2   3   >