From patchwork Thu Aug 23 10:05:05 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: 961258 X-Patchwork-Delegate: shemminger@vyatta.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="lLKtYk9v"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41x0R404L6z9s4v for ; Thu, 23 Aug 2018 20:05:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728058AbeHWNea (ORCPT ); Thu, 23 Aug 2018 09:34:30 -0400 Received: from mail.toke.dk ([52.28.52.200]:39073 "EHLO mail.toke.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727231AbeHWNea (ORCPT ); Thu, 23 Aug 2018 09:34:30 -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=1535018731; bh=ocXQWuIxhfYHzczE7kybgAy554vt37hz3kpE/CNO9WY=; h=From:To:Cc:Subject:Date:From; b=lLKtYk9vgy44Omowvom1V/BAuze7CGaYPKYmJkLxo+jjdQdeYLUgpL6DyVMiCXbrT gZzwmghxMYzsOjoAERTLMh1D9ZwQd/EFZD6uSSIP5wInPnKMgHBUHc5ockjz40XEjQ wZae7xvvLwgdGC24CT5ONbAEtuW1C1mQtkC/JXRWDRatbE9GQcmtReb7620XNX0baM V5ReJ/LAKkweBWNBy8shQNCK4Lqc8OXboxEcV21ow0nTpLeFIhxob1y7S5tsbikbZi eV3MBAftpGBTV1pO5R78+guuoV5ZMgF2GrqsLWikaH+jp3i7+f7h3cBxMJ15GyvkUj f7lFOGairzbMg== To: netdev@vger.kernel.org Cc: cake@lists.bufferbloat.net, =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= Subject: [PATCH iproute2] q_cake: Add description of the tc filter override mechanism to man page Date: Thu, 23 Aug 2018 12:05:05 +0200 Message-Id: <20180823100505.22367-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 Since CAKE now has three different settings that can be overridden by tc filters (priority and host and flow hashes), documenting how they work is probably a good idea. Signed-off-by: Toke Høiland-Jørgensen --- man/man8/tc-cake.8 | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/man/man8/tc-cake.8 b/man/man8/tc-cake.8 index c1e751d6..c62e5547 100644 --- a/man/man8/tc-cake.8 +++ b/man/man8/tc-cake.8 @@ -569,6 +569,61 @@ 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 OVERRIDING CLASSIFICATION WITH TC FILTERS + +CAKE supports overriding of its internal classification of packets through the +tc filter mechanism. Packets can be assigned to different priority tins by +setting the +.B priority +field on the skb, and the flow hashing can be overridden by setting the +.B classid +parameter. + +.PP +.B Tin override + +.br + To assign a priority tin, the major number of the priority field needs +to match the qdisc handle of the cake instance; if it does, the minor number +will be interpreted as the tin index. For example, to classify all ICMP packets +as 'bulk', the following filter can be used: + +.br + # tc qdisc replace dev eth0 handle 1: root cake diffserv3 + # tc filter add dev eth0 parent 1: protocol ip prio 1 \\ + u32 match icmp type 0 0 action skbedit priority 1:1 + +.PP +.B Flow hash override + +.br + To override flow hashing, the classid can be set. CAKE will interpret +the major number of the classid as the host hash used in host isolation mode, +and the minor number as the flow hash used for flow-based queueing. One or both +of those can be set, and will be used if the relevant flow isolation parameter +is set (i.e., the major number will be ignored if CAKE is not configured in +hosts mode, and the minor number will be ignored if CAKE is not configured in +flows mode). + +.br +This example will assign all ICMP packets to the first queue: + +.br + # tc qdisc replace dev eth0 handle 1: root cake + # tc filter add dev eth0 parent 1: protocol ip prio 1 \\ + u32 match icmp type 0 0 classid 0:1 + +.br +If only one of the host and flow overrides is set, CAKE will compute the other +hash from the packet as normal. Note, however, that the host isolation mode +works by assigning a host ID to the flow queue; so if overriding both host and +flow, the same flow cannot have more than one host assigned. In addition, it is +not possible to assign different source and destination host IDs through the +override mechanism; if a host ID is assigned, it will be used as both source and +destination host. + + + .SH EXAMPLES # tc qdisc delete root dev eth0 .br