From patchwork Sat Jul 2 03:18:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianbo Liu X-Patchwork-Id: 1651427 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=t7cLDBii; dkim-atps=neutral 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=) 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 (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LZckR1r8Lz9ryY for ; Sat, 2 Jul 2022 13:19:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 30B3F60F60; Sat, 2 Jul 2022 03:19:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 30B3F60F60 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=t7cLDBii 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 FjAGz9PwTfv0; Sat, 2 Jul 2022 03:19:40 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 75B7B614D0; Sat, 2 Jul 2022 03:19:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 75B7B614D0 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 65756C0083; Sat, 2 Jul 2022 03:19:37 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 20420C007B for ; Sat, 2 Jul 2022 03:19:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 74C6D61471 for ; Sat, 2 Jul 2022 03:19:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 74C6D61471 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 16ttfIemPuLO for ; Sat, 2 Jul 2022 03:19:05 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A1B2F60FEF Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2071.outbound.protection.outlook.com [40.107.223.71]) by smtp3.osuosl.org (Postfix) with ESMTPS id A1B2F60FEF for ; Sat, 2 Jul 2022 03:19:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ioCnU71UGVajrTIsjs0KxqCKeqHxdywkhVUhqkgHaheL3f1oocJmalIOuknPwYG48v42zhQ5XnT+crLhRxV7wuiCeW1Wn8sEbjxgLsqiCWkhW4OQ3znvt8ob15+S2IZDBPNZMTi4bgUxah4LF6aoUyoHZuCv3ajR22jFXXVMCAzMsXX78zqpEHa+FBhUrfAqtdJw9lByic0NWK4olYr4MJuKISjS91w4Zil6Hi0bRdWbXQNSrKmy7W1V8wKYp1pYDbiTIKFnvYh+TeM+KSTcx3XvWnm/xXDWX3N2IQ/z9MELVbk0gvafOmE0ku5HfzGL/BNo1SGDqcxniesXvCNkCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+Uh4MPqEz1RQrKoTYdG+8pwNXZaukZ3FBe3mkfRJLng=; b=nG2kgxbgKrK2KXEGJ3x4+DSV7MolO9GGH6tlIdeWqrym1XhX0Dc6nJw3RjlMoBVs7Kj+7AoicFy5SarJNHyC5T9Bls2Scr9n4g3drb+reWgbg1Qcz41UROTvf6rO2yJh0Ik2OFzMYB9F82OskWoPz199rx35J4loW9dlplaIcAcFCc9FPa444D8skj7azFiqrQYCidTJBo+Nr4Tl6z88bPBykubZqffjtGXcgcsrFSGdhuq55mmmqUWY0BZ7b8Tur0aXhM/76+zYNCNTNfOcePUSOiIpozUPCTeFex+GUgv96S8Nu+X3cp0KW2j0AHznPLoKduPb5ikTP4l30d/tMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=corigine.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Uh4MPqEz1RQrKoTYdG+8pwNXZaukZ3FBe3mkfRJLng=; b=t7cLDBiim/vloUFuoHe4NTIln9gaSoUEsa8K4RXrW0DBM8R+OROp5AAkqANh5iRhHfKqm81bmL/obnO2SfmYKU8xJgBgI86NuvfztSfWjBePEKZvkHNeIy603exPMpo46hrS/tCJiIMVYagZBOoc6LxwLNbMi7pnYzZArY80tClX2CxpCInvoaTgVITgQwGWxZ8liTfeLp31D9kH8FOdv7kszr968xbq+kiT/suwtT/SEyFAYE51Kxjryov09z0M4+iSiAQHZZlVaVnogY2WqKhc4Pd0bShFvrxWjYf0+SbIfggyQVvClc20fDPglpyK0FqW3Mc82B6g7PPhlJlm8Q== Received: from MW4PR04CA0090.namprd04.prod.outlook.com (2603:10b6:303:6b::35) by MWHPR12MB1151.namprd12.prod.outlook.com (2603:10b6:300:e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Sat, 2 Jul 2022 03:19:02 +0000 Received: from CO1NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:303:6b:cafe::d0) by MW4PR04CA0090.outlook.office365.com (2603:10b6:303:6b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Sat, 2 Jul 2022 03:19:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by CO1NAM11FT039.mail.protection.outlook.com (10.13.174.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5395.14 via Frontend Transport; Sat, 2 Jul 2022 03:19:01 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sat, 2 Jul 2022 03:19:01 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Fri, 1 Jul 2022 20:19:00 -0700 Received: from vdi.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Fri, 1 Jul 2022 20:18:58 -0700 To: , , , , , Date: Sat, 2 Jul 2022 03:18:32 +0000 Message-ID: <20220702031832.13282-10-jianbol@nvidia.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220702031832.13282-1-jianbol@nvidia.com> References: <20220702031832.13282-1-jianbol@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c3aa801-c145-492e-4f90-08da5bd99c6d X-MS-TrafficTypeDiagnostic: MWHPR12MB1151:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3P9hdCno7lcCOlA5mkW8HebTnOmxoWM0ESnYND5I2fddHAEjXAYHxm/gAg6sDIPhhL2xlFjd6oX8RL0GFUC+/6zOZZ9FstyPS73yorqksaEACsIi8L9RN5v4s8xQfOExtNEccY5Ljq8ldXWGVuVbGeShyAMRcclqBrVi0zUZz9MJBOPqbpz17tOnc+qmc9nBt3tPu6rjQ+rjalAbxxBWk7p18pQJqoz/G3Fe38doYrS3nHtneneLuiTrqzTxh1L6d5wTAzvRSXuWbI3RFCDoCBuWFE2tLpyCYpfxUT5JKBNHr0FRQGMlXyHOp+iMhJnJYLZw/KqITXKyQ7WLSpyfnbJl1IC4pKXmhq+VwsRPtpxxYnneGP43p5w1SnAWsSwTqnL99+AgyMzCOYtGRMs1kdcR25ELd0cNvQZuJfSpnuAMpE+hXvyBtjl/wDbrLZhs8FSy4SLZxeWXunv3sxpGyStJ4NtAPwxNUycrEzUuJYaFrsL/bFffHjNDDnS7iT/uehg9CUQcHbRBe3UvjzpF/4ycFKryxP+wWMoWT+ttxebX4Z53Awk5n4hqmx9WE/n8oD8dlI4Q+v0UnyroGhTDSDjxbVUByvxTT8KW7UDKPTS+BNAP9ffcJXmLC2C5b3+OpkDPHoo24b2QO/2C5VuNQ6HWDFZlubzhlaEF2oC1ABNn7bkP0KkX10hhc0IrU5ieBoy+dpdwjc99Ss8hhZefL21/JOYt0lyHEfKmpOOUCPIIQAt7sVAySelVNDsB15YjSXL+nm4mTKMt1rHi69249FfeswYNdOiUnJNN5XgyTe1qacROc8lS5kM/JfNwuHp8mcA1NEZ+bDPMFX4t4X1HLWQca3VFJ6Ghpl306nOxF5Tvbol52hNNRzYXMct6QXwvojyweJQxY0s7HgvUOt2JGHjutxkKD5XIsljUx0hllw68VqwdTe/1vX9jwdapvUoU X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(136003)(346002)(39860400002)(376002)(396003)(46966006)(40470700004)(36840700001)(7696005)(82740400003)(81166007)(82310400005)(356005)(2906002)(6666004)(186003)(41300700001)(83380400001)(40480700001)(2616005)(47076005)(26005)(426003)(70586007)(107886003)(8676002)(36756003)(86362001)(966005)(5660300002)(70206006)(4326008)(478600001)(8936002)(336012)(40460700003)(1076003)(110136005)(36860700001)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2022 03:19:01.5224 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c3aa801-c145-492e-4f90-08da5bd99c6d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1151 Cc: Jianbo Liu Subject: [ovs-dev] [v6 9/9] doc: Add meter offload topic document 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: , X-Patchwork-Original-From: Jianbo Liu via dev From: Jianbo Liu Reply-To: Jianbo Liu Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Fow now, add introduction and the limitation of meter offload. Signed-off-by: Jianbo Liu --- Documentation/automake.mk | 1 + Documentation/howto/index.rst | 1 + Documentation/howto/tc-offload.rst | 75 ++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 Documentation/howto/tc-offload.rst diff --git a/Documentation/automake.mk b/Documentation/automake.mk index 6c2c57739..185349c14 100644 --- a/Documentation/automake.mk +++ b/Documentation/automake.mk @@ -79,6 +79,7 @@ DOC_SOURCE = \ Documentation/howto/vlan.png \ Documentation/howto/vlan.rst \ Documentation/howto/vtep.rst \ + Documentation/howto/tc-offload.rst \ Documentation/ref/index.rst \ Documentation/faq/index.rst \ Documentation/faq/configuration.rst \ diff --git a/Documentation/howto/index.rst b/Documentation/howto/index.rst index 60fb8a717..1812f6a11 100644 --- a/Documentation/howto/index.rst +++ b/Documentation/howto/index.rst @@ -49,4 +49,5 @@ OVS vtep sflow dpdk + tc-offload diff --git a/Documentation/howto/tc-offload.rst b/Documentation/howto/tc-offload.rst new file mode 100644 index 000000000..09a136264 --- /dev/null +++ b/Documentation/howto/tc-offload.rst @@ -0,0 +1,75 @@ +.. + Licensed under the Apache License, Version 2.0 (the "License"); you may + not use this file except in compliance with the License. You may obtain + a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations + under the License. + + Convention for heading levels in Open vSwitch documentation: + + ======= Heading 0 (reserved for the title in a document) + ------- Heading 1 + ~~~~~~~ Heading 2 + +++++++ Heading 3 + ''''''' Heading 4 + + Avoid deeper levels because they do not render well. + +===================================== +Hardware offload with Linux TC flower +===================================== + +This document describes how to offload with TC flower. It is disabled by +default and can be enabled by:: + + $ ovs-vsctl set Open_vSwitch . other_config:hw-offload=true + +Offload meter to TC +------------------- + +After hardware offload is enabled, meter offload is enabled as well. + +Configuration +~~~~~~~~~~~~~ + +There is no parameter change in ovs-ofctl command, to configue a meter and use +it for a flow in the offload way. Usually the commands are like:: + + $ ovs-ofctl -O OpenFlow13 add-meter br0 "meter=1 pktps bands=type=drop rate=1" + $ ovs-ofctl -O OpenFlow13 add-flow br0 "priority=10,in_port=ovs-p0,udp actions=meter:1,normal" + +.. note:: + Each meter is mapped to one TC police action. To avovid the conflicton, the + police action index of 0x10000000-0x1fffffff are resevered for the mapping. + You can check the police actions by the command "tc action ls action police" + in Linux system. + +Dump meter statistics +--------------------- + +You can use ovs-ofctl to display the statisticsof meter:: + + $ ovs-ofctl -O OpenFlow13 meter-stats br0 + OFPST_METER reply (OF1.3) (xid=0x2): + meter:1 flow_count:1 packet_in_count:11 byte_in_count:377 duration:3.199s bands: + 0: packet_count:9 byte_count:0 + +The stats of the dropped packets is stored to band 0. + +.. note:: + Meter in OVS DP is not synced with the mapped poloce action, and the first + packet for DP learning does not pass TC police action, as the rule is not + offloaded yet. So, you may notice that packet_count of band 0 (for dropped + packets) is counted after the rule is offoalded, while packet_in_count is + summed with the numbers of packets of both DP and TC police action. + +.. note:: + Linux TC does not support the dropped bytes count, so the byte_count of band + 0 is always 0 if meter is offloaded. +