On Wed, Jan 24, 2018 at 4:05 PM, John Fastabend <john.fastab...@gmail.com> wrote: > On 01/23/2018 10:18 AM, Cong Wang wrote: >> +int dev_qdisc_change_tx_queue_len(struct net_device *dev) >> +{ >> + bool up = dev->flags & IFF_UP; >> + unsigned int i; >> + int ret = 0; >> + >> + if (up) >> + dev_deactivate(dev); >> + >> + for (i = 0; i < dev->num_tx_queues; i++) { >> + ret = qdisc_change_tx_queue_len(dev, &dev->_tx[i]); >> + >> + /* TODO: revert changes on a partial failure */ >> + if (ret) >> + break; > > After another look it seems we can solve this without too much pain > by using skb_array_resize_multiple() in patch 3/3. Then pass the > error pack here via qdisc_change_tx_queue_len and reset queue length > to orig_length.
Yeah, I was not aware of that API, looks reasonable. But, since you are referring to dev_qdisc_change_tx_queue_len(), it doesn't help 2/3 because we still have to iterate each tx queue, so the above comment still stands. I will update patch 3/3. Thanks.