Re: [PATCH] xfrm: fix the xfrm_policy/state_walk

2015-04-22 Thread Li RongQing
On Wed, Apr 22, 2015 at 3:57 PM, Herbert Xu herb...@gondor.apana.org.au wrote: Signed-off-by: Li RongQing roy.qing...@gmail.com This is not a bug fix but an optimisation. The walker entries are all marked as dead and will be skipped by the loop. However, I don't see anything wrong

Re: [PATCH] net: sysctl: fix a kmemleak warning

2015-10-23 Thread Li RongQing
On Fri, Oct 23, 2015 at 6:04 PM, David Miller wrote: >> +out1: >> + unregister_sysctl_table(net_header); >> + kfree(net_header); > > I read over unregister_sysctl_table() and it appears to do the kfree() > for us, doesn't it? you are right, thanks -Roy -- To

Re: [bug report or not] ping6 will lost packets when ping6 lots of ipv6 address

2015-10-14 Thread Li RongQing
On Wed, Oct 14, 2015 at 12:11 AM, Martin KaFai Lau <ka...@fb.com> wrote: > On Tue, Oct 13, 2015 at 08:46:49PM +0800, Li RongQing wrote: >> 1. in a machine, configure 3000 ipv6 address in one interface >> >> for i in {1..3000}; do ip -6 addr add 4001:5013::$i/0 dev eth0

Re: ICMPv6 too big Packet will makes the network unreachable

2015-10-14 Thread Li RongQing
On Tue, Oct 13, 2015 at 10:26 PM, Hannes Frederic Sowa wrote: >>root@du1:~# ip route get 2001:1b70:82a8:18:650:65:0:2 >>2001:1b70:82a8:18:650:65:0:2 dev eth10.650 src >> 2001:1b70:82a8:18:650:65:0:2 metric 0 >>cache >>root@du1:~# > > Which kernel

Re: ICMPv6 too big Packet will makes the network unreachable

2015-10-14 Thread Li RongQing
ev/msg314717.html > > You can try these patches to check if they resolve your problem: > 7035870d1219 | 2015-05-03 | ipv6: Check RTF_LOCAL on rt->rt6i_flags instead > of rt->dst.flags > 653437d02f1f | 2015-04-28 | ipv6: Stop /128 route from disappearing after > pmtu update > &g

Re: ICMPv6 too big Packet will makes the network unreachable

2015-10-14 Thread Li RongQing
On Wed, Oct 14, 2015 at 5:53 PM, Li RongQing <roy.qing...@gmail.com> wrote: > On Wed, Oct 14, 2015 at 5:18 PM, Sheng Yong <shengyo...@huawei.com> wrote: >> Hi, Rongqing, >> >> Cced Martin KaFai Lau <ka...@fb.com> >> >> It seems you trig

Re: [PATCH net-next v2] ipconfig: send Client-identifier in DHCP requests

2015-10-15 Thread Li RongQing
On Thu, Oct 15, 2015 at 10:56 PM, Florian Fainelli wrote: > Did not you mean strlen(dhcp_client_identifer) + 1 instead? no; dhcp_client_identifer[0] is client identifier type, and it maybe 0; dhcp_client_identifer+1 is the start address of client identifier value; -Roy --

Re: [PATCH] ipconfig: send Client-identifier in DHCP requests

2015-10-14 Thread Li RongQing
On Thu, Oct 15, 2015 at 11:27 AM, kbuild test robot wrote: > Hi Li, > > [auto build test WARNING on net/master -- if it's inappropriate base, please > suggest rules for selecting the more suitable base] > > url: >

ICMPv6 too big Packet will makes the network unreachable

2015-10-13 Thread Li RongQing
1. Machine with 2001:1b70:82a8:18:650:65:0:2 address, and receive wrong icmp packets root@du1:~# ifconfig eth10.650 Link encap:Ethernet HWaddr 74:c9:9a:a7:e5:88 inet6 addr: fe80::76c9:9aff:fea7:e588/64 Scope:Link inet6 addr: 2001:1b70:82a8:18:650:65:0:2/80

[bug report or not] ping6 will lost packets when ping6 lots of ipv6 address

2015-10-13 Thread Li RongQing
1. in a machine, configure 3000 ipv6 address in one interface for i in {1..3000}; do ip -6 addr add 4001:5013::$i/0 dev eth0; done 2. in other machine, ping6 the upper configured ipv6 address, then lots of lost packets ip -6 addr add 4001:5013::0/64 dev eth0 for i in {1..2000}; do ping6 -q -c1

Re: question about vrf-lite

2016-01-06 Thread Li RongQing
>> >> is it right? > > > no. The above works fine for me. I literally copied and pasted all of the > commands except the master ones which were adapted to my setup -- eth9 and > eth11 for me instead of eth0 and eth1. tcpdump on N2, N3 show the right one > is receiving packets based on which 'ping

Re: [PATCH][net-next][v2] bridge: allow the maximum mtu to 64k

2016-02-24 Thread Li RongQing
On Thu, Feb 25, 2016 at 5:44 AM, Stephen Hemminger wrote: >> This is especially annoying for the virtualization case because the >> KVM's tap driver will by default adopt the bridge's MTU on startup >> making it impossible (without the workaround) to use a large MTU on

Re: [PATCH][net-next] bridge: increase mtu to 9000

2016-02-22 Thread Li RongQing
On Tue, Feb 23, 2016 at 1:58 AM, Stephen Hemminger <step...@networkplumber.org> wrote: >> guest VMs. >> >> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1399064 >> >> Signed-off-by: Li RongQing <roy.qing...@gmail.com> > > Your change wor

Re: [PATCH][net-next] ipv6: replace write lock with read lock in addrconf_permanent_addr

2016-03-14 Thread Li RongQing
On Tue, Mar 15, 2016 at 12:25 AM, David Miller wrote: > > We need it for the modifications made by fixup_permanent_addr(). fixup_permanent_addr should be protected by ifp->lock, not by idev->lock write lock, since ifp is modified, -Roy

[net-next][PATCH] inet: Use switch case instead of multiple condition checks

2018-05-09 Thread Li RongQing
:400236400 400236401 Signed-off-by: Li RongQing <lirongq...@baidu.com> --- include/net/inet_connection_sock.h | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h

Re: [PATCH][ipsec] xfrm: replace NR_CPU with num_possible_cpus()

2018-06-18 Thread Li RongQing
sorry, please drop this patch. I should replace NR_CPUS with nr_cpu_ids, i will resend it -R On 6/15/18, Li RongQing wrote: > The default NR_CPUS can be very large, but actual possible nr_cpu_ids > usually is very small. For some x86 distribution, the NR_CPUS is 8192 > and nr_cpu

[PATCH][ipsec] xfrm: replace NR_CPU with num_possible_cpus()

2018-06-15 Thread Li RongQing
The default NR_CPUS can be very large, but actual possible nr_cpu_ids usually is very small. For some x86 distribution, the NR_CPUS is 8192 and nr_cpu_ids is 4. when xfrm_init is running, num_possible_cpus() should work Signed-off-by: Li RongQing Signed-off-by: Wang Li --- net/xfrm

[PATCH][v2] xfrm: replace NR_CPU with nr_cpu_ids

2018-06-19 Thread Li RongQing
The default NR_CPUS can be very large, but actual possible nr_cpu_ids usually is very small. For some x86 distribution, the NR_CPUS is 8192 and nr_cpu_ids is 4, so replace NR_CPU to save some memory Signed-off-by: Li RongQing Signed-off-by: Wang Li --- net/xfrm/xfrm_policy.c | 4 ++-- 1 file

[net-next][PATCH] tcp: probe timer MUST not less than 5 minuter for tcp PMTU

2018-06-01 Thread Li RongQing
RFC4821 say: The value for this timer MUST NOT be less than 5 minutes and is recommended to be 10 minutes, per RFC 1981. Signed-off-by: Li RongQing --- net/ipv4/sysctl_net_ipv4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4

[PATCH][net-next] net: increase MAX_GRO_SKBS to 64

2018-07-02 Thread Li RongQing
After 07d78363dcffd [net: Convert NAPI gro list into a small hash table] there is 8 hash buckets, which allow more flows to be held for merging. keep each as original list length, so increase MAX_GRO_SKBS to 64 Signed-off-by: Li RongQing --- net/core/dev.c | 3 +-- 1 file changed, 1 insertion

Re: [PATCH][net-next] net: increase MAX_GRO_SKBS to 64

2018-07-03 Thread Li RongQing
On 7/2/18, David Miller wrote: > From: Li RongQing > Date: Mon, 2 Jul 2018 19:41:43 +0800 > >> After 07d78363dcffd [net: Convert NAPI gro list into a small hash table] >> there is 8 hash buckets, which allow more flows to be held for merging. >> >> keep each as

答复: [PATCH][net-next] net: increase MAX_GRO_SKBS to 64

2018-07-02 Thread Li,Rongqing
发件人: David Miller [da...@davemloft.net] 发送时间: 2018年7月2日 19:44 收件人: Li,Rongqing 抄送: netdev@vger.kernel.org; eric.duma...@gmail.com 主题: Re: [PATCH][net-next] net: increase MAX_GRO_SKBS to 64 From: Li RongQing Date: Mon, 2 Jul 2018 19:41:43 +0800 >>

[PATCH] tcp: release sk_frag.page in tcp_disconnect

2018-01-26 Thread Li RongQing
socket can be disconnected and gets transformed back to a listening socket, if sk_frag.page is not released, which will be cloned into a new socket by sk_clone_lock, but the reference count of this page is increased, lead to a use after free or double free issue Signed-off-by: Li RongQing

答复: [PATCH] net: clean the sk_frag.page of new cloned socket

2018-01-25 Thread Li,Rongqing
> > if (newsk->sk_prot->sockets_allocated) > > sk_sockets_allocated_inc(newsk); > > Good catch. > > I suspect this was discovered by some syzkaller/syzbot run ? > No. I am seeing a panic, a page is in both task.task_frag.page and buddy free list; It should

答复: 答复: [PATCH] net: clean the sk_frag.page of new cloned socket

2018-01-25 Thread Li,Rongqing
> -邮件原件- > 发件人: Eric Dumazet [mailto:eric.duma...@gmail.com] > 发送时间: 2018年1月26日 11:14 > 收件人: Li,Rongqing <lirongq...@baidu.com>; netdev@vger.kernel.org > 抄送: eduma...@google.com > 主题: Re: 答复: [PATCH] net: clean the sk_frag.page of new cloned socket > > On

答复: 答复: [PATCH] net: clean the sk_frag.page of new cloned socket

2018-01-25 Thread Li,Rongqing
> > my kernel is 3.10, I did not find the root cause, I guest all kind of > > possibility > > > > Have you backported 22a0e18eac7a9e986fec76c60fa4a2926d1291e2 ? > > When I see this bug, I find this commit, and backport it, But this seems to not related to my bug. > > > I would rather move

[PATCH] net: clean the sk_frag.page of new cloned socket

2018-01-25 Thread Li RongQing
gets transformed back to a listening socket, will allocate an tcp_sock through sk_clone_lock() when a new connection comes in. Signed-off-by: Li RongQing <lirongq...@baidu.com> Cc: Eric Dumazet <eduma...@google.com> --- net/core/sock.c | 2 ++ 1 file changed, 2 insertions(+) diff --gi

[PATCH] net: propagate dev_get_valid_name return code

2018-06-19 Thread Li RongQing
if dev_get_valid_name failed, propagate its return code and remove the setting err to ENODEV, it will be set to 0 again before dev_change_net_namespace exits. Signed-off-by: Li RongQing --- net/core/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b

[PATCH][net-next] tun: not use hardcoded mask value

2018-08-03 Thread Li RongQing
0x3ff in tun_hashfn is mask of TUN_NUM_FLOW_ENTRIES, instead of hardcode, define a macro to setup the relationship with TUN_NUM_FLOW_ENTRIES Signed-off-by: Li RongQing --- drivers/net/tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/tun.c b/drivers/net

[PATCH][net-next] net: check extack._msg before print

2018-08-03 Thread Li RongQing
dev_set_mtu_ext is able to fail with a valid mtu value, at that condition, extack._msg is not set and random since it is in stack, then kernel will crash when print it. Fixes: 7a4c53bee3324a ("net: report invalid mtu value via netlink extack") Signed-off-by: Zhang Yu Signed-off-by: L

[PATCH][net-next] openvswitch: eliminate cpu_used_mask from sw_flow

2018-07-27 Thread Li RongQing
cpumask_first(cpu_possible_mask) 2: when get/clear statistic, reduce the iteratation; but it is not hot path, so use for_each_possible_cpu Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/openvswitch/flow.c | 11 +-- net/openvswitch/flow.h | 5 ++--- net

[PATCH][net-next][v2] packet: switch kvzalloc to allocate memory

2018-08-12 Thread Li RongQing
struct packet_ring_buffer, no longer need to save/restore 'order' *Remove variable 'order' for packet_set_ring, it is now unused Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/packet/af_packet.c | 44 +--- net/packet/internal.h | 1 - 2

[PATCH][net-next] packet: switch kvzalloc to allocate memory

2018-08-10 Thread Li RongQing
Use modern kvzalloc()/kvfree() instead of custom allocations. And remove order argument for free_pg_vec and alloc_pg_vec, this argument is useless to kvfree, or can get from req. Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/packet/af_packet.c | 40

[PATCH][net-next] vxlan: reduce dirty cache line in vxlan_find_mac

2018-08-18 Thread Li RongQing
ed-off-by: Zhang Yu Signed-off-by: Li RongQing --- drivers/net/vxlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index ababba37d735..e5d236595206 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -464,7 +464,7 @@ static

[PATCH][net-next] vxlan: reduce dirty cache line in vxlan_find_mac

2018-08-28 Thread Li RongQing
e line times, this gives 3% speed-up with small packets. Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- drivers/net/vxlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index ababba37d735..e5d236595206 100644 --- a/drive

[PATCH] netfilter: avoid stalls in nf_ct_alloc_hashtable

2018-07-24 Thread Li RongQing
create_new_namespaces copy_namespaces copy_process do_fork sys_clone stub_clone __clone not use the directly memory reclaim flag to avoid stall Signed-off-by: Ni Xun Signed-off-by: Zhang Yu Signed-off-by: Wang Li Signed-off-by: Li RongQing

答复: [PATCH] netfilter: avoid stalls in nf_ct_alloc_hashtable

2018-07-24 Thread Li,Rongqing
> -邮件原件- > 发件人: Florian Westphal [mailto:f...@strlen.de] > 发送时间: 2018年7月24日 17:20 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org; pa...@netfilter.org; > kad...@blackhole.kfki.hu; f...@strlen.de > 主题: Re: [PATCH] netfilter: avoid stalls in nf_ct_alloc_hashtable &g

答复: 答复: [PATCH] netfilter: avoid stalls in nf_ct_alloc_hashtable

2018-07-24 Thread Li,Rongqing
> > On 07/24/2018 02:50 AM, Li,Rongqing wrote: > > > Thanks, Your patch fixes my issue; > > > > My patch may be able to reduce stall when modprobe nf module in > memory > > stress, Do you think this patch has any value? > > Only if you make it use kvza

[PATCH][v2] netfilter: use kvzalloc to allocate memory for hashtable

2018-07-24 Thread Li RongQing
-off-by: Wang Li Signed-off-by: Li RongQing --- include/net/netfilter/nf_conntrack.h | 2 -- net/netfilter/nf_conntrack_core.c| 23 +-- net/netfilter/nf_conntrack_expect.c | 2 +- net/netfilter/nf_conntrack_helper.c | 4 ++-- net/netfilter/nf_nat_core.c | 4

答复: [PATCH][v2] netfilter: use kvzalloc to allocate memory for hashtable

2018-07-24 Thread Li,Rongqing
> -邮件原件- > 发件人: Eric Dumazet [mailto:eric.duma...@gmail.com] > 发送时间: 2018年7月25日 13:45 > 收件人: Li,Rongqing ; netdev@vger.kernel.org; > pa...@netfilter.org; kad...@blackhole.kfki.hu; f...@strlen.de; netfilter- > de...@vger.kernel.org; coret...@netfilter.org; eduma...@g

[PATCH][v3] netfilter: use kvmalloc_array to allocate memory for hashtable

2018-07-25 Thread Li RongQing
Signed-off-by: Zhang Yu Signed-off-by: Wang Li Signed-off-by: Li RongQing --- include/net/netfilter/nf_conntrack.h | 2 -- net/netfilter/nf_conntrack_core.c| 29 ++--- net/netfilter/nf_conntrack_expect.c | 2 +- net/netfilter/nf_conntrack_helper.c | 4 ++-- net

Re: [PATCH] netlink: fix hash::nelems check

2018-09-09 Thread Li RongQing
after reconsider, I think we can remove this check directly, since rht_grow_above_max() will be called to check the overflow again in rhashtable_insert_one. and atomic_read(>hash.nelems) always compares with unsigned value, will force to switch unsigned, so the hash.nelems overflows can be

[PATCH][net-next][v2] netlink: remove hash::nelems check in netlink_insert

2018-09-10 Thread Li RongQing
ed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/netlink/af_netlink.c | 5 - 1 file changed, 5 deletions(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index b4a29bcc33b9..e3a0538ec0be 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -574,11

[PATCH] netlink: fix hash::nelems check

2018-09-08 Thread Li RongQing
The type of hash::nelems has been changed from size_t to atom_t which is int in fact, and impossible to be bigger than UINT_MAX Fixes: 97defe1ecf86 ("rhashtable: Per bucket locks & deferred expansion/shrinking") Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/netlin

[PATCH][net-next][v2] net: limit each hash list length to MAX_GRO_SKBS

2018-07-05 Thread Li RongQing
but limit each hash list length to 8 skb, not the total 8 skb Signed-off-by: Li RongQing --- include/linux/netdevice.h | 7 +- net/core/dev.c| 56 +++ 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/include/linux/net

[PATCH][net-next] net: limit each hash list length to MAX_GRO_SKBS

2018-07-04 Thread Li RongQing
but limit each hash list length to 8 skb, not the total 8 skb Signed-off-by: Li RongQing --- include/linux/netdevice.h | 7 +- net/core/dev.c| 54 +++ 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/include/linux/net

[PATCH][net-next] net: replace num_possible_cpus with nr_cpu_ids

2018-07-06 Thread Li RongQing
The return of num_possible_cpus() is same as nr_cpu_ids, but nr_cpu_ids can reduce cpu computation Signed-off-by: Li RongQing --- net/core/dev.c | 4 ++-- net/ipv4/inet_hashtables.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/core/dev.c b/net/core

答复: [PATCH][net-next][v2] net: limit each hash list length to MAX_GRO_SKBS

2018-07-10 Thread Li,Rongqing
> -邮件原件- > 发件人: Eric Dumazet [mailto:eric.duma...@gmail.com] > 发送时间: 2018年7月8日 8:22 > 收件人: David Miller ; Li,Rongqing > > 抄送: netdev@vger.kernel.org > 主题: Re: [PATCH][net-next][v2] net: limit each hash list length to > MAX_GRO_SKBS > > > > On 07/

[PATCH] net: convert gro_count to bitmask

2018-07-11 Thread Li RongQing
of gro_hash, only flush a gro_hash element if the related bit is set, to speed up napi_gro_flush(). and update gro_bitmask only if it will be changed, to reduce cache update Suggested-by: Eric Dumazet Signed-off-by: Li RongQing --- include/linux/netdevice.h | 2 +- net/core/dev.c

答复: 答复: [PATCH][net-next] bridge: clean up mtu_set_by_user setting to false and comments

2018-07-13 Thread Li,Rongqing
> This is used to differentiate when auto adjust is used and when user has set > the MTU. > As I already said everything is working as expected and you should not > remove this code. > I see, thank you, and sorry for the noise. -R

[PATCH][net-next] bridge: clean up mtu_set_by_user setting to false and comments

2018-07-13 Thread Li RongQing
Once mtu_set_by_user is set to true, br_mtu_auto_adjust will not run, and no chance to clear mtu_set_by_user. and br_mtu_auto_adjust will run only if mtu_set_by_user is false, so not need to set it to false again Cc: Nikolay Aleksandrov Signed-off-by: Li RongQing --- net/bridge/br_device.c

[PATCH][net-next][v2] net: convert gro_count to bitmask

2018-07-13 Thread Li RongQing
of gro_hash, only flush a gro_hash element if the related bit is set, to speed up napi_gro_flush(). and update gro_bitmask only if it will be changed, to reduce cache update Suggested-by: Eric Dumazet Signed-off-by: Li RongQing Cc: Stefano Brivio --- netperf shows no difference, maybe because

答复: [PATCH][net-next] bridge: clean up mtu_set_by_user setting to false and comments

2018-07-13 Thread Li,Rongqing
> -邮件原件- > 发件人: Nikolay Aleksandrov [mailto:niko...@cumulusnetworks.com] > 发送时间: 2018年7月13日 16:01 > 收件人: Li,Rongqing ; netdev@vger.kernel.org > 主题: Re: [PATCH][net-next] bridge: clean up mtu_set_by_user setting to > false and comments > > On 13/07/18 09:47, Li

答复: [PATCH] net: convert gro_count to bitmask

2018-07-11 Thread Li,Rongqing
> -邮件原件- > 发件人: Stefano Brivio [mailto:sbri...@redhat.com] > 发送时间: 2018年7月11日 18:52 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org; Eric Dumazet > 主题: Re: [PATCH] net: convert gro_count to bitmask > > On Wed, 11 Jul 2018 17:15:53 +0800 > Li RongQing wrote:

答复: [PATCH] net: convert gro_count to bitmask

2018-07-11 Thread Li,Rongqing
> -邮件原件- > 发件人: Eric Dumazet [mailto:eric.duma...@gmail.com] > 发送时间: 2018年7月11日 19:32 > 收件人: Li,Rongqing ; netdev@vger.kernel.org > 主题: Re: [PATCH] net: convert gro_count to bitmask > > > > On 07/11/2018 02:15 AM, Li RongQing wrote: > > gro_hash si

答复: [PATCH] net: convert gro_count to bitmask

2018-07-11 Thread Li,Rongqing
> -邮件原件- > 发件人: David Miller [mailto:da...@davemloft.net] > 发送时间: 2018年7月12日 10:49 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org > 主题: Re: [PATCH] net: convert gro_count to bitmask > > From: Li RongQing > Date: Wed, 11 Jul 2018 17:15:53 +0800 > &

答复: [PATCH][net-next] net: ip tos cgroup

2018-04-18 Thread Li,Rongqing
> -邮件原件- > 发件人: Daniel Borkmann [mailto:dan...@iogearbox.net] > 发送时间: 2018年4月17日 22:11 > 收件人: Li,Rongqing <lirongq...@baidu.com> > 抄送: netdev@vger.kernel.org; t...@kernel.org; a...@fb.com; > bra...@fb.com > 主题: Re: [PATCH][net-next] net: ip tos cgroup >

[PATCH] net: net_cls: remove a NULL check for css_cls_state

2018-04-18 Thread Li RongQing
The input of css_cls_state() is impossible to NULL except cgrp_css_online, so simplify it Signed-off-by: Li RongQing <lirongq...@baidu.com> --- net/core/netclassid_cgroup.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/core/netclassid_cgroup.c b/ne

Re: [PATCH] net: net_cls: remove a NULL check for css_cls_state

2018-04-25 Thread Li RongQing
On 4/20/18, David Miller <da...@davemloft.net> wrote: > From: Li RongQing <lirongq...@baidu.com> > Date: Thu, 19 Apr 2018 12:59:21 +0800 > >> The input of css_cls_state() is impossible to NULL except >> cgrp_css_online, so simplify it >> >> Signed-off

[PATCH][net-next] net: ip tos cgroup

2018-04-16 Thread Li RongQing
>/cgroups/tos/ip_tos.tos 2. then move processes to cgroup, or create processes in cgroup Signed-off-by: jimyan <jim...@baidu.com> Signed-off-by: Li RongQing <lirongq...@baidu.com> --- include/linux/cgroup_subsys.h | 4 ++ include/net/tos_cgroup.h | 35 n

[PATCH] net: ip tos cgroup

2018-04-01 Thread Li RongQing
ups/tos/ip_tos.tos 2. then move processes to cgroup, or create processes in cgroup Signed-off-by: jimyan <jim...@baidu.com> Signed-off-by: Li RongQing <lirongq...@baidu.com> --- include/linux/cgroup_subsys.h | 4 ++ include/net/tos_cgroup.h | 46 ++ n

[PATCH] net: sched: do not emit messages while holding spinlock

2018-03-29 Thread Li RongQing
move messages emitting out of sch_tree_lock to avoid holding this lock too long. Signed-off-by: Li RongQing <lirongq...@baidu.com> --- net/sched/sch_htb.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 1ea984

[net-next][PATCH] net/ipv4: fix a net leak

2018-10-24 Thread Li RongQing
put net when input a invalid ifindex, otherwise it will be leaked Fixes: 5fcd266a9f64("net/ipv4: Add support for dumping addresses for a specific device") Cc: David Ahern Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/ipv4/devinet.c | 4 +++- 1 file changed, 3 insert

[PATCH][net-next] net/ipv6: compute anycast address hash only if dev is null

2018-11-07 Thread Li RongQing
avoid to compute the hash value if dev is not null, since hash value is not used Signed-off-by: Li RongQing --- net/ipv6/anycast.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 94999058e110..a20e344486cb 100644 --- a/net

[PATCH][net-next][v2] net/ipv6: compute anycast address hash only if dev is null

2018-11-07 Thread Li RongQing
avoid to compute the hash value if dev is not null, since hash value is not used Signed-off-by: Li RongQing --- net/ipv6/anycast.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 94999058e110..cca3b3603c42 100644 --- a/net

[PATCH][net-next] openvswitch: remove BUG_ON from get_dpdev

2018-11-08 Thread Li RongQing
if local is NULL pointer, and the following access of local's dev will trigger panic, which is same as BUG_ON Signed-off-by: Li RongQing --- net/openvswitch/vport-netdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c index

[PATCH][net-next] net: slightly optimize eth_type_trans

2018-11-12 Thread Li RongQing
of time reduce a comparision To unicast, and skb dst mac is not device mac, nothing change To multicast, increase a comparision Before: 1.03% [kernel] [k] eth_type_trans After: 0.78% [kernel] [k] eth_type_trans Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net

[PATCH][net-next][v2] net: remove BUG_ON from __pskb_pull_tail

2018-11-12 Thread Li RongQing
if list is NULL pointer, and the following access of list will trigger panic, which is same as BUG_ON Signed-off-by: Li RongQing --- net/core/skbuff.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 396fcb3baad0..d69503d66021 100644 --- a/net

答复: [PATCH][RFC] udp: cache sock to avoid searching it twice

2018-11-11 Thread Li,Rongqing
On Sat, Nov 10, 2018 at 1:29 AM Eric Dumazet wrote: > > > > On 11/08/2018 10:21 PM, Li RongQing wrote: > > GRO for UDP needs to lookup socket twice, first is in gro receive, > > second is gro complete, so if store sock to skb to avoid looking up > > twice, this ca

答复: [PATCH][RFC] udp: cache sock to avoid searching it twice

2018-11-11 Thread Li,Rongqing
> > return pp; > > } > > What if 'pp' is NULL? > > Aside from that, this replace a lookup with 2 atomic ops, and only when > such lookup is amortized on multiple aggregated packets: I'm unsure if > it's worthy and I don't understand how that improves RR tests (where > the

[PATCH][net-next] net: remove BUG_ON from __pskb_pull_tail

2018-11-12 Thread Li RongQing
if list is NULL pointer, and the following access of list will trigger panic, which is same as BUG_ON Signed-off-by: Li RongQing --- net/core/skbuff.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 396fcb3baad0..cd668b52f96f 100644 --- a/net/core

[PATCH][RFC] udp: cache sock to avoid searching it twice

2018-11-08 Thread Li RongQing
-by: Li RongQing --- net/ipv4/udp_offload.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index 0646d61f4fa8..429570112a33 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -408,6 +408,11

[PATCH][net-next] net: tcp: remove BUG_ON from tcp_v4_err

2018-11-09 Thread Li RongQing
if skb is NULL pointer, and the following access of skb's skb_mstamp_ns will trigger panic, which is same as BUG_ON Signed-off-by: Li RongQing --- net/ipv4/tcp_ipv4.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index a336787d75e5..5424a4077c27

[PATCH][xfrm-next] xfrm6: remove BUG_ON from xfrm6_dst_ifdown

2018-11-12 Thread Li RongQing
if loopback_idev is NULL pointer, and the following access of loopback_idev will trigger panic, which is same as BUG_ON Signed-off-by: Li RongQing --- net/ipv6/xfrm6_policy.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index d35bcf92969c

[PATCH][net-next] net: drop container_of in dst_cache_get_ip4

2018-09-29 Thread Li RongQing
we can save container_of computation and return dst directly, since dst is always first member of struct rtable, and any breaking will be caught by BUILD_BUG_ON in route.h include/net/route.h:BUILD_BUG_ON(offsetof(struct rtable, dst) != 0); Signed-off-by: Li RongQing --- net/core

[PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info

2018-09-29 Thread Li RongQing
we can save container_of computation and return dst directly, since dst is always first member of struct rt6_info Add a BUILD_BUG_ON() to catch any change that could break this assertion. Signed-off-by: Li RongQing --- include/net/ip6_route.h | 4 +++- net/ipv6/route.c| 6 +++--- 2

[PATCH] xfrm: fix gro_cells leak when remove virtual xfrm interfaces

2018-09-30 Thread Li RongQing
The device gro_cells has been initialized, it should be freed, otherwise it will be leaked Fixes: f203b76d78092faf2 ("xfrm: Add virtual xfrm interfaces") Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/xfrm/xfrm_interface.c | 3 +++ 1 file changed, 3 insertions(+) diff -

[PATCH][ipsec-next] xfrm: remove unnecessary check in xfrmi_get_stats64

2018-10-06 Thread Li RongQing
if tstats of a device is not allocated, this device is not registered correctly and can not be used. Signed-off-by: Li RongQing --- net/xfrm/xfrm_interface.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c index dc5b20bf29cf

[PATCH][ipsec-next] xfrm: use correct size to initialise sp->ovec

2018-10-06 Thread Li RongQing
This place should want to initialize array, not a element, so it should be sizeof(array) instead of sizeof(element) but now this array only has one element, so no error in this condition that XFRM_MAX_OFFLOAD_DEPTH is 1 Signed-off-by: Li RongQing --- net/xfrm/xfrm_input.c | 2 +- 1 file

Re: [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info

2018-09-30 Thread Li RongQing
> > I don't understand why you are doing this? It is not going to be > faster (or safer) than container_of. container_of provides the > same functionality and is safe against position of the member > in the structure. > In fact, most places are converting dst to rt6_info directly, and only few

Re: [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info

2018-09-30 Thread Li RongQing
> + BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0); > + please drop this patch, thanks since BUILD_BUG_ON has been added in ip6_fib.h include/net/ip6_fib.h: BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0); -Li

答复: [PATCH][next-next][v2] netlink: avoid to allocate full skb when sending to many devices

2018-09-20 Thread Li,Rongqing
: Re: [PATCH][next-next][v2] netlink: avoid to allocate full skb when > sending to many devices > > > > On 09/20/2018 06:43 AM, Eric Dumazet wrote: > > > Sorry, I should cc to you. > > And lastly this patch looks way too complicated to me. > > You probably can write something much simpler. >

[PATCH][next-next][v2] netlink: avoid to allocate full skb when sending to many devices

2018-09-20 Thread Li RongQing
one and send, to avoid to allocate full skb everytime. Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/netlink/af_netlink.c | 37 ++--- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c in

[PATCH][net-next] tun: align write-heavy flow entry members to a cache line

2018-12-06 Thread Li RongQing
they are changed to reduce the cache false-sharing. Signed-off-by: Zhang Yu Signed-off-by: Wang Li Signed-off-by: Li RongQing --- drivers/net/tun.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 835c73f42ae7..d0745dc81976 100644

[PATCH][net-next] tun: remove unnecessary check in tun_flow_update

2018-12-06 Thread Li RongQing
caller has guaranted that rxhash is not zero Signed-off-by: Li RongQing --- drivers/net/tun.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index d0745dc81976..6760b86547df 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c

答复: [PATCH][net-next] vhost:net: allocate 32KB memory instead of 32K pages when page frag refill

2018-11-22 Thread Li,Rongqing
On 2018/11/23 上午10:04, Li RongQing wrote: > >when page frag refills, 32K pages, 128MB memory is asked, it hardly > >successes when system has memory stress > Looking at get_order(), it seems we get 3 after get_order(32768) since it > accepts the size of block. You are r

[PATCH][net-next] vhost:net: allocate 32KB memory instead of 32K pages when page frag refill

2018-11-22 Thread Li RongQing
is used up so 32KB memory is safe choice, meanwhile, remove a unnecessary check Fixes: e4dab1e6ea64 ("vhost_net: mitigate page reference counting during page frag refill") Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- drivers/vhost/net.c | 22 +++--- 1 file c

[PATCH] net: fix the per task frag allocator size

2018-11-22 Thread Li RongQing
on x86)" Fixes: 5640f7685831e ("net: use a per task frag allocator") Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/core/sock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c index 6d7e189e3cd9..e3cbefeedf5c 100644 -

答复: [PATCH] net: fix the per task frag allocator size

2018-11-22 Thread Li,Rongqing
> get_order(8) returns zero here if I understood it correctly. You are right, I understood wrongly, Please drop this patch, sorry for the noise -Q

[PATCH][net-next] net: move definition of pcpu_lstats to header file

2018-09-14 Thread Li RongQing
pcpu_lstats is defined in several files, so unify them as one and move to header file Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- drivers/net/loopback.c| 6 -- drivers/net/nlmon.c | 6 -- drivers/net/vsockmon.c| 14 -- include/linux/netdevice.h

[PATCH][net-next] netlink: avoid to allocate full skb when sending to many devices

2018-09-17 Thread Li RongQing
dup deliver. Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/netlink/af_netlink.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index e3a0538ec0be..095b99e3c1fb 100644 --- a/net/netlink/af_netlink.c ++

答复: [PATCH][net-next] netlink: avoid to allocate full skb when sending to many devices

2018-09-18 Thread Li,Rongqing
> On 09/17/2018 10:26 PM, Li RongQing wrote: > > if skb->head is vmalloc address, when this skb is delivered, full > > allocation for this skb is required, if there are many devices, the > > --- > > net/netlink/af_netlink.c | 14 -- > > 1 file c

[PATCH][net-next] veth: rename pcpu_vstats as pcpu_lstats

2018-09-17 Thread Li RongQing
struct pcpu_vstats and pcpu_lstats have same members and usage, and pcpu_lstats is used in many files, so rename pcpu_vstats as pcpu_lstats to reduce duplicate definition Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- drivers/net/veth.c| 22 -- include/linux