From patchwork Wed Sep 23 21:06:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1370091 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.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: 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=ATHsZvxs; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BxW372cQHz9sRf for ; Thu, 24 Sep 2020 07:07:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 87ACB86A0C; Wed, 23 Sep 2020 21:07:29 +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 Ce4i8Rqmv39o; Wed, 23 Sep 2020 21:07:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id ED7C586948; Wed, 23 Sep 2020 21:07:27 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C9A93C0889; Wed, 23 Sep 2020 21:07:27 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7E7F3C0051 for ; Wed, 23 Sep 2020 21:07:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 78175873CE for ; Wed, 23 Sep 2020 21:07:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sIggZlLisbEL for ; Wed, 23 Sep 2020 21:07:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by hemlock.osuosl.org (Postfix) with ESMTPS id C8EFF873C8 for ; Wed, 23 Sep 2020 21:07:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600895243; 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=S0r0As7268E/HROJPa3iFCuW1nDumf+jliprTroEMB0=; b=ATHsZvxs4KBVPpbaiHTY6EVyDd++yKQZSXzuAtvZk+mGStbxE3NTMKFvghSxilvCdGkKkU vBvXX0aX/X5dMh3eo5SBCXwe+ct3u2HnveUrY8Zp6eXm7vMNnF4oPwG+Q0TB8fVMatteI/ 2o2fjLETf77jk8UAG9eKzqD3NDm/ums= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-289-_M8gXZDNP-GPHJGy45_YSA-1; Wed, 23 Sep 2020 17:07:06 -0400 X-MC-Unique: _M8gXZDNP-GPHJGy45_YSA-1 Received: by mail-wr1-f71.google.com with SMTP id l15so324877wro.10 for ; Wed, 23 Sep 2020 14:07:06 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=S0r0As7268E/HROJPa3iFCuW1nDumf+jliprTroEMB0=; b=MrMkmp9pH9SVvZYN8aHxLG2gZfEM+fpWKGdYqKEibHiDTfyF0qzuy6nnv8Rsligpkk dUS1t2aG8tXlO86SD0KTTr/AeTuf8QLAVFZr03c1f6eZuot/Qh177CI57zRX7CfkP+pS +AW6O3B/iMdi0vE1nLsC0FgOXxrJ6nXh1uWxUYPkYlEE1Ql83bIheZpk41ti1r9Ywu6+ 9reGnYRgDSdLafUQxCeugBPqSMivP10bguwXtPKHHqnzDmnpVgo8VjC4I3tzg6LttMye EsK51AnR1m66ZMgoeKN4zbPpj3K1TfVmMr351bhaaa7YkPspJQBs6vUakqVjWlq1cwBD 4J4A== X-Gm-Message-State: AOAM53149DbOuPZm/rBOugNC8/PEj201/sInYTDq9KjnwdSrL7iKJ4le iDPrW0+M0ZVzcDAFlwoSNBcWTOFhdS9EzOqCzEiUxNI3DOl5qplIOw7oiGQKjbKJSGRX95td50m o557sLHJrDYO7/McqBg== X-Received: by 2002:adf:fc4e:: with SMTP id e14mr1527632wrs.329.1600895225083; Wed, 23 Sep 2020 14:07:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0n7W5GSFmBo/TDFH7Yo1PWs4nBuHtGvj74KIG02L0cP+XKpBHH2ZQw7+zlqGwMPQlfPqcRw== X-Received: by 2002:adf:fc4e:: with SMTP id e14mr1527608wrs.329.1600895224757; Wed, 23 Sep 2020 14:07:04 -0700 (PDT) Received: from lore-desk.redhat.com ([151.66.98.27]) by smtp.gmail.com with ESMTPSA id h186sm997793wmf.24.2020.09.23.14.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 14:07:04 -0700 (PDT) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Wed, 23 Sep 2020 23:06:58 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lorenzo.bianconi@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: hzhou@ovn.org Subject: [ovs-dev] [PATCH v3 ovn] binding: fix localnet QoS configuration after I-P 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" After the I-P has been introduced in commit 354bdba51a ("ovn-controller: I-P for SB port binding and OVS interface in runtime_data"), the QoS on localnet ports is not properly configured if the ovs interface is marked with "ovn-egress-iface" flag after the related record in the logical_switch_port table is set. The issue can be triggered with the following reproducer: $ovn-nbctl set Logical_Switch_Port ln-public options:qos_burst=1000 $ovs-vsctl set interface eth0 external-ids:ovn-egress-iface=true Fix the issue triggering a recomputation after qos is configured for ovs interface Fixes: 354bdba51abf ("ovn-controller: I-P for SB port binding and OVS interface in runtime_data") Signed-off-by: Lorenzo Bianconi --- Changes since v2: - drop patch 1/3 - patch 2/3 has been applied - simplify full recomputation check Changes since v1: - move qos_map fix in a separated patch - add ovn-egress-iface info to binding I-P engine relying on shash for local_iface_ids --- controller/binding.c | 5 ++++ tests/ovn-performance.at | 13 +++++++++ tests/system-ovn.at | 60 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) diff --git a/controller/binding.c b/controller/binding.c index 99e9fae30..c9a097f66 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -1870,6 +1870,11 @@ binding_handle_ovs_interface_changes(struct binding_ctx_in *b_ctx_in, b_ctx_in, b_ctx_out); } + if (smap_get(&iface_rec->external_ids, "ovn-egress-iface") || + sset_contains(b_ctx_out->egress_ifaces, iface_rec->name)) { + handled = false; + } + if (!handled) { break; } diff --git a/tests/ovn-performance.at b/tests/ovn-performance.at index 3010860d5..6cc5b2174 100644 --- a/tests/ovn-performance.at +++ b/tests/ovn-performance.at @@ -247,6 +247,8 @@ for i in 1 2 3; do ovs-vsctl set open . external_ids:ovn-bridge-mappings="public:br-ex" j=$((i + 2)) ovn_attach n1 br-phys 192.168.0.$j + ip link add vgw$i type dummy + ovs-vsctl add-port br-ex vgw$i done # Wait for the tunnel ports to be created and up. @@ -477,6 +479,17 @@ OVN_CONTROLLER_EXPECT_HIT( [ovn-nbctl --wait=hv lrp-set-gateway-chassis lr1-public gw3 10 && ovn-nbctl --wait=hv sync] ) +# create QoS rule +OVN_CONTROLLER_EXPECT_NO_HIT( + [hv1 hv2 gw1 gw2 gw3], [lflow_run], + [ovn-nbctl --wait=hv set Logical_Switch_Port ln-public options:qos_burst=1000] +) + +OVN_CONTROLLER_EXPECT_HIT( + [gw1], [lflow_run], + [as gw1 ovs-vsctl set interface vgw1 external-ids:ovn-egress-iface=true] +) + # Make gw2 master. There is remote possibility that full recompute # triggers for gw2 after it becomes master. Most of the time # there will be no recompute. diff --git a/tests/system-ovn.at b/tests/system-ovn.at index 4f72754c6..f779947f4 100644 --- a/tests/system-ovn.at +++ b/tests/system-ovn.at @@ -5397,3 +5397,63 @@ as OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d /.*terminating with signal 15.*/d"]) AT_CLEANUP + +AT_SETUP([ovn -- egress qos]) +AT_KEYWORDS([ovn-egress-qos]) + +ovn_start +OVS_TRAFFIC_VSWITCHD_START() + +ADD_BR([br-int]) +ADD_BR([br-ext]) + +ovs-ofctl add-flow br-ext action=normal +# Set external-ids in br-int needed for ovn-controller +ovs-vsctl \ + -- set Open_vSwitch . external-ids:system-id=hv1 \ + -- set Open_vSwitch . external-ids:ovn-remote=unix:$ovs_base/ovn-sb/ovn-sb.sock \ + -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \ + -- set Open_vSwitch . external-ids:ovn-encap-ip=169.0.0.1 \ + -- set bridge br-int fail-mode=secure other-config:disable-in-band=true + +# Start ovn-controller +start_daemon ovn-controller + +ovn-nbctl ls-add sw0 + +ADD_NAMESPACES(sw01) +ADD_VETH(sw01, sw01, br-int, "192.168.1.2/24", "f0:00:00:01:02:03") +ovn-nbctl lsp-add sw0 sw01 \ + -- lsp-set-addresses sw01 "f0:00:00:01:02:03 192.168.1.2" + +ADD_NAMESPACES(public) +ADD_VETH(public, public, br-ext, "192.168.2.2/24", "f0:00:00:01:02:05") + +AT_CHECK([ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=phynet:br-ext]) +ovn-nbctl lsp-add sw0 public \ + -- lsp-set-addresses public unknown \ + -- lsp-set-type public localnet \ + -- lsp-set-options public network_name=phynet + +AT_CHECK([ovn-nbctl set Logical_Switch_Port public options:qos_burst=1000]) +AT_CHECK([ovs-vsctl set interface ovs-public external-ids:ovn-egress-iface=true]) +AT_CHECK([tc qdisc show | grep -q 'htb 1: dev ovs-public']) + +AT_CHECK([ovn-nbctl remove Logical_Switch_Port public options qos_burst=1000]) +AT_CHECK([tc qdisc show | grep -q 'htb 1: dev ovs-public'],[1]) + +kill $(pidof ovn-controller) + +as ovn-sb +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) + +as ovn-nb +OVS_APP_EXIT_AND_WAIT([ovsdb-server]) + +as northd +OVS_APP_EXIT_AND_WAIT([ovn-northd]) + +as +OVS_TRAFFIC_VSWITCHD_STOP(["/.*error receiving.*/d +/.*terminating with signal 15.*/d"]) +AT_CLEANUP