From patchwork Wed Jul 12 07:02:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Adri=C3=A1n_Moreno?= X-Patchwork-Id: 1806635 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TR2NJdle; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R17xJ73rhz20ZZ for ; Wed, 12 Jul 2023 17:03:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 31218404C8; Wed, 12 Jul 2023 07:03:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 31218404C8 Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TR2NJdle X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wf3T9EVAG0lf; Wed, 12 Jul 2023 07:03:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4F5054010C; Wed, 12 Jul 2023 07:03:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4F5054010C Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 22BE7C0071; Wed, 12 Jul 2023 07:03:12 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id A7143C0032 for ; Wed, 12 Jul 2023 07:03:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 81614403E9 for ; Wed, 12 Jul 2023 07:03:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 81614403E9 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nL5NBCgi9pra for ; Wed, 12 Jul 2023 07:03:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org AB1004010C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id AB1004010C for ; Wed, 12 Jul 2023 07:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689145388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iUCBi7dVxViFjIsuquHnewUXJs9Po90TntgkHTv+bZI=; b=TR2NJdleRCIk9XJY+/IXGWUlnK7tiuZFCOjJQrR/e1EtGKqW+jwYkZxnKn80I7cpD0vNXG NObLQQi/OKheh/wm8QcVIOslFezHFLkMqWy7KC6aNCRg2xhB1Xii7BuahK/UStxfvHlsLv zvluMH3FJ/84WyWAySyl6phXTt3zrMY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-203-9-yArgbVMNitG3gavmPVcw-1; Wed, 12 Jul 2023 03:03:07 -0400 X-MC-Unique: 9-yArgbVMNitG3gavmPVcw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 991AA185A7B4; Wed, 12 Jul 2023 07:03:02 +0000 (UTC) Received: from antares.redhat.com (unknown [10.39.192.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B96B492CAC; Wed, 12 Jul 2023 07:03:01 +0000 (UTC) From: Adrian Moreno To: dev@openvswitch.org Date: Wed, 12 Jul 2023 09:02:44 +0200 Message-ID: <20230712070259.531904-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: simon.horman@corigine.com, i.maximets@ovn.org Subject: [ovs-dev] [PATCH v3 0/7] Improve linux QoS for exotic and fast links 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: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" There are currently two issues that limit our ability to configure QoS on certain cards in linux: 1) Firstly, the maximum link speed (which is used as maximum rate in some tc classes), is obtained from netdev feature bits. This is quite problematic because netdev feature bits do not keep up with the new feature bits being added to ethtool. Therefore, cards whose speed is not supported by OpenFlow currently report an incorrect speed and this can affect QoS configuration. This series addresses this problem by adding a new netdev function that gets the actual link speed so we don't rely on feature bits which are difficult to keep in sync. 2) The tc layer uses 32bit Bps rates which means we cannot express rates higher than ~34Gbps. This series addresses this problem using 64-bit tc attributes when needed. --- v2 -> v3 - Move some (non htb-related) from patch 4 to patch 3. - Add a checkpatch.py warning if the old netdev_features_to_bps API is used. - Change unit tests to avoid burst integer overflow. - Use netdev_get_speed() instead of accessing current_speed directly in {hfsc,htb}parse_qdisc_details__() (patch 2). v1 -> v2 - Fix style issues. - Add a test that checks we can expose a 50Gbps speed using a tap interface. - Add an implementation of get_speed for netdev-bsd. - Expose both HAVE_TCA_HTB_RATE64 and HAVE_TCA_POLICE_PKTRATE64 as AC variables and skip tests if the running kernel does not support them. Adrian Moreno (7): netdev: add netdev_get_speed() to nedev API netdev-linux: use speed as max rate in tc classes netdev-linux: use 64bit rtab and burst calculations netdev-linux: use 64-bit rates in htb tc classes netdev-linux: remove tc_matchall_fill_police netdev-linux: refactor nl_msg_put_act_police netdev-linux: support 64-bit rates in tc policing acinclude.m4 | 20 ++++ include/openvswitch/netdev.h | 1 + lib/dpif.h | 4 +- lib/netdev-bsd.c | 22 ++++ lib/netdev-dpdk.c | 52 ++++++++ lib/netdev-linux-private.h | 1 + lib/netdev-linux.c | 223 ++++++++++++++++++++--------------- lib/netdev-linux.h | 2 +- lib/netdev-provider.h | 9 ++ lib/netdev.c | 23 ++++ lib/tc.c | 2 + ofproto/ofproto-dpif-sflow.c | 11 +- ofproto/ofproto.c | 6 +- tests/atlocal.in | 5 + tests/system-interface.at | 30 +++++ tests/system-traffic.at | 49 ++++++++ utilities/checkpatch.py | 11 +- vswitchd/bridge.c | 30 +++-- 18 files changed, 386 insertions(+), 115 deletions(-)