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
> 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
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
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
> -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
> -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
().
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
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
> -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
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
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
> -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
> -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
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
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
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
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
> -邮件原件-
> 发件人: 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
> -邮件原件-
> 发件人: 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/
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(+),
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
> -邮件原件-
> 发件人: 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
> 主题:
> -邮件原件-
> 发件人: 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
> 主题:
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,
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(-)
> -邮件原件-
> 发件人: 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
> -邮件原件-
> 发件人: 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:
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
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
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
> > > >
> > > > 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
> -邮件原件-
> 发件人: 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
> -邮件原件-
> 发件人: 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
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
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
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
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
> -邮件原件-
> 发件人: 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
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
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/
> -邮件原件-
> 发件人: 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
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
> -邮件原件-
> 发件人: 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
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
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-
>
>
> 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-
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
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
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
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
> -邮件原件-
> 发件人: 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
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
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
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
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
> -邮件原件-
> 发件人: 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
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
> -邮件原件-
> 发件人: 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
> -邮件原件-
> 发件人: 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
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
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
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
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
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
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
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
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
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
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
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
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
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
> 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
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
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
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
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
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
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
> > 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
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
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
: 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
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
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
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
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
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
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
>
> 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
> + 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
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 -
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
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
: 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.
>
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
> 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
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
++
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
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 - 100 of 162 matches
Mail list logo