[PATCH net-next v3 2/2] net: Use lockdep_assert_in_softirq() in napi_consume_skb()

2020-11-24 Thread Yunsheng Lin
Use napi_consume_skb() to assert the case when it is not called in a atomic softirq context. Signed-off-by: Yunsheng Lin --- net/core/skbuff.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ffe3dcc..effa19d 100644 --- a/net/core/skbuff.c +++ b

[PATCH net-next v3 1/2] lockdep: Introduce in_softirq lockdep assert

2020-11-24 Thread Yunsheng Lin
be interrupted by hard IRQ or NMI context, lockdep_assert_in_softirq() need to assert about hard IRQ or NMI context too. Suggested-by: Jakub Kicinski Signed-off-by: Yunsheng Lin --- V3: add comment to emphasize the ambiguous semantics. --- include/linux/lockdep.h | 8 1 file changed, 8

[PATCH net-next v3 0/2] Add an assert in napi_consume_skb()

2020-11-24 Thread Yunsheng Lin
This patch introduces a lockdep_assert_in_softirq() interface and uses it to assert the case when napi_consume_skb() is not called in the softirq context. Changelog: V3: add comment to emphasize the ambiguous semantics V2: Use lockdep instead of one-off Kconfig knob Yunsheng Lin (2): lockdep

Re: [PATCH net-next v2 1/2] lockdep: Introduce in_softirq lockdep assert

2020-11-24 Thread Yunsheng Lin
On 2020/11/24 16:11, Peter Zijlstra wrote: > On Mon, Nov 23, 2020 at 12:12:59PM -0800, Jakub Kicinski wrote: >> One liner would be: >> >> * Acceptable for protecting per-CPU resources accessed from BH >> >> We can add: >> >> * Much like in_softirq() - semantics are ambiguous, use

[PATCH net-next v2 1/2] lockdep: Introduce in_softirq lockdep assert

2020-11-20 Thread Yunsheng Lin
IRQ or NMI context too. Suggested-by: Jakub Kicinski Signed-off-by: Yunsheng Lin --- include/linux/lockdep.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index f559487..f5e3d81 100644 --- a/include/linux/lockdep.h +++ b/include

[PATCH net-next v2 0/2] Add an assert in napi_consume_skb()

2020-11-20 Thread Yunsheng Lin
This patch introduces a lockdep_assert_in_softirq() interface and uses it to assert the case when napi_consume_skb() is not called in the softirq context. Changelog: V2: Use lockdep instead of one-off Kconfig knob Yunsheng Lin (2): lockdep: Introduce in_softirq lockdep assert net: Use

[PATCH net-next v2 2/2] net: Use lockdep_assert_in_softirq() in napi_consume_skb()

2020-11-20 Thread Yunsheng Lin
Use napi_consume_skb() to assert the case when it is not called in a atomic softirq context. Signed-off-by: Yunsheng Lin --- net/core/skbuff.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ffe3dcc..effa19d 100644 --- a/net/core/skbuff.c +++ b

Re: [PATCH net-next] net: add in_softirq() debug checking in napi_consume_skb()

2020-11-19 Thread Yunsheng Lin
On 2020/11/19 19:41, Peter Zijlstra wrote: > On Thu, Nov 19, 2020 at 05:19:44PM +0800, Yunsheng Lin wrote: >> On 2020/11/19 0:26, Jakub Kicinski wrote: >>> On Wed, 18 Nov 2020 16:57:57 +0100 Peter Zijlstra wrote: >>>> On Wed, Nov 18, 2020 at 07:43:48AM -0800, Jakub

Re: [PATCH net-next] net: add in_softirq() debug checking in napi_consume_skb()

2020-11-19 Thread Yunsheng Lin
On 2020/11/19 0:26, Jakub Kicinski wrote: > On Wed, 18 Nov 2020 16:57:57 +0100 Peter Zijlstra wrote: >> On Wed, Nov 18, 2020 at 07:43:48AM -0800, Jakub Kicinski wrote: >> >>> TBH the last sentence I wrote isn't clear even to me at this point ;D >>> >>> Maybe using just the macros from preempt.h -

Re: [PATCH net-next] net: add in_softirq() debug checking in napi_consume_skb()

2020-11-17 Thread Yunsheng Lin
On 2020/11/3 3:41, Jakub Kicinski wrote: > On Mon, 2 Nov 2020 11:14:32 +0800 Yunsheng Lin wrote: >> On 2020/11/1 6:38, Jakub Kicinski wrote: >>> On Thu, 29 Oct 2020 19:34:48 +0800 Yunsheng Lin wrote: >>>> The current semantic for napi_consume_skb() is that caller

Re: [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug

2020-11-09 Thread Yunsheng Lin
On 2020/11/9 20:46, Greg KH wrote: > On Tue, Nov 03, 2020 at 11:25:38AM +0800, Yunsheng Lin wrote: >> commit 2fb541c862c9 ("net: sch_generic: aviod concurrent reset and enqueue >> op for lockless qdisc") >> >> When the above upstream commit is backporte

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-11-04 Thread Yunsheng Lin
On 2020/11/5 14:16, Cong Wang wrote: > On Wed, Nov 4, 2020 at 10:04 PM Cong Wang wrote: >> >> On Mon, Nov 2, 2020 at 11:24 PM Yunsheng Lin wrote: >>>>> From my understanding, we can do anything about the old qdisc (including >>>>> destorying the old q

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-11-04 Thread Yunsheng Lin
On 2020/11/5 14:04, Cong Wang wrote: > On Mon, Nov 2, 2020 at 11:24 PM Yunsheng Lin wrote: >>>> From my understanding, we can do anything about the old qdisc (including >>>> destorying the old qdisc) after some_qdisc_is_busy() return false. >>> >>>

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-11-02 Thread Yunsheng Lin
On 2020/11/3 0:55, Cong Wang wrote: > On Fri, Oct 30, 2020 at 12:38 AM Yunsheng Lin wrote: >> >> On 2020/10/30 3:05, Cong Wang wrote: >>> >>> I do not see how and why it should. synchronize_net() is merely an optimized >>> version of synchronize_rcu()

[PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug

2020-11-02 Thread Yunsheng Lin
nment back to fix it. 1. https://www.spinics.net/lists/netdev/msg693916.html 2. https://www.spinics.net/lists/netdev/msg695131.html Fixes: 749cc0b0c7f3 ("net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc") Signed-off-by: Yunsheng Lin --- net/sched/sch_gener

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-11-02 Thread Yunsheng Lin
On 2020/10/30 1:20, Vishwanath Pai wrote: > On 10/29/20 6:24 AM, Yunsheng Lin wrote: >> On 2020/10/29 12:50, Vishwanath Pai wrote: >>> On 10/28/20 10:37 PM, Yunsheng Lin wrote: >>>> On 2020/10/29 4:04, Vishwanath Pai wrote: >>>>> On 10/28/20 1:47 PM,

Re: [PATCH net-next] net: add in_softirq() debug checking in napi_consume_skb()

2020-11-01 Thread Yunsheng Lin
On 2020/11/1 6:38, Jakub Kicinski wrote: > On Thu, 29 Oct 2020 19:34:48 +0800 Yunsheng Lin wrote: >> The current semantic for napi_consume_skb() is that caller need >> to provide non-zero budget when calling from NAPI context, and >> breaking this semantic will cause hard to d

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-10-30 Thread Yunsheng Lin
On 2020/10/30 3:05, Cong Wang wrote: > On Wed, Oct 28, 2020 at 7:54 PM Yunsheng Lin wrote: >> >> On 2020/9/18 3:26, Cong Wang wrote: >>> On Fri, Sep 11, 2020 at 1:13 AM Yunsheng Lin wrote: >>>> >>>> On 2020/9/11 4:07, Cong Wang wrote: &

[PATCH net-next] net: add in_softirq() debug checking in napi_consume_skb()

2020-10-29 Thread Yunsheng Lin
' napi_alloc_cache atomically. So add a in_softirq() debug checking in napi_consume_skb() to catch this kind of error. Suggested-by: Eric Dumazet Signed-off-by: Yunsheng Lin --- v1: drop RFC in the title --- include/linux/netdevice.h | 6 ++ net/Kconfig | 7 +++ net/core/skbuff.c

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-10-29 Thread Yunsheng Lin
On 2020/10/29 12:50, Vishwanath Pai wrote: > On 10/28/20 10:37 PM, Yunsheng Lin wrote: >> On 2020/10/29 4:04, Vishwanath Pai wrote: >>> On 10/28/20 1:47 PM, Cong Wang wrote: >>>> On Wed, Oct 28, 2020 at 8:37 AM Pai, Vishwanath wrote: >>>>> Hi, >

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-10-29 Thread Yunsheng Lin
On 2020/9/18 3:26, Cong Wang wrote: > On Fri, Sep 11, 2020 at 1:13 AM Yunsheng Lin wrote: >> >> On 2020/9/11 4:07, Cong Wang wrote: >>> On Tue, Sep 8, 2020 at 4:06 AM Yunsheng Lin wrote: >>>> >>>> Currently there is concurrent reset and enqueue

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-10-28 Thread Yunsheng Lin
On 2020/10/29 4:04, Vishwanath Pai wrote: > On 10/28/20 1:47 PM, Cong Wang wrote: >> On Wed, Oct 28, 2020 at 8:37 AM Pai, Vishwanath wrote: >>> Hi, >>> >>> We noticed some problems when testing the latest 5.4 LTS kernel and traced >>> it >>> back to this commit using git bisect. When running our

Re: [PATCH net] net: hns3: Clear the CMDQ registers before unmapping BAR region

2020-10-26 Thread Yunsheng Lin
On 2020/10/27 9:25, Jakub Kicinski wrote: > On Tue, 27 Oct 2020 09:24:10 +0800 Yunsheng Lin wrote: >>> Fixes: 862d969a3a4d ("net: hns3: do VF's pci re-initialization while PF >>> doing FLR") >> >> The correct Fixes tag should be: >> >

Re: [PATCH net] net: hns3: Clear the CMDQ registers before unmapping BAR region

2020-10-26 Thread Yunsheng Lin
On 2020/10/27 7:13, Jakub Kicinski wrote: > On Fri, 23 Oct 2020 15:01:14 +0800 Zenghui Yu wrote: >> On 2020/10/23 14:22, Yunsheng Lin wrote: >>> On 2020/10/23 13:15, Zenghui Yu wrote: >>>> When unbinding the hns3 driver with the HNS3 VF, I got t

Re: [PATCH net] net: hns3: clean up a return in hclge_tm_bp_setup()

2020-10-25 Thread Yunsheng Lin
On 2020/10/23 19:22, Dan Carpenter wrote: > Smatch complains that "ret" might be uninitialized if we don't enter > the loop. We do always enter the loop so it's a false positive, but > it's cleaner to just return a literal zero and that silences the > warning as well. Thanks for the clean up.

Re: [PATCH net] net: hns3: Clear the CMDQ registers before unmapping BAR region

2020-10-23 Thread Yunsheng Lin
On 2020/10/23 13:15, Zenghui Yu wrote: > When unbinding the hns3 driver with the HNS3 VF, I got the following > kernel panic: > > [ 265.709989] Unable to handle kernel paging request at virtual address > 800054627000 > [ 265.717928] Mem abort info: > [ 265.720740] ESR = 0x9647 > [

[PATCH RFC] net: add in_softirq() debug checking in napi_consume_skb()

2020-09-22 Thread Yunsheng Lin
' napi_alloc_cache atomically. So add a in_softirq() debug checking in napi_consume_skb() to catch this kind of error. Suggested-by: Eric Dumazet Signed-off-by: Yunsheng Lin --- include/linux/netdevice.h | 6 ++ net/Kconfig | 7 +++ net/core/skbuff.c | 4 3 files changed

Re: [PATCH net-next] net: use in_softirq() to indicate the NAPI context in napi_consume_skb()

2020-09-21 Thread Yunsheng Lin
On 2020/9/21 16:17, Eric Dumazet wrote: > On Mon, Sep 21, 2020 at 10:10 AM Yunsheng Lin wrote: >> >> On 2020/9/21 15:19, Eric Dumazet wrote: >>> On Mon, Sep 21, 2020 at 4:08 AM Yunsheng Lin wrote: >>>> >>>> When napi_consume_skb() is called in

Re: [PATCH net-next] net: use in_softirq() to indicate the NAPI context in napi_consume_skb()

2020-09-21 Thread Yunsheng Lin
On 2020/9/21 15:19, Eric Dumazet wrote: > On Mon, Sep 21, 2020 at 4:08 AM Yunsheng Lin wrote: >> >> When napi_consume_skb() is called in the tx desc cleaning process, >> it is usually in the softirq context(BH disabled, or are processing >> softirqs), but it may

[PATCH net-next] net: use in_softirq() to indicate the NAPI context in napi_consume_skb()

2020-09-20 Thread Yunsheng Lin
context or not as long as it runs in softirq context or with BH disabled, then _kfree_skb_defer() will push the skb to the particular cpu' napi_alloc_cache atomically. [1] https://lkml.org/lkml/2020/9/15/38 Signed-off-by: Yunsheng Lin --- note that budget parameter is not removed in this patch

[PATCH net-next] net: remove unnecessary NULL checking in napi_consume_skb()

2020-09-18 Thread Yunsheng Lin
(). Signed-off-by: Yunsheng Lin --- net/core/skbuff.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index bfd7483..e077447 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -895,9 +895,6 @@ void __kfree_skb_defer(struct sk_buff *skb) void

Re: [PATCH net-next] net: hns3: remove unnecessary NULL checking in napi_consume_skb()

2020-09-18 Thread Yunsheng Lin
Please ignore this patch, the title is not right, sorry for the noise. On 2020/9/19 10:16, Yunsheng Lin wrote: > When budget is non-zero, skb_unref() has already handled the > NULL checking. > > When budget is zero, the dev_consume_skb_any() has handled NULL > checking in __de

[PATCH net-next] net: hns3: remove unnecessary NULL checking in napi_consume_skb()

2020-09-18 Thread Yunsheng Lin
(). Signed-off-by: Yunsheng Lin --- net/core/skbuff.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index bfd7483..e077447 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -895,9 +895,6 @@ void __kfree_skb_defer(struct sk_buff *skb) void

Re: [PATCH net-next 6/6] net: hns3: use napi_consume_skb() when cleaning tx desc

2020-09-17 Thread Yunsheng Lin
On 2020/9/16 16:38, Eric Dumazet wrote: > On Wed, Sep 16, 2020 at 10:33 AM Saeed Mahameed wrote: >> >> On Tue, 2020-09-15 at 15:04 +0800, Yunsheng Lin wrote: >>> On 2020/9/15 13:09, Saeed Mahameed wrote: >>>> On Mon, 2020-09-14 at 20:06 +0800, Huazhong

Re: [PATCH net-next 6/6] net: hns3: use napi_consume_skb() when cleaning tx desc

2020-09-15 Thread Yunsheng Lin
On 2020/9/15 13:09, Saeed Mahameed wrote: > On Mon, 2020-09-14 at 20:06 +0800, Huazhong Tan wrote: >> From: Yunsheng Lin >> >> Use napi_consume_skb() to batch consuming skb when cleaning >> tx desc in NAPI polling. >> >> Signed-off-by: Yunsh

Re: [PATCH net-next 5/6] net: hns3: use writel() to optimize the barrier operation

2020-09-14 Thread Yunsheng Lin
On 2020/9/15 5:45, Jakub Kicinski wrote: > On Mon, 14 Sep 2020 20:06:56 +0800 Huazhong Tan wrote: >> From: Yunsheng Lin >> >> writel() can be used to order I/O vs memory by default when >> writing portable drivers. Use writel() to replace wmb() + >> writel_r

Re: Packet gets stuck in NOLOCK pfifo_fast qdisc

2020-09-13 Thread Yunsheng Lin
On 2020/9/11 4:19, Cong Wang wrote: > On Thu, Sep 3, 2020 at 8:21 PM Kehuan Feng wrote: >> I also tried Cong's patch (shown below on my tree) and it could avoid >> the issue (stressing for 30 minutus for three times and not jitter >> observed). > > Thanks for verifying it! > >> >> ---

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-11 Thread Yunsheng Lin
On 2020/9/11 16:13, Yunsheng Lin wrote: > On 2020/9/11 4:07, Cong Wang wrote: >> On Tue, Sep 8, 2020 at 4:06 AM Yunsheng Lin wrote: >>> >>> Currently there is concurrent reset and enqueue operation for the >>> same lockless qdisc when there is no lo

Re: [PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-11 Thread Yunsheng Lin
On 2020/9/11 4:07, Cong Wang wrote: > On Tue, Sep 8, 2020 at 4:06 AM Yunsheng Lin wrote: >> >> Currently there is concurrent reset and enqueue operation for the >> same lockless qdisc when there is no lock to synchronize the >> q->enqueue() in __dev_xmit_skb()

[PATCH v2 net] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-08 Thread Yunsheng Lin
re skb with larger queue_mapping enqueued to old qdisc(which is saved in dev_queue->qdisc_sleeping) will always be reset when dev_reset_queue() is called. Fixes: 6b3ba9146fe6 ("net: sched: allow qdiscs to handle locking") Signed-off-by: Yunsheng Lin --- ChangeLog V2:

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-04 Thread Yunsheng Lin
On 2020/9/3 15:24, Eric Dumazet wrote: > > > On 9/2/20 6:14 PM, Yunsheng Lin wrote: > >> >> It seems semantics for some_qdisc_is_busy() is changed, which does not only >> do >> the checking, but also do the reseting? > > Yes, obviously, we would have

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-04 Thread Yunsheng Lin
On 2020/9/4 9:30, John Fastabend wrote: > Cong Wang wrote: >> On Wed, Sep 2, 2020 at 7:22 PM Yunsheng Lin wrote: >>> >>> On 2020/9/3 9:48, Cong Wang wrote: >>>> On Wed, Sep 2, 2020 at 6:22 PM Yunsheng Lin wrote: >>>>> >>>>> O

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-02 Thread Yunsheng Lin
On 2020/9/3 9:48, Cong Wang wrote: > On Wed, Sep 2, 2020 at 6:22 PM Yunsheng Lin wrote: >> >> On 2020/9/3 8:35, Cong Wang wrote: >>> On Tue, Sep 1, 2020 at 11:35 PM Yunsheng Lin wrote: >>>> >>>> On 2020/9/2 12:41, Cong Wang wrote: >>>>

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-02 Thread Yunsheng Lin
On 2020/9/3 8:35, Cong Wang wrote: > On Tue, Sep 1, 2020 at 11:35 PM Yunsheng Lin wrote: >> >> On 2020/9/2 12:41, Cong Wang wrote: >>> On Tue, Sep 1, 2020 at 6:42 PM Yunsheng Lin wrote: >>>> >>>> On 2020/9/2 2:24, Cong Wang wrote: >>>>

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-02 Thread Yunsheng Lin
On 2020/9/2 17:20, Eric Dumazet wrote: > > > On 9/2/20 1:14 AM, Yunsheng Lin wrote: >> On 2020/9/2 15:32, Eric Dumazet wrote: >>> >>> >>> On 9/1/20 11:34 PM, Yunsheng Lin wrote: >>> >>>> >>>> I am

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-02 Thread Yunsheng Lin
On 2020/9/2 15:32, Eric Dumazet wrote: > > > On 9/1/20 11:34 PM, Yunsheng Lin wrote: > >> >> I am not familiar with TCQ_F_CAN_BYPASS. >> From my understanding, the problem is that there is no order between >> qdisc enqueuing and qdisc reset. > > Thw qd

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-02 Thread Yunsheng Lin
On 2020/9/2 12:41, Cong Wang wrote: > On Tue, Sep 1, 2020 at 6:42 PM Yunsheng Lin wrote: >> >> On 2020/9/2 2:24, Cong Wang wrote: >>> On Mon, Aug 31, 2020 at 5:59 PM Yunsheng Lin wrote: >>>> >>>> Currently there is concurrent reset and enqueue

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-01 Thread Yunsheng Lin
On 2020/9/2 2:24, Cong Wang wrote: > On Mon, Aug 31, 2020 at 5:59 PM Yunsheng Lin wrote: >> >> Currently there is concurrent reset and enqueue operation for the >> same lockless qdisc when there is no lock to synchronize the >> q->enqueue() in __dev_xmit_skb()

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-01 Thread Yunsheng Lin
On 2020/9/2 2:34, David Miller wrote: > From: Yunsheng Lin > Date: Tue, 1 Sep 2020 15:27:44 +0800 > >> On 2020/9/1 14:48, Eric Dumazet wrote: >>> We request Fixes: tag for fixes in networking land. >> >> ok. >> >> Fixes: 6b3ba9146fe6 ("net: sc

Re: [PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-09-01 Thread Yunsheng Lin
On 2020/9/1 14:48, Eric Dumazet wrote: > > > On 8/31/20 5:55 PM, Yunsheng Lin wrote: >> Currently there is concurrent reset and enqueue operation for the >> same lockless qdisc when there is no lock to synchronize the >> q->enqueue() in __dev_xmit_skb()

[PATCH net-next] vhost: fix typo in error message

2020-08-31 Thread Yunsheng Lin
"enable" should be "disable" when the function name is vhost_disable_notify(), which does the disabling work. Signed-off-by: Yunsheng Lin --- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/v

[PATCH net-next] net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc

2020-08-31 Thread Yunsheng Lin
after assigning new qdisc to dev_queue->qdisc and before calling qdisc_deactivate() to make sure skb with larger queue_mapping enqueued to old qdisc will always be reset when qdisc_deactivate() is called. Signed-off-by: Yunsheng Lin --- net/sched/sch_generic.c | 7 ++- 1 file changed, 6 inserti

Re: INFO: task hung in linkwatch_event (2)

2020-05-06 Thread Yunsheng Lin
+cc Xiaoguang & Jens On 2020/5/6 14:56, Hillf Danton wrote: > > Wed, 29 Apr 2020 02:59:13 -0700 >> syzbot found the following crash on: >> >> HEAD commit:b4f63322 Merge branch 'for-linus' of git://git.kernel.org/.. >> git tree: upstream >> console output:

Re: INFO: task hung in linkwatch_event (2)

2020-05-06 Thread Yunsheng Lin
On 2020/5/6 12:25, Hillf Danton wrote: > > On Wed, 6 May 2020 09:38:21 Yunsheng Lin wrote: >> >> On 2020/4/29 17:59, syzbot wrote: >>> Hello, >>> >>> syzbot found the following crash on: >>> >>> HEAD commit:b4f63322 M

Re: INFO: task hung in linkwatch_event (2)

2020-05-05 Thread Yunsheng Lin
On 2020/4/29 17:59, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:b4f63322 Merge branch 'for-linus' of git://git.kernel.org/.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=1558936fe0 > kernel config:

Re: [PATCH] PCI: Warn about host bridge device when its numa node is NO_NODE

2019-10-23 Thread Yunsheng Lin
On 2019/10/22 21:55, Robin Murphy wrote: > On 21/10/2019 05:05, Yunsheng Lin wrote: >> On 2019/10/19 16:34, Christoph Hellwig wrote: >>> On Sat, Oct 19, 2019 at 02:45:43PM +0800, Yunsheng Lin wrote: >>>> +if (nr_node_ids > 1 && dev_to_node(bus->br

Re: [PATCH] PCI: Warn about host bridge device when its numa node is NO_NODE

2019-10-23 Thread Yunsheng Lin
On 2019/10/23 5:04, Bjorn Helgaas wrote: > On Sat, Oct 19, 2019 at 02:45:43PM +0800, Yunsheng Lin wrote: >> As the disscusion in [1]: > > We need to justify this patch right here in the commit log, not with a > pointer to a 50+ message email thread. Ok, thanks. > >>

Re: [PATCH RFC] net: vlan: reverse 4 bytes of vlan header when setting initial MTU

2019-10-21 Thread Yunsheng Lin
On 2019/10/22 7:27, Stephen Hemminger wrote: > On Mon, 21 Oct 2019 20:26:03 +0800 > Yunsheng Lin wrote: > >> Currently the MTU of vlan netdevice is set to the same MTU >> of the lower device, which requires the underlying device >> to handle it as the comment has indi

Re: [PATCH RFC] net: vlan: reverse 4 bytes of vlan header when setting initial MTU

2019-10-21 Thread Yunsheng Lin
On 2019/10/21 22:46, David Laight wrote: > From: Yunsheng Lin >> Sent: 21 October 2019 13:26 >> Currently the MTU of vlan netdevice is set to the same MTU >> of the lower device, which requires the underlying device >> to handle it as the comment has indicated: >>

[PATCH RFC] net: vlan: reverse 4 bytes of vlan header when setting initial MTU

2019-10-21 Thread Yunsheng Lin
t; __arm64_sys_write => el0_svc_common.constprop.0 => el0_svc_handler => el0_svc This patch set initial MTU of the vlan device to the MTU of the lower device minus vlan header to handle the above case. Signed-off-by: Yunsheng Lin --- net/8021q/vlan.c | 7 +++ 1 file changed, 3 inser

Re: [PATCH] PCI: Warn about host bridge device when its numa node is NO_NODE

2019-10-20 Thread Yunsheng Lin
On 2019/10/19 16:34, Christoph Hellwig wrote: > On Sat, Oct 19, 2019 at 02:45:43PM +0800, Yunsheng Lin wrote: >> +if (nr_node_ids > 1 && dev_to_node(bus->bridge) == NUMA_NO_NODE) >> +dev_err(bus->bridge, FW_BUG "No node assigned on NUMA capabl

[PATCH] PCI: Warn about host bridge device when its numa node is NO_NODE

2019-10-19 Thread Yunsheng Lin
com/ Signed-off-by: Yunsheng Lin --- drivers/pci/probe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 3d5271a..22be96a 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -927,6 +927,9 @@ static int pci_register_host_bridge(str

[PATCH net-next] pktgen: remove unnecessary assignment in pktgen_xmit()

2019-10-17 Thread Yunsheng Lin
variable ret is not used after jumping to "unlock" label, so the assignment is redundant. Signed-off-by: Yunsheng Lin --- net/core/pktgen.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 48b1e42..294bfcf 100644 --- a/net/core/pktgen.c

[PATCH v3 2/8] x86: numa: make node_to_cpumask_map() NUMA_NO_NODE aware for x86

2019-09-12 Thread Yunsheng Lin
n "bug" since it is for debugging and should catch all the error cases. [1] https://lore.kernel.org/patchwork/patch/1125789/ Signed-off-by: Yunsheng Lin Suggested-by: Michal Hocko --- V3: Change to only handle NUMA_NO_NODE, and return cpu_online_mask for NUMA_NO_NODE case, and change the commi

Re: [PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-11 Thread Yunsheng Lin
On 2019/9/11 19:03, Yunsheng Lin wrote: > On 2019/9/11 15:34, Michal Hocko wrote: >> On Wed 11-09-19 15:22:30, Yunsheng Lin wrote: >> [...] >>> It seems that there is no protection that prevent setting the node >>> of device to an invalid node. >>> And

Re: [PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-11 Thread Yunsheng Lin
On 2019/9/11 15:34, Michal Hocko wrote: > On Wed 11-09-19 15:22:30, Yunsheng Lin wrote: > [...] >> It seems that there is no protection that prevent setting the node >> of device to an invalid node. >> And the kernel does have a few different check now: >> 1) some

Re: [PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-11 Thread Yunsheng Lin
On 2019/9/11 14:49, Michal Hocko wrote: > On Wed 11-09-19 14:15:51, Yunsheng Lin wrote: >> On 2019/9/11 13:33, Michal Hocko wrote: >>> On Tue 10-09-19 14:53:39, Michal Hocko wrote: >>>> On Tue 10-09-19 20:47:40, Yunsheng Lin wrote: >>>>> On 2019/9/1

Re: [PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-11 Thread Yunsheng Lin
On 2019/9/11 13:33, Michal Hocko wrote: > On Tue 10-09-19 14:53:39, Michal Hocko wrote: >> On Tue 10-09-19 20:47:40, Yunsheng Lin wrote: >>> On 2019/9/10 19:12, Greg KH wrote: >>>> On Tue, Sep 10, 2019 at 01:04:51PM +0200, Michal Hocko wrote: >>>>>

Re: [PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-10 Thread Yunsheng Lin
On 2019/9/10 19:12, Greg KH wrote: > On Tue, Sep 10, 2019 at 01:04:51PM +0200, Michal Hocko wrote: >> On Tue 10-09-19 18:58:05, Yunsheng Lin wrote: >>> On 2019/9/10 17:31, Greg KH wrote: >>>> On Tue, Sep 10, 2019 at 02:43:32PM +0800, Yunsheng Lin wrote: >>

Re: [PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-10 Thread Yunsheng Lin
On 2019/9/10 17:31, Greg KH wrote: > On Tue, Sep 10, 2019 at 02:43:32PM +0800, Yunsheng Lin wrote: >> On 2019/9/9 17:53, Greg KH wrote: >>> On Mon, Sep 09, 2019 at 02:04:23PM +0800, Yunsheng Lin wrote: >>>> Currently a device does not belong to any of the n

Re: [PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-10 Thread Yunsheng Lin
On 2019/9/10 15:24, Michal Hocko wrote: > Our emails crossed, sorry about that. > > On Tue 10-09-19 15:08:20, Yunsheng Lin wrote: >> On 2019/9/10 2:50, Michal Hocko wrote: >>> On Mon 09-09-19 14:04:23, Yunsheng Lin wrote: > [...] >>>> Even if a device's

Re: [PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-10 Thread Yunsheng Lin
On 2019/9/10 2:50, Michal Hocko wrote: > On Mon 09-09-19 14:04:23, Yunsheng Lin wrote: >> Currently a device does not belong to any of the numa nodes >> (dev->numa_node is NUMA_NO_NODE) when the node id is neither >> specified by fw nor by virtual device layer and the

Re: [PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-10 Thread Yunsheng Lin
On 2019/9/9 17:53, Greg KH wrote: > On Mon, Sep 09, 2019 at 02:04:23PM +0800, Yunsheng Lin wrote: >> Currently a device does not belong to any of the numa nodes >> (dev->numa_node is NUMA_NO_NODE) when the node id is neither >> specified by fw nor by virtual device

[PATCH] driver core: ensure a device has valid node id in device_add()

2019-09-09 Thread Yunsheng Lin
ice really does belong to a node. This patch sets the device node to node 0 in device_add() if the device's node id is not specified and it either has no parent device, or the parent device also does not have a valid node id. [1] https://lkml.org/lkml/2019/9/2/466 Signed-off-by: Yunsheng

Re: [PATCH RFC] driver core: ensure a device has valid node id in device_add()

2019-09-06 Thread Yunsheng Lin
On 2019/9/6 22:00, Greg KH wrote: > On Fri, Sep 06, 2019 at 04:21:47PM +0800, Yunsheng Lin wrote: >> On 2019/9/6 14:52, Greg KH wrote: >>> On Fri, Sep 06, 2019 at 02:41:36PM +0800, Yunsheng Lin wrote: >>>> On 2019/9/5 15:33, Greg KH wrote: >>>>> On Th

Re: [PATCH RFC] driver core: ensure a device has valid node id in device_add()

2019-09-06 Thread Yunsheng Lin
On 2019/9/6 14:52, Greg KH wrote: > On Fri, Sep 06, 2019 at 02:41:36PM +0800, Yunsheng Lin wrote: >> On 2019/9/5 15:33, Greg KH wrote: >>> On Thu, Sep 05, 2019 at 02:48:24PM +0800, Yunsheng Lin wrote: >>>> On 2019/9/5 13:57, Greg KH wrote: >>>>> On Th

Re: [PATCH RFC] driver core: ensure a device has valid node id in device_add()

2019-09-06 Thread Yunsheng Lin
On 2019/9/5 15:33, Greg KH wrote: > On Thu, Sep 05, 2019 at 02:48:24PM +0800, Yunsheng Lin wrote: >> On 2019/9/5 13:57, Greg KH wrote: >>> On Thu, Sep 05, 2019 at 09:33:50AM +0800, Yunsheng Lin wrote: >>>> Currently a device does not belong to any of the n

Re: [PATCH RFC] driver core: ensure a device has valid node id in device_add()

2019-09-05 Thread Yunsheng Lin
On 2019/9/5 17:02, Greg KH wrote: > On Thu, Sep 05, 2019 at 04:57:00PM +0800, Yunsheng Lin wrote: >> On 2019/9/5 15:33, Greg KH wrote: >>> On Thu, Sep 05, 2019 at 02:48:24PM +0800, Yunsheng Lin wrote: >>>> On 2019/9/5 13:57, Greg KH wrote: >>>>> On Th

Re: [PATCH RFC] driver core: ensure a device has valid node id in device_add()

2019-09-05 Thread Yunsheng Lin
On 2019/9/5 15:33, Greg KH wrote: > On Thu, Sep 05, 2019 at 02:48:24PM +0800, Yunsheng Lin wrote: >> On 2019/9/5 13:57, Greg KH wrote: >>> On Thu, Sep 05, 2019 at 09:33:50AM +0800, Yunsheng Lin wrote: >>>> Currently a device does not belong to any of the n

Re: [PATCH RFC] driver core: ensure a device has valid node id in device_add()

2019-09-05 Thread Yunsheng Lin
On 2019/9/5 13:57, Greg KH wrote: > On Thu, Sep 05, 2019 at 09:33:50AM +0800, Yunsheng Lin wrote: >> Currently a device does not belong to any of the numa nodes >> (dev->numa_node is NUMA_NO_NODE) when the FW does not provide >> the node id and the device has not no parent

[PATCH RFC] driver core: ensure a device has valid node id in device_add()

2019-09-04 Thread Yunsheng Lin
org/lkml/2019/9/2/466 Signed-off-by: Yunsheng Lin --- drivers/base/core.c | 17 ++--- include/linux/numa.h | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 1669d41..466b8ff 100644 --- a/drivers/base/core.c ++

Re: [PATCH v2 2/9] x86: numa: check the node id consistently for x86

2019-09-03 Thread Yunsheng Lin
On 2019/9/3 15:11, Peter Zijlstra wrote: > On Tue, Sep 03, 2019 at 02:19:04PM +0800, Yunsheng Lin wrote: >> On 2019/9/2 20:56, Peter Zijlstra wrote: >>> On Mon, Sep 02, 2019 at 08:25:24PM +0800, Yunsheng Lin wrote: >>>> On 2019/9/2 15:25, Peter Zijlstra wrote: >&

Re: [PATCH] arm64: numa: check the node id before accessing node_to_cpumask_map

2019-08-30 Thread Yunsheng Lin
On 2019/8/30 16:39, Michal Hocko wrote: > On Fri 30-08-19 16:08:14, Yunsheng Lin wrote: >> On 2019/8/30 14:44, Michal Hocko wrote: >>> On Fri 30-08-19 14:35:26, Yunsheng Lin wrote: >>>> On 2019/8/30 13:55, Michal Hocko wrote: >>>>> On Fri 30-08-19 10

Re: [PATCH] arm64: numa: check the node id before accessing node_to_cpumask_map

2019-08-30 Thread Yunsheng Lin
On 2019/8/30 14:44, Michal Hocko wrote: > On Fri 30-08-19 14:35:26, Yunsheng Lin wrote: >> On 2019/8/30 13:55, Michal Hocko wrote: >>> On Fri 30-08-19 10:26:31, Yunsheng Lin wrote: >>>> Some buggy bios may not set the device' numa id, and dev_to_node >>>>

Re: [PATCH] arm64: numa: check the node id before accessing node_to_cpumask_map

2019-08-30 Thread Yunsheng Lin
On 2019/8/30 13:55, Michal Hocko wrote: > On Fri 30-08-19 10:26:31, Yunsheng Lin wrote: >> Some buggy bios may not set the device' numa id, and dev_to_node >> will return -1, which may cause global-out-of-bounds error >> detected by KASAN. > > Why should we w

[PATCH] arm64: numa: check the node id before accessing node_to_cpumask_map

2019-08-29 Thread Yunsheng Lin
in numa.h and numa.c. Signed-off-by: Yunsheng Lin --- arch/arm64/include/asm/numa.h | 6 ++ arch/arm64/mm/numa.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/include/asm/numa.h index 626ad01..da891ed 100644 --- a/arch

Re: [PATCH v2 2/6] mdev: Make mdev alias unique among all mdevs

2019-08-29 Thread Yunsheng Lin
On 2019/8/29 19:19, Parav Pandit wrote: > Mdev alias should be unique among all the mdevs, so that when such alias > is used by the mdev users to derive other objects, there is no > collision in a given system. > > Signed-off-by: Parav Pandit > > --- > Changelog: > v1->v2: > - Moved alias NULL

Re: [PATCH v2 1/6] mdev: Introduce sha1 based mdev alias

2019-08-29 Thread Yunsheng Lin
On 2019/8/29 19:18, Parav Pandit wrote: > Some vendor drivers want an identifier for an mdev device that is > shorter than the UUID, due to length restrictions in the consumers of > that identifier. > > Add a callback that allows a vendor driver to request an alias of a > specified length to be

[PATCH] vhost: Remove unnecessary variable

2019-08-20 Thread Yunsheng Lin
It is unnecessary to use ret variable to return the error code, just return the error code directly. Signed-off-by: Yunsheng Lin --- drivers/vhost/vhost.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 0536f85

[PATCH net-next] page_pool: remove unnecessary variable init

2019-08-15 Thread Yunsheng Lin
Remove variable initializations in functions that are followed by assignments before use Signed-off-by: Yunsheng Lin --- net/core/page_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 3272dc7..31187ff 100644 --- a/net

Re: [PATCH 2/2] vfio_pci: make use of update_irq_devid and optimize irq ops

2019-08-11 Thread Yunsheng Lin
On 2019/8/8 20:07, Ben Luo wrote: > When userspace (e.g. qemu) triggers a switch between KVM > irqfd and userspace eventfd, only dev_id of irq action > (i.e. the "trigger" in this patch's context) will be > changed, but a free-then-request-irq action is taken in > current code. And, irq affinity

Re: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for misc interrupt

2019-07-29 Thread Yunsheng Lin
eng >> (Y) ; tanhuazhong >> Subject: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for >> misc interrupt >> >> From: Yunsheng Lin >> >> The misc interrupt is used to schedule the reset and mailbox >> subtask, and a 1 sec timer is

Re: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for misc interrupt

2019-07-29 Thread Yunsheng Lin
On 2019/7/27 7:18, Saeed Mahameed wrote: > On Thu, 2019-07-25 at 10:05 +0800, Yunsheng Lin wrote: >> On 2019/7/25 3:24, Saeed Mahameed wrote: >>> On Wed, 2019-07-24 at 11:18 +0800, Huazhong Tan wrote: >>>> From: Yunsheng Lin >>>> > > [...] >>

Re: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for misc interrupt

2019-07-24 Thread Yunsheng Lin
On 2019/7/25 3:24, Saeed Mahameed wrote: > On Wed, 2019-07-24 at 11:18 +0800, Huazhong Tan wrote: >> From: Yunsheng Lin >> >> The misc interrupt is used to schedule the reset and mailbox >> subtask, and a 1 sec timer is used to schedule the service >>

Re: [PATCH net-next 02/12] net: hns3: enable DCB when TC num is one and pfc_en is non-zero

2019-06-28 Thread Yunsheng Lin
On 2019/6/29 2:47, Willem de Bruijn wrote: > On Fri, Jun 28, 2019 at 7:53 AM Huazhong Tan wrote: >> >> From: Yunsheng Lin >> >> Currently when TC num is one, the DCB will be disabled no matter if >> pfc_en is non-zero or not. >> >> This patch enable

[PATCH v3 net-next] net: link_watch: prevent starvation when processing linkwatch wq

2019-06-27 Thread Yunsheng Lin
problem and worker starvation problem for other work queue, such as irqfd_inject wq. This patch releases the cpu when link watch worker has processed a fixed number of netdev' link watch event, and schedule the work queue again when there is still link watch event remaining. Signed-off-by: Yunsheng

Re: [PATCH net-next] net: link_watch: prevent starvation when processing linkwatch wq

2019-06-24 Thread Yunsheng Lin
On 2019/5/29 16:59, Yunsheng Lin wrote: > On 2019/5/29 14:58, David Miller wrote: >> From: Yunsheng Lin >> Date: Mon, 27 May 2019 09:47:54 +0800 >> >>> When user has configured a large number of virtual netdev, such >>> as 4K vlans, the carrier on/off ope

Re: [PATCH v2 net-next] net: link_watch: prevent starvation when processing linkwatch wq

2019-06-02 Thread Yunsheng Lin
On 2019/5/31 19:17, Salil Mehta wrote: >> From: netdev-ow...@vger.kernel.org [mailto:netdev- >> ow...@vger.kernel.org] On Behalf Of Yunsheng Lin >> Sent: Friday, May 31, 2019 10:01 AM >> To: da...@davemloft.net >> Cc: hkallwe...@gmail.com; f.faine...@gmail.com; >

Re: [PATCH v2 net-next] net: link_watch: prevent starvation when processing linkwatch wq

2019-06-02 Thread Yunsheng Lin
On 2019/5/31 17:54, Salil Mehta wrote: >> From: netdev-ow...@vger.kernel.org On Behalf Of Yunsheng Lin >> Sent: Friday, May 31, 2019 10:01 AM >> To: da...@davemloft.net >> Cc: hkallwe...@gmail.com; f.faine...@gmail.com; >> step...@networkplumber.org; net...@

[PATCH v2 net-next] net: link_watch: prevent starvation when processing linkwatch wq

2019-05-31 Thread Yunsheng Lin
starvation problem. This patch releases the cpu and rtnl lock when link watch worker has processed a fixed number of netdev' link watch event. Currently __linkwatch_run_queue is called with rtnl lock, so enfore it with ASSERT_RTNL(); Signed-off-by: Yunsheng Lin --- V2: use cond_resched and rtnl_unlock

<    1   2   3   4   >