Re: [Patch net-next v3 3/3] net_sched: implement ->change_tx_queue_len() for pfifo_fast

2018-01-28 Thread Jason Wang
On 2018年01月26日 12:01, Cong Wang wrote: Is __skb_array_empty() in pfifo_fast_dequeue() still safe after this change? Yes, we sync with dequeue path before calling ->change_tx_queue_len(). I already mentioned this in patch 2/3. Aha, ok, I think I get the synchronize_net() trick in

Re: [Patch net-next v3 3/3] net_sched: implement ->change_tx_queue_len() for pfifo_fast

2018-01-28 Thread Cong Wang
On Fri, Jan 26, 2018 at 6:10 AM, Michael S. Tsirkin wrote: > > This part? Yes, dev_deactivate() as you quote. > > + bool up = dev->flags & IFF_UP; > + unsigned int i; > + int ret = 0; > + > + if (up) > + dev_deactivate(dev); > + > +

Re: [Patch net-next v3 3/3] net_sched: implement ->change_tx_queue_len() for pfifo_fast

2018-01-26 Thread Michael S. Tsirkin
On Thu, Jan 25, 2018 at 08:01:42PM -0800, Cong Wang wrote: > On Thu, Jan 25, 2018 at 7:57 PM, Jason Wang wrote: > > > > > > On 2018年01月26日 10:26, Cong Wang wrote: > >> > >> pfifo_fast used to drop based on qdisc_dev(qdisc)->tx_queue_len, > >> so we have to resize skb array

Re: [Patch net-next v3 3/3] net_sched: implement ->change_tx_queue_len() for pfifo_fast

2018-01-26 Thread Michael S. Tsirkin
On Fri, Jan 26, 2018 at 11:57:59AM +0800, Jason Wang wrote: > > > On 2018年01月26日 10:26, Cong Wang wrote: > > pfifo_fast used to drop based on qdisc_dev(qdisc)->tx_queue_len, > > so we have to resize skb array when we change tx_queue_len. > > > > Other qdiscs which read tx_queue_len are fine

Re: [Patch net-next v3 3/3] net_sched: implement ->change_tx_queue_len() for pfifo_fast

2018-01-25 Thread Cong Wang
On Thu, Jan 25, 2018 at 7:57 PM, Jason Wang wrote: > > > On 2018年01月26日 10:26, Cong Wang wrote: >> >> pfifo_fast used to drop based on qdisc_dev(qdisc)->tx_queue_len, >> so we have to resize skb array when we change tx_queue_len. >> >> Other qdiscs which read tx_queue_len are

Re: [Patch net-next v3 3/3] net_sched: implement ->change_tx_queue_len() for pfifo_fast

2018-01-25 Thread Jason Wang
On 2018年01月26日 10:26, Cong Wang wrote: pfifo_fast used to drop based on qdisc_dev(qdisc)->tx_queue_len, so we have to resize skb array when we change tx_queue_len. Other qdiscs which read tx_queue_len are fine because they all save it to sch->limit or somewhere else in qdisc during init. They

[Patch net-next v3 3/3] net_sched: implement ->change_tx_queue_len() for pfifo_fast

2018-01-25 Thread Cong Wang
pfifo_fast used to drop based on qdisc_dev(qdisc)->tx_queue_len, so we have to resize skb array when we change tx_queue_len. Other qdiscs which read tx_queue_len are fine because they all save it to sch->limit or somewhere else in qdisc during init. They don't have to implement this, it is nicer