From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2] fq_codel: add per queue memory limit Date: Wed, 1 Jun 2016 08:53:40 -0700 Message-ID: <20160601085340.4b3c84dc@xeon-e3> References: <1464791011.5939.150.camel@edumazet-glaptop3.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev To: Eric Dumazet Return-path: Received: from mail-pf0-f179.google.com ([209.85.192.179]:36225 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932108AbcFAPx2 (ORCPT ); Wed, 1 Jun 2016 11:53:28 -0400 Received: by mail-pf0-f179.google.com with SMTP id f144so17552753pfa.3 for ; Wed, 01 Jun 2016 08:53:27 -0700 (PDT) In-Reply-To: <1464791011.5939.150.camel@edumazet-glaptop3.roam.corp.google.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 01 Jun 2016 07:23:31 -0700 Eric Dumazet wrote: > + } else if (strcmp(*argv, "memory_limit") == 0) { > + NEXT_ARG(); > + if (get_size(&memory, *argv)) { > + fprintf(stderr, "Illegal \"memory_limit\"\n"); > + return -1; > + } Do you really want to allow memory limit of 0? > + if (tb[TCA_FQ_CODEL_MEMORY_LIMIT] && > + RTA_PAYLOAD(tb[TCA_FQ_CODEL_MEMORY_LIMIT]) >= sizeof(__u32)) { > + memory_limit = rta_getattr_u32(tb[TCA_FQ_CODEL_MEMORY_LIMIT]); > + > + fprintf(f, "memory_limit %s ", sprint_size(memory_limit, b1)); > + } Why the size check? other parameters don't do it?