From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: [RFC PATCH 10/17] net: sched: qdisc_qlen for per cpu logic Date: Wed, 15 Nov 2017 07:18:43 -0800 Message-ID: References: <20171113195256.6245.64676.stgit@john-Precision-Tower-5810> <20171113201055.6245.8474.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-pg0-f67.google.com ([74.125.83.67]:56791 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755854AbdKOPTK (ORCPT ); Wed, 15 Nov 2017 10:19:10 -0500 Received: by mail-pg0-f67.google.com with SMTP id z184so12834370pgd.13 for ; Wed, 15 Nov 2017 07:19:09 -0800 (PST) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/14/2017 05:16 PM, Willem de Bruijn wrote: > On Mon, Nov 13, 2017 at 3:10 PM, John Fastabend > wrote: >> Add qdisc qlen helper routines for lockless qdiscs to use. >> >> The qdisc qlen is no longer used in the hotpath but it is reported >> via stats query on the qdisc so it still needs to be tracked. This >> adds the per cpu operations needed. >> >> Signed-off-by: John Fastabend >> --- >> 0 files changed >> >> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h >> index 4717c4b..bad24a9 100644 >> --- a/include/net/sch_generic.h >> +++ b/include/net/sch_generic.h >> @@ -291,8 +291,16 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz) >> BUILD_BUG_ON(sizeof(qcb->data) < sz); >> } >> >> +static inline int qdisc_qlen_cpu(const struct Qdisc *q) >> +{ >> + return this_cpu_ptr(q->cpu_qstats)->qlen; >> +} >> + >> static inline int qdisc_qlen(const struct Qdisc *q) >> { >> + if (q->flags & TCQ_F_NOLOCK) >> + return qdisc_qlen_cpu(q); > > Shouldn't this return qdisc_qlen_sum from the follow-on patch? > The two patches can also be squashed. > Actually I think this change can just be dropped. Looks like I removed all cases of calling it from NOLOCK paths. Also squashing this patch with 11/17 seems reasonable will go ahead and do that.