From patchwork Sun Jan 23 10:09:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 80052 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4CA73B7113 for ; Sun, 23 Jan 2011 21:09:19 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751409Ab1AWKJO (ORCPT ); Sun, 23 Jan 2011 05:09:14 -0500 Received: from mail-ww0-f42.google.com ([74.125.82.42]:52353 "EHLO mail-ww0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351Ab1AWKJN (ORCPT ); Sun, 23 Jan 2011 05:09:13 -0500 Received: by wwi17 with SMTP id 17so2233812wwi.1 for ; Sun, 23 Jan 2011 02:09:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:cc:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=vljGXnFwOfn1TveP5WT8bNCoW6yfYuvwUKtbdl5G888=; b=VlXo3y6w7ZiYIKGpVWy3KNWLmauRTFD1PE9t3qSYUpL0EiehBDj/cUdlZWa1AOPXLw u8vIJdxoxWBjTZ/mG0j4+C9pc1dMQfgxLin9JOE51G1mjdOmLkhILVW7pguhV6TuDw/n Gi7kypxtVYZxADjcdSR/Tvg0I0ozWTP0JksUc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=Ch14Ub+GyGMAbOyCOXikoBPuf6ZJcYMCccT3Q+lMHjcmFRE+k8zzvfcmFGT4EYp/Ho rGsvoOiJJ0Ixyb5L5DZpI7spvSv265U5+tAtDTuioCbtQu7+Wpg4v3hPW/RmF5FxHGTp XEKX/Wf860sTJirX+Kf8o9SEhMnDWtBIyUK9s= Received: by 10.227.155.15 with SMTP id q15mr2942682wbw.133.1295777351970; Sun, 23 Jan 2011 02:09:11 -0800 (PST) Received: from [10.150.51.210] (gw0.net.jmsp.net [212.23.165.14]) by mx.google.com with ESMTPS id 11sm8360540wbi.12.2011.01.23.02.09.10 (version=SSLv3 cipher=RC4-MD5); Sun, 23 Jan 2011 02:09:11 -0800 (PST) Subject: [PATCH iproute2] sfq: add divisor support From: Eric Dumazet To: Stephen Hemminger Cc: netdev In-Reply-To: <20110120.165618.180427971.davem@davemloft.net> References: <1295518498.2825.2.camel@edumazet-laptop> <20110120.165618.180427971.davem@davemloft.net> Date: Sun, 23 Jan 2011 11:09:06 +0100 Message-ID: <1295777346.17333.26.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In 2.6.39, we can build SFQ queues with a given hash table size, --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html different than default one (1024 slots) # tc qdisc add dev eth0 sfq help Usage: ... sfq [ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ] [ divisor NUMBER ] Signed-off-by: Eric Dumazet --- tc/q_sfq.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tc/q_sfq.c b/tc/q_sfq.c index 71a3c9a..98ec530 100644 --- a/tc/q_sfq.c +++ b/tc/q_sfq.c @@ -26,6 +26,7 @@ static void explain(void) { fprintf(stderr, "Usage: ... sfq [ limit NUMBER ] [ perturb SECS ] [ quantum BYTES ]\n"); + fprintf(stderr, " [ divisor NUMBER ]\n"); } static int sfq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) @@ -61,6 +62,13 @@ static int sfq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl return -1; } ok++; + } else if (strcmp(*argv, "divisor") == 0) { + NEXT_ARG(); + if (get_u32(&opt.divisor, *argv, 0)) { + fprintf(stderr, "Illegal \"divisor\"\n"); + return -1; + } + ok++; } else if (strcmp(*argv, "help") == 0) { explain(); return -1; @@ -93,6 +101,7 @@ static int sfq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) if (show_details) { fprintf(f, "flows %u/%u ", qopt->flows, qopt->divisor); } + fprintf(f, "divisor %u ", qopt->divisor); if (qopt->perturb_period) fprintf(f, "perturb %dsec ", qopt->perturb_period); return 0;