From patchwork Tue Sep 7 17:15:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1525476 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=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H3sNQ4k20z9sRN for ; Wed, 8 Sep 2021 03:15:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D9194403DC; Tue, 7 Sep 2021 17:15:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yQQL9kj1tDvk; Tue, 7 Sep 2021 17:15:29 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 31B92403DD; Tue, 7 Sep 2021 17:15:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 05CEBC0011; Tue, 7 Sep 2021 17:15:28 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 29850C000D for ; Tue, 7 Sep 2021 17:15:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 192F881D34 for ; Tue, 7 Sep 2021 17:15:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aCXOZOMHbCkS for ; Tue, 7 Sep 2021 17:15:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp1.osuosl.org (Postfix) with ESMTPS id A300A81826 for ; Tue, 7 Sep 2021 17:15:24 +0000 (UTC) Received: (Authenticated sender: numans@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 7C3124000A; Tue, 7 Sep 2021 17:15:20 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Tue, 7 Sep 2021 13:15:07 -0400 Message-Id: <20210907171507.1617879-1-numans@ovn.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn] controller: Fall back to full recompute of pflow_output for vtep lport changes. 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" From: Numan Siddique When a vtep logical port changes, necessary flows are not added as expected. This is because the function physical_handle_flows_for_lport() in physical.c does not add flows required for vtep logical ports. These flows are added by physical_run(). So fall back to full recompute of pflow_output engine node when vtep lports change. Reported-by: Odintsov Vladislav Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2021-September/387435.html Signed-off-by: Numan Siddique Tested-by: Vladislav Odintsov > Reported-by: Odintsov Vladislav > Signed-off-by: Numan Siddique > --- controller/ovn-controller.c | 11 ++++++++--- controller/physical.c | 9 ++++++++- controller/physical.h | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c index 0031a1035..d98ebbbfa 100644 --- a/controller/ovn-controller.c +++ b/controller/ovn-controller.c @@ -2867,7 +2867,10 @@ pflow_output_sb_port_binding_handler(struct engine_node *node, const struct sbrec_port_binding *pb; SBREC_PORT_BINDING_TABLE_FOR_EACH_TRACKED (pb, p_ctx.port_binding_table) { bool removed = sbrec_port_binding_is_deleted(pb); - physical_handle_flows_for_lport(pb, removed, &p_ctx, &pfo->flow_table); + if (!physical_handle_flows_for_lport(pb, removed, &p_ctx, + &pfo->flow_table)) { + return false; + } } engine_set_node_state(node, EN_UPDATED); @@ -2930,8 +2933,10 @@ pflow_output_runtime_data_handler(struct engine_node *node, void *data) struct tracked_lport *lport = shash_node->data; bool removed = lport->tracked_type == TRACKED_RESOURCE_REMOVED ? true: false; - physical_handle_flows_for_lport(lport->pb, removed, &p_ctx, - &pfo->flow_table); + if (!physical_handle_flows_for_lport(lport->pb, removed, &p_ctx, + &pfo->flow_table)) { + return false; + } } } diff --git a/controller/physical.c b/controller/physical.c index 6f2c1cea0..ffb9f9952 100644 --- a/controller/physical.c +++ b/controller/physical.c @@ -1509,11 +1509,16 @@ consider_mc_group(enum mf_field_id mff_ovn_geneve, sset_destroy(&remote_chassis); } -void +bool physical_handle_flows_for_lport(const struct sbrec_port_binding *pb, bool removed, struct physical_ctx *p_ctx, struct ovn_desired_flow_table *flow_table) { + if (!strcmp(pb->type, "vtep")) { + /* Cannot handle changes to vtep lports (yet). */ + return false; + } + ofctrl_remove_flows(flow_table, &pb->header_.uuid); if (!strcmp(pb->type, "external")) { @@ -1553,6 +1558,8 @@ physical_handle_flows_for_lport(const struct sbrec_port_binding *pb, p_ctx->chassis, flow_table, &ofpacts); ofpbuf_uninit(&ofpacts); } + + return true; } void diff --git a/controller/physical.h b/controller/physical.h index c4540ad7f..ee4b1ae1f 100644 --- a/controller/physical.h +++ b/controller/physical.h @@ -65,7 +65,7 @@ void physical_run(struct physical_ctx *, struct ovn_desired_flow_table *); void physical_handle_mc_group_changes(struct physical_ctx *, struct ovn_desired_flow_table *); -void physical_handle_flows_for_lport(const struct sbrec_port_binding *, +bool physical_handle_flows_for_lport(const struct sbrec_port_binding *, bool removed, struct physical_ctx *, struct ovn_desired_flow_table *);