From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [Patch net-next v3 0/3] net_sched: reflect tx_queue_len change for pfifo_fast Date: Sun, 28 Jan 2018 22:25:05 -0800 Message-ID: References: <20180126022624.20442-1-xiyou.wangcong@gmail.com> <2d805413-f5ca-81b5-eac4-c20104bfe474@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Linux Kernel Network Developers To: John Fastabend Return-path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:44227 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032AbeA2GZ0 (ORCPT ); Mon, 29 Jan 2018 01:25:26 -0500 Received: by mail-pf0-f194.google.com with SMTP id 17so2691198pfw.11 for ; Sun, 28 Jan 2018 22:25:26 -0800 (PST) In-Reply-To: <2d805413-f5ca-81b5-eac4-c20104bfe474@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Sun, Jan 28, 2018 at 10:09 PM, John Fastabend wrote: > On 01/28/2018 09:57 PM, Cong Wang wrote: >> On Sun, Jan 28, 2018 at 9:35 PM, John Fastabend >> wrote: >>> On 01/25/2018 06:26 PM, Cong Wang wrote: >>>> This pathcset restores the pfifo_fast qdisc behavior of dropping >>>> packets based on latest dev->tx_queue_len. Patch 1 introduces >>>> a helper, patch 2 introduces a new Qdisc ops which is called when >>>> we modify tx_queue_len, patch 3 implements this ops for pfifo_fast. >>>> >>>> Please see each patch for details. >>>> >>> >>> Overall this series is better than what we have at the moment, but >>> a better fix would preallocate the memory, to avoid ENOMEM errors, >> >> I am not against for better ENOMEM error handling, but I still have to >> remind you that attach_one_default_qdisc() doesn't handle it either. >> Since no one complained about it, why this one is so special? > > Its not we should fix both cases. And also clean up the multiple > net sync calls in these paths as well. Now can we agree error handling can be improved later? You already agree this is not a new problem introduced by this patchset, why do you want to block a regression fix just because of an old problem which I will fix later? > >> >> >>> and add a ptr_ring API to use the preallocated buffers. >> >> >> What ptr_ring API could cure netdev tx queues problem here? >> Looks like you still don't understand the problem here. >> > > The resize multiple array API can only fail due to alloc failures. > We need to break this API into two pieces preallocate the memory > and then commit array changes. Alternatively the qdisc layer could > allocate new arrays and then swap them after all the arrays been > initialized correctly using ptr_ring APIs below the ptr_ring > resize API calls. > > Having ptr_ring API operations to support this seems best. > Apparently qdisc layer doesn't care about ptr_ring, as you describe here this potentially needs to change two layers: 1) qdisc layer 2) ptr_ring API. It is more work than just a simple error handling, potentially bigger than this patchset itself. >> >>> >>> We have time (its only in net-next) so lets do the complete fix >>> rather than this series IMO. >>> >> >> Why not just accept this and complete the error handling later >> given the fact that I already add a TODO? IOW, why it is now? >> > > Because its not correct and its not too much work to get it so > the error is avoided. So you must want a fix for net too, because attach_one_default_qdisc() "is not correct" either and "it is not too much work". I can't agree on any of your claims here. Sorry.