From patchwork Mon Aug 13 11:36:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= X-Patchwork-Id: 956944 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=toke.dk Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=toke.dk header.i=@toke.dk header.b="ddLyvWhW"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41ptwn5kg5z9sBJ for ; Mon, 13 Aug 2018 21:36:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729250AbeHMOSc (ORCPT ); Mon, 13 Aug 2018 10:18:32 -0400 Received: from mail.toke.dk ([52.28.52.200]:53173 "EHLO mail.toke.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728427AbeHMOSc (ORCPT ); Mon, 13 Aug 2018 10:18:32 -0400 From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1534160196; bh=J7Ff8fAO5rEV2830Ok9k8mt4hte2QmyWEHwuXG0ni+o=; h=From:To:Cc:Subject:Date:From; b=ddLyvWhW953mOkuew83KTECPpgllvImTg4Y42v7FzDKUD96jqKxYIaQ5jn+WDxRAe M/P6MLzY+dM73HHGF/k8hECsRSOsNq8erhcKuDgg3llFmgBZkZONYM1PsRJsBy7AE4 j2J4DHlxe6cOMEMBB6wIs03v69GV/uTWZi8YvRDaEdXw3WQjF3kAly/ObpdraCF0st HVhfPUIZ0ok4t8ReZs6aixTLCQAyDYv/3mPZ4beEFMRHO79zgpzxIeB0dKLmtcflrh DWZZicvJK4KlDts/5kFJ3KPfjdnbs2wgBYz1KvPEDRsB7hyhmWdcn8VLncNMrvCcZe IO9Er2oc4WIpw== To: David Ahern Cc: netdev@vger.kernel.org, =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , Dave Taht Subject: [PATCH v2 iproute2-next] sch_cake: Make gso-splitting configurable Date: Mon, 13 Aug 2018 13:36:17 +0200 Message-Id: <20180813113617.13073-1-toke@toke.dk> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch makes sch_cake's gso/gro splitting configurable from userspace. To disable breaking apart superpackets in sch_cake: tc qdisc replace dev whatever root cake no-split-gso to enable: tc qdisc replace dev whatever root cake split-gso Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Dave Taht --- v2: - Fix x-mas tree variable order - Also update man page man/man8/tc-cake.8 | 23 +++++++++++++++++++++++ tc/q_cake.c | 9 +++++++++ 2 files changed, 32 insertions(+) diff --git a/man/man8/tc-cake.8 b/man/man8/tc-cake.8 index 0e84bc6e..b8e3089b 100644 --- a/man/man8/tc-cake.8 +++ b/man/man8/tc-cake.8 @@ -73,6 +73,12 @@ TIME | ] .br [ +.BR split-gso* +| +.BR no-split-gso +] +.br +[ .BR ack-filter | .BR ack-filter-aggressive @@ -546,6 +552,23 @@ If you are shaping inbound, and cannot trust the diffserv markings (as is the case for Comcast Cable, among others), it is best to use a single queue "besteffort" mode with wash. +.PP +.B split-gso + +.br + This option controls whether CAKE will split General Segmentation +Offload (GSO) super-packets into their on-the-wire components and +dequeue them individually. + +.br +Super-packets are created by the networking stack to improve efficiency. +However, because they are larger they take longer to dequeue, which +translates to higher latency for competing flows, especially at lower +bandwidths. CAKE defaults to splitting GSO packets to achieve the lowest +possible latency. At link speeds higher than 10 Gbps, setting the +no-split-gso parameter can increase the maximum achievable throughput by +retaining the full GSO packets. + .SH EXAMPLES # tc qdisc delete root dev eth0 .br diff --git a/tc/q_cake.c b/tc/q_cake.c index f1e232a6..50de46a7 100644 --- a/tc/q_cake.c +++ b/tc/q_cake.c @@ -79,6 +79,7 @@ static void explain(void) " dual-srchost | dual-dsthost | triple-isolate* ]\n" " [ nat | nonat* ]\n" " [ wash | nowash* ]\n" +" [ split-gso* | no-split-gso ]\n" " [ ack-filter | ack-filter-aggressive | no-ack-filter* ]\n" " [ memlimit LIMIT ]\n" " [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n" @@ -99,6 +100,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv, __u64 bandwidth = 0; int ack_filter = -1; struct rtattr *tail; + int split_gso = -1; int unlimited = 0; int flowmode = -1; int autorate = -1; @@ -155,6 +157,10 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv, wash = 0; } else if (strcmp(*argv, "wash") == 0) { wash = 1; + } else if (strcmp(*argv, "split-gso") == 0) { + split_gso = 1; + } else if (strcmp(*argv, "no-split-gso") == 0) { + split_gso = 0; } else if (strcmp(*argv, "flowblind") == 0) { flowmode = CAKE_FLOW_NONE; } else if (strcmp(*argv, "srchost") == 0) { @@ -374,6 +380,9 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv, addattr_l(n, 1024, TCA_CAKE_NAT, &nat, sizeof(nat)); if (wash != -1) addattr_l(n, 1024, TCA_CAKE_WASH, &wash, sizeof(wash)); + if (split_gso != -1) + addattr_l(n, 1024, TCA_CAKE_SPLIT_GSO, &split_gso, + sizeof(split_gso)); if (ingress != -1) addattr_l(n, 1024, TCA_CAKE_INGRESS, &ingress, sizeof(ingress)); if (ack_filter != -1)