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 to rename to a better name. > >> >> Also,

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: > > On 2020/9/3 8:35, Cong Wang wrote: >> On Tue, Sep 1, 2020 at 11:35

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

2020-09-03 Thread John Fastabend
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: > > >> > > >> On 2020/9/3 8:35, Cong Wang wrote: > > >>> On Tue, Sep 1, 2020 at 11:35 PM Yunsheng Lin > > >>> wrote:

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

2020-09-03 Thread Eric Dumazet
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 to rename to a better name. > > Also, qdisc_reset() could be called multi times for the same

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

2020-09-02 Thread Cong Wang
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: > >> > >> 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

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: > On Tue, Sep 1, 2020 at 6:42 PM Yunsheng Lin > wrote:

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

2020-09-02 Thread Cong Wang
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: > >>> On Tue, Sep 1, 2020 at 6:42 PM Yunsheng Lin > >>> wrote: > > On 2020/9/2 2:24, Cong

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: > On Mon, Aug 31, 2020 at 5:59 PM Yunsheng Lin > 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 not familiar with TCQ_F_CAN_BYPASS. From my understanding, the problem is that there is no

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

2020-09-02 Thread Cong Wang
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: > >>> On Mon, Aug 31, 2020 at 5:59 PM Yunsheng Lin > >>> wrote: > > Currently there is

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

2020-09-02 Thread Eric Dumazet
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 not familiar with TCQ_F_CAN_BYPASS. >>> From my understanding, the problem is that there is no order between >>> qdisc enqueuing and qdisc reset. >>

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 qdisc_reset() should be done after rcu grace

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

2020-09-02 Thread Eric Dumazet
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 qdisc_reset() should be done after rcu grace period, when there is guarantee no enqueue is in

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 operation for the same lockless qdisc when

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

2020-09-01 Thread Cong Wang
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 operation for the > >> same lockless qdisc when there is no lock to synchronize the > >>

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() with the qdisc reset operation in >>

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: sched: allow qdiscs to handle locking") > > You should

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

2020-09-01 Thread David Miller
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: sched: allow qdiscs to handle locking") You should repost the patch with the Fixes: tag in order to

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

2020-09-01 Thread Cong Wang
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() with the qdisc reset operation in > qdisc_deactivate() called by

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() with the qdisc reset operation in >>

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

2020-09-01 Thread Eric Dumazet
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() with the qdisc reset operation in > qdisc_deactivate() called by dev_deactivate_queue(),

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

2020-08-31 Thread Yunsheng Lin
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() with the qdisc reset operation in qdisc_deactivate() called by dev_deactivate_queue(), which may cause out-of-bounds access for