[PATCH][net-next,v2] virtio_net: Remove u64_stats_update_begin()/end() for stats fetch

2024-06-21 Thread Li RongQing
This place is fetching the stats, u64_stats_update_begin()/end() should not be used, and the fetcher of stats is in the same context as the updater of the stats, so don't need any protection Suggested-by: Jakub Kicinski Signed-off-by: Li RongQing --- drivers/net/virtio_net.c | 4 ++-- 1

RE: [????] Re: [PATCH] virtio_net: Use u64_stats_fetch_begin() for stats fetch

2024-06-20 Thread Li,Rongqing
> Did you by any chance use an automated tool of any sort to find this issue or > generate the fix? > > I don't think this is actually necessary here, you're in the same context as > the > updater of the stats, you don't need any protection. > You can remove u64_stats_update_begin() / end() (in n

[PATCH] virtio_net: Use u64_stats_fetch_begin() for stats fetch

2024-06-18 Thread Li RongQing
This place is fetching the stats, so u64_stats_fetch_begin and u64_stats_fetch_retry should be used Fixes: 6208799553a8 ("virtio-net: support rx netdim") Signed-off-by: Li RongQing --- drivers/net/virtio_net.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) di

[PATCH][v2] igb: avoid premature Rx buffer reuse

2021-01-13 Thread Li RongQing
ch means that the skb data area is passed to the Rx HW ring! To work around this, the page count is stored prior calling xdp_do_redirect(). Fixes: 9cbc948b5a20 ("igb: add XDP support") Signed-off-by: Li RongQing --- drivers/net/ethernet/intel/igb/igb_main.c | 22 +++--- 1

RE: [PATCH] igb: avoid premature Rx buffer reuse

2021-01-12 Thread Li,Rongqing
> -Original Message- > From: Alexander Duyck [mailto:alexander.du...@gmail.com] > Sent: Wednesday, January 13, 2021 5:23 AM > To: Li,Rongqing > Cc: Netdev ; intel-wired-lan > ; Björn Töpel > Subject: Re: [PATCH] igb: avoid premature Rx buffer r > Okay, this exp

RE: [PATCH] igb: avoid premature Rx buffer reuse

2021-01-11 Thread Li,Rongqing
> -Original Message- > From: Alexander Duyck [mailto:alexander.du...@gmail.com] > Sent: Tuesday, January 12, 2021 4:54 AM > To: Li,Rongqing > Cc: Netdev ; intel-wired-lan > ; Björn Töpel > Subject: Re: [PATCH] igb: avoid premature Rx buffer reuse > > On Wed

[PATCH] igb: avoid premature Rx buffer reuse

2021-01-06 Thread Li RongQing
(). Fixes: 9cbc948b5a20 ("igb: add XDP support") Signed-off-by: Li RongQing Cc: Björn Töpel --- drivers/net/ethernet/intel/igb/igb_main.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/ne

[PATCH][V2] libbpf: add support for canceling cached_cons advance

2020-11-23 Thread Li RongQing
returning or cancelling a number of them so that they are returned to the ring. This patch adds a new function called xsk_ring_cons__cancel that performs this operation on nb descriptors counted from the end of the batch of descriptors that was received through the peek call. Signed-off-by: Li

RE: [PATCH] libbpf: add support for canceling cached_cons advance

2020-11-23 Thread Li,Rongqing
> -Original Message- > From: Magnus Karlsson [mailto:magnus.karls...@gmail.com] > Sent: Monday, November 23, 2020 5:40 PM > To: Li,Rongqing > Cc: Network Development ; bpf > > Subject: Re: [PATCH] libbpf: add support for canceling cached_cons advance > > O

[PATCH] libbpf: add support for canceling cached_cons advance

2020-11-22 Thread Li RongQing
It is possible to fail receiving packets after calling xsk_ring_cons__peek, at this condition, cached_cons has been advanced, should be cancelled. Signed-off-by: Li RongQing --- tools/lib/bpf/xsk.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/lib/bpf/xsk.h b/tools/lib/bpf

[PATCH][next][v2] iavf: use kvzalloc instead of kzalloc for rx/tx_bi buffer

2020-08-27 Thread Li RongQing
reduce TLB pressure than vmalloc as suggested by Eric Dumazet Signed-off-by: Li RongQing --- v2: __GFP_RETRY_MAYFAIL is used drivers/net/ethernet/intel/iavf/iavf_txrx.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b

RE: [PATCH] iavf: use kvzalloc instead of kzalloc for rx/tx_bi buffer

2020-08-27 Thread Li,Rongqing
> -Original Message- > From: Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: Thursday, August 27, 2020 5:55 PM > To: Li,Rongqing ; Eric Dumazet > ; netdev@vger.kernel.org; > intel-wired-...@lists.osuosl.org > Subject: Re: [PATCH] iavf: use kvzalloc instead of

RE: [PATCH] iavf: use kvzalloc instead of kzalloc for rx/tx_bi buffer

2020-08-27 Thread Li,Rongqing
> -Original Message- > From: Eric Dumazet [mailto:eric.duma...@gmail.com] > Sent: Thursday, August 27, 2020 4:26 PM > To: Li,Rongqing ; netdev@vger.kernel.org; > intel-wired-...@lists.osuosl.org > Subject: Re: [PATCH] iavf: use kvzalloc instead of kzalloc f

[PATCH] iavf: use kvzalloc instead of kzalloc for rx/tx_bi buffer

2020-08-27 Thread Li RongQing
when changes the rx/tx ring to 4096, kzalloc may fail due to a temporary shortage on slab entries. kvmalloc is used to allocate this memory as there is no need to have this memory area physical continuously. Signed-off-by: Li RongQing --- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 12

RE: [PATCH net 2/3] ixgbe: avoid premature Rx buffer reuse

2020-08-25 Thread Li,Rongqing
ev@vger.kernel.org; > maciej.fijalkow...@intel.com; piotr.raczyn...@intel.com; > maciej.machnikow...@intel.com; Li,Rongqing > Subject: [PATCH net 2/3] ixgbe: avoid premature Rx buffer reuse > > From: Björn Töpel > > The page recycle code, incorrectly, relied on that a page

RE: [PATCH net 3/3] ice: avoid premature Rx buffer reuse

2020-08-25 Thread Li,Rongqing
ev@vger.kernel.org; > maciej.fijalkow...@intel.com; piotr.raczyn...@intel.com; > maciej.machnikow...@intel.com; Li,Rongqing > Subject: [PATCH net 3/3] ice: avoid premature Rx buffer reuse > > From: Björn Töpel > > The page recycle code, incorrectly, relied on that a page

[PATCH][next] i40e: switch kvzalloc to allocate rx/tx_bi buffer

2020-08-21 Thread Li RongQing
ksys_ioctl+0x70/0x80 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x5b/0x1b0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Li RongQing --- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 10 +- 2 files changed, 6 insertions(+), 6

答复: 答复: [Intel-wired-lan] [PATCH 0/2] intel/xdp fixes for fliping rx buffer

2020-08-19 Thread Li,Rongqing
> -邮件原件- > 发件人: Björn Töpel [mailto:bjorn.to...@intel.com] > 发送时间: 2020年8月19日 14:45 > 收件人: Li,Rongqing ; Björn Töpel > > 抄送: Netdev ; intel-wired-lan > ; Karlsson, Magnus > ; bpf ; Maciej Fijalkowski > ; Piotr ; Maciej > > 主题: Re: 答复: [Intel-wired-lan

答复: [Intel-wired-lan] [PATCH 0/2] intel/xdp fixes for fliping rx buffer

2020-08-18 Thread Li,Rongqing
> -邮件原件- > 发件人: Björn Töpel [mailto:bjorn.to...@gmail.com] > 发送时间: 2020年8月18日 22:05 > 收件人: Li,Rongqing > 抄送: Netdev ; intel-wired-lan > ; Karlsson, Magnus > ; Björn Töpel ; bpf > ; Maciej Fijalkowski ; > Piotr ; Maciej > 主题: Re: [Intel-wired-lan] [PATCH 0/

[PATCH][v3] i40e: optimise prefetch page refcount

2020-08-18 Thread Li RongQing
b Kicinski Signed-off-by: Li RongQing --- diff with v2: fix a build warning -Wvisibility diff with v1: create a common function prefetch_page_address drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- include/linux/prefetch.h| 8 2 files changed, 9 insertions(+),

[PATCH][v2] i40e: optimise prefetch page refcount

2020-07-31 Thread Li RongQing
ess(), but which accesses struct page only when WANT_PAGE_VIRTUAL or HASHED_PAGE_VIRTUAL is defined otherwise it returns address based on offset, so we prefetch it conditionally Jakub suggested to define prefetch_page_address in a common header Suggested-by: Jakub Kicinski Signed-off-by: L

答复: [net-next 2/6] i40e: prefetch struct page of Rx buffer conditionally

2020-07-29 Thread Li,Rongqing
> -邮件原件- > 发件人: Jakub Kicinski [mailto:k...@kernel.org] > 发送时间: 2020年7月30日 5:20 > 收件人: Li,Rongqing > 抄送: Tony Nguyen ; da...@davemloft.net; > netdev@vger.kernel.org; nhor...@redhat.com; sassm...@redhat.com; > jeffrey.t.kirs...@intel.com; Andrew Bowers > 主题:

答复: [net-next 2/6] i40e: prefetch struct page of Rx buffer conditionally

2020-07-28 Thread Li,Rongqing
> -邮件原件- > 发件人: Jakub Kicinski [mailto:k...@kernel.org] > 发送时间: 2020年7月29日 4:14 > 收件人: Tony Nguyen > 抄送: da...@davemloft.net; Li,Rongqing ; > netdev@vger.kernel.org; nhor...@redhat.com; sassm...@redhat.com; > jeffrey.t.kirs...@intel.com; Andrew Bowers > 主题:

[PATCH 1/2] xdp/i40e/ixgbe: not flip rx buffer for copy mode xdp

2020-07-24 Thread Li RongQing
receive functions and poll support") Signed-off-by: Li RongQing Signed-off-by: Dongsheng Rong --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 5 - drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 - include/linux/filter.h| 11 +++ 3 files changed,

[PATCH 2/2] ice/xdp: not adjust rx buffer for copy mode xdp

2020-07-24 Thread Li RongQing
OOL, or map type is not BPF_MAP_TYPE_XSKMAP which means that memory will be released immediately Fixes: 2d4238f55697 ("ice: Add support for AF_XDP") Signed-off-by: Li RongQing --- drivers/net/ethernet/intel/ice/ice_txrx.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

答复: [Intel-wired-lan] [PATCH 1/2] xdp: i40e: ixgbe: ixgbevf: not flip rx buffer for copy mode xdp

2020-07-21 Thread Li,Rongqing
> -邮件原件- > 发件人: Li,Rongqing > 发送时间: 2020年7月21日 9:43 > 收件人: 'Magnus Karlsson' > 抄送: Network Development ; intel-wired-lan > ; Karlsson, Magnus > ; Björn Töpel > 主题: 答复: [Intel-wired-lan] [PATCH 1/2] xdp: i40e: ixgbe: ixgbevf: not flip rx > buffer for

答复: [Intel-wired-lan] [PATCH 1/2] xdp: i40e: ixgbe: ixgbevf: not flip rx buffer for copy mode xdp

2020-07-20 Thread Li,Rongqing
> -邮件原件- > 发件人: Magnus Karlsson [mailto:magnus.karls...@gmail.com] > 发送时间: 2020年7月20日 15:21 > 收件人: Li,Rongqing > 抄送: Network Development ; intel-wired-lan > ; Karlsson, Magnus > ; Björn Töpel > 主题: Re: [Intel-wired-lan] [PATCH 1/2] xdp: i40e: ixgbe: ixgbevf:

[PATCH 1/2] xdp: i40e: ixgbe: ixgbevf: not flip rx buffer for copy mode xdp

2020-07-16 Thread Li RongQing
nowledge whether to flip rx buffer Fixes: c497176cb2e4 ("xsk: add Rx receive functions and poll support") Signed-off-by: Li RongQing Signed-off-by: Dongsheng Rong --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 5 - drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5

[PATCH 2/2] ice/xdp: not adjust rx buffer for copy mode xdp

2020-07-16 Thread Li RongQing
xes: 2d4238f55697 ("ice: Add support for AF_XDP") Signed-off-by: Li RongQing --- drivers/net/ethernet/intel/ice/ice_txrx.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c index

[PATCH 0/2] intel/xdp fixes for fliping rx buffer

2020-07-16 Thread Li RongQing
This fixes ice/i40e/ixgbe/ixgbevf_rx_buffer_flip in copy mode xdp that can lead to data corruption. I split two patches, since i40e/xgbe/ixgbevf supports xsk receiving from 4.18, put their fixes in a patch Li RongQing (2): xdp: i40e: ixgbe: ixgbevf: not flip rx buffer for copy mode xdp ice

答复: [Intel-wired-lan] [bug ?] i40e_rx_buffer_flip should not be called for redirected xsk copy mode

2020-07-15 Thread Li,Rongqing
> > > > > > > > Thank you RongQing for reporting this. I will take a look at it > > > > and produce a patch. > > > > > > > > /Magnus > > > > > > > Ping > > My apologies RongQing, but it is taking longer than expected due to key people > being on vacation during this summer period. We are debating

答复: [Intel-wired-lan] [bug ?] i40e_rx_buffer_flip should not be called for redirected xsk copy mode

2020-07-14 Thread Li,Rongqing
> -邮件原件- > 发件人: Li,Rongqing > 发送时间: 2020年7月6日 14:38 > 收件人: 'Magnus Karlsson' > 抄送: intel-wired-lan ; Björn Töpel > ; Karlsson, Magnus ; > Netdev > 主题: 答复: [Intel-wired-lan] [bug ?] i40e_rx_buffer_flip should not be called > for redirected xsk copy m

答复: [Intel-wired-lan] [bug ?] i40e_rx_buffer_flip should not be called for redirected xsk copy mode

2020-07-05 Thread Li,Rongqing
> -邮件原件- > 发件人: Magnus Karlsson [mailto:magnus.karls...@gmail.com] > 发送时间: 2020年7月6日 14:13 > 收件人: Li,Rongqing > 抄送: intel-wired-lan ; Björn Töpel > ; Karlsson, Magnus ; > Netdev > 主题: Re: [Intel-wired-lan] [bug ?] i40e_rx_buffer_flip should not be called for &g

[PATCH][RFC] i40e: not flip rx buffer for copy mode xdp

2020-07-03 Thread Li RongQing
ble since only first skb is in it, but i40e_rx_buffer_flip will make that page_offset is set to first skb data 4. then reuse rx buffer, first skb which still is living will be corrupted. so add flags in xdp struct, to report xdp's data status Signed-off-by: Li

[PATCH][net-next] i40e: prefetch struct page of rx buffer conditionally

2020-07-01 Thread Li RongQing
page_address() accesses struct page only when WANT_PAGE_VIRTUAL or HASHED_PAGE_VIRTUAL is defined, otherwise it returns address based on offset, so we prefetch it conditionally Signed-off-by: Li RongQing --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 ++ 1 file changed, 2 insertions

[PATCH] i40e: not compute affinity_mask for IRQ

2020-07-01 Thread Li RongQing
After commit 759dc4a7e605 ("i40e: initialize our affinity_mask based on cpu_possible_mask"), NAPI IRQ affinity_mask is bind to all possible cpus, not a fixed cpu Signed-off-by: Li RongQing --- drivers/net/ethernet/intel/i40e/i40e_main.c | 12 +++- 1 file changed, 3 insert

[PATCH] xdp: fix xsk_generic_xmit errno

2020-06-10 Thread Li RongQing
propagate sock_alloc_send_skb error code, not set it to EAGAIN unconditionally, when fail to allocate skb, which maybe causes that user space unnecessary loops Fixes: 35fcde7f8deb "(xsk: support for Tx)" Signed-off-by: Li RongQing --- net/xdp/xsk.c | 1 - 1 file changed, 1 deletio

答复: [PATCH] i40e: fix wrong index in i40e_xsk_umem_dma_map

2020-06-02 Thread Li,Rongqing
> -邮件原件- > 发件人: Björn Töpel [mailto:bjorn.to...@gmail.com] > 发送时间: 2020年6月2日 19:27 > 收件人: Li,Rongqing ; intel-wired-lan > ; Netdev > 抄送: bpf ; Karlsson, Magnus > > 主题: Re: [PATCH] i40e: fix wrong index in i40e_xsk_umem_dma_map > > On Tue, 2 Jun 202

[PATCH][v2] i40e: fix wrong index in i40e_xsk_umem_dma_map

2020-06-02 Thread Li RongQing
The dma should be unmapped in rollback path from umem->pages[0].dma till umem->pages[i-1].dma which is last dma map address Fixes: 0a714186d3c0 "(i40e: add AF_XDP zero-copy Rx support)" Signed-off-by: Li RongQing --- diff with v1: add description drivers/net/ethernet/intel/i40

[PATCH] i40e: fix wrong index in i40e_xsk_umem_dma_map

2020-06-02 Thread Li RongQing
Fixes: 0a714186d3c0 "(i40e: add AF_XDP zero-copy Rx support)" Signed-off-by: Li RongQing --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/

答复: [PATCH] openvswitch: change type of UPCALL_PID attribute to NLA_UNSPEC

2019-09-25 Thread Li,Rongqing
> -邮件原件- > 发件人: Pravin Shelar [mailto:pshe...@ovn.org] > 发送时间: 2019年9月26日 5:03 > 收件人: Li,Rongqing > 抄送: Linux Kernel Network Developers > 主题: Re: [PATCH] openvswitch: change type of UPCALL_PID attribute to > NLA_UNSPEC > > On Tue, Sep 24, 2019 at

[PATCH] openvswitch: change type of UPCALL_PID attribute to NLA_UNSPEC

2019-09-24 Thread Li RongQing
is bug is exposed by the below warning [ 57.215841] netlink: 'ovs-vswitchd': attribute type 5 has an invalid length. Signed-off-by: Li RongQing --- net/openvswitch/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/datapath.c b/ne

答复: [PATCH][net-next] net: drop_monitor: change the stats variable to u64 in net_dm_stats_put

2019-08-22 Thread Li,Rongqing
> -邮件原件- > 发件人: Ido Schimmel [mailto:ido...@idosch.org] > 发送时间: 2019年8月22日 20:00 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org; ido...@mellanox.com > 主题: Re: [PATCH][net-next] net: drop_monitor: change the stats variable to > u64 in net_dm_stats_put > > On

[PATCH][net-next] net: drop_monitor: change the stats variable to u64 in net_dm_stats_put

2019-08-21 Thread Li RongQing
only the element drop of struct net_dm_stats is used, so simplify it to u64 Signed-off-by: Li RongQing --- net/core/drop_monitor.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index bfc024024aa3..ed10a40cf629

[PATCH][V2] net: fix __ip_mc_inc_group usage

2019-08-19 Thread Li RongQing
in ip_mc_inc_group, memory allocation flag, not mcast mode, is expected by __ip_mc_inc_group similar issue in __ip_mc_join_group, both mcase mode and gfp_t are needed here, so use ip_mc_inc_group(...) Fixes: 9fb20801dab4 ("net: Fix ip_mc_{dec,inc}_group allocation context") Signed-

答复: [PATCH] net: Fix __ip_mc_inc_group argument 3 input

2019-08-19 Thread Li,Rongqing
> > > On 8/19/2019 7:25 PM, Li RongQing wrote: > > It expects gfp_t, but got unsigned int mode > > > > Fixes: 6e2059b53f98 ("ipv4/igmp: init group mode as INCLUDE when join > > source group") > > Signed-off-by: Li RongQing > > Signed-off-

[PATCH] net: fix icmp_socket_deliver argument 2 input

2019-08-19 Thread Li RongQing
it expects a unsigned int, but got a __be32 Signed-off-by: Li RongQing Signed-off-by: Zhang Yu --- net/ipv4/icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 1510e951f451..bf7b5d45de99 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4

[PATCH] net: Fix __ip_mc_inc_group argument 3 input

2019-08-19 Thread Li RongQing
It expects gfp_t, but got unsigned int mode Fixes: 6e2059b53f98 ("ipv4/igmp: init group mode as INCLUDE when join source group") Signed-off-by: Li RongQing Signed-off-by: Zhang Yu --- net/ipv4/igmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ig

[PATCH][net-next] net: remove empty inet_exit_net

2019-08-19 Thread Li RongQing
Pointer members of an object with static storage duration, if not explicitly initialized, will be initialized to a NULL pointer. The net namespace API checks if this pointer is not NULL before using it, it are safe to remove the function. Signed-off-by: Li RongQing --- net/ipv4/af_inet.c | 5

[PATCH][net-next] net: remove unused parameter from skb_checksum_try_convert

2019-07-04 Thread Li RongQing
the check parameter is never used Signed-off-by: Li RongQing --- include/linux/skbuff.h | 8 +++- net/ipv4/gre_demux.c | 2 +- net/ipv4/udp.c | 3 +-- net/ipv6/udp.c | 3 +-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/linux/skbuff.h b/include

答复: [PATCH] xfrm: use list_for_each_entry_safe in xfrm_policy_flush

2019-07-01 Thread Li,Rongqing
> -邮件原件- > 发件人: Florian Westphal [mailto:f...@strlen.de] > 发送时间: 2019年7月1日 17:04 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org > 主题: Re: [PATCH] xfrm: use list_for_each_entry_safe in xfrm_policy_flush > > Li RongQing wrote: > > The iterated pol

[PATCH] xfrm: use list_for_each_entry_safe in xfrm_policy_flush

2019-07-01 Thread Li RongQing
The iterated pol maybe be freed since it is not protected by RCU or spinlock when put it, lead to UAF, so use _safe function to iterate over it against removal Signed-off-by: Li RongQing --- net/xfrm/xfrm_policy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/xfrm

[PATCH][net-next] netns: restore ops before calling ops_exit_list

2019-06-20 Thread Li RongQing
ops has been iterated to first element when call pre_exit, and it needs to restore from save_ops, not save ops to save_ops Fixes: d7d99872c144 ("netns: add pre_exit method to struct pernet_operations") Signed-off-by: Li RongQing --- net/core/net_namespace.c | 2 +- 1 file changed, 1

[PATCH][net-next] net: remove empty netlink_tap_exit_net

2019-06-13 Thread Li RongQing
Pointer members of an object with static storage duration, if not explicitly initialized, will be initialized to a NULL pointer. The net namespace API checks if this pointer is not NULL before using it, it are safe to remove the function. Signed-off-by: Li RongQing --- net/netlink/af_netlink.c

[PATCH] xfrm: remove empty xfrmi_init_net

2019-06-13 Thread Li RongQing
Pointer members of an object with static storage duration, if not explicitly initialized, will be initialized to a NULL pointer. The net namespace API checks if this pointer is not NULL before using it, it are safe to remove the function. Signed-off-by: Li RongQing --- net/xfrm/xfrm_interface.c

答复: [PATCH][v2] net: ethtool: not call vzalloc for zero sized memory request

2019-03-29 Thread Li,Rongqing
> -邮件原件- > 发件人: Michal Kubecek [mailto:mkube...@suse.cz] > 发送时间: 2019年3月29日 17:29 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org > 主题: Re: [PATCH][v2] net: ethtool: not call vzalloc for zero sized memory > request > > On Fri, Mar 29, 2019 at 09:18:02

[PATCH][v2] net: ethtool: not call vzalloc for zero sized memory request

2019-03-28 Thread Li RongQing
phy_ethtool_get_stats returns error, memory should be freed before exit Signed-off-by: Li RongQing Reviewed-by: Wang Li --- v1->v2: not call get_ethtool_stats if n_stats is 0 net/core/ethtool.c | 46 ++ 1 file changed, 30 insertions(+), 16 deleti

答复: 答复: [PATCH] net: ethtool: not call vzalloc for zero sized memory request

2019-03-28 Thread Li,Rongqing
> -邮件原件- > 发件人: Michal Kubecek [mailto:mkube...@suse.cz] > 发送时间: 2019年3月28日 18:26 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org > 主题: Re: 答复: [PATCH] net: ethtool: not call vzalloc for zero sized memory > request > > On Thu, Mar 28, 2019 at 09:51:56

答复: [PATCH] net: ethtool: not call vzalloc for zero sized memory request

2019-03-28 Thread Li,Rongqing
> -邮件原件- > 发件人: Michal Kubecek [mailto:mkube...@suse.cz] > 发送时间: 2019年3月28日 17:09 > 收件人: Li,Rongqing > 抄送: netdev@vger.kernel.org > 主题: Re: [PATCH] net: ethtool: not call vzalloc for zero sized memory request > > On Thu, Mar 28, 2019 at 02:01:09PM +0800, Li Ron

[PATCH] net: ethtool: not call vzalloc for zero sized memory request

2019-03-27 Thread Li RongQing
if phy_ethtool_get_stats returns error, memory should be freed before exit Signed-off-by: Li RongQing Reviewed-by: Wang Li --- net/core/ethtool.c | 37 ++--- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/net/core/ethtool.c b/net/core/ethtool.c

[PATCH] connector: fix unsafe usage of ->real_parent

2019-03-05 Thread Li RongQing
273493] 88a027698980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 748.282630] == Fixes: b086ff87251b4a4 ("connector: add parent pid and tgid to coredump and exit events") Signed-off-by: Zhang Yu Signed-off-by: Li RongQi

[PATCH][net-next] ethtool: Use explicit designated initializers for .cmd

2019-02-27 Thread Li RongQing
Initialize the .cmd member by using a designated struct initializer. This fixes warning of missing field initializers, and makes code a little easier to read. Signed-off-by: Li RongQing --- net/core/ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core

[PATCH][net-next] net: Use RCU_POINTER_INITIALIZER() to init static variable

2019-02-24 Thread Li RongQing
This pointer is RCU protected, so proper primitives should be used. Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/sched/sch_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 38e5add14fab

[PATCH][net-next] ipv6: sanitize RCU usage on fib6_next

2019-02-22 Thread Li RongQing
using rcu_assign_pointer when setting, which has a memory barrier to ensure the initialization is seen first. using rcu_dereference when dereference this pointer Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/ipv6/ip6_fib.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions

[PATCH][net-next] net: Use RCU_INIT_POINTER() to set sk_wq

2019-02-22 Thread Li RongQing
This pointer is RCU protected, so proper primitives should be used. Signed-off-by: Zhang Yu Signed-off-by: Li RongQing --- net/core/sock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c index f4b8b78535f8..f5d82f3fa474 100644 --- a

[PATCH][net-next] bridge: remove redundant check on err in br_multicast_ipv4_rcv

2019-02-18 Thread Li RongQing
br_ip4_multicast_mrd_rcv only return 0 and -ENOMSG, no other negative value Signed-off-by: Li RongQing --- net/bridge/br_multicast.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 4a048fd1cbea..fe9f2d8ca2c1

[PATCH] net: remove unneeded switch fall-through

2019-02-18 Thread Li RongQing
This case block has been terminated by a return, so not need a switch fall-through Signed-off-by: Li RongQing --- net/ipv4/igmp.c| 1 - net/ipv6/mcast_snoop.c | 1 - 2 files changed, 2 deletions(-) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index b448cf32296c..6c2febc39dca 100644

[PATCH] ipv6: propagate genlmsg_reply return code

2019-02-11 Thread Li RongQing
genlmsg_reply can fail, so propagate its return code Fixes: 915d7e5e593 ("ipv6: sr: add code base for control plane support of SR-IPv6") Signed-off-by: Li RongQing --- net/ipv6/seg6.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/ipv6/seg6.c b/net/ipv6/se

[PATCH][net-next] devlink: use direct return of genlmsg_reply

2019-02-11 Thread Li RongQing
This can remove redundant check Signed-off-by: Li RongQing --- net/core/devlink.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/core/devlink.c b/net/core/devlink.c index e6a015b8ac9b..76a9d287dbec 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -4355,11

[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] tun: align write-heavy flow entry members to a cache line

2018-12-06 Thread Li RongQing
7;update' field only when 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 inde

答复: [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: 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] vhost:net: allocate 32KB memory instead of 32K pages when page frag refill

2018-11-22 Thread Li RongQing
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
r-3 pages 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..e3cbefeedf5

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

2018-11-12 Thread Li RongQing
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][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: 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-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 socket

答复: [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][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..5424a40

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

2018-11-08 Thread Li RongQing
: 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] 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

[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] 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

[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][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

[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

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 pla

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] 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][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][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][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] 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] 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] 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

[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

  1   2   >