From patchwork Sat Sep 12 07:10:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Gray X-Patchwork-Id: 1362786 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=Ad9YmcJZ; 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 4BpP0D3bDZz9sRf for ; Sat, 12 Sep 2020 17:10:18 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 79A358760E; Sat, 12 Sep 2020 07:10:15 +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 8zOlueYhiYCq; Sat, 12 Sep 2020 07:10:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 7F25887629; Sat, 12 Sep 2020 07:10:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5ABEBC0052; Sat, 12 Sep 2020 07:10:13 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 340B5C0051 for ; Sat, 12 Sep 2020 07:10:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0409520445 for ; Sat, 12 Sep 2020 07:10:12 +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 DaECCx9y76W9 for ; Sat, 12 Sep 2020 07:10:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by silver.osuosl.org (Postfix) with ESMTPS id D223E20404 for ; Sat, 12 Sep 2020 07:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599894608; 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=62Ysw/dHxrPMG6suqA1kWKhyB9Hp4thjIUxLUX7At94=; b=Ad9YmcJZsnDzwTBPwZ5nrZ9i4X2Uo8UguzFKwqwugZkp5trhZrgJ4KgPrFP59W8STkfqIx 8bX6hgGSgkwIYTJyOhrO4i/1a1Ph2/BLthIyqA3LHifwymjBItgKiuLA/1VJuNHkdldgtZ o0sBnLFJgvfzciJ8GHDuCmBOqvIr38U= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-543-4lIACq_9PCai8iOuMbayCQ-1; Sat, 12 Sep 2020 03:10:06 -0400 X-MC-Unique: 4lIACq_9PCai8iOuMbayCQ-1 Received: by mail-wr1-f70.google.com with SMTP id l9so4059617wrq.20 for ; Sat, 12 Sep 2020 00:10: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=62Ysw/dHxrPMG6suqA1kWKhyB9Hp4thjIUxLUX7At94=; b=SuFVw8n2+XU4jEEM0LONtfq0hUEjINUhpaJxvlnXGALW8LY2ExuaPIhHnqwzjXJ/c3 1zda5rp0dihZ9qWIyWdaPuquNQ1aHit6sNTIb3NTWLC0MdlmGfmMkcfGt2ZXJi7OScNV jV9mFeJvSmbmATJnmaTewaWaWOMk0CGkxwLjKcHXz0DqX8erJKoiEneI5sNyl4qatlo6 WSbyc427Ngi1zFqrntNl8zHObMUfS7VFutmVccel98zCRq0POahBzTWIZ35sBYSlzmRz fMkozWkJcDdj39rjAcbdYSU5JbUSttgzkqFQ6vVVKaQJpH6cyNB739E638GdGWWDeLhL gwqg== X-Gm-Message-State: AOAM533o3S0pbah3A7TMRwT2k/QspLIQDlOPZoKH4dNeho7pGcur2CPc q4nxD3S/WbVMBKbxDQE53FyoXsDDbSH/symJtqQZZiRAEND4CWr01ooPYTuLqlGep/+QKQJDgEY 6Egfz5J2K/HB7QCxvNg== X-Received: by 2002:adf:e80b:: with SMTP id o11mr1961962wrm.118.1599894605026; Sat, 12 Sep 2020 00:10:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBnd1M9Ar/X9jAx8GV4yJgzkcG6AmdTWyXLWMiF+aVK944AsJIPsts8Ej+uUucwRVKP4/L+Q== X-Received: by 2002:adf:e80b:: with SMTP id o11mr1961949wrm.118.1599894604836; Sat, 12 Sep 2020 00:10:04 -0700 (PDT) Received: from magray.station ([51.37.93.130]) by smtp.gmail.com with ESMTPSA id m3sm8704737wrs.83.2020.09.12.00.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2020 00:10:03 -0700 (PDT) From: Mark Gray To: ovs-dev@openvswitch.org Date: Sat, 12 Sep 2020 08:10:01 +0100 Message-Id: <20200912071001.5576-1-mark.d.gray@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mark.d.gray@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v2] ovn-controller: Handle changes in requested-tnl-key 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" runtime_data_sb_datapath_binding_handler() only handles deletion of rows in the Datapath_Binding table in OVN-SB. The user can update the requested-tnl-key by the following command: ovn-nbctl set logical_switch sw0 other_config:requested-tnl-key= This command modifies the tunnel_key column. This patch ensures that an update of this column is handled by the incremental processing engine by forcing a recompute of the runtime_data node. As it is expected that changing the requested-tnl-key is not updated frequently, we do not attempt to make this update incrementally. Signed-off-by: Mark Gray --- controller/ovn-controller.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c index 995805470..106f8eae1 100644 --- a/controller/ovn-controller.c +++ b/controller/ovn-controller.c @@ -1362,8 +1362,8 @@ runtime_data_sb_port_binding_handler(struct engine_node *node, void *data) } static bool -runtime_data_sb_datapath_binding_handler(struct engine_node *node OVS_UNUSED, - void *data OVS_UNUSED) +runtime_data_sb_datapath_binding_handler(struct engine_node *node, + void *data) { struct sbrec_datapath_binding_table *dp_table = (struct sbrec_datapath_binding_table *)EN_OVSDB_GET( @@ -1378,6 +1378,18 @@ runtime_data_sb_datapath_binding_handler(struct engine_node *node OVS_UNUSED, return false; } } + + /* Force recompute when the tunnel_key is updated. However, + don't update if the external_id column is updated as this + can be done when a logical switch or logical router is + added which does not recquire a recompute. + */ + if (sbrec_datapath_binding_is_updated(dp, + SBREC_DATAPATH_BINDING_COL_TUNNEL_KEY) && + !sbrec_datapath_binding_is_updated(dp, + SBREC_DATAPATH_BINDING_COL_EXTERNAL_IDS)) { + return false; + } } return true;