netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug
@ 2020-11-03  3:25 Yunsheng Lin
  2020-11-03 15:46 ` Vishwanath Pai
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Yunsheng Lin @ 2020-11-03  3:25 UTC (permalink / raw)
  To: gregkh, stable
  Cc: vpai, Joakim.Tjernlund, xiyou.wangcong, johunt, jhs, jiri, davem,
	kuba, netdev, linux-kernel, linuxarm, john.fastabend,
	eric.dumazet, dsahern

commit 2fb541c862c9 ("net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc")

When the above upstream commit is backported to stable kernel,
one assignment is missing, which causes two problems reported
by Joakim and Vishwanath, see [1] and [2].

So add the assignment 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 <linyunsheng@huawei.com>
---
 net/sched/sch_generic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 0e275e1..6e6147a 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -1127,10 +1127,13 @@ static void dev_deactivate_queue(struct net_device *dev,
 				 void *_qdisc_default)
 {
 	struct Qdisc *qdisc = rtnl_dereference(dev_queue->qdisc);
+	struct Qdisc *qdisc_default = _qdisc_default;
 
 	if (qdisc) {
 		if (!(qdisc->flags & TCQ_F_BUILTIN))
 			set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state);
+
+		rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
 	}
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug
  2020-11-03  3:25 [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug Yunsheng Lin
@ 2020-11-03 15:46 ` Vishwanath Pai
  2020-11-03 19:06 ` Jakub Kicinski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Vishwanath Pai @ 2020-11-03 15:46 UTC (permalink / raw)
  To: Yunsheng Lin, gregkh, stable
  Cc: Joakim.Tjernlund, xiyou.wangcong, johunt, jhs, jiri, davem, kuba,
	netdev, linux-kernel, linuxarm, john.fastabend, eric.dumazet,
	dsahern

On 11/2/20 10:25 PM, Yunsheng Lin wrote:
 > commit 2fb541c862c9 ("net: sch_generic: aviod concurrent reset and 
enqueue op for lockless qdisc")
 >
 > When the above upstream commit is backported to stable kernel,
 > one assignment is missing, which causes two problems reported
 > by Joakim and Vishwanath, see [1] and [2].
 >
 > So add the assignment back to fix it.
 >
 > 1. 
https://urldefense.com/v3/__https://www.spinics.net/lists/netdev/msg693916.html__;!!GjvTz_vk!AqzcoNtwXeDu-vDNRKnOiOWYmi4B-2atZZExjZTvpp2jeJ9asOyQBVUtQyBp$
 > 2. 
https://urldefense.com/v3/__https://www.spinics.net/lists/netdev/msg695131.html__;!!GjvTz_vk!AqzcoNtwXeDu-vDNRKnOiOWYmi4B-2atZZExjZTvpp2jeJ9asOyQBQlaitCQ$
 >
 > Fixes: 749cc0b0c7f3 ("net: sch_generic: aviod concurrent reset and 
enqueue op for lockless qdisc")
 > Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
 > ---
 >  net/sched/sch_generic.c | 3 +++
 >  1 file changed, 3 insertions(+)
 >
 > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
 > index 0e275e1..6e6147a 100644
 > --- a/net/sched/sch_generic.c
 > +++ b/net/sched/sch_generic.c
 > @@ -1127,10 +1127,13 @@ static void dev_deactivate_queue(struct 
net_device *dev,
 >                   void *_qdisc_default)
 >  {
 >      struct Qdisc *qdisc = rtnl_dereference(dev_queue->qdisc);
 > +    struct Qdisc *qdisc_default = _qdisc_default;
 >
 >      if (qdisc) {
 >          if (!(qdisc->flags & TCQ_F_BUILTIN))
 >              set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state);
 > +
 > +        rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
 >      }
 >  }
 >

I have tested the patch on v5.4.71 and it fixes our issues.

Tested-by: Vishwanath Pai <vpai@akamai.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug
  2020-11-03  3:25 [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug Yunsheng Lin
  2020-11-03 15:46 ` Vishwanath Pai
@ 2020-11-03 19:06 ` Jakub Kicinski
  2020-11-09 12:46 ` Greg KH
  2020-11-13  3:51 ` Brian Norris
  3 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2020-11-03 19:06 UTC (permalink / raw)
  To: Yunsheng Lin
  Cc: gregkh, stable, vpai, Joakim.Tjernlund, xiyou.wangcong, johunt,
	jhs, jiri, davem, netdev, linux-kernel, linuxarm, john.fastabend,
	eric.dumazet, dsahern

On Tue, 3 Nov 2020 11:25:38 +0800 Yunsheng Lin wrote:
> commit 2fb541c862c9 ("net: sch_generic: aviod concurrent reset and enqueue op for lockless qdisc")
> 
> When the above upstream commit is backported to stable kernel,
> one assignment is missing, which causes two problems reported
> by Joakim and Vishwanath, see [1] and [2].
> 
> So add the assignment 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 <linyunsheng@huawei.com>

Acked-by: Jakub Kicinski <kuba@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug
  2020-11-03  3:25 [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug Yunsheng Lin
  2020-11-03 15:46 ` Vishwanath Pai
  2020-11-03 19:06 ` Jakub Kicinski
@ 2020-11-09 12:46 ` Greg KH
  2020-11-10  0:58   ` Yunsheng Lin
  2020-11-13  3:51 ` Brian Norris
  3 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2020-11-09 12:46 UTC (permalink / raw)
  To: Yunsheng Lin
  Cc: stable, vpai, Joakim.Tjernlund, xiyou.wangcong, johunt, jhs,
	jiri, davem, kuba, netdev, linux-kernel, linuxarm,
	john.fastabend, eric.dumazet, dsahern

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 backported to stable kernel,
> one assignment is missing, which causes two problems reported
> by Joakim and Vishwanath, see [1] and [2].
> 
> So add the assignment 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 <linyunsheng@huawei.com>
> ---
>  net/sched/sch_generic.c | 3 +++
>  1 file changed, 3 insertions(+)

What kernel tree(s) does this need to be backported to?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug
  2020-11-09 12:46 ` Greg KH
@ 2020-11-10  0:58   ` Yunsheng Lin
  2020-11-17 12:09     ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Yunsheng Lin @ 2020-11-10  0:58 UTC (permalink / raw)
  To: Greg KH
  Cc: stable, vpai, Joakim.Tjernlund, xiyou.wangcong, johunt, jhs,
	jiri, davem, kuba, netdev, linux-kernel, linuxarm,
	john.fastabend, eric.dumazet, dsahern

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 backported to stable kernel,
>> one assignment is missing, which causes two problems reported
>> by Joakim and Vishwanath, see [1] and [2].
>>
>> So add the assignment 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 <linyunsheng@huawei.com>
>> ---
>>  net/sched/sch_generic.c | 3 +++
>>  1 file changed, 3 insertions(+)
> 
> What kernel tree(s) does this need to be backported to?

4.19.x and 5.4.x

Thanks

> 
> thanks,
> 
> greg k-h
> .
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug
  2020-11-03  3:25 [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug Yunsheng Lin
                   ` (2 preceding siblings ...)
  2020-11-09 12:46 ` Greg KH
@ 2020-11-13  3:51 ` Brian Norris
  3 siblings, 0 replies; 7+ messages in thread
From: Brian Norris @ 2020-11-13  3:51 UTC (permalink / raw)
  To: Yunsheng Lin
  Cc: gregkh, stable, vpai, Joakim.Tjernlund, xiyou.wangcong, johunt,
	jhs, jiri, davem, kuba, netdev, linux-kernel, linuxarm,
	john.fastabend, eric.dumazet, dsahern

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 backported to stable kernel,
> one assignment is missing, which causes two problems reported
> by Joakim and Vishwanath, see [1] and [2].
> 
> So add the assignment 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 <linyunsheng@huawei.com>

For whatever it's worth, we've seen similar problems (particularly,
ENOBUFS on AF_PACKET sockets) and have tested this fix on 4.19.y (we're
also queueing it up on our 5.4.y branch, but haven't tested it as much):

Tested-by: Brian Norris <briannorris@chromium.org>

Thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug
  2020-11-10  0:58   ` Yunsheng Lin
@ 2020-11-17 12:09     ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2020-11-17 12:09 UTC (permalink / raw)
  To: Yunsheng Lin
  Cc: stable, vpai, Joakim.Tjernlund, xiyou.wangcong, johunt, jhs,
	jiri, davem, kuba, netdev, linux-kernel, linuxarm,
	john.fastabend, eric.dumazet, dsahern

On Tue, Nov 10, 2020 at 08:58:17AM +0800, Yunsheng Lin wrote:
> 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 backported to stable kernel,
> >> one assignment is missing, which causes two problems reported
> >> by Joakim and Vishwanath, see [1] and [2].
> >>
> >> So add the assignment 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 <linyunsheng@huawei.com>
> >> ---
> >>  net/sched/sch_generic.c | 3 +++
> >>  1 file changed, 3 insertions(+)
> > 
> > What kernel tree(s) does this need to be backported to?
> 
> 4.19.x and 5.4.x

Now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-17 12:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03  3:25 [PATCH stable] net: sch_generic: fix the missing new qdisc assignment bug Yunsheng Lin
2020-11-03 15:46 ` Vishwanath Pai
2020-11-03 19:06 ` Jakub Kicinski
2020-11-09 12:46 ` Greg KH
2020-11-10  0:58   ` Yunsheng Lin
2020-11-17 12:09     ` Greg KH
2020-11-13  3:51 ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).