Re: [PATCH v4.14.x] net: erspan: fix use-after-free

2019-05-29 Thread William Tu
; RAX: ffda RBX: 0004 RCX: 20011000 > > > > RDX: RSI: RDI: 20008000 > > > > RBP: 001c R08: R09: > > > > R10: R11: 0

[PATCHv2 net] net: ip6_gre: access skb data after skb_cow_head()

2019-05-30 Thread William Tu
w_head before accessing the skb->data pointer. Fixes: 01b8d064d58b4 ("net: ip6_gre: Request headroom in __gre6_xmit()") Reported-by: Haichao Ma Signed-off-by: William Tu --- v1-v2: add more details in commit message. --- net/ipv6/ip6_gre.c | 6 +++--- 1 file changed, 3 insertions(+), 3 d

Re: [PATCHv2 net] net: ip6_gre: access skb data after skb_cow_head()

2019-05-30 Thread William Tu
Please ignore this patch and allow me to investigate more. On Thu, May 30, 2019 at 10:23 AM Gregory Rose wrote: > > > On 5/30/2019 9:59 AM, William Tu wrote: > > When increases the headroom, skb's data pointer might get re-allocated. > > As a result, the skb->data be

Re: [PATCH net] selftest/bpf: no need to drop the packet when there is no geneve opt

2021-02-24 Thread William Tu
nel option, there is no need to drop the packet and > break all geneve rx traffic. Just set opt_class to 0 in this test and > keep returning TC_ACT_OK. > > Signed-off-by: Hangbin Liu > --- LGTM. Acked-by: William Tu

Re: [PATCH iproute2] erspan: fix JSON output

2021-04-06 Thread William Tu
com > Reported-by: Christian Pössinger > Signed-off-by: Stephen Hemminger > --- LGTM, Thanks. Acked-by: William Tu

Re: [PATCH] erspan/erspan6: fix JSON output

2021-04-12 Thread William Tu
span version II support") > Cc: u9012...@gmail.com > Cc: Stephen Hemminger > Reported-by: Christian Poessinger > Signed-off-by: Christian Poessinger > --- LGTM, thanks Acked-by: William Tu

Re: [PATCH net] selftests/bpf: set gopt opt_class to 0 if get tunnel opt failed

2021-03-09 Thread William Tu
.") > Signed-off-by: Hangbin Liu > --- LGTM, thanks. Acked-by: William Tu

Re: [PATCH bpf] selftests/bpf: use bash instead of sh in test_xdp_redirect.sh

2021-02-05 Thread William Tu
e bash instead. > > Also remove the 'set -e' since the script actually relies on that the > return value can be used to determine pass/fail of the test. > > Fixes: 996139e801fd ("selftests: bpf: add a test for XDP redirect") > Signed-off-by: Björn Töpel > --- LGTM, thanks. Acked-by: William Tu

[PATCH net-next] erspan: auto detect truncated packets.

2018-04-27 Thread William Tu
If true, this indicated that the mirrored packet is truncated and set the erspan truncate bit. I tested the patch using bpf_skb_change_tail helper function to shrink the packet size and send to erspan tunnel. Reported-by: Xiaoyan Jin Signed-off-by: William Tu --- net/ipv4/ip_gre.c | 6 ++

[PATCH bpf-next] tools include uapi: Grab a copy of linux/erspan.h

2018-04-30 Thread William Tu
Bring the erspan uapi header file so BPF tunnel helpers can use it. Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.") Reported-by: Yonghong Song Signed-off-by: William Tu --- tools/include/uapi/linux/erspan.h | 52 +++ 1 file changed, 52

Re: [PATCH bpf-next] selftests/bpf: bpf tunnel test.

2018-04-30 Thread William Tu
On Mon, Apr 30, 2018 at 2:05 AM, Daniel Borkmann wrote: > On 04/30/2018 09:02 AM, Y Song wrote: >> Hi, William, >> >> When compiled the selftests/bpf in my centos 7 based system, I have >> the following failures, >> >> clang -I. -I./include/uapi -I../../../include/uapi >> -Wno-compare-distinct-poi

[PATCH bpf-next] bpf/verifier: enable ctx + const + 0.

2018-04-30 Thread William Tu
Yonghong Song Signed-off-by: Yifeng Sun Signed-off-by: William Tu --- kernel/bpf/verifier.c | 2 +- tools/testing/selftests/bpf/test_verifier.c | 13 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index

Re: [PATCH bpf-next] bpf/verifier: enable ctx + const + 0.

2018-05-01 Thread William Tu
On Tue, May 1, 2018 at 4:16 PM, Alexei Starovoitov wrote: > On Mon, Apr 30, 2018 at 10:15:05AM -0700, William Tu wrote: >> Existing verifier does not allow 'ctx + const + const'. However, due to >> compiler optimization, there is a case where BPF compilerit generates

Re: [PATCH bpf-next] bpf/verifier: enable ctx + const + 0.

2018-05-02 Thread William Tu
On Wed, May 2, 2018 at 1:29 AM, Daniel Borkmann wrote: > On 05/02/2018 06:52 AM, Alexei Starovoitov wrote: >> On Tue, May 01, 2018 at 09:35:29PM -0700, William Tu wrote: >>> >>>> How did you test this patch? >>>> >>> Without the patch, the tes

[PATCH net-next] erspan: auto detect truncated ipv6 packets.

2018-05-11 Thread William Tu
gt;len. Reported-by: Xiaoyan Jin Signed-off-by: William Tu --- net/ipv4/ip_gre.c | 6 ++ net/ipv6/ip6_gre.c | 6 ++ 2 files changed, 12 insertions(+) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index dfe5b22f6ed4..2409e648454d 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip

Re: [PATCH iproute2] iplink_geneve: correct size of message to avoid spurious errors

2018-04-20 Thread William Tu
ied. > > Fixes: 6c4b672738ac ("iplink_geneve: Get rid of inet_get_addr()") > Signed-off-by: Jakub Kicinski > Reviewed-by: Quentin Monnet > --- Thanks. We also hit this issue when creating geneve tunnel. Acked-by: William Tu

[PATCH bpf-next] bpf: clear the ip_tunnel_info.

2018-04-24 Thread William Tu
The patch zeros the fields in ip_tunnel_info. Signed-off-by: William Tu Reported-by: Yifeng Sun --- net/core/filter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/filter.c b/net/core/filter.c index 8e45c6c7ab08..d3781daa26ab 100644 --- a/net/core/filter.c +++ b/net/core/fil

[PATCH bpf-next] selftests/bpf: bpf tunnel test.

2018-04-25 Thread William Tu
get_tunnel, ip6ip6_set_tunnel, ip6ip6_get_tunnel Signed-off-by: William Tu --- samples/bpf/Makefile | 1 - samples/bpf/tcbpf2_kern.c | 612 -- samples/bpf/test_tunnel_bpf.sh | 390 -- too

Re: [PATCH bpf-next] bpf: clear the ip_tunnel_info.

2018-04-25 Thread William Tu
On Wed, Apr 25, 2018 at 12:54 AM, Daniel Borkmann wrote: > On 04/25/2018 08:46 AM, William Tu wrote: >> The percpu metadata_dst might carry the stale ip_tunnel_info >> and cause incorrect behavior. When mixing tests using ipv4/ipv6 >> bpf vxlan and geneve tunnel, the ipv6 tu

Re: [PATCH bpf-next] selftests/bpf: bpf tunnel test.

2018-04-26 Thread William Tu
On Wed, Apr 25, 2018 at 8:01 AM, William Tu wrote: > The patch migrates the original tests at samples/bpf/tcbpf2_kern.c > and samples/bpf/test_tunnel_bpf.sh to selftests. There are a couple > changes from the original: > 1) add ipv6 vxlan, ipv6 geneve, ipv6 ipip tests >

[PATCHv2 bpf-next 0/2] BPF tunnel testsuite

2018-04-26 Thread William Tu
t_tunnel, ipip_get_tunnel IP6IP:ipip6_set_tunnel, ipip6_get_tunnel, ip6ip6_set_tunnel, ip6ip6_get_tunnel XFRM: xfrm_get_state William Tu (2): selftests/bpf: bpf tunnel test. samples/bpf: remove the bpf tunnel testsuite. samples/bpf/Makefile

[PATCHv2 bpf-next 2/2] samples/bpf: remove the bpf tunnel testsuite.

2018-04-26 Thread William Tu
Move the testsuite to selftests/bpf/{test_tunnel_kern.c, test_tunnel.sh} Signed-off-by: William Tu --- samples/bpf/Makefile | 1 - samples/bpf/tcbpf2_kern.c | 612 - samples/bpf/test_tunnel_bpf.sh | 390 -- 3 files

[PATCHv2 bpf-next 1/2] selftests/bpf: bpf tunnel test.

2018-04-26 Thread William Tu
get_tunnel, ip6ip6_set_tunnel, ip6ip6_get_tunnel XFRM: xfrm_get_state Signed-off-by: William Tu --- tools/testing/selftests/bpf/Makefile | 5 +- tools/testing/selftests/bpf/test_tunnel.sh | 729 + tools/testing/selftests/bpf/test_tunnel_ke

Re: [PATCH][next] gre: fix TUNNEL_SEQ bit check on sequence numbering

2018-03-21 Thread William Tu
|. > > Detected by CoverityScan, CID#1466039 ("Operands don't affect result") > > Fixes: 77a5196a804e ("gre: add sequence number for collect md mode.") > Signed-off-by: Colin Ian King Thanks for the fix! btw, how can I access the CoverityScan result with this CI

Re: [RFC PATCH 00/24] Introducing AF_XDP support

2018-03-26 Thread William Tu
On Wed, Jan 31, 2018 at 5:53 AM, Björn Töpel wrote: > From: Björn Töpel > > This RFC introduces a new address family called AF_XDP that is > optimized for high performance packet processing and zero-copy > semantics. Throughput improvements can be up to 20x compared to V2 and > V3 for the micro b

Re: [RFC PATCH 00/24] Introducing AF_XDP support

2018-03-26 Thread William Tu
Hi Jesper, Thanks a lot for your prompt reply. >> Hi, >> I also did an evaluation of AF_XDP, however the performance isn't as >> good as above. >> I'd like to share the result and see if there are some tuning suggestions. >> >> System: >> 16 core, Intel(R) Xeon(R) CPU E5-2440 v2 @ 1.90GHz >> Inte

Re: [RFC PATCH 00/24] Introducing AF_XDP support

2018-03-27 Thread William Tu
On Tue, Mar 27, 2018 at 2:37 AM, Jesper Dangaard Brouer wrote: > On Mon, 26 Mar 2018 14:58:02 -0700 > William Tu wrote: > >> > Again high count for NMI ?!? >> > >> > Maybe you just forgot to tell perf that you want it to decode the >> > bp

Re: [RFC PATCH 00/24] Introducing AF_XDP support

2018-03-27 Thread William Tu
> Indeed. Intel iommu has least effect on RX because of premap/recycle. > But TX dma map and unmap is really expensive! > >> >> Basically the IOMMU can make creating/destroying a DMA mapping really >> expensive. The easiest way to work around it in the case of the Intel >> IOMMU is to boot with "io

Re: [RFC PATCH 00/24] Introducing AF_XDP support

2018-03-28 Thread William Tu
Hi Jesper, Thanks for the comments. >> I assume this xdpsock code is small and should all fit into the icache. >> However, doing another perf stat on xdpsock l2fwd shows >> >> 13,720,109,581 stalled-cycles-frontend # 60.01% frontend cycles >> idle (23.82%) >> >> stalled-cycles-bac

Re: [PATCH bpf v2] xdp: fix race on generic receive path

2019-07-03 Thread William Tu
; broader perspective and find the most low hanging fruit. > > Thanks Ilya for this fix. > > Acked-by: Magnus Karlsson > > > Fixes: c497176cb2e4 ("xsk: add Rx receive functions and poll support") > > Signed-off-by: Ilya Maximets > > --- Tested on my machine and works ok. Tested-by: William Tu

Re: [PATCHv2 net-next iproute2] gre: add support for ERSPAN tunnel

2017-08-17 Thread William Tu
>> + if (greinfo[IFLA_GRE_ERSPAN_INDEX]) >> + erspan_idx = >> rta_getattr_u32(greinfo[IFLA_GRE_ERSPAN_INDEX]); >> } > > Are you missing a ntohl() here? > > It is encoded as htonl() when sending to kernel. > > addattr32(n, 1024, IFLA_GRE_FWMARK

Re: [PATCHv2 net-next] gre: introduce native tunnel support for ERSPAN

2017-08-17 Thread William Tu
>> >> +static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi, >> + int gre_hdr_len) >> +{ >> + struct net *net = dev_net(skb->dev); >> + struct ip_tunnel_net *itn; >> + struct ip_tunnel *tunnel; >> + struct metadata_dst *tun_dst = NULL; >> + const

[PATCHv3 iproute2 net-next] gre: add support for ERSPAN tunnel

2017-08-18 Thread William Tu
2.16.1.200 remote 172.16.1.100 Signed-off-by: William Tu Signed-off-by: Meenakshi Vohra Cc: Stephen Hemminger Cc: Alexey Kuznetsov --- v2->v3: - make erspan index 0 as reserved, only set to kernel when index is non-zero - endianness: make the index host byte order v1->v2: Add

[PATCHv3 net-next] gre: introduce native tunnel support for ERSPAN

2017-08-18 Thread William Tu
100 global [1] https://tools.ietf.org/html/draft-foschiano-erspan-01 [2] iproute2 patch: http://marc.info/?l=linux-netdev&m=150306086924951&w=2 [3] test script: http://marc.info/?l=linux-netdev&m=150231021807304&w=2 Signed-off-by: William Tu Signed-off-by: Meenakshi Vohra Cc: Ale

Re: [PATCHv3 net-next] gre: introduce native tunnel support for ERSPAN

2017-08-22 Thread William Tu
>> + struct metadata_dst *tun_dst = NULL; >> + const struct iphdr *iph; >> + struct erspanhdr *ershdr; >> + __be32 index; >> + __be32 session_id; >> + int len; > > Please order local variables from longest to shortest line, ie. reverse > christmas tree format. > thanks for t

[PATCHv4 net-next] gre: introduce native tunnel support for ERSPAN

2017-08-22 Thread William Tu
807304&w=2 Signed-off-by: William Tu Signed-off-by: Meenakshi Vohra Cc: Alexey Kuznetsov Cc: Hideaki YOSHIFUJI --- v3->v4: fix skb_may_pull len fix local variable ordering fix commit message Nexus set-up v2->v3: add skb_may_pull check at erspan_rcv a couple of minor fixes a

[trivial] gre: fix goto statement typo

2017-08-22 Thread William Tu
Fix typo: pnet_tap_faied. Signed-off-by: William Tu --- net/ipv4/ip_gre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 6e8a62289e03..5a20ba9b9b50 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -1467,7 +1467,7

[PATCH net-next 2/3] gre: add collect_md mode to ERSPAN tunnel

2017-08-23 Thread William Tu
Similar to gre, vxlan, geneve, ipip tunnels, allow ERSPAN tunnels to operate in 'collect metadata' mode. bpf_skb_[gs]et_tunnel_key() helpers can make use of it right away. OVS can use it as well in the future. Signed-off-by: William Tu --- include/net/ip_tunnels.h | 4 +- net/ipv

[PATCH net-next 3/3] samples/bpf: extend test_tunnel_bpf.sh with ERSPAN

2017-08-23 Thread William Tu
Extend existing tests for vxlan, gre, geneve, ipip to include ERSPAN tunnel. Signed-off-by: William Tu --- samples/bpf/tcbpf2_kern.c | 63 +- samples/bpf/test_tunnel_bpf.sh | 29 +++ 2 files changed, 91 insertions(+), 1 deletion

[PATCH net-next 1/3] gre: refactor the gre_fb_xmit

2017-08-23 Thread William Tu
The patch refactors the gre_fb_xmit function, by creating prepare_fb_xmit function for later ERSPAN collect_md mode patch. Signed-off-by: William Tu --- net/ipv4/ip_gre.c | 55 --- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git

[PATCH net-next 0/3] gre: add collect_md mode for ERSPAN tunnel

2017-08-25 Thread William Tu
prepare_fb_xmit function and adding ERSPAN specific logic. The final patch adds the test case using bpf_skb_{set,get}_tunnel_{key,opt}. Thank you William Tu (3): gre: refactor the gre_fb_xmit gre: add collect_md mode to ERSPAN tunnel samples/bpf: extend test_tunnel_bpf.sh with ERSPAN include/net

[PATCH net-next 1/3] gre: refactor the gre_fb_xmit

2017-08-25 Thread William Tu
The patch refactors the gre_fb_xmit function, by creating prepare_fb_xmit function for later ERSPAN collect_md mode patch. Signed-off-by: William Tu --- net/ipv4/ip_gre.c | 55 --- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git

[PATCH net-next 3/3] samples/bpf: extend test_tunnel_bpf.sh with ERSPAN

2017-08-25 Thread William Tu
Extend existing tests for vxlan, gre, geneve, ipip to include ERSPAN tunnel. Signed-off-by: William Tu Acked-by: Alexei Starovoitov --- samples/bpf/tcbpf2_kern.c | 63 +- samples/bpf/test_tunnel_bpf.sh | 29 +++ 2 files changed, 91

[PATCH net-next 2/3] gre: add collect_md mode to ERSPAN tunnel

2017-08-25 Thread William Tu
Similar to gre, vxlan, geneve, ipip tunnels, allow ERSPAN tunnels to operate in 'collect metadata' mode. bpf_skb_[gs]et_tunnel_key() helpers can make use of it right away. OVS can use it as well in the future. Signed-off-by: William Tu --- include/net/ip_tunnels.h | 4 +- net/ipv

Re: [RFC PATCH bpf-next 00/14] xdp_flow: Flow offload to XDP

2019-08-15 Thread William Tu
On Tue, Aug 13, 2019 at 5:07 AM Toshiaki Makita wrote: > > This is a rough PoC for an idea to offload TC flower to XDP. > > > * Motivation > > The purpose is to speed up software TC flower by using XDP. > > I chose TC flower because my current interest is in OVS. OVS uses TC to > offload flow tabl

Re: [PATCH net v3] ixgbe: fix double clean of tx descriptors with xdp

2019-08-23 Thread William Tu
On Thu, Aug 22, 2019 at 11:10 PM Björn Töpel wrote: > > On 2019-08-22 19:32, William Tu wrote: > > On Thu, Aug 22, 2019 at 10:21 AM Alexander Duyck > > wrote: > >> > >> On Thu, Aug 22, 2019 at 10:12 AM Ilya Maximets > >> wrote: > >>>

Re: [PATCH bpf 2/2] libbpf: proper XSKMAP cleanup

2019-04-30 Thread William Tu
KMAP. Instead, the > bpf_map_delete_elem() function should be used for that. > > This patch also simplifies the code by breaking up > xsk_update_bpf_maps() into three smaller functions. > > Reported-by: William Tu > Fixes: 1cad07884239 ("libbpf: add support for using AF_XDP sockets"

Re: [PATCH bpf 1/2] libbpf: fix invalid munmap call

2019-04-30 Thread William Tu
passed > to munmap. > > When the userspace application tried to tear down an AF_XDP socket, > the operation failed and the application would still have a reference > to socket it wished to get rid of. > > Reported-by: William Tu > Fixes: 1cad07884239 ("libbpf: add sup

[PATCH bpf] libbpf: add libbpf_util.h to header install.

2019-05-02 Thread William Tu
The libbpf_util.h is used by xsk.h, so add it to the install headers. Reported-by: Ben Pfaff Signed-off-by: William Tu --- tools/lib/bpf/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index c6c06bc6683c..f91639bf5650 100644 --- a

Re: [PATCH bpf] libbpf: add libbpf_util.h to header install.

2019-05-03 Thread William Tu
On Thu, May 2, 2019 at 1:18 PM Y Song wrote: > > On Thu, May 2, 2019 at 11:34 AM William Tu wrote: > > > > The libbpf_util.h is used by xsk.h, so add it to > > the install headers. > > Can we try to change code a little bit to avoid exposing libbpf_util.h?

[PATCH net] net: ip6_gre: access skb data after skb_cow_head()

2019-05-16 Thread William Tu
When increases the headroom, skb's pointer might get re-allocated. Fix it by moving skb_cow_head before accessing the skb->data pointer. Fixes: 01b8d064d58b4 ("net: ip6_gre: Request headroom in __gre6_xmit()") Reported-by: Haichao Ma Signed-off-by: William Tu --- net/

Re: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-05 Thread William Tu
On Thu, Oct 5, 2017 at 6:59 AM, David Laight wrote: > From: William Tu >> Sent: 05 October 2017 01:14 >> Similarly to early patch for erspan_xmit(), the ARPHDR_ETHER device >> is the length of the whole ether packet. So skb->len should subtract >> the dev

[net-next,v2] ip_gre: check packet length and mtu correctly in erspan tx

2017-10-05 Thread William Tu
ve tunnel support for ERSPAN") Signed-off-by: William Tu Cc: Xin Long Cc: David Laight --- v1->v2: use addition to avoid overflow fix pskb_trim size --- net/ipv4/ip_gre.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c ind

Re: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-06 Thread William Tu
On Fri, Oct 6, 2017 at 2:38 AM, David Laight wrote: > From: William Tu >> Sent: 05 October 2017 22:21 > ... >> >> - if (skb->len > dev->mtu) { >> >> + if (skb->len - dev->hard_header_len > dev->mtu) { >> > >> >

Re: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-06 Thread William Tu
On Fri, Oct 6, 2017 at 3:22 PM, David Miller wrote: > From: William Tu > Date: Fri, 6 Oct 2017 15:09:29 -0700 > >> Yes, adding another field in the struct net_device can avoid the >> arithmetic operation. I'm not sure it's a good idea to add new field >

[net-next 0/3] ip_gre: a bunch of fixes for mtu

2017-10-09 Thread William Tu
The first two patches are to fix some issues for mtu and needed_headroom length calculation from the gre and erspan tunnel header. The last path tries to avoid arithmetic operation for every packet when checking for erspan truncate. William Tu (3): ip_gre: fix mtu and headroom size ip_gre

[net-next 1/3] ip_gre: fix mtu and headroom size

2017-10-09 Thread William Tu
e/UDP foo-over-udp encapsulation") Signed-off-by: William Tu Cc: Tom Herbert --- net/ipv4/ip_gre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index c105a315b1a3..286065c35959 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip

[net-next 2/3] ip_gre: fix erspan tunnel mtu calculation

2017-10-09 Thread William Tu
the ip_tunnel_bind_dev(), the mtu is adjusted to 1464 - 14 (dev->hard_header_len) = 1450. The maximum skb->len the erspan tunnel can carry without being truncated is 1450 + 14 = 1464 byte. Signed-off-by: William Tu Cc: Xin Long --- include/net/erspan.h | 1 + net/ipv4/ip_gre.c| 11 +

[net-next 3/3] ip_gre: cache the device mtu hard_header_len calc

2017-10-09 Thread William Tu
The patch introduces ip_tunnel->ether_mtu fields to cache the value of dev->mtu + dev->hard_header_len. This avoids the arithmetic operation on every packet. Signed-off-by: William Tu Cc: David Laight --- include/net/ip_tunnels.h | 1 + net/ipv4/ip_gre.c| 8

Re: [net-next 2/3] ip_gre: fix erspan tunnel mtu calculation

2017-10-10 Thread William Tu
>> @@ -1242,14 +1241,14 @@ static int erspan_tunnel_init(struct net_device *dev) >> struct ip_tunnel *tunnel = netdev_priv(dev); >> int t_hlen; >> >> - tunnel->tun_hlen = 8; >> + tunnel->tun_hlen = ERSPAN_GREHDR_LEN; >> tunnel->parms.iph.protocol = IPPROTO_GRE; >

Re: [PATCH net-next] net: ip6_gre: get ipv6hdr after skb_cow_head()

2018-07-13 Thread William Tu
port") > Signed-off-by: Prashant Bhole > --- Thanks for the fix. Acked-by: William Tu

[PATCH net 0/3] a couple of erspan fixes

2018-03-09 Thread William Tu
xmit. William Tu (3): ip6gre: add erspan v2 to tunnel lookup ip6erspan: improve error handling for erspan version number. ip6erspan: make sure enough headroom at xmit. net/ipv6/ip6_gre.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.7.4

[PATCH net 1/3] ip6gre: add erspan v2 to tunnel lookup

2018-03-09 Thread William Tu
The patch adds the erspan v2 proto in ip6gre_tunnel_lookup so the erspan v2 tunnel can be found correctly. Signed-off-by: William Tu --- net/ipv6/ip6_gre.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 18a3dfbd0300

[PATCH net 2/3] ip6erspan: improve error handling for erspan version number.

2018-03-09 Thread William Tu
When users fill in incorrect erspan version number through the struct erspan_metadata uapi, current code skips pushing the erspan header but continue pushing the gre header, which is incorrect. The patch fixes it by returning error. Signed-off-by: William Tu --- net/ipv6/ip6_gre.c | 2 ++ 1

[PATCH net 3/3] ip6erspan: make sure enough headroom at xmit.

2018-03-09 Thread William Tu
The patch adds skb_cow_header() to ensure enough headroom at ip6erspan_tunnel_xmit before pushing the erspan header to the skb. Signed-off-by: William Tu --- net/ipv6/ip6_gre.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 4ab476d3a46e

Re: [RFC PATCH v2 00/14] Introducing AF_XDP support

2018-04-09 Thread William Tu
On Tue, Mar 27, 2018 at 9:59 AM, Björn Töpel wrote: > From: Björn Töpel > > This RFC introduces a new address family called AF_XDP that is > optimized for high performance packet processing and, in upcoming > patch sets, zero-copy semantics. In this v2 version, we have removed > all zero-copy rel

Re: [PATCH net] ip_gre: clear feature flags when incompatible o_flags are set

2018-04-10 Thread William Tu
ixes: dd9d598c6657 ("ip_gre: add the support for i/o_flags update via >> netlink") >> Signed-off-by: Sabrina Dubroca >> --- Looks good to me. Acked-by: William Tu >> net/ipv4/ip_gre.c | 6 ++ >> 1 file changed, 6 insertions(+) >> >> diff --

Re: [RFC PATCH v2 00/14] Introducing AF_XDP support

2018-04-10 Thread William Tu
On Mon, Apr 9, 2018 at 11:47 PM, Björn Töpel wrote: > 2018-04-09 23:51 GMT+02:00 William Tu : >> On Tue, Mar 27, 2018 at 9:59 AM, Björn Töpel wrote: >>> From: Björn Töpel >>> >>> This RFC introduces a new address family called AF_XDP that is >>> opt

[PATCH net-next 2/2] samples/bpf: add gre sequence number test.

2018-02-28 Thread William Tu
The patch adds tests for GRE sequence number support for metadata mode tunnel. Signed-off-by: William Tu --- samples/bpf/tcbpf2_kern.c | 6 -- samples/bpf/test_tunnel_bpf.sh | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/samples/bpf/tcbpf2_kern.c b/samples/bpf

[PATCH net-next 0/2] gre: add sequence number for collect md mode.

2018-02-28 Thread William Tu
ype having sequence number. William Tu (2): gre: add sequence number for collect md mode. samples/bpf: add gre sequence number test. include/uapi/linux/bpf.h | 1 + net/core/filter.c | 4 +++- net/ipv4/ip_gre.c | 7 +-- net/ipv6/ip6_gre.c

[PATCH net-next 1/2] gre: add sequence number for collect md mode.

2018-02-28 Thread William Tu
sequence number is shared in the same tunnel device. That is, different tunnel keys using the same collect_md tunnel share single sequence number. Signed-off-by: William Tu --- include/uapi/linux/bpf.h | 1 + net/core/filter.c| 4 +++- net/ipv4/ip_gre.c| 7 +-- net/ipv6

Re: [PATCH net-next 1/2] gre: add sequence number for collect md mode.

2018-03-01 Thread William Tu
On Thu, Mar 1, 2018 at 2:18 AM, Daniel Borkmann wrote: > On 03/01/2018 01:11 AM, William Tu wrote: >> Currently GRE sequence number can only be used in native >> tunnel mode. This patch adds sequence number support for >> gre collect metadata mode. RFC2890 defines GRE seq

Re: [PATCH net-next 2/2] samples/bpf: add gre sequence number test.

2018-03-01 Thread William Tu
On Thu, Mar 1, 2018 at 2:30 AM, Daniel Borkmann wrote: > On 03/01/2018 01:11 AM, William Tu wrote: >> The patch adds tests for GRE sequence number >> support for metadata mode tunnel. >> >> Signed-off-by: William Tu >> --- >> samples/bpf/tcbpf2

help on iproute2 hangs

2018-03-01 Thread William Tu
Hi, We're running commands below on kernel 4.15.0: 1) ip netns add at_ns0 2) ip link add p0 type veth peer name ovs-p0 3) ip link set p0 netns at_ns0 4) ip link set dev ovs-p0 up However, it always hangs at creating veth peer, command (2) when we run above commands in GNU autotest. Running the sa

Re: help on iproute2 hangs

2018-03-01 Thread William Tu
On Thu, Mar 1, 2018 at 10:36 AM, David Ahern wrote: > On 3/1/18 10:29 AM, William Tu wrote: >> Hi, >> >> We're running commands below on kernel 4.15.0: >> 1) ip netns add at_ns0 >> 2) ip link add p0 type veth peer name ovs-p0 >> 3) ip link set p0

[PATCHv2 net-next 1/2] gre: add sequence number for collect md mode.

2018-03-01 Thread William Tu
sequence number is shared in the same tunnel device. That is, different tunnel keys using the same collect_md tunnel share single sequence number. Signed-off-by: William Tu --- include/uapi/linux/bpf.h | 1 + net/core/filter.c| 4 +++- net/ipv4/ip_gre.c| 7 +-- net/ipv6

[PATCHv2 net-next 0/2] gre: add sequence number for collect md mode.

2018-03-01 Thread William Tu
_F_GRE_SEQ to BPF_F_SEQ_NUMBER suggested by Daniel -- William Tu (2): gre: add sequence number for collect md mode. samples/bpf: add gre sequence number test. include/uapi/linux/bpf.h | 1 + net/core/filter.c | 4 +++- net/ipv4/ip_gre.c | 7 +-- net/ipv6/ip6_gre.c

[PATCHv2 net-next 2/2] samples/bpf: add gre sequence number test.

2018-03-01 Thread William Tu
The patch adds tests for GRE sequence number support for metadata mode tunnel. Signed-off-by: William Tu --- samples/bpf/tcbpf2_kern.c | 6 -- samples/bpf/test_tunnel_bpf.sh | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/samples/bpf/tcbpf2_kern.c b/samples

Re: help on iproute2 hangs

2018-03-01 Thread William Tu
> > I still can not reproduce the hang, but try this and see if it fixes > your problem (whitespace damaged on paste): > > diff --git a/lib/libnetlink.c b/lib/libnetlink.c > index 7ca47b22581a..9d692afbc740 100644 > --- a/lib/libnetlink.c > +++ b/lib/libnetlink.c > @@ -670,8 +672,9 @@ static int __

Re: [PATCH net-next] selftests: rtnetlink: remove testns on test fail

2018-03-02 Thread William Tu
On Thu, Mar 1, 2018 at 6:22 PM, Prashant Bhole wrote: > This patch removes testns after test failure so that next test can > continue with clean ns > > Signed-off-by: Prashant Bhole Thanks for the fix. Acked-by: William Tu

[PATCH net-next] openvswitch: fix vport packet length check.

2018-03-06 Thread William Tu
This causes the 'unsign int length' to become super large because it is negative value, causing the later ovs_vport_send to drop it due to over-mtu size. The patch fixes it by setting it to 0. Signed-off-by: William Tu --- net/openvswitch/vport.c | 4 ++-- 1 file changed, 2 inser

Re: [PATCH net-next] openvswitch: fix vport packet length check.

2018-03-07 Thread William Tu
On Wed, Mar 7, 2018 at 1:18 PM, Pravin Shelar wrote: > On Tue, Mar 6, 2018 at 5:56 PM, William Tu wrote: >> When sending a packet to a tunnel device, the dev's hard_header_len >> could be larger than the skb->len in function packet_length(). >> In the case of ip6g

[PATCHv2 net-next] openvswitch: fix vport packet length check.

2018-03-07 Thread William Tu
This causes the 'unsign int length' to become super large because it is negative value, causing the later ovs_vport_send to drop it due to over-mtu size. The patch fixes it by setting it to 0. Signed-off-by: William Tu --- v1->v2: replace the return type from unsigned int to int ---

[PATCH net-next] openvswitch: Add erspan tunnel support.

2017-10-04 Thread William Tu
Add type II erspan vport implementation. Since erspan protocol is on top of the GRE header, the implementation is extended from the existing gre implementation. Signed-off-by: William Tu Cc: Pravin B Shelar --- include/net/gre.h| 2 ++ include/uapi/linux/openvswitch.h | 2

Re: [PATCH net-next] openvswitch: Add erspan tunnel support.

2017-10-04 Thread William Tu
On Wed, Oct 4, 2017 at 2:31 PM, Pravin Shelar wrote: > On Wed, Oct 4, 2017 at 5:02 AM, William Tu wrote: >> Add type II erspan vport implementation. Since erspan protocol is >> on top of the GRE header, the implementation is extended from the >> existing gre implementation

[PATCHv2 net-next] openvswitch: Add erspan tunnel support.

2017-10-04 Thread William Tu
Add erspan netlink interface for OVS. Signed-off-by: William Tu Cc: Pravin B Shelar --- v1->v2: remove unnecessary compat code. --- include/uapi/linux/openvswitch.h | 1 + net/openvswitch/flow_netlink.c | 51 +++- 2 files changed, 51 insertions(+)

[PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-04 Thread William Tu
Similarly to early patch for erspan_xmit(), the ARPHDR_ETHER device is the length of the whole ether packet. So skb->len should subtract the dev->hard_header_len. Fixes: 1a66a836da63 ("gre: add collect_md mode to ERSPAN tunnel") Signed-off-by: William Tu Cc: Xin Long --- net/i

Re: [PATCH bpf-next 00/11] AF_XDP zero-copy support for i40e

2018-08-29 Thread William Tu
> Thanks for working on this, LGTM! Are you also planning to get ixgbe > out after that? > I currently don't have i40e nic to test, so I'm also looking forward to the ixgbe patch! Thank you William

[PATCH net-next] selftests: rtnetlink: add gretap test cases

2017-12-19 Thread William Tu
Add test cases for gretap and ip6gretap, native mode and external (collect metadata) mode. Signed-off-by: William Tu --- tools/testing/selftests/net/rtnetlink.sh | 98 1 file changed, 98 insertions(+) diff --git a/tools/testing/selftests/net/rtnetlink.sh b

Re: [PATCH v2 iproute2 net-next] erspan: add erspan version II support

2017-12-19 Thread William Tu
On Tue, Dec 19, 2017 at 2:17 PM, David Ahern wrote: > On 12/15/17 6:06 PM, William Tu wrote: >> @@ -343,6 +355,22 @@ get_failed: >> invarg("invalid erspan index\n", *argv); >> if (erspan_idx &

[PATCH v3 iproute2 net-next] erspan: add erspan version II support

2017-12-19 Thread William Tu
users to set ERSPAN engine ID within a system. As for manpage, the ERSPAN descriptions used to be under GRE, IPIP, SIT Type paragraph. Since IP6GRE/IP6GRETAP also supports ERSPAN, the patch removes the old one, creates a separate ERSPAN paragrah, and adds an example. Signed-off-by: William Tu

Re: [PATCH v3 iproute2 net-next] erspan: add erspan version II support

2017-12-19 Thread William Tu
On Tue, Dec 19, 2017 at 5:28 PM, David Ahern wrote: > Hi William: > > On 12/19/17 6:08 PM, William Tu wrote: >> @@ -343,6 +355,26 @@ get_failed: >> invarg("invalid erspan index\n", *argv); >> if (erspan_id

[PATCH v4 iproute2 net-next] erspan: add erspan version II support

2017-12-19 Thread William Tu
users to set ERSPAN engine ID within a system. As for manpage, the ERSPAN descriptions used to be under GRE, IPIP, SIT Type paragraph. Since IP6GRE/IP6GRETAP also supports ERSPAN, the patch removes the old one, creates a separate ERSPAN paragrah, and adds an example. Signed-off-by: William Tu ---

Re: [PATCH v3,net-next 2/2] ip6_gre: fix potential memory leak in ip6erspan_rcv

2017-12-20 Thread William Tu
On Tue, Dec 19, 2017 at 6:07 PM, Haishuang Yan wrote: > If md is NULL, tun_dst must be freed, otherwise it will cause memory > leak. > > Fixes: ef7baf5e083c ("ip6_gre: add ip6 erspan collect_md mode") > Cc: William Tu > Signed-off-by: Haishuang Yan > > --- &

[PATCH v5 iproute2 net-next] erspan: add erspan version II support

2017-12-20 Thread William Tu
users to set ERSPAN engine ID within a system. As for manpage, the ERSPAN descriptions used to be under GRE, IPIP, SIT Type paragraph. Since IP6GRE/IP6GRETAP also supports ERSPAN, the patch removes the old one, creates a separate ERSPAN paragrah, and adds an example. Signed-off-by: William Tu --

[PATCH net-next] net: erspan: remove md NULL check

2017-12-21 Thread William Tu
Fixes: 50670b6ee9bc ("ip_gre: fix potential memory leak in erspan_rcv") Cc: Haishuang Yan Signed-off-by: William Tu --- net/ipv4/ip_gre.c | 5 - net/ipv6/ip6_gre.c | 4 2 files changed, 9 deletions(-) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 90c912307814..47

[PATCH iproute2 net-next] erspan: add erspan usage description

2017-12-26 Thread William Tu
The patch adds erspan usage description, so 'ip link help erspan' and 'ip link help ip6erspan' shows the options. Signed-off-by: William Tu --- ip/link_gre.c | 4 ip/link_gre6.c | 4 2 files changed, 8 insertions(+) diff --git a/ip/link_gre.c b/ip/link_gre.

[PATCH net-next] selftests: rtnetlink: add erspan and ip6erspan

2017-12-26 Thread William Tu
Add test cases for ipv4, ipv6 erspan, v1 and v2 native mode and external (collect metadata) mode. Signed-off-by: William Tu --- tools/testing/selftests/net/rtnetlink.sh | 131 +++ 1 file changed, 131 insertions(+) diff --git a/tools/testing/selftests/net

Re: [PATCH iproute2 3/3] ip/tunnel: Document "external" parameter

2017-12-27 Thread William Tu
Hi Serhey, On Wed, Dec 27, 2017 at 3:28 AM, Serhey Popovych wrote: > Also add "noexternal" variant to be inline > with geneve and vxlan tunnel types. > > Signed-off-by: Serhey Popovych > --- > ip/link_gre.c |3 +++ > ip/link_ip6tnl.c |4 +++- > ip/link_iptnl.c |4

Re: [PATCH iproute2] gre/tunnel: Print erspan_index using print_uint()

2017-12-28 Thread William Tu
Hi Serhey, On Thu, Dec 28, 2017 at 3:12 AM, Serhey Popovych wrote: > One is missing in JSON output because fprintf() > is used instead of print_uint(). > > Signed-off-by: Serhey Popovych > --- > ip/link_gre.c |3 ++- > ip/link_gre6.c |4 +++- > 2 files changed, 5 insertions(+), 2 delet

  1   2   3   4   >