From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: [RFC PATCH 03/17] net: sched: remove remaining uses for qdisc_qlen in xmit path Date: Wed, 15 Nov 2017 07:00:26 -0800 Message-ID: <7a97a5c7-d81d-9dfe-9997-d27799705c99@gmail.com> References: <20171113195256.6245.64676.stgit@john-Precision-Tower-5810> <20171113200838.6245.5586.stgit@john-Precision-Tower-5810> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Daniel Borkmann , Eric Dumazet , make0818@gmail.com, Network Development , =?UTF-8?B?SmnFmcOtIFDDrXJr?= =?UTF-8?Q?o?= , Cong Wang To: Willem de Bruijn Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:54782 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753083AbdKOPAy (ORCPT ); Wed, 15 Nov 2017 10:00:54 -0500 Received: by mail-pf0-f195.google.com with SMTP id n89so17197250pfk.11 for ; Wed, 15 Nov 2017 07:00:54 -0800 (PST) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/14/2017 05:56 PM, Willem de Bruijn wrote: > On Tue, Nov 14, 2017 at 7:11 PM, Willem de Bruijn > wrote: >> On Mon, Nov 13, 2017 at 3:08 PM, John Fastabend >> wrote: >>> sch_direct_xmit() uses qdisc_qlen as a return value but all call sites >>> of the routine only check if it is zero or not. Simplify the logic so >>> that we don't need to return an actual queue length value. >>> >>> This introduces a case now where sch_direct_xmit would have returned >>> a qlen of zero but now it returns true. >> >> You mean the first case, when the likely(skb) branch failed? >> Can that return false, then? > > I misunderstood. __qdisc_run will just take one extra loop, since it > will no longer break out of the loop on reading the last packet on > the queue with qdisc_restart. > > That does have a subtle (but benign if rare) side effect of possibly > calling __netif_schedule while there is nothing queued, if either > the quota is exactly exhausted or need_resched is true. > Right. Seems OK to me. Will also make code cleanup comment from intial email. .John