From patchwork Mon Jul 17 08:08:10 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: 1808581 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=140.211.166.137; helo=smtp4.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=eluxYcQ4; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4R4F8k41jsz20FK for ; Mon, 17 Jul 2023 18:08:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 603A44091A; Mon, 17 Jul 2023 08:08:52 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 603A44091A Authentication-Results: smtp4.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=eluxYcQ4 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3ZBgiG6oPoaa; Mon, 17 Jul 2023 08:08:51 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 10DAB408C9; Mon, 17 Jul 2023 08:08:50 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 10DAB408C9 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D7E44C0071; Mon, 17 Jul 2023 08:08:49 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id D2781C0032 for ; Mon, 17 Jul 2023 08:08:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 998A64010C for ; Mon, 17 Jul 2023 08:08:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 998A64010C Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eluxYcQ4 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 r9wtXS-m5w0a for ; Mon, 17 Jul 2023 08:08:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9DD5640012 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 9DD5640012 for ; Mon, 17 Jul 2023 08:08:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689581325; 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=jCl7t2oC5m22LgYPHTOfgCXpc/USybgirhbpMNm9RR8=; b=eluxYcQ45hZEZ9nN0hmL6UkxqSum3WZVPqUbo4vvCJRx3N351hlARXLAaSMdLelfZR44qu HV28QzLSMFVAIjxsng8/PBGCy897E3jBEZwhUMfi93dakOLrZGmtjQpb2ZdoDmW5M+k4OO CFpqga+nBYBNyv8aT7gpZE/Q6BtZhFs= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-534-nMgdNDVvOxeL7X5Y6ARzlw-1; Mon, 17 Jul 2023 04:08:40 -0400 X-MC-Unique: nMgdNDVvOxeL7X5Y6ARzlw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CC1C23C0F66E; Mon, 17 Jul 2023 08:08:39 +0000 (UTC) Received: from antares.redhat.com (unknown [10.39.192.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4650E40C2063; Mon, 17 Jul 2023 08:08:38 +0000 (UTC) From: Adrian Moreno To: dev@openvswitch.org Date: Mon, 17 Jul 2023 10:08:10 +0200 Message-ID: <20230717080836.1456756-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: simon.horman@corigine.com, i.maximets@ovn.org Subject: [ovs-dev] [PATCH v4 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. --- v3 -> v4 - Fallback to netdev_get_features if netdev_get_speed is not implemented. 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 | 221 ++++++++++++++++++++--------------- lib/netdev-linux.h | 2 +- lib/netdev-provider.h | 9 ++ lib/netdev.c | 30 +++++ 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, 393 insertions(+), 113 deletions(-)