From patchwork Thu Feb 18 15:24:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1441699 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=RzYGvtPp; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DhJSW6VqQz9sCD for ; Fri, 19 Feb 2021 02:25:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 81A7A60590 for ; Thu, 18 Feb 2021 15:25:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ptCkRMLnrjpr for ; Thu, 18 Feb 2021 15:25:44 +0000 (UTC) Received: by smtp3.osuosl.org (Postfix, from userid 1001) id 8D9DF60663; Thu, 18 Feb 2021 15:25:44 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTP id 0DBC46058C; Thu, 18 Feb 2021 15:25:35 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D5C12C000E; Thu, 18 Feb 2021 15:25:34 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2BE3FC000D for ; Thu, 18 Feb 2021 15:25:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1B3C180B15 for ; Thu, 18 Feb 2021 15:25:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MXjZUZnxU9+D for ; Thu, 18 Feb 2021 15:25:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6F7CF806EA for ; Thu, 18 Feb 2021 15:25:33 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id x136so1517985pfc.2 for ; Thu, 18 Feb 2021 07:25:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=3TestxE/7ap5nbgDSbi43FDjqizeKXbzavQTY+uIN9Y=; b=RzYGvtPpCxNvl9dVYArjIHHu9icWjchwJTHU60lq79QNufzL9XUzRDu3Gs3d+QDwjq 3K6l/UsPZT5EhJmqPuD1yvlv0gB8fBj4xDOaECe9IyWg5HUTaUOhKFSNv49gKpIb5pX5 nIBes2cLT4Ty89bTgh/cYkZdE2SuGc5F3JvWIhVO9xV4tilOgK8t93HLncqO6OjIz4p/ 5ZwJWbCPP0U0+dQbE71TPwgtfCmCQyZCg2ZhqbldPtHGyelnL/e3rV02i1HNA8SOlMe9 Dwi9nRD7uOhw3TSVT0m7xyobOvESNKY6oDtp5K7QmeNE5TwQMVA3FYRziqlZDMB5kvyy 5MJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3TestxE/7ap5nbgDSbi43FDjqizeKXbzavQTY+uIN9Y=; b=mg8fnXctqbMlHgb8in1Hx7WaBxd9HseUASF8Dm8rRyUHlBXs7iCqtG34izXRqoG68W jHn6Fnew4zsnXm0u66GUvQ+FXhkzdG+Jpn9WjpopTvWFqTYnp2el+eOMTmYiPzDH3w0e caqfenuOyKLYlt0MNudLHOTKCvTG4qPx6SulYBq8quOVJyht1uQ/66eaQ9j0D8ZMkTcJ heF7Du6sK5fCIW6Ddzm4kgMAzi+Is46/mRNALMw0+S1VUVGRmKN6Ciy/9Fdhr+ph86xY IQYEmN+WK1MG0RWx/B+yC+miBiORuhvG8oRN+RUsvlHFGQqCIgHJDDS3EO30q/7JxXpj Dahg== X-Gm-Message-State: AOAM530v3lwrKjIXXoViEbBVi5Aiht3lkBg3hvWm8UykKMRrh5YuGCB0 wCFJ9GrUdJJD2Tw4+lC7kRG6tTCYkjk= X-Google-Smtp-Source: ABdhPJySMCkbBpYEM+ByGuEHY8RA/Xp36/rHjGJIPG2GBQOlgVIItzD2GXgMwvqfhjg354Hy7K0HQQ== X-Received: by 2002:a65:6688:: with SMTP id b8mr4491875pgw.158.1613661932369; Thu, 18 Feb 2021 07:25:32 -0800 (PST) Received: from sc9-mailhost3.vmware.com (c-67-185-44-206.hsd1.wa.comcast.net. [67.185.44.206]) by smtp.gmail.com with ESMTPSA id g68sm7270588pfb.29.2021.02.18.07.25.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2021 07:25:31 -0800 (PST) From: William Tu To: dev@openvswitch.org Date: Thu, 18 Feb 2021 07:24:49 -0800 Message-Id: <1613661889-59893-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [ovs-dev] [PATCHv2] Documentation: Fix DPDK qos example. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Fix the example use case based on the decription. EIR and CIR are measured in bytes/sec and considered 64-byte IP packets size withtout 14-byte Ethernet header. So fix the 1000pps example by: (64 - 14) * 1000 = 50,000 If the frame includes 4-byte FCS header, then it's (64 - 14 - 4) * 1000 = 46,000 Fixes: e61bdffc2a98 ("netdev-dpdk: Add new DPDK RFC 4115 egress policer") Signed-off-by: William Tu Acked-by: Eelco Chaudron --- Documentation/topics/dpdk/qos.rst | 14 ++++++++------ vswitchd/vswitch.xml | 6 ++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Documentation/topics/dpdk/qos.rst b/Documentation/topics/dpdk/qos.rst index 103495415a9c..a98ec672fcf5 100644 --- a/Documentation/topics/dpdk/qos.rst +++ b/Documentation/topics/dpdk/qos.rst @@ -69,22 +69,24 @@ to prioritize certain traffic over others at a port level. For example, the following configuration will limit the traffic rate at a port level to a maximum of 2000 packets a second (64 bytes IPv4 packets). -100pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess -Information Rate). High priority traffic is routed to queue 10, which marks +1000pps as CIR (Committed Information Rate) and 1000pps as EIR (Excess +Information Rate). CIR and EIR are measured in bytes without Ethernet header. +As a result, 1000pps means (64-byte - 14-byte) * 1000 = 50,000 in the +configuration below. High priority traffic is routed to queue 10, which marks all traffic as CIR, i.e. Green. All low priority traffic, queue 20, is marked as EIR, i.e. Yellow:: $ ovs-vsctl --timeout=5 set port dpdk1 qos=@myqos -- \ --id=@myqos create qos type=trtcm-policer \ - other-config:cir=52000 other-config:cbs=2048 \ - other-config:eir=52000 other-config:ebs=2048 \ + other-config:cir=50000 other-config:cbs=2048 \ + other-config:eir=50000 other-config:ebs=2048 \ queues:10=@dpdk1Q10 queues:20=@dpdk1Q20 -- \ --id=@dpdk1Q10 create queue \ - other-config:cir=41600000 other-config:cbs=2048 \ + other-config:cir=100000 other-config:cbs=2048 \ other-config:eir=0 other-config:ebs=0 -- \ --id=@dpdk1Q20 create queue \ other-config:cir=0 other-config:cbs=0 \ - other-config:eir=41600000 other-config:ebs=2048 \ + other-config:eir=50000 other-config:ebs=2048 This configuration accomplishes that the high priority traffic has a guaranteed bandwidth egressing the ports at CIR (1000pps), but it can also diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index a2ad84edefa9..4597a215d936 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -4660,7 +4660,8 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \ packets per second the CIR would be set to to to 46000000. This value can be broken into '1,000,000 x 46'. Where 1,000,000 is the policing rate for the number of packets per second and 46 represents the size - of the packet data for a 64 byte ip packet. + of the packet data for a 64 bytes IP packet without 14 bytes Ethernet + and 4 bytes FCS header. The Committed Burst Size (CBS) is measured in bytes and represents a @@ -4681,7 +4682,8 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \ packets per second the EIR would be set to to to 46000000. This value can be broken into '1,000,000 x 46'. Where 1,000,000 is the policing rate for the number of packets per second and 46 represents the size - of the packet data for a 64 byte ip packet. + of the packet data for a 64 bytes IP packet without 14 bytes Ethernet + and 4 bytes FCS header. The Excess Burst Size (EBS) is measured in bytes and represents a