From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH iproute2-next 3/3] q_netem: slotting with non-uniform distribution Date: Sun, 12 Aug 2018 16:18:05 -0600 Message-ID: References: <20180806170953.164776-1-ysseung@google.com> <20180806170953.164776-4-ysseung@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Stephen Hemminger , Michael McLennan , Priyaranjan Jha , Neal Cardwell , Dave Taht To: Yousuk Seung , netdev@vger.kernel.org Return-path: Received: from mail-pl0-f52.google.com ([209.85.160.52]:40692 "EHLO mail-pl0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727774AbeHMA5f (ORCPT ); Sun, 12 Aug 2018 20:57:35 -0400 Received: by mail-pl0-f52.google.com with SMTP id s17-v6so6101337plp.7 for ; Sun, 12 Aug 2018 15:18:08 -0700 (PDT) In-Reply-To: <20180806170953.164776-4-ysseung@google.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 8/6/18 11:09 AM, Yousuk Seung wrote: > @@ -417,21 +421,53 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, > } > } > } else if (matches(*argv, "slot") == 0) { > - NEXT_ARG(); > - present[TCA_NETEM_SLOT] = 1; > - if (get_time64(&slot.min_delay, *argv)) { > - explain1("slot min_delay"); > - return -1; > - } > if (NEXT_IS_NUMBER()) { > NEXT_ARG(); > - if (get_time64(&slot.max_delay, *argv)) { > - explain1("slot min_delay max_delay"); > + present[TCA_NETEM_SLOT] = 1; > + if (get_time64(&slot.min_delay, *argv)) { > + explain1("slot min_delay"); > + return -1; > + } > + if (NEXT_IS_NUMBER()) { > + NEXT_ARG(); > + if (get_time64(&slot.max_delay, *argv)) { > + explain1("slot min_delay max_delay"); > + return -1; > + } > + } > + if (slot.max_delay < slot.min_delay) > + slot.max_delay = slot.min_delay; > + } else { > + NEXT_ARG(); > + if (strcmp(*argv, "distribution") == 0) { > + present[TCA_NETEM_SLOT] = 1; > + NEXT_ARG(); > + slot_dist_data = calloc(sizeof(slot_dist_data[0]), MAX_DIST); if (!slot_dist_data) ...