Re: [PATCH] ip6_gre: fix a pontential issue in ip6erspan_rcv

2017-12-15 Thread
> On 2017年12月16日, at 上午3:11, David Miller wrote: > > From: Haishuang Yan > Date: Fri, 15 Dec 2017 10:46:38 +0800 > >> pskb_may_pull() can change skb->data, so we need to load ipv6h/ershdr at >> the right place. >> >> Fixes:

Re: [PATCH] ip6_gre: fix a pontential issue in ip6erspan_rcv

2017-12-15 Thread
> On 2017年12月16日, at 上午3:11, David Miller wrote: > > From: Haishuang Yan > Date: Fri, 15 Dec 2017 10:46:38 +0800 > >> pskb_may_pull() can change skb->data, so we need to load ipv6h/ershdr at >> the right place. >> >> Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support") >> Cc:

Re: [PATCH 1/2] ip_gre: fix potential memory leak in erspan_rcv

2017-12-14 Thread
> On 2017年12月15日, at 上午2:47, William Tu wrote: > > On Thu, Dec 14, 2017 at 7:15 AM, Haishuang Yan > wrote: >> If md is NULL, tun_dst must be freed, otherwise it will cause memory >> leak. >> >> Fixes: 84e54fe0a5ea ("gre: introduce native

Re: [PATCH 1/2] ip_gre: fix potential memory leak in erspan_rcv

2017-12-14 Thread
> On 2017年12月15日, at 上午2:47, William Tu wrote: > > On Thu, Dec 14, 2017 at 7:15 AM, Haishuang Yan > wrote: >> If md is NULL, tun_dst must be freed, otherwise it will cause memory >> leak. >> >> Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") >> Cc: William Tu >>

Re: [PATCH v4 2/3] ipv4: Namespaceify tcp_fastopen_key knob

2017-09-26 Thread
> On 2017年9月27日, at 上午2:18, David Miller <da...@davemloft.net> wrote: > > From: 严海双 <yanhaishu...@cmss.chinamobile.com> > Date: Tue, 26 Sep 2017 09:25:51 +0800 > >>> On 2017年9月26日, at 上午7:24, David Miller <da...@davemloft.net> wrot

Re: [PATCH v4 2/3] ipv4: Namespaceify tcp_fastopen_key knob

2017-09-26 Thread
> On 2017年9月27日, at 上午2:18, David Miller wrote: > > From: 严海双 > Date: Tue, 26 Sep 2017 09:25:51 +0800 > >>> On 2017年9月26日, at 上午7:24, David Miller wrote: >>> >>> From: Haishuang Yan >>> Date: Fri, 22 Sep 2017 21:48:43 +0800 >&

Re: [PATCH v4 2/3] ipv4: Namespaceify tcp_fastopen_key knob

2017-09-25 Thread
> On 2017年9月26日, at 上午7:24, David Miller wrote: > > From: Haishuang Yan > Date: Fri, 22 Sep 2017 21:48:43 +0800 > >> @@ -9,13 +9,18 @@ >> #include >> #include >> >> -struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; >> - >>

Re: [PATCH v4 2/3] ipv4: Namespaceify tcp_fastopen_key knob

2017-09-25 Thread
> On 2017年9月26日, at 上午7:24, David Miller wrote: > > From: Haishuang Yan > Date: Fri, 22 Sep 2017 21:48:43 +0800 > >> @@ -9,13 +9,18 @@ >> #include >> #include >> >> -struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; >> - >> -static DEFINE_SPINLOCK(tcp_fastopen_ctx_lock); >> - >> -void

Re: [Patch v3 1/3] ipv4: Namespaceify tcp_fastopen knob

2017-09-20 Thread
> On 2017年9月21日, at 上午5:22, David Miller wrote: > > From: Haishuang Yan > Date: Tue, 19 Sep 2017 17:38:14 +0800 > >> -if ((sysctl_tcp_fastopen & TFO_SERVER_WO_SOCKOPT1) && >> -(sysctl_tcp_fastopen &

Re: [Patch v3 1/3] ipv4: Namespaceify tcp_fastopen knob

2017-09-20 Thread
> On 2017年9月21日, at 上午5:22, David Miller wrote: > > From: Haishuang Yan > Date: Tue, 19 Sep 2017 17:38:14 +0800 > >> -if ((sysctl_tcp_fastopen & TFO_SERVER_WO_SOCKOPT1) && >> -(sysctl_tcp_fastopen & TFO_SERVER_ENABLE) && >> +tcp_fastopen =

Re: [PATCH v2] ipv4: Namespaceify tcp_fastopen knob

2017-09-14 Thread
> On 2017年9月13日, at 下午9:02, Eric Dumazet wrote: > > On Wed, 2017-09-13 at 05:44 -0700, Eric Dumazet wrote: >> On Wed, 2017-09-13 at 19:19 +0800, Haishuang Yan wrote: >>> Different namespace application might require enable TCP Fast Open >>> feature independently of the

Re: [PATCH v2] ipv4: Namespaceify tcp_fastopen knob

2017-09-14 Thread
> On 2017年9月13日, at 下午9:02, Eric Dumazet wrote: > > On Wed, 2017-09-13 at 05:44 -0700, Eric Dumazet wrote: >> On Wed, 2017-09-13 at 19:19 +0800, Haishuang Yan wrote: >>> Different namespace application might require enable TCP Fast Open >>> feature independently of the host. >>> >> >> Poor

Re: [PATCH v2] geneve: Fix setting ttl value in collect metadata mode

2017-09-13 Thread
> On 2017年9月13日, at 上午7:43, Pravin Shelar wrote: > > On Tue, Sep 12, 2017 at 12:05 AM, Haishuang Yan > wrote: >> Similar to vxlan/ipip tunnel, if key->tos is zero in collect metadata >> mode, tos should also fallback to ip{4,6}_dst_hoplimit.

Re: [PATCH v2] geneve: Fix setting ttl value in collect metadata mode

2017-09-13 Thread
> On 2017年9月13日, at 上午7:43, Pravin Shelar wrote: > > On Tue, Sep 12, 2017 at 12:05 AM, Haishuang Yan > wrote: >> Similar to vxlan/ipip tunnel, if key->tos is zero in collect metadata >> mode, tos should also fallback to ip{4,6}_dst_hoplimit. >> >> Signed-off-by: Haishuang Yan >> >> --- >>

Re: [PATCH] ipv4: Namespaceify tcp_fastopen knob

2017-09-13 Thread
> On 2017年9月13日, at 上午11:57, David Miller wrote: > > From: Haishuang Yan > Date: Tue, 12 Sep 2017 18:30:57 +0800 > >> Different namespace application might require enable TCP Fast Open >> feature independently of the host. >> >>

Re: [PATCH] ipv4: Namespaceify tcp_fastopen knob

2017-09-13 Thread
> On 2017年9月13日, at 上午11:57, David Miller wrote: > > From: Haishuang Yan > Date: Tue, 12 Sep 2017 18:30:57 +0800 > >> Different namespace application might require enable TCP Fast Open >> feature independently of the host. >> >> Reported-by: Luca BRUNO >> Signed-off-by: Haishuang Yan >

Re: [PATCH] ipv4: Namespaceify tcp_max_orphans knob

2017-09-09 Thread
> On 2017年9月9日, at 下午1:16, David Miller <da...@davemloft.net> wrote: > > From: 严海双 <yanhaishu...@cmss.chinamobile.com> > Date: Sat, 9 Sep 2017 13:09:57 +0800 > >> >> >>> On 2017年9月9日, at 下午12:35, Cong Wang <xiyou.wangc...@gmail.com&g

Re: [PATCH] ipv4: Namespaceify tcp_max_orphans knob

2017-09-09 Thread
> On 2017年9月9日, at 下午1:16, David Miller wrote: > > From: 严海双 > Date: Sat, 9 Sep 2017 13:09:57 +0800 > >> >> >>> On 2017年9月9日, at 下午12:35, Cong Wang wrote: >>> >>> On Fri, Sep 8, 2017 at 6:25 PM, 严海双 >>> wro

Re: [PATCH] ipv4: Namespaceify tcp_max_orphans knob

2017-09-08 Thread
> On 2017年9月9日, at 下午12:35, Cong Wang <xiyou.wangc...@gmail.com> wrote: > > On Fri, Sep 8, 2017 at 6:25 PM, 严海双 <yanhaishu...@cmss.chinamobile.com> wrote: >> >> >>> On 2017年9月9日, at 上午6:13, Cong Wang <xiyou.wangc...@gmail.com> wrote: >&g

Re: [PATCH] ipv4: Namespaceify tcp_max_orphans knob

2017-09-08 Thread
> On 2017年9月9日, at 下午12:35, Cong Wang wrote: > > On Fri, Sep 8, 2017 at 6:25 PM, 严海双 wrote: >> >> >>> On 2017年9月9日, at 上午6:13, Cong Wang wrote: >>> >>> On Wed, Sep 6, 2017 at 8:10 PM, Haishuang Yan >>> wrote: >>>> D

Re: [PATCH] ipv4: Namespaceify tcp_max_orphans knob

2017-09-08 Thread
> On 2017年9月9日, at 上午6:13, Cong Wang wrote: > > On Wed, Sep 6, 2017 at 8:10 PM, Haishuang Yan > wrote: >> Different namespace application might require different maximal number >> of TCP sockets independently of the host. > > So

Re: [PATCH] ipv4: Namespaceify tcp_max_orphans knob

2017-09-08 Thread
> On 2017年9月9日, at 上午6:13, Cong Wang wrote: > > On Wed, Sep 6, 2017 at 8:10 PM, Haishuang Yan > wrote: >> Different namespace application might require different maximal number >> of TCP sockets independently of the host. > > So after your patch we could have N *

Re: [PATCH v3 2/2] ip6_tunnel: fix ip6 tunnel lookup in collect_md mode

2017-09-06 Thread
> On 2017年9月6日, at 上午11:14, Alexei Starovoitov wrote: > > On 9/4/17 1:36 AM, Haishuang Yan wrote: >> In collect_md mode, if the tun dev is down, it still can call >> __ip6_tnl_rcv to receive on packets, and the rx statistics increase >> improperly. >> >> Fixes: 8d79266bc48c

Re: [PATCH v3 2/2] ip6_tunnel: fix ip6 tunnel lookup in collect_md mode

2017-09-06 Thread
> On 2017年9月6日, at 上午11:14, Alexei Starovoitov wrote: > > On 9/4/17 1:36 AM, Haishuang Yan wrote: >> In collect_md mode, if the tun dev is down, it still can call >> __ip6_tnl_rcv to receive on packets, and the rx statistics increase >> improperly. >> >> Fixes: 8d79266bc48c ("ip6_tunnel: add

Re: [PATCH] be2net: Fix some u16 fields appropriately

2017-08-28 Thread
> On 2017年8月29日, at 上午7:19, David Miller wrote: > > From: Haishuang Yan > Date: Sun, 27 Aug 2017 15:24:45 +0800 > >> In be_tx_compl_process, frag_index declared as u32, so it's better to >> declare last_index as u32 also. >> >> CC: Ajit

Re: [PATCH] be2net: Fix some u16 fields appropriately

2017-08-28 Thread
> On 2017年8月29日, at 上午7:19, David Miller wrote: > > From: Haishuang Yan > Date: Sun, 27 Aug 2017 15:24:45 +0800 > >> In be_tx_compl_process, frag_index declared as u32, so it's better to >> declare last_index as u32 also. >> >> CC: Ajit Khaparde >> Fixes: b0fd2eb28bd4 ("be2net: Declare some

Re: [PATCH v2 1/2] ip_tunnel: fix ip tunnel lookup in collect_md mode

2017-06-21 Thread
> On 20 Jun 2017, at 2:08 AM, Pravin Shelar <pshe...@ovn.org> wrote: > > On Mon, Jun 19, 2017 at 6:13 AM, 严海双 <yanhaishu...@cmss.chinamobile.com> > wrote: >> >> >>> On 19 Jun 2017, at 1:43 PM, Pravin Shelar <pshe...@ovn.org> wrote: >

Re: [PATCH v2 1/2] ip_tunnel: fix ip tunnel lookup in collect_md mode

2017-06-21 Thread
> On 20 Jun 2017, at 2:08 AM, Pravin Shelar wrote: > > On Mon, Jun 19, 2017 at 6:13 AM, 严海双 > wrote: >> >> >>> On 19 Jun 2017, at 1:43 PM, Pravin Shelar wrote: >>> >>> On Fri, Jun 16, 2017 at 8:27 PM, Haishuang Yan >>> wrote: &

Re: [PATCH v2 1/2] ip_tunnel: fix ip tunnel lookup in collect_md mode

2017-06-19 Thread
> On 19 Jun 2017, at 1:43 PM, Pravin Shelar wrote: > > On Fri, Jun 16, 2017 at 8:27 PM, Haishuang Yan > wrote: >> In collect_md mode, if the tun dev is down, it still can call >> ip_tunnel_rcv to receive on packets, and the rx statistics

Re: [PATCH v2 1/2] ip_tunnel: fix ip tunnel lookup in collect_md mode

2017-06-19 Thread
> On 19 Jun 2017, at 1:43 PM, Pravin Shelar wrote: > > On Fri, Jun 16, 2017 at 8:27 PM, Haishuang Yan > wrote: >> In collect_md mode, if the tun dev is down, it still can call >> ip_tunnel_rcv to receive on packets, and the rx statistics increase >> improperly. >> >> Fixes: 2e15ea390e6f

Re: [PATCH v2] ip6_tunnel: Correct tos value in collect_md mode

2017-06-16 Thread
> On 16 Jun 2017, at 10:44 PM, Daniel Borkmann wrote: > > On 06/15/2017 05:54 AM, Peter Dawson wrote: >> On Thu, 15 Jun 2017 10:30:29 +0800 >> Haishuang Yan wrote: >> >>> Same as ip_gre, geneve and vxlan, use key->tos as tos value. >>>

Re: [PATCH v2] ip6_tunnel: Correct tos value in collect_md mode

2017-06-16 Thread
> On 16 Jun 2017, at 10:44 PM, Daniel Borkmann wrote: > > On 06/15/2017 05:54 AM, Peter Dawson wrote: >> On Thu, 15 Jun 2017 10:30:29 +0800 >> Haishuang Yan wrote: >> >>> Same as ip_gre, geneve and vxlan, use key->tos as tos value. >>> >>> CC: Peter Dawson >>> Fixes: 0e9a709560db

Re: [PATCH] ip6_tunnel: Correct tos value in collect_md mode

2017-06-14 Thread
> On 14 Jun 2017, at 1:28 PM, Peter Dawson <peted...@gmail.com> wrote: > > On Wed, 14 Jun 2017 10:54:31 +0800 > 严海双 <yanhaishu...@cmss.chinamobile.com> wrote: > > >>> Changes since v2: >>> * mask key->tos with RT_TOS() suggested by D

Re: [PATCH] ip6_tunnel: Correct tos value in collect_md mode

2017-06-14 Thread
> On 14 Jun 2017, at 1:28 PM, Peter Dawson wrote: > > On Wed, 14 Jun 2017 10:54:31 +0800 > 严海双 wrote: > > >>> Changes since v2: >>> * mask key->tos with RT_TOS() suggested by Daniel > > Can you help me understand the rationale for this chan

Re: [PATCH] ip6_tunnel: Correct tos value in collect_md mode

2017-06-13 Thread
> On 14 Jun 2017, at 10:48 AM, Haishuang Yan > wrote: > > Same as ip_gre, geneve and vxlan, use key->tos as tos value. > > CC: Peter Dawson > Fixes: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on > encapsulated packets”) >

Re: [PATCH] ip6_tunnel: Correct tos value in collect_md mode

2017-06-13 Thread
> On 14 Jun 2017, at 10:48 AM, Haishuang Yan > wrote: > > Same as ip_gre, geneve and vxlan, use key->tos as tos value. > > CC: Peter Dawson > Fixes: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on > encapsulated packets”) > Suggested-by: Daniel Borkmann > Signed-off-by:

Re: [PATCH] ip6_tunnel: fix potential issue in __ip6_tnl_rcv

2017-06-13 Thread
> On 13 Jun 2017, at 4:56 PM, Haishuang Yan > wrote: > > When __ip6_tnl_rcv fails, the tun_dst won't be freed, so call > dst_release to free it in error code path. > > CC: Alexei Starovoitov > Fixes: 8d79266bc48c ("ip6_tunnel: add collect_md

Re: [PATCH] ip6_tunnel: fix potential issue in __ip6_tnl_rcv

2017-06-13 Thread
> On 13 Jun 2017, at 4:56 PM, Haishuang Yan > wrote: > > When __ip6_tnl_rcv fails, the tun_dst won't be freed, so call > dst_release to free it in error code path. > > CC: Alexei Starovoitov > Fixes: 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels") > Signed-off-by: Haishuang

Re: [PATCH v2 1/2] ip_tunnel: fix potential issue in ip_tunnel_rcv

2017-06-07 Thread
> On 8 Jun 2017, at 10:13 AM, Pravin Shelar wrote: > > On Wed, Jun 7, 2017 at 5:57 PM, Haishuang Yan > wrote: >> When ip_tunnel_rcv fails, the tun_dst won't be freed, so move >> skb_dst_set to begin and tun_dst would be freed by kfree_skb.

Re: [PATCH v2 1/2] ip_tunnel: fix potential issue in ip_tunnel_rcv

2017-06-07 Thread
> On 8 Jun 2017, at 10:13 AM, Pravin Shelar wrote: > > On Wed, Jun 7, 2017 at 5:57 PM, Haishuang Yan > wrote: >> When ip_tunnel_rcv fails, the tun_dst won't be freed, so move >> skb_dst_set to begin and tun_dst would be freed by kfree_skb. >> >> CC: Pravin B Shelar >> Fixes: 2e15ea390e6f

Re: [PATCH 1/2] ip_tunnel: fix potential issue in ip_tunnel_rcv

2017-06-07 Thread
> On 7 Jun 2017, at 10:48 PM, Eric Dumazet wrote: > > On Wed, 2017-06-07 at 22:16 +0800, Haishuang Yan wrote: >> When ip_tunnel_rcv fails, the tun_dst won't be freed, so move >> skb_dst_set to begin and tun_dst would be freed by kfree_skb. >> >> Signed-off-by: Haishuang

Re: [PATCH 1/2] ip_tunnel: fix potential issue in ip_tunnel_rcv

2017-06-07 Thread
> On 7 Jun 2017, at 10:48 PM, Eric Dumazet wrote: > > On Wed, 2017-06-07 at 22:16 +0800, Haishuang Yan wrote: >> When ip_tunnel_rcv fails, the tun_dst won't be freed, so move >> skb_dst_set to begin and tun_dst would be freed by kfree_skb. >> >> Signed-off-by: Haishuang Yan >> --- > > Please

Re: [PATCH] geneve: fix max_mtu setting

2016-06-26 Thread
> On Jun 26, 2016, at 8:35 PM, zhuyj wrote: > > + if (geneve->remote.sa.sa_family == AF_INET) > + max_mtu -= sizeof(struct iphdr); > + else > + max_mtu -= sizeof(struct ipv6hdr); > > Sorry, if sa_family is not AF_NET, it is

Re: [PATCH] geneve: fix max_mtu setting

2016-06-26 Thread
> On Jun 26, 2016, at 8:35 PM, zhuyj wrote: > > + if (geneve->remote.sa.sa_family == AF_INET) > + max_mtu -= sizeof(struct iphdr); > + else > + max_mtu -= sizeof(struct ipv6hdr); > > Sorry, if sa_family is not AF_NET, it is AF_INET6? > > There is a lot

Re: [PATCH v2] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6)

2016-05-23 Thread
> On May 24, 2016, at 11:14 AM, Eric Dumazet wrote: > > On Tue, 2016-05-24 at 10:39 +0800, Haishuang Yan wrote: >> For ipv6 case, enclose the code block in macro IS_ENABLED(CONFIG_IPV6). >> >> --- >> Changes in v2: >> - Place the "#if IS_ENABLED" block before the "}

Re: [PATCH v2] ip_tunnel: enclose a code block in macro IS_ENABLED(CONFIG_IPV6)

2016-05-23 Thread
> On May 24, 2016, at 11:14 AM, Eric Dumazet wrote: > > On Tue, 2016-05-24 at 10:39 +0800, Haishuang Yan wrote: >> For ipv6 case, enclose the code block in macro IS_ENABLED(CONFIG_IPV6). >> >> --- >> Changes in v2: >> - Place the "#if IS_ENABLED" block before the "} else if >> (..) {" piece

Re: [PATCH 2/2] ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit path.

2016-05-20 Thread
> On May 21, 2016, at 1:48 AM, David Miller wrote: > > From: Haishuang Yan > Date: Wed, 18 May 2016 18:05:52 +0800 > >> In gre6 xmit path, we are sending a GRE packet, so set fl6 proto >> to IPPROTO_GRE properly. >> >> Signed-off-by:

Re: [PATCH 2/2] ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit path.

2016-05-20 Thread
> On May 21, 2016, at 1:48 AM, David Miller wrote: > > From: Haishuang Yan > Date: Wed, 18 May 2016 18:05:52 +0800 > >> In gre6 xmit path, we are sending a GRE packet, so set fl6 proto >> to IPPROTO_GRE properly. >> >> Signed-off-by: Haishuang Yan > > I think it would be a lot better to