From patchwork Mon Jul 29 23:24:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1138713 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G7yUAfGb"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45yG766XvPz9sBt for ; Tue, 30 Jul 2019 09:27:14 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E587326DA; Mon, 29 Jul 2019 23:27:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id D19C1260A for ; Mon, 29 Jul 2019 23:24:17 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8A1D88AD for ; Mon, 29 Jul 2019 23:24:17 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id k189so9968306pgk.13 for ; Mon, 29 Jul 2019 16:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=nubuzX2zES6etieqgUVAQtyRuwJb3fxkWvnstQ026fw=; b=G7yUAfGbincOgckvZzXNeo/cWlQl7m+sxQFw3mvKY832AAvqIvGC+Er6n/7pT5TTCy PxpBLHxlyizxpK3ZoxnwaQprCxRa/wTNpE37aQCJn4uKEzXi6hZ+X/F3N4koEZMgPcD3 TUN8Fav7f+WNyXFzQDBW/w0oI5M3P7Z8llIuCo96PXPoGP+uHb5lnPnYNYSjA9UWOdzL 3WcFxTSPCJQBDQTxjoNGFs2i3gT01E2VyRjbQZdA/Bi43o0x4J3i8nuT+2QDw2xppsxU c3ZWCs2ehgUTmUR29ikM9aMCEDsKoSnU/aFLck3BdFiPKgh9Y4HxghK5PxSL3Je1Vlrb 5sLw== 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; bh=nubuzX2zES6etieqgUVAQtyRuwJb3fxkWvnstQ026fw=; b=VLTqp7SjJImCvLcq9rrvV3WSxBU1qoy0bi8LT+bYxqWkqWC9M0Dj42vmEzQpE9gXr1 73e0JcR2twkWaEHsb77Nm16oPKUQLWVMF2nERHNSB4wbbx7iVSU/YMhJrxcaRr6NMXSS IcimiSYI+gfGl7ybNvqz8Lqlop9qthMas2WNThiTUho3/8roTRHg3oevwTfrCkDmTE9r 3Ap0qh7LtMViAF9F33Zcpc7wVHcpKnnr0ZZcp3hYsM1SgF6Mou5/oiG+2E4Z8xnajdGi Kw+sh5LdiQLnXPS7+VLOZ4vR/2Hksi04GCwygb87LE2f723n6ozPPZrjOZMWC2h5Tw84 sDQg== X-Gm-Message-State: APjAAAVvqmjNpz9UHs0UT03Cbvm6cvGyJuRceq9WAB6N1i3tvDbQn+yC kejpMulT84U9x3rLHEB9gX1iQsS6YGg= X-Google-Smtp-Source: APXvYqwBkYejboqc9SAtH7XqurX3zEuYFFyoIlffdX4BFRmcspHNotoKphXsXa/mYqKsCl6zh5HVkA== X-Received: by 2002:a65:62d7:: with SMTP id m23mr106458111pgv.358.1564442656931; Mon, 29 Jul 2019 16:24:16 -0700 (PDT) Received: from localhost.localdomain.localdomain ([216.113.160.77]) by smtp.gmail.com with ESMTPSA id s15sm62920758pfd.183.2019.07.29.16.24.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jul 2019 16:24:16 -0700 (PDT) From: Han Zhou X-Google-Original-From: Han Zhou To: dev@openvswitch.org Date: Mon, 29 Jul 2019 16:24:15 -0700 Message-Id: <1564442655-93062-1-git-send-email-hzhou8@ebay.com> X-Mailer: git-send-email 2.1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH ovn] ovn-northd: Fix ARP respond flows flapping. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Han Zhou From ovn-controller debug log it is seen that when creating a lsp in NB, a lflow for ARP respond is added and then deleted in SB by northd (the flow will be added again when the port is bound to a chassis). This causes unnecessary handling from ovn-controller. The root cause is lsp_is_up() returns true when the column is not set, when the lsp is just created. So northd adds the ARP respond flow in SB lflow table. At the same time it will create port-binding in SB without chassis binding. Then in the next iteration northd will process that port-binding change and notice that there is no chassis binding for this lsp, so it will set the "up" to false, which causes northd to delete the ARP respond flow. The fix is to make sure when "up" is not set, it is regarded as false by default. Signed-off-by: Han Zhou --- northd/ovn-northd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index bed2993..020cde4 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -3495,7 +3495,7 @@ lsp_is_enabled(const struct nbrec_logical_switch_port *lsp) static bool lsp_is_up(const struct nbrec_logical_switch_port *lsp) { - return !lsp->up || *lsp->up; + return lsp->up && *lsp->up; } static bool