From patchwork Sat Dec 21 19:51:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1214589 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.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47gGTc6mrTz9sPh for ; Sun, 22 Dec 2019 06:51:48 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D22DD863E3; Sat, 21 Dec 2019 19:51:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Aj4PpW1RoFZM; Sat, 21 Dec 2019 19:51:42 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id BE052863E0; Sat, 21 Dec 2019 19:51:41 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 83AD9C1D84; Sat, 21 Dec 2019 19:51:41 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id E3166C077D for ; Sat, 21 Dec 2019 19:51:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D238086074 for ; Sat, 21 Dec 2019 19:51:38 +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 u5SLYd1mtOE5 for ; Sat, 21 Dec 2019 19:51:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4CC3885FC4 for ; Sat, 21 Dec 2019 19:51:36 +0000 (UTC) Received: from localhost.localdomain.localdomain (unknown [73.241.94.255]) (Authenticated sender: hzhou@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id CD274240005; Sat, 21 Dec 2019 19:51:34 +0000 (UTC) From: Han Zhou To: dev@openvswitch.org Date: Sat, 21 Dec 2019 11:51:05 -0800 Message-Id: <1576957867-69488-3-git-send-email-hzhou@ovn.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1576957867-69488-1-git-send-email-hzhou@ovn.org> References: <1576957867-69488-1-git-send-email-hzhou@ovn.org> Cc: Han Zhou Subject: [ovs-dev] [PATCH 2.12 2/4] ovn-controller: Fix meter-table-list and group-table-list commands. 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" These commands are supposed to print existing items of the tables, but they actually print only items that is in existing table but not in desired table, which is useless because this would print nothing in normal conditions. The patch fixes it so that they behave as what the document says. Acked-by: Dumitru Ceara Signed-off-by: Han Zhou --- ovn/controller/ovn-controller.c | 6 +++--- tests/ovn.at | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index c8bf29d..e2fce92 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -2317,9 +2317,9 @@ extend_table_list(struct unixctl_conn *conn, int argc OVS_UNUSED, struct ds ds = DS_EMPTY_INITIALIZER; struct simap items = SIMAP_INITIALIZER(&items); - struct ovn_extend_table_info *installed, *next; - EXTEND_TABLE_FOR_EACH_INSTALLED (installed, next, extend_table) { - simap_put(&items, installed->name, installed->table_id); + struct ovn_extend_table_info *item; + HMAP_FOR_EACH (item, hmap_node, &extend_table->existing) { + simap_put(&items, item->name, item->table_id); } const struct simap_node **nodes = simap_sort(&items); diff --git a/tests/ovn.at b/tests/ovn.at index 54aa19b..3acd8a1 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -7319,7 +7319,10 @@ echo "Meter duration: $d_secs" AT_SKIP_IF([test $d_secs -gt 9]) # Print some information that may help debugging. -as hv ovs-appctl -t ovn-controller meter-table-list +AT_CHECK([as hv ovs-appctl -t ovn-controller meter-table-list], [0], [dnl +http-rl1: 1 +http-rl2: 2 +]) as hv ovs-ofctl -O OpenFlow13 meter-stats br-int n_acl1=$(grep -c 'http-acl1' hv/ovn-controller.log)