From patchwork Fri Jun 26 11:51:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Moreno X-Patchwork-Id: 1317597 X-Patchwork-Delegate: i.maximets@samsung.com 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.136; helo=silver.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=FgEba9NH; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49tZwk0vYwz9sRN for ; Fri, 26 Jun 2020 21:51:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 106A9231A5; Fri, 26 Jun 2020 11:51:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id alFP8i+62n7h; Fri, 26 Jun 2020 11:51:29 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 0D62B20107; Fri, 26 Jun 2020 11:51:29 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E1C2BC088C; Fri, 26 Jun 2020 11:51:28 +0000 (UTC) X-Original-To: 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 9DC8DC016F for ; Fri, 26 Jun 2020 11:51:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8A7D88828E for ; Fri, 26 Jun 2020 11:51:27 +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 TrLTGSoAVwy1 for ; Fri, 26 Jun 2020 11:51:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7FCB588081 for ; Fri, 26 Jun 2020 11:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593172284; 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=FQmY8eRByoLcvpAqqXQp6FVdegKbuyfTfWXp1pFh8Ww=; b=FgEba9NHZxn0AVpQhRI4NZWGSrGrCn0fuLU4D2EN3jIIaUuK3bW2VTEgkvFpytpB/yPKCd LYxZUj+3SpB40+jqxjlsA9KT5kz5qBSPJQ6P3QaB2FngH9r2qGsvrADAk2wukglQ11ViaH kr2qDbXtWAfYEmhI3TU6HYBX8LZJLS8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-162-cJtyYOY3O9-ckXWSOHPDEg-1; Fri, 26 Jun 2020 07:51:22 -0400 X-MC-Unique: cJtyYOY3O9-ckXWSOHPDEg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 400A1805EE1; Fri, 26 Jun 2020 11:51:21 +0000 (UTC) Received: from amorenoz.users.ipa.redhat.com (ovpn-113-249.ams2.redhat.com [10.36.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id C01C45D9DA; Fri, 26 Jun 2020 11:51:17 +0000 (UTC) From: Adrian Moreno To: dev@openvswitch.org Date: Fri, 26 Jun 2020 13:51:16 +0200 Message-Id: <20200626115116.795656-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH] ofproto: delete buckets when lb_output is false 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" When lb-output-action is toggled back to "false" buckets are not being deleted. Delete them as they will no longer be used. Add unit test to verify buckets are correctly deleted. Cc: Vishal Deep Ajmera Signed-off-by: Adrian Moreno --- ofproto/bond.c | 3 +++ tests/ofproto-dpif.at | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ofproto/bond.c b/ofproto/bond.c index 9947e7531..2466c4d02 100644 --- a/ofproto/bond.c +++ b/ofproto/bond.c @@ -490,6 +490,9 @@ bond_reconfigure(struct bond *bond, const struct bond_settings *s) "disabled.", bond->name); } else { bond->use_lb_output_action = s->use_lb_output_action; + if (!bond->use_lb_output_action) { + bond_del_lb_output_buckets(bond); + } revalidate = true; } } diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index e3402e7b8..c1455d8aa 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -193,6 +193,10 @@ AT_CHECK([test $(grep -c in_port.5 br1_flows.txt) -gt 24]) AT_CHECK([test $(grep -c in_port.6 br1_flows.txt) -gt 24]) AT_CHECK([grep -q lb_output br0_flows.txt]) +AT_CHECK([test $(ovs-appctl dpif-netdev/bond-show | grep -c bucket) -eq 256]) +AT_CHECK([ovs-vsctl set Port bond0 other_config:lb-output-action=false]) +OVS_WAIT_UNTIL([test -z "$(ovs-appctl dpif-netdev/bond-show)"]) + OVS_VSWITCHD_STOP() AT_CLEANUP