Re: [PATCH net-next v6 1/4] net: vhost: lock the vqs one by one

2018-07-25 Thread Tonghao Zhang
On Sun, Jul 22, 2018 at 11:26 PM Michael S. Tsirkin wrote: > > On Sat, Jul 21, 2018 at 11:03:59AM -0700, xiangxia.m@gmail.com wrote: > > From: Tonghao Zhang > > > > This patch changes the way that lock all vqs > > at the same, to lock them one by one. It w

Re: [PATCH net-next v3 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-07-01 Thread Tonghao Zhang
On Mon, Jul 2, 2018 at 10:29 AM Jason Wang wrote: > > > > On 2018年06月30日 14:33, xiangxia.m@gmail.com wrote: > > From: Tonghao Zhang > > > > Factor out generic busy polling logic and will be > > used for tx path in the next patch. And with the

[PATCH] net: virtio: simplify the virtnet_find_vqs

2018-05-31 Thread Tonghao Zhang
Use the common free functions while return successfully. Signed-off-by: Tonghao Zhang --- drivers/net/virtio_net.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 8f08a3e..0eee6d6 100644 --- a/drivers/net

[PATCH] net: core: improve the tx_hash calculating

2018-05-31 Thread Tonghao Zhang
Use the % instead of while, and it may simple code and improve the calculating. The real_num_tx_queues has been checked when allocating and setting it. Signed-off-by: Tonghao Zhang --- net/core/dev.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net/core/dev.c b

[PATCH] bonding: introduce link change helper

2018-05-16 Thread Tonghao Zhang
Introduce an new common helper to avoid redundancy. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/bonding/bond_main.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/d

[PATCH 1/3] bonding: replace the return value type

2018-05-11 Thread Tonghao Zhang
The method ndo_start_xmit is defined as returning a netdev_tx_t, which is a typedef for an enum type, but the implementation in this driver returns an int. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/bonding/bond_alb.c | 8 drivers/net/bonding/bond_

[PATCH 3/3] net: doc: fix spelling mistake: "modrobe.d" -> "modprobe.d"

2018-05-11 Thread Tonghao Zhang
Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- Documentation/networking/bonding.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index 9ba04c0..c13214d 100644 --- a/Documen

[PATCH 2/3] bonding: use the skb_get/set_queue_mapping

2018-05-11 Thread Tonghao Zhang
Use the skb_get_queue_mapping, skb_set_queue_mapping and skb_rx_queue_recorded for skb queue_mapping in bonding driver, but not use it directly. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/bonding/bond_main.c | 8 1 file changed, 4 insertions(+), 4 del

[PATCH 1/3] bonding: replace the return value type

2018-05-11 Thread Tonghao Zhang
The method ndo_start_xmit is defined as returning a netdev_tx_t, which is a typedef for an enum type, but the implementation in this driver returns an int. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/bonding/bond_alb.c | 8 drivers/net/bonding/bond_

[PATCH v2 2/2] doc: Change the udp/sctp rmem/wmem default value.

2018-03-13 Thread Tonghao Zhang
The SK_MEM_QUANTUM was changed from PAGE_SIZE to 4096. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- Documentation/networking/ip-sysctl.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/netw

[PATCH v2 1/2] udp: Move the udp sysctl to namespace.

2018-03-13 Thread Tonghao Zhang
This patch moves the udp_rmem_min, udp_wmem_min to namespace and init the udp_l3mdev_accept explicitly. The udp_rmem_min/udp_wmem_min affect udp rx/tx queue, with this patch namespaces can set them differently. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- v2: use a common

Re: [PATCH 1/2] udp: Move the udp sysctl to namespace.

2018-03-13 Thread Tonghao Zhang
On Tue, Mar 13, 2018 at 7:36 PM, Paolo Abeni <pab...@redhat.com> wrote: > Hi, > > On Tue, 2018-03-13 at 02:57 -0700, Tonghao Zhang wrote: >> This patch moves the udp_rmem_min, udp_wmem_min >> to namespace and init the udp_l3mdev_accept explicitly. > > Can you pl

[PATCH 1/2] udp: Move the udp sysctl to namespace.

2018-03-13 Thread Tonghao Zhang
This patch moves the udp_rmem_min, udp_wmem_min to namespace and init the udp_l3mdev_accept explicitly. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- include/net/netns/ipv4.h | 3 ++ net/ipv4/sysctl_net_ipv4.c | 32 - net/ipv4/udp.c

[PATCH 2/2] doc: Change the udp/sctp rmem/wmem default value.

2018-03-13 Thread Tonghao Zhang
The SK_MEM_QUANTUM was changed from PAGE_SIZE to 4096. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- Documentation/networking/ip-sysctl.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/netw

Re: [PATCH] tcp: Support tcp socket allocated counter in namespace.

2018-02-28 Thread Tonghao Zhang
On Wed, Feb 28, 2018 at 10:41 PM, David Miller <da...@davemloft.net> wrote: > From: Tonghao Zhang <xiangxia.m@gmail.com> > Date: Wed, 28 Feb 2018 21:01:52 +0800 > >>> The amount of new conditional tests in these fast paths are not >>> justified for

Re: [PATCH] tcp: Support tcp socket allocated counter in namespace.

2018-02-28 Thread Tonghao Zhang
On Wed, Feb 14, 2018 at 1:19 AM, David Miller <da...@davemloft.net> wrote: > From: Tonghao Zhang <xiangxia.m@gmail.com> > Date: Mon, 12 Feb 2018 18:44:00 -0800 > >> Sometimes, we want to know how many tcp sockets are in use >> different _net_ names

[PATCH] tcp: Support tcp socket allocated counter in namespace.

2018-02-12 Thread Tonghao Zhang
a counter because the previous counter is used in proto(e.g tcp, udp and sctp) memory management. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- include/net/netns/ipv4.h | 3 +++ include/net/tcp.h| 2 ++ net/ipv4/proc.c | 2 +- net/ipv4/tcp.c | 2 +

[PATCH] doc: Change the min default value of tcp_wmem/tcp_rmem.

2018-02-04 Thread Tonghao Zhang
The SK_MEM_QUANTUM was changed from PAGE_SIZE to 4096. And the tcp_wmem/tcp_rmem min default values are 4096. Fixes: bd68a2a854ad ("net: set SK_MEM_QUANTUM to 4096") Cc: Eric Dumazet <eduma...@google.com> Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- Docum

Re: Compare length of req sock queue with sk_max_ack_backlog

2018-02-01 Thread Tonghao Zhang
On Fri, Feb 2, 2018 at 12:19 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Fri, 2018-02-02 at 09:55 +0800, Tonghao Zhang wrote: >> On Thu, Feb 1, 2018 at 10:00 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: >> > On Thu, 2018-02-01 at 20:34 +0800, Tongh

Re: Compare length of req sock queue with sk_max_ack_backlog

2018-02-01 Thread Tonghao Zhang
On Thu, Feb 1, 2018 at 10:00 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Thu, 2018-02-01 at 20:34 +0800, Tonghao Zhang wrote: >> Hi Eric >> One question for you, In the patch ef547f2ac16 ("tcp: remove >> max_qlen_log"), why we

Compare length of req sock queue with sk_max_ack_backlog

2018-02-01 Thread Tonghao Zhang
Hi Eric One question for you, In the patch ef547f2ac16 ("tcp: remove max_qlen_log"), why we compared the length of req sock queue with sk_max_ack_backlog. If we remove the max_qlen_log, we should check the length of req sock queue with tcp_max_syn_backlog, right ? With this patch, the option

[PATCH] ipv4: Get the address of interface correctly.

2018-01-28 Thread Tonghao Zhang
ow. Fixes: 03aef17bb79b3 ("devinet_ioctl(): take copyin/copyout to caller") Cc: Al Viro <v...@zeniv.linux.org.uk> Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/ipv4/devinet.c | 4 1 file changed, 4 insertions(+) diff --git a/net/ipv4/devinet.c b/net/ipv4/

[PATCH 2/2] ixgbe: Set rss key in order.

2018-01-23 Thread Tonghao Zhang
-most byte, and the LSB of K[k-1] is the right-most bit. 8.2.3.7.14 RSS Random Key Register: The K[0] is the 7:0 bit of RSSRK (RSS Random Key Register). Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 14 +++--- 1 file chang

[PATCH 1/2] ixgbe: Avoid to write the RETA table when unnecessary.

2018-01-23 Thread Tonghao Zhang
If indir == 0 in the ixgbe_set_rxfh(), it is unnecessary to write the HW. Because redirection table is not changed. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH v2] vhost: Remove the unused variable.

2018-01-09 Thread Tonghao Zhang
The patch (7235acdb1) changed the way of the work flushing in which the queued seq, done seq, and the flushing are not used anymore. Then remove them now. Fixes: 7235acdb1 ("vhost: simplify work flushing") Cc: Jason Wang <jasow...@redhat.com> Signed-off-by: Tonghao Zhang <xiang

[PATCH] vhost: Remove the unused variable.

2018-01-07 Thread Tonghao Zhang
The patch (7235acdb1) changed the way of the work flushing in which the queued seq, done seq, and the flushing are not used anymore. Then remove them now. Fixes: 7235acdb1 ("vhost: simplify work flushing") Cc: Jason Wang <jasow...@redhat.com> Signed-off-by: Tonghao Zhang <xiang

[PATCH v2] sctp: Replace use of sockets_allocated with specified macro.

2017-12-22 Thread Tonghao Zhang
("foundations of per-cgroup memory pressure controlling.") Cc: Glauber Costa <glom...@parallels.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- fix typo. --- net/sctp/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sctp/socket

[PATCH] stcp: Replace use of sockets_allocated with specified macro.

2017-12-22 Thread Tonghao Zhang
("foundations of per-cgroup memory pressure controlling.") Cc: Glauber Costa <glom...@parallels.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- net/sctp/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sctp/socket.c b/n

[PATCH] stcp: Replace use of sockets_allocated with specified macro.

2017-12-22 Thread Tonghao Zhang
("foundations of per-cgroup memory pressure controlling.") Cc: Glauber Costa <glom...@parallels.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- net/sctp/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sctp/socket.c b/n

[PATCH v7 2/3] sock: Move the socket inuse to namespace.

2017-12-14 Thread Tonghao Zhang
counter the socket-inuse in sock, for avoiding holding _net_ namespace again in socket. It's a easy way to maintain the code. Signed-off-by: Martin Zhang <zhangjunweimar...@didichuxing.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- include/net/netns/core.h | 3 +++

[PATCH v7 1/3] sock: Change the netns_core member name.

2017-12-14 Thread Tonghao Zhang
Change the member name will make the code more readable. This patch will be used in next patch. Signed-off-by: Martin Zhang <zhangjunweimar...@didichuxing.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- include/net/netns/core.h | 2 +- net/core/sock.c

[PATCH v7 3/3] sock: Hide unused variable when !CONFIG_PROC_FS.

2017-12-14 Thread Tonghao Zhang
Zhang <zhangjunweimar...@didichuxing.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- include/net/netns/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/netns/core.h b/include/net/netns/core.h index a5e8a66..36c2d99 100644 --- a/includ

Re: [PATCH v6 2/3] sock: Move the socket inuse to namespace.

2017-12-13 Thread Tonghao Zhang
On Wed, Dec 13, 2017 at 2:04 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Sun, Dec 10, 2017 at 7:12 AM, Tonghao Zhang <xiangxia.m@gmail.com> > wrote: >> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c >> index b797832..6c191fb 100644 >

[PATCH net-next] tcp: Remove tcp_low_latency sysctl.

2017-12-12 Thread Tonghao Zhang
The prequeue has been removed from the kernel. If we leave the tcp_low_latency in kernel, it may confuse the users. If users can't find the option, the doc may tell them why. So we remove also the sysctl about tcp_low_latency. Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.

Re: [PATCH v5 2/2] sock: Move the socket inuse to namespace.

2017-12-08 Thread Tonghao Zhang
On Sat, Dec 9, 2017 at 6:09 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Thu, Dec 7, 2017 at 9:28 PM, Tonghao Zhang <xiangxia.m@gmail.com> > wrote: >> >> Release the netlink sock created in kernel(not hold the _net_ namespace): >> > > You

Re: [PATCH v5 2/2] sock: Move the socket inuse to namespace.

2017-12-08 Thread Tonghao Zhang
On Fri, Dec 8, 2017 at 9:24 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Fri, 2017-12-08 at 19:29 +0800, Tonghao Zhang wrote: >> hi all. we can add synchronize_rcu and rcu_barrier in >> sock_inuse_exit_net to >> ensure there are no outstanding rcu callbacks usin

Re: [PATCH v5 2/2] sock: Move the socket inuse to namespace.

2017-12-08 Thread Tonghao Zhang
net *net) { free_percpu(net->core.prot_inuse); + + synchronize_rcu(); + rcu_barrier(); + + free_percpu(net->core.sock_inuse); } On Fri, Dec 8, 2017 at 5:52 PM, Tonghao Zhang <xiangxia.m@gmail.com> wrote: > On Fri, Dec 8, 2017 at 1:40 PM, Eric

Re: [PATCH v5 2/2] sock: Move the socket inuse to namespace.

2017-12-08 Thread Tonghao Zhang
On Fri, Dec 8, 2017 at 1:40 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Fri, 2017-12-08 at 13:28 +0800, Tonghao Zhang wrote: >> On Fri, Dec 8, 2017 at 1:20 AM, Eric Dumazet <eric.duma...@gmail.com> >> wrote: >> > On Thu, 2017-12-07 at 08:45 -0800, Tong

Re: [PATCH v5 2/2] sock: Move the socket inuse to namespace.

2017-12-07 Thread Tonghao Zhang
On Fri, Dec 8, 2017 at 1:20 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Thu, 2017-12-07 at 08:45 -0800, Tonghao Zhang wrote: >> In some case, we want to know how many sockets are in use in >> different _net_ namespaces. It's a key resource metric. >>

Re: [PATCH v4 2/2] sock: Move the socket inuse to namespace.

2017-12-07 Thread Tonghao Zhang
On Sat, Nov 25, 2017 at 10:53 PM, David Miller <da...@davemloft.net> wrote: > From: Tonghao Zhang <xiangxia.m@gmail.com> > Date: Wed, 22 Nov 2017 17:51:25 -0800 > >> This patch add a member in struct netns_core. And this is >> a counter for socket_inuse

[PATCH v5 2/2] sock: Move the socket inuse to namespace.

2017-12-07 Thread Tonghao Zhang
-by: Martin Zhang <zhangjunweimar...@didichuxing.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- include/net/netns/core.h | 1 + include/net/sock.h | 1 + net/core/sock.c | 52 ++-- net/socket.c

[PATCH v5 1/2] sock: Change the netns_core member name.

2017-12-07 Thread Tonghao Zhang
Change the member name will make the code more readable. This patch will be used in next patch. Signed-off-by: Martin Zhang <zhangjunweimar...@didichuxing.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- include/net/netns/core.h | 2 +- net/core/sock.c

[PATCH v4 2/2] sock: Move the socket inuse to namespace.

2017-11-22 Thread Tonghao Zhang
holding the _net_ namespace again. Signed-off-by: Martin Zhang <zhangjunweimar...@didichuxing.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- v3 --> v4: 1. add noop function for !CONF_PROC_FS case. 2. change the __this_cpu_add to this_cpu_add. This is reported b

[PATCH v4 1/2] sock: Change the netns_core member name.

2017-11-22 Thread Tonghao Zhang
Change the member name will make the code more readable. This patch will be used in next patch. Signed-off-by: Martin Zhang <zhangjunweimar...@didichuxing.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- include/net/netns/core.h | 2 +- net/core/sock.c

Re: [PATCH v3 2/2] sock: Move the socket inuse to namespace.

2017-11-16 Thread Tonghao Zhang
On Fri, Nov 17, 2017 at 4:20 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Wed, Nov 15, 2017 at 7:36 AM, Tonghao Zhang <xiangxia.m@gmail.com> > wrote: >> diff --git a/net/core/sock.c b/net/core/sock.c >> index b899d8669388..f01ed0b41bde 100644 >> ---

[PATCH v3 1/2] sock: Change the netns_core member name.

2017-11-15 Thread Tonghao Zhang
From: Tonghao Zhang <xiangxia.m@gmail.com> Change the member name will make the code more readable. This patch will be used in next patch. Signed-off-by: Martin Zhang <zhangjunweimar...@didichuxing.com> Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- includ

[PATCH v3 2/2] sock: Move the socket inuse to namespace.

2017-11-15 Thread Tonghao Zhang
From: Tonghao Zhang <xiangxia.m@gmail.com> This patch add a member in struct netns_core. and this is a counter for socket_inuse in the _net_ namespace. The patch will add/sub counter in the sk_alloc or sk_free. Because socket and sock is in pair. It's a easy way to maintain the code. an

Re: [PATCH v2 net-next] socket: Move the socket inuse to namespace.

2017-11-15 Thread Tonghao Zhang
On Wed, Nov 15, 2017 at 12:48 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Tue, Nov 14, 2017 at 3:17 AM, Tonghao Zhang <xiangxia.m@gmail.com> > wrote: >> Hi cong, we increase the socket inuse in sk_allock ? > > How about sock_init_data()? > >

Re: [PATCH v2 net-next] socket: Move the socket inuse to namespace.

2017-11-14 Thread Tonghao Zhang
<xiyou.wangc...@gmail.com> wrote: >>> >>> On Mon, Nov 13, 2017 at 4:36 AM, Tonghao Zhang <xiangxia.m@gmail.com> >>> wrote: >>>> From: Tonghao Zhang <xiangxia.m@gmail.com> >>>> >>>> This patch add a member in

Re: [PATCH v2 net-next] socket: Move the socket inuse to namespace.

2017-11-13 Thread Tonghao Zhang
Yes, thanks for your advise. I will modify, test it and then submit v3 On Tue, Nov 14, 2017 at 10:09 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Mon, Nov 13, 2017 at 4:36 AM, Tonghao Zhang <xiangxia.m@gmail.com> > wrote: >> From: Tonghao Zhang &

[PATCH v2 net-next] socket: Move the socket inuse to namespace.

2017-11-13 Thread Tonghao Zhang
From: Tonghao Zhang <xiangxia.m@gmail.com> This patch add a member in struct netns_core. and this is a counter for socket_inuse in the _net_ namespace. The patch will add/sub counter in the sock_alloc or sock_release. In the sock_alloc, the private data of inode saves the special _net_

[PATCH] socket: Move the socket inuse to namespace.

2017-11-13 Thread Tonghao Zhang
From: Tonghao Zhang <xiangxia.m@gmail.com> This patch add a member in struct netns_core. and this is a counter for socket_inuse in the _net_ namespace. The patch will add/sub counter in the sock_alloc or sock_release. In the sock_alloc, the private data of inode saves the special _net_

[PATCH] socket: add THIS_MODULE to sock_fs_type.

2017-11-10 Thread Tonghao Zhang
As important member of file_system_type, we set ->owner for sock_fs_type. Signed-off-by: Tonghao Zhang <zhangtong...@didichuxing.com> --- net/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/socket.c b/net/socket.c index c729625..b085f14 100644 --- a/net/socket.c

[PATCH] sock: Remove the global prot_inuse counter.

2017-11-09 Thread Tonghao Zhang
The per-cpu counter for init_net is prepared in core_initcall. The patch 7d720c3e ("percpu: add __percpu sparse annotations to net") and d6d9ca0fe ("net: this_cpu_xxx conversions") optimize the routines. Then remove the old counter. Cc: Pavel Emelyanov <xe...@openvz.org&

[PATCH] ixgbe: Remove an obsolete comment about ITR.

2017-10-30 Thread Tonghao Zhang
From: Tonghao Zhang <xiangxia.m@gmail.com> The InterruptThrottleRate has been removed from ixgbe. Then Update the comment. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 -- 1 file changed, 2 deletions(-) diff --g

Re: [PATCH] datapath: Fix an error handling path in 'ovs_nla_init_match_and_action()'

2017-09-12 Thread Tonghao Zhang
On Tue, Sep 12, 2017 at 3:20 AM, Christophe JAILLET wrote: > All other error handling paths in this function go through the 'error' > label. This one should do the same. > > Fixes: 9cc9a5cb176c ("datapath: Avoid using stack larger than 1024.") > Signed-off-by:

[PATCH net-next v3 2/2] tcp: Remove the unused parameter for tcp_try_fastopen.

2017-08-22 Thread Tonghao Zhang
Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- include/net/tcp.h | 3 +-- net/ipv4/tcp_fastopen.c | 6 ++ net/ipv4/tcp_input.c| 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index afdab3781425..a99500

[PATCH net-next v3 1/2] tcp: Get a proper dst before checking it.

2017-08-22 Thread Tonghao Zhang
tcp_peer_is_proven needs a proper route to make the determination, but dst always is NULL. This bug may be there at the beginning of git tree. This does not look serious enough to deserve backports to stable versions. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- ne

[PATCH net-next v3 0/2] Simplify the tcp_conn_request.

2017-08-22 Thread Tonghao Zhang
Just simplify the tcp_conn_request function. Tonghao Zhang (2): tcp: Get a proper dst before checking it. tcp: Remove the unused parameter for tcp_try_fastopen. include/net/tcp.h | 3 +-- net/ipv4/tcp_fastopen.c | 6 ++ net/ipv4/tcp_input.c| 11 +-- 3 files changed

Re: [PATCH net-next v2 1/2] tcp: Remove unnecessary dst check in tcp_conn_request.

2017-08-21 Thread Tonghao Zhang
On Mon, Aug 21, 2017 at 10:56 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > Please do not top post. Got it, thanks. > On Mon, 2017-08-21 at 21:24 +0800, Tonghao Zhang wrote: >> Thanks, yes this is a bug. I found this bug exists from 3.17~ 4.13. >> The commit is

Re: [PATCH net-next v2 1/2] tcp: Remove unnecessary dst check in tcp_conn_request.

2017-08-21 Thread Tonghao Zhang
tcp_tw_recycle has been removed. Thanks very much. On Sun, Aug 20, 2017 at 12:25 PM, David Miller <da...@davemloft.net> wrote: > From: Tonghao Zhang <xiangxia.m@gmail.com> > Date: Wed, 16 Aug 2017 20:02:45 -0700 > >> Because we remove the tcp_tw_recycle support i

[PATCH net-next v2 1/2] tcp: Remove unnecessary dst check in tcp_conn_request.

2017-08-16 Thread Tonghao Zhang
check. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/ipv4/tcp_input.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d73903f..7eee2c7 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c

[PATCH net-next v2 2/2] tcp: Remove the unused parameter for tcp_try_fastopen.

2017-08-16 Thread Tonghao Zhang
The parameter dst of tcp_try_fastopen and tcp_fastopen_create_child is not used anymore. We remove it. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- include/net/tcp.h | 3 +-- net/ipv4/tcp_fastopen.c | 6 ++ net/ipv4/tcp_input.c| 2 +- 3 files changed, 4 inse

[PATCH net-next v2 0/2] simplify the tcp_conn_request.

2017-08-16 Thread Tonghao Zhang
These patches are not bugfix. But just simplify the tcp_conn_request function. These patches are based on Davem's net-next tree. Tonghao Zhang (2): tcp: Remove unnecessary dst check in tcp_conn_request. tcp: Remove the unused parameter for tcp_try_fastopen. include/net/tcp.h | 3

Re: [PATCH 1/2] tcp: Remove unnecessary dst check in tcp_conn_request.

2017-08-16 Thread Tonghao Zhang
On Wed, Aug 16, 2017 at 10:44 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Wed, 2017-08-16 at 06:31 -0700, Tonghao Zhang wrote: >> Because we remove the tcp_tw_recycle support in the commit > > >> 4396e46187c ('tcp: remove tcp_tw_recycle') and also delete >

[PATCH net-next v2 1/2] tcp: Remove unnecessary dst check in tcp_conn_request.

2017-08-16 Thread Tonghao Zhang
check. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/ipv4/tcp_input.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d73903f..7eee2c7 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c

[PATCH net-next v2 0/2] simplify the tcp_conn_request.

2017-08-16 Thread Tonghao Zhang
These patches are not bugfix. But just simplify the tcp_conn_request function. These patches are based on Davem's net-next tree. Tonghao Zhang (2): tcp: Remove unnecessary dst check in tcp_conn_request. tcp: Remove the unused parameter for tcp_try_fastopen. include/net/tcp.h | 3

[PATCH 2/2] tcp: Remove the unused parameter for tcp_try_fastopen.

2017-08-16 Thread Tonghao Zhang
Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- include/net/tcp.h | 3 +-- net/ipv4/tcp_fastopen.c | 6 ++ net/ipv4/tcp_input.c| 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index afdab3781425..a99500

[PATCH 1/2] tcp: Remove unnecessary dst check in tcp_conn_request.

2017-08-16 Thread Tonghao Zhang
check. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/ipv4/tcp_input.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d73903fe8c83..7eee2c7ddb7a 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4

[PATCH] net: Fix a typo in comment about sock flags.

2017-08-15 Thread Tonghao Zhang
Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- include/linux/net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/net.h b/include/linux/net.h index b5c15b3..d97d80d 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -37,7

[PATCH net-next] net: skb_needs_check() removes CHECKSUM_UNNECESSARY check for tx.

2017-08-10 Thread Tonghao Zhang
Because we remove the UFO support, we will also remove the CHECKSUM_UNNECESSARY check in skb_needs_check(). Cc: Willem de Bruijn <will...@google.com> Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/core/dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

Re: [PATCH net-next] net: skb_needs_check() removes CHECKSUM_NONE check for tx.

2017-08-10 Thread Tonghao Zhang
mdebruijn.ker...@gmail.com> wrote: > On Wed, Aug 9, 2017 at 6:02 PM, Tonghao Zhang <xiangxia.m@gmail.com> > wrote: >> Thanks for your work. > > You, too. > >> On Thu, Aug 10, 2017 at 2:30 AM, Willem de Bruijn >> <willemdebruijn.ker...@gmail.com> wrote:

Re: [PATCH net-next] skbuff: Add BUG_ON in skb_init.

2017-08-10 Thread Tonghao Zhang
= { On Thu, Aug 10, 2017 at 1:49 PM, David Miller <da...@davemloft.net> wrote: > From: Tonghao Zhang <xiangxia.m@gmail.com> > Date: Wed, 9 Aug 2017 05:04:38 -0700 > >> When initializing the skbuff SLAB cache, we should make >> sure it is successful. Adding BUG_ON t

Re: [PATCH net-next] net: skb_needs_check() removes CHECKSUM_NONE check for tx.

2017-08-09 Thread Tonghao Zhang
Thanks for your work. On Thu, Aug 10, 2017 at 2:30 AM, Willem de Bruijn <willemdebruijn.ker...@gmail.com> wrote: > On Wed, Aug 9, 2017 at 5:04 AM, Tonghao Zhang <xiangxia.m@gmail.com> > wrote: >> This patch reverts the commit 6e7bc478c9a0 >> ("net: skb_

Re: [PATCH] net: Reduce skb_warn_bad_offload() noise.

2017-08-09 Thread Tonghao Zhang
Thanks, I send a patch, which will revert commit 6e7bc478c9a0 in net-next. On Wed, Aug 9, 2017 at 1:46 AM, Willem de Bruijn wrote: >>> @@ -2670,6 +2670,7 @@ static inline bool skb_needs_check(struct >>> sk_buff *skb, bool tx_path) >>> { >>> if (tx_path)

[PATCH net-next] net: skb_needs_check() removes CHECKSUM_NONE check for tx.

2017-08-09 Thread Tonghao Zhang
This patch reverts the commit 6e7bc478c9a0 ("net: skb_needs_check() accepts CHECKSUM_NONE for tx"), because we removed the UFO support. Cc: Eric Dumazet <eduma...@google.com> Cc: Willem de Bruijn <will...@google.com> Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com

[PATCH net-next] skbuff: Add BUG_ON in skb_init.

2017-08-09 Thread Tonghao Zhang
When initializing the skbuff SLAB cache, we should make sure it is successful. Adding BUG_ON to check it and init_inodecache() is in the same case. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/core/skbuff.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ne

Re: [PATCH] net: Reduce skb_warn_bad_offload() noise.

2017-08-07 Thread Tonghao Zhang
c7 80 65 ac 8f 31 c0 e8 a7 bd a5 ff <0f> ff 48 83 c4 18 5b 41 5c 5d c3 55 48 89 f2 31 c0 89 fe 48 c7 [ 1291.596447] ---[ end trace b66534f41f98ceda ]--- On Tue, Aug 8, 2017 at 7:44 AM, Tonghao Zhang <xiangxia.m@gmail.com> wrote: > That is fine to me. I have tested it. Thanks

Re: [PATCH] net: Reduce skb_warn_bad_offload() noise.

2017-08-07 Thread Tonghao Zhang
That is fine to me. I have tested it. Thanks. On Mon, Aug 7, 2017 at 12:42 PM, Willem de Bruijn wrote: >> The openvswitch kernel module calls the __skb_gso_segment()(and sets >> tx_path = false) when passing packets to userspace. The UFO will set >> the ip_summed

Re: [PATCH] net: Reduce skb_warn_bad_offload() noise.

2017-08-06 Thread Tonghao Zhang
On Fri, Aug 4, 2017 at 9:29 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Fri, 2017-08-04 at 06:11 -0700, Tonghao Zhang wrote: >> This patch will revert the b2504a5dbe "net: reduce >> skb_warn_bad_offload() noise". The ovs will call the >> __skb_gso_seg

[PATCH] net: Reduce skb_warn_bad_offload() noise.

2017-08-04 Thread Tonghao Zhang
e] [] validate_xmit_skb+0x5c9/0xc20 net/core/dev.c:2969 [] __dev_queue_xmit+0xe6b/0x1e70 net/core/dev.c:3383 [] dev_queue_xmit+0x17/0x20 net/core/dev.c:3424 Cc: Eric Dumazet <eduma...@google.com> Cc: Willem de Bruijn <will...@google.com> Cc: Pravin B Shelar <pshe...@ovn.org>

[PATCH] ipv4: Introduce ipip_offload_init helper function.

2017-08-02 Thread Tonghao Zhang
It's convenient to init ipip offload. We will check the return value, and print KERN_CRIT info on failure. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/ipv4/af_inet.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/ipv4/af_inet.c b/ne

[PATCH 2/3] drivers/net: Compare pointer-typed values to NULL rather than 0.

2017-07-25 Thread Tonghao Zhang
This makes an effort to choose between !x and x == NULL. 1. drivers/net/ethernet/nxp/lpc_eth.c 2. drivers/net/ethernet/amd/declance.c Generated by: scripts/coccinelle/null/badzero.cocci Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/ethernet/amd/declance

[PATCH 1/3] drivers/net: Fix ptr_ret.cocci warnings.

2017-07-25 Thread Tonghao Zhang
we can use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR 1. drivers/net/appletalk/ipddp.c 2. drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/app

[PATCH 3/3] drivers/net: Unsigned expressions cannot be lesser than zero.

2017-07-25 Thread Tonghao Zhang
QUICC_ENGINE) on failure. Generated by: scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci Fix c19b6d24('drivers/net: support hdlc function for QE-UCC') Cc: Zhao Qiang <qiang.z...@nxp.com> Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/wan/fsl_ucc_hdlc.c | 9

[PATCH] drivers/net: Fix ptr_ret.cocci warnings.

2017-07-25 Thread Tonghao Zhang
we can use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR 1. drivers/net/appletalk/ipddp.c 2. drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/app

Re: [PATCH] tun/tap: Add the missed return value check of register_netdevice_notifier

2017-07-24 Thread Tonghao Zhang
e check now. >> >> Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> > > Applied.

[PATCH] tun/tap: Add the missed return value check of register_netdevice_notifier

2017-07-20 Thread Tonghao Zhang
There is some codes of tun/tap module which did not check the return value of register_netdevice_notifier. Add the check now. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- drivers/net/tun.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH v2 1/2] openvswitch: Optimize updating for OvS flow_stats.

2017-07-18 Thread Tonghao Zhang
In the ovs_flow_stats_update(), we only use the node var to alloc flow_stats struct. But this is not a common case, it is unnecessary to call the numa_node_id() everytime. This patch is not a bugfix, but there maybe a small increase. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.

[PATCH v2 2/2] openvswitch: Optimize operations for OvS flow_stats.

2017-07-18 Thread Tonghao Zhang
all possible cpu when getting, cleaning, and updating the flow_stats. Adding the cpu_used_mask to sw_flow struct does’t increase the cacheline number. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> Acked-by: Pravin B Shelar <pshe...@ovn.org> --- net/openvswitch/flow.c | 7

Re: [ovs-dev] [PATCH 2/2] openvswitch: Optimize operations for OvS flow_stats.

2017-07-17 Thread Tonghao Zhang
check all possible cpu when getting, >> cleaning, and updating the flow_stats. Adding the cpu_used_mask to >> sw_flow struct does’t increase the cacheline number. >> >> Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> > > Patch looks good to me. I have one comment. Thanks. I will sent v2 and add “Acked-by”.

[PATCH 2/2] openvswitch: Optimize operations for OvS flow_stats.

2017-07-17 Thread Tonghao Zhang
all possible cpu when getting, cleaning, and updating the flow_stats. Adding the cpu_used_mask to sw_flow struct does’t increase the cacheline number. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/openvswitch/flow.c | 7 --- net/openvswitch/flow.h | 2 +

[PATCH 1/2] openvswitch: Optimize updating for OvS flow_stats.

2017-07-17 Thread Tonghao Zhang
In the ovs_flow_stats_update(), we only use the node var to alloc flow_stats struct. But this is not a common case, it is unnecessary to call the numa_node_id() everytime. This patch is not a bugfix, but there maybe a small increase. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.

[PATCH 1/2] openvswitch: Optimize updating for OvS flow_stats.

2017-07-10 Thread Tonghao Zhang
In the ovs_flow_stats_update(), we only use the node var to alloc flow_stats struct. But this is not a common case, it is unnecessary to call the numa_node_id() everytime. This patch is not a bugfix, but there maybe a small increase. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.

[PATCH 2/2] openvswitch: Optimize operations for OvS flow_stats.

2017-07-10 Thread Tonghao Zhang
all possible cpu when getting, cleaning, and updating the flow_stats. Adding the cpu_used_mask to sw_flow struct does’t increase the cacheline number. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/openvswitch/flow.c | 7 --- net/openvswitch/flow.h | 2 +

Re: [PATCH v3] datapath: Avoid using stack larger than 1024.

2017-06-29 Thread Tonghao Zhang
Thanks for your works. I send v3 for net-next and add "Acked-by". If it is applied, I will backport it to d...@openvswitch.org. On Fri, Jun 30, 2017 at 1:45 AM, Pravin Shelar <pshe...@ovn.org> wrote: > On Wed, Jun 28, 2017 at 6:38 PM, Tonghao Zhang <xiangxia.m@gmail.

[PATCH v3] datapath: Avoid using stack larger than 1024.

2017-06-28 Thread Tonghao Zhang
1024 bytes [-Wframe-larger-than=] This patch factors out match-init and action-copy to avoid "Wframe-larger-than=1024" warning. Because mask is only used to get actions, we new a function to save some stack space. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- dat

[PATCH v2] datapath: Avoid using stack larger than 1024.

2017-06-27 Thread Tonghao Zhang
1024 bytes [-Wframe-larger-than=] This patch factors out match-init and action-copy to avoid "Wframe-larger-than=1024" warning. Because mask is only used to get actions, we new a function to save some stack space. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- dat

[PATCH] datapath: Avoid using stack larger than 1024.

2017-06-27 Thread Tonghao Zhang
1024 bytes [-Wframe-larger-than=] This patch use kmalloc to malloc mem for sw_flow_mask and avoid using stack. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- net/openvswitch/datapath.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/net/openv

[PATCH] datapath: Avoid using stack larger than 1024.

2017-06-27 Thread Tonghao Zhang
1024 bytes [-Wframe-larger-than=] This patch use kmalloc to malloc mem for sw_flow_mask and avoid using stack. Signed-off-by: Tonghao Zhang <xiangxia.m@gmail.com> --- datapath/datapath.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/datapath/datapa

  1   2   >