From patchwork Wed Jun 7 17:28:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1791872 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=a6W83aPU; 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 4QbvT84syQz20WP for ; Thu, 8 Jun 2023 03:28:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C3CD440955; Wed, 7 Jun 2023 17:28:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C3CD440955 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=a6W83aPU 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 GOSbyroeEwo0; Wed, 7 Jun 2023 17:28:40 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 889AF4085D; Wed, 7 Jun 2023 17:28:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 889AF4085D Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 47CFAC0037; Wed, 7 Jun 2023 17:28:39 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6841DC0029 for ; Wed, 7 Jun 2023 17:28:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3CC6381345 for ; Wed, 7 Jun 2023 17:28:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3CC6381345 Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=a6W83aPU X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 65At3jDisWnn for ; Wed, 7 Jun 2023 17:28:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6912B8132D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6912B8132D for ; Wed, 7 Jun 2023 17:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686158916; 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: in-reply-to:in-reply-to:references:references; bh=31YnnDeNXQbANhVRSuZJmYIS2EfwQ6SBzbbbhnXY9ro=; b=a6W83aPUunkYag5YeMNIb+dFpEbKyvwaOmBHZMg/SEZWMkuGese7x90QnyxQtVCYUM15QG ygpadbj/8lw7qQ152K6E67XNWGr2IM8k/j9wZHAOXTQCgXzOvAy3s4QfRZF0EkjYrRGUww TfnJBneuLCoGkW7Cjx+sxKciviz/IhM= 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-133-0UlmQwjaMrCY2T64lT4wSQ-1; Wed, 07 Jun 2023 13:28:35 -0400 X-MC-Unique: 0UlmQwjaMrCY2T64lT4wSQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B7EF280027F for ; Wed, 7 Jun 2023 17:28:34 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.ntdv.lab.eng.bos.redhat.com [10.19.188.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 974551121318; Wed, 7 Jun 2023 17:28:34 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Wed, 7 Jun 2023 19:28:34 +0200 Message-Id: <20230607172834.3851733-2-xsimonar@redhat.com> In-Reply-To: <20230607172834.3851733-1-xsimonar@redhat.com> References: <20230607172834.3851733-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 2/2] binding: fixed qos when no iface 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" If iface does not exist when qos I+P is run the first time a qos queue is still created and qos I+P will never apply qos to OVS qos might still be applied later, if/when (for any reason) runtime_date must be recomputed Fixes: 7d1d111ff213 ("controller: configure qos through ovs qos table and do not run tc directly") Signed-off-by: Xavier Simonart --- controller/binding.c | 28 +++++++++++++++------------- tests/ovn.at | 7 +++++++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/controller/binding.c b/controller/binding.c index f2896a9c9..8a0a24b95 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -362,7 +362,7 @@ configure_qos(const struct sbrec_port_binding *pb, struct qos_queue *q = find_qos_queue(b_ctx_out->qos_map, hash, pb->logical_port); if (!q || q->min_rate != min_rate || q->max_rate != max_rate || - q->burst != burst) { + q->burst != burst || strcmp(network, q->network)) { struct shash bridge_mappings = SHASH_INITIALIZER(&bridge_mappings); add_ovs_bridge_mappings(b_ctx_in->ovs_table, b_ctx_in->bridge_table, &bridge_mappings); @@ -378,22 +378,24 @@ configure_qos(const struct sbrec_port_binding *pb, add_ovs_qos_table_entry(b_ctx_in->ovs_idl_txn, port, min_rate, max_rate, burst, queue_id, pb->logical_port); + if (!q) { + q = xzalloc(sizeof *q); + hmap_insert(b_ctx_out->qos_map, &q->node, hash); + q->port = xstrdup(pb->logical_port); + q->queue_id = queue_id; + } + free(q->network); + q->network = network ? xstrdup(network) : NULL; + q->min_rate = min_rate; + q->max_rate = max_rate; + q->burst = burst; + } else { + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1); + VLOG_DBG_RL(&rl, "no iface => no entries added on qos_table"); } shash_destroy(&bridge_mappings); } - if (!q) { - q = xzalloc(sizeof *q); - hmap_insert(b_ctx_out->qos_map, &q->node, hash); - q->port = xstrdup(pb->logical_port); - q->queue_id = queue_id; - } - - free(q->network); - q->network = network ? xstrdup(network) : NULL; - q->min_rate = min_rate; - q->max_rate = max_rate; - q->burst = burst; } static const struct ovsrec_queue * diff --git a/tests/ovn.at b/tests/ovn.at index 05bf7fa5b..70ce91d26 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -36089,6 +36089,7 @@ check ovn-nbctl ls-add ls1 check ovn-nbctl lsp-add ls1 public1 check ovn-nbctl lsp-set-addresses public1 unknown check ovn-nbctl lsp-set-type public1 localnet +check ovn-nbctl lsp-set-options public1 network_name=phys check ovn-nbctl lsp-add ls1 lsp5 check ovn-nbctl lsp-set-addresses lsp5 f0:00:00:00:00:05 @@ -36098,6 +36099,12 @@ ovs-vsctl add-port br-int vif5 -- \ ofport-request=5 OVS_WAIT_UNTIL([test x`ovn-nbctl lsp-get-up lsp5` = xup]) +# Delete and add back public1 +check ovn-nbctl --wait=hv lsp-del public1 +check ovn-nbctl lsp-add ls1 public1 +check ovn-nbctl lsp-set-addresses public1 unknown +check ovn-nbctl lsp-set-type public1 localnet + check ovn-nbctl set Logical_Switch_Port public1 options:qos_min_rate=6000000000 check ovn-nbctl set Logical_Switch_Port public1 options:qos_max_rate=7000000000 check ovn-nbctl set Logical_Switch_Port public1 options:qos_burst=8000000000