Re: linux-next: build warning after merge of the bpf-next tree

2020-11-11 Thread Qian Cai
On Wed, 2020-11-11 at 12:01 +1100, Stephen Rothwell wrote: > Hi all, > > After merging the bpf-next tree, today's linux-next build (powerpc > ppc64_defconfig) produced this warning: > > kernel/bpf/btf.c:4481:20: warning: 'btf_parse_module' defined but not used [- > Wunused-function] > 4481 | sta

Re: [PATCH net-next v3 5/7] devlink: Add devlink health port reporters API

2020-07-13 Thread Qian Cai
On Fri, Jul 10, 2020 at 03:25:11PM +0300, Moshe Shemesh wrote: > From: Vladyslav Tarasiuk > > In order to use new devlink port health reporters infrastructure, add > corresponding constructor and destructor functions. > > Signed-off-by: Vladyslav Tarasiuk > Reviewed-by: Moshe Shemesh > Reviewe

[PATCH] i40e: silence an UBSAN false positive

2020-06-06 Thread Qian Cai
+0x6f/0x80 i40e_vc_process_vf_msg+0x457c/0x4660 [i40e] i40e_service_task+0x96c/0x1ab0 [i40e] process_one_work+0x57d/0xbd0 worker_thread+0x63/0x5b0 kthread+0x20c/0x230 ret_from_fork+0x22/0x30 Fixes: d510497b8397 ("i40e: add input validation for virtchnl handlers") Signed-off-by: Qian C

Re: UBSAN: array-index-out-of-bounds in kernel/bpf/arraymap.c:177

2020-05-19 Thread Qian Cai
> On May 19, 2020, at 7:23 PM, Andrii Nakryiko > wrote: > > I agree, it's bad to have this noise. But again, there is nothing > wrong with the way it's used in BPF code base. We'd gladly use > flexible array, if we could. But given we can't, I'd say the proper > solution (in order of my prefe

Re: UBSAN: array-index-out-of-bounds in kernel/bpf/arraymap.c:177

2020-05-19 Thread Qian Cai
On Tue, May 19, 2020 at 3:30 PM Andrii Nakryiko wrote: > > On Tue, May 19, 2020 at 8:00 AM Qian Cai wrote: > > > > On Mon, May 18, 2020 at 8:25 PM Andrii Nakryiko > > wrote: > > > > > > On Mon, May 18, 2020 at 5:09 PM Qian Cai wrote: > > &g

Re: UBSAN: array-index-out-of-bounds in kernel/bpf/arraymap.c:177

2020-05-19 Thread Qian Cai
On Mon, May 18, 2020 at 8:25 PM Andrii Nakryiko wrote: > > On Mon, May 18, 2020 at 5:09 PM Qian Cai wrote: > > > > On Mon, May 18, 2020 at 7:55 PM Andrii Nakryiko > > wrote: > > > > > > On Sun, May 17, 2020 at 7:45 PM Qian Cai wrote: > > >

Re: UBSAN: array-index-out-of-bounds in kernel/bpf/arraymap.c:177

2020-05-18 Thread Qian Cai
On Mon, May 18, 2020 at 7:55 PM Andrii Nakryiko wrote: > > On Sun, May 17, 2020 at 7:45 PM Qian Cai wrote: > > > > With Clang 9.0.1, > > > > return array->value + array->elem_size * (index & array->index_mask); > > > > but array->value

UBSAN: array-index-out-of-bounds in kernel/bpf/arraymap.c:177

2020-05-17 Thread Qian Cai
With Clang 9.0.1, return array->value + array->elem_size * (index & array->index_mask); but array->value is, char value[0] __aligned(8); [ 506.031548][ T4134] LTP: starting bpf_prog02 [ 506.125326][ T4352] [ 506

Re: linux-next boot error: WARNING: suspicious RCU usage in bpq_device_event

2020-05-14 Thread Qian Cai
> On May 14, 2020, at 7:37 AM, syzbot > wrote: > > Hello, > > syzbot found the following crash on: > > HEAD commit:c9529331 Add linux-next specific files for 20200514 > git tree: linux-next > console output: https://syzkaller.appspot.com/x/log.txt?x=17119f4810 > kernel config:

Re: linux-next boot error: WARNING: suspicious RCU usage in ip6mr_get_table

2020-05-07 Thread Qian Cai
> On May 7, 2020, at 5:32 AM, Dmitry Vyukov wrote: > > On Thu, May 7, 2020 at 11:26 AM syzbot > wrote: >> >> Hello, >> >> syzbot found the following crash on: >> >> HEAD commit:6b43f715 Add linux-next specific files for 20200507 >> git tree: linux-next >> console output: https://

Re: linux-next boot error: WARNING: suspicious RCU usage in ipmr_get_table

2020-05-06 Thread Qian Cai
> On May 6, 2020, at 4:16 PM, Stephen Rothwell wrote: > > Hi Qian, > > On Tue, 28 Apr 2020 09:56:59 -0400 Qian Cai wrote: >> >>> On Apr 28, 2020, at 4:57 AM, Dmitry Vyukov wrote: >>>> net/ipv4/ipmr.c:136 RCU-list traversed in non-reader section

Re: [PATCH] net: fix memory leaks in flush_backlog() with RPS

2020-05-01 Thread Qian Cai
> On May 1, 2020, at 11:32 PM, Eric Dumazet wrote: > > kfree_skb() is supposed to call skb_dst_drop() (look in > skb_release_head_state()) > > If you think about it, we would have hundreds of similar bugs if this was not > the case. Thanks for quick response. Funny thing is that once I app

[PATCH] net: fix memory leaks in flush_backlog() with RPS

2020-05-01 Thread Qian Cai
tirq+0xd9/0x589 [<00000000087ee354>] irq_exit+0xa2/0xc0 [<1c4db0cd>] do_IRQ+0x87/0x180 Signed-off-by: Qian Cai --- net/core/dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/dev.c b/net/core/dev.c index 522288177bbd..b898cd3036da 100644 --- a/ne

Re: rcu_barrier() + membarrier() + scheduler deadlock?

2020-04-30 Thread Qian Cai
> On Apr 30, 2020, at 9:15 AM, Paul E. McKenney wrote: >> >> https://raw.githubusercontent.com/cailca/linux-mm/master/x86.config >> >> [53294.651754][T149877] futex_wake_op: trinity-c25 tries to shift op by -17; >> fix this program >> [53323.947396][T150988] futex_wake_op: trinity-c6 tries t

Re: linux-next boot error: WARNING: suspicious RCU usage in ipmr_get_table

2020-04-28 Thread Qian Cai
> On Apr 28, 2020, at 10:11 AM, Madhuparna Bhowmik > wrote: > > On Tue, Apr 28, 2020 at 09:56:59AM -0400, Qian Cai wrote: >> >> >>> On Apr 28, 2020, at 4:57 AM, Dmitry Vyukov wrote: >>>> net/ipv4/ipmr.c:136 RCU-list traversed in non-reader se

Re: linux-next boot error: WARNING: suspicious RCU usage in ipmr_get_table

2020-04-28 Thread Qian Cai
> On Apr 28, 2020, at 4:57 AM, Dmitry Vyukov wrote: >> net/ipv4/ipmr.c:136 RCU-list traversed in non-reader section!! https://lore.kernel.org/netdev/20200222063835.14328-2-frextr...@gmail.com/ Never been picked up for a few months due to some reasons. You could probably need to convince David

Re: [PATCH] be2net: fix adapter->big_page_size miscaculation

2019-07-22 Thread Qian Cai
The original issue, https://lore.kernel.org/netdev/1562959401-19815-1-git-send-email-...@lca.pw/ The debugging so far seems point to that the compilers get confused by the module sections. During module_param(), it stores “__param_rx_frag_size" as a “struct kernel_param” into the __param section.

[PATCH v2] net/core: tidy up an error message

2018-12-01 Thread Qian Cai
_ring_data netif_napi_add register_netdev dev_get_valid_name Hence, make it a bit more human-readable by using netdev_err_once() instead. Signed-off-by: Qian Cai --- v2: * Used netdev_err_once() suggested by Joe. * Replaced the hard-coded function name with __func__. net/core/dev.c |

[PATCH] net/core: tidy up an error message

2018-11-30 Thread Qian Cai
_ring_data netif_napi_add register_netdev dev_get_valid_name Hence, make it a bit more human-readable. Signed-off-by: Qian Cai --- net/core/dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index ddc551f24ba2..bbd7cdbbbebd 100644

[PATCH v2] dma-debug: Kconfig for PREALLOC_DMA_DEBUG_ENTRIES

2018-11-30 Thread Qian Cai
65536 Added a Kconfig entry for PREALLOC_DMA_DEBUG_ENTRIES, so make it easier for users to deal with special cases like this. Signed-off-by: Qian Cai --- Changes since v1: * Increased the default value if has HNS_ENET suggested by Robin. kernel/dma/debug.c | 9 ++--- lib/Kconfig.debug | 10 ++ 2 fi

[PATCH] dma-debug: Kconfig for PREALLOC_DMA_DEBUG_ENTRIES

2018-11-30 Thread Qian Cai
s to deal with special cases like this. Signed-off-by: Qian Cai --- kernel/dma/debug.c | 9 ++--- lib/Kconfig.debug | 9 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 231ca4628062..3752fb23f72f 100644 --- a/kernel/dma/de

[PATCH] dma-debug: hns_enet_drv could use more DMA entries

2018-11-29 Thread Qian Cai
(i = 0; i < handle->q_num; i++) [2] for (i = 0; i < ring->desc_num; i++) On this Huawei TaiShan 2280 aarch64 server, it has reached the limit already, 4 (ports) x 16 (handles) x 1024 (rings) = 65536 Signed-off-by: Qian Cai --- kernel/dma/debug.c | 5 + 1 file changed, 5 inser