From patchwork Mon Aug 26 14:14:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1976853 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=dYmuFHIT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wst4B0qHpz1yZd for ; Tue, 27 Aug 2024 00:15:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 221B080CF1; Mon, 26 Aug 2024 14:15:17 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id QLdBQBf5XKa4; Mon, 26 Aug 2024 14:15:15 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org F131080BBA Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dYmuFHIT Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id F131080BBA; Mon, 26 Aug 2024 14:15:14 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9790CC07E7; Mon, 26 Aug 2024 14:15:14 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id BFA40C07E6 for ; Mon, 26 Aug 2024 14:15:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9262B40139 for ; Mon, 26 Aug 2024 14:15:12 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id qc0-hnU_BMtt for ; Mon, 26 Aug 2024 14:15:11 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=lorenzo.bianconi@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 093BF40347 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 093BF40347 Authentication-Results: smtp2.osuosl.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=dYmuFHIT Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 093BF40347 for ; Mon, 26 Aug 2024 14:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724681709; 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: in-reply-to:in-reply-to:references:references; bh=xF3VUIzvP2pQuMDzQkQTZlXkAbS7h6nY9GbGB8HkJkQ=; b=dYmuFHITyB4UBOPTiUNmK6vfFFHXfJA5Pmaqzgbj8D8bKYRsWBGyDUDjQKhsX+twS1jgKI e795TWB9Kfp0Dav1Yqz3xGgCqUDIPE1bVI35eTeRLzIaceSHHdfRjMlBxbQZLWmXIw/BgE OAULthhz2tknu6fGbwKXEcGXoTdX2KQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-558-2MfgKnuDO3yq5Zz6IdOwoA-1; Mon, 26 Aug 2024 10:15:08 -0400 X-MC-Unique: 2MfgKnuDO3yq5Zz6IdOwoA-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3718bf7d54aso2893449f8f.1 for ; Mon, 26 Aug 2024 07:15:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724681707; x=1725286507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5lp516fP6924xQyK4aS1IhIh/X4oh952GicTscQ1R3A=; b=v++eGTGkGfTmhh7NJmwf1ONg8XrOJzQ2KlpurNQ3qKonjCo79rGcEnif11240J88lZ Tc0ZiNaoV6VkgI1SozQh/jUTa4AXred1Qade2JU2c4oCerH7bg1+ak0oKqGzdR++LMp/ 6gwAS8TXxFHxUYtRx9iMFqsaKhcpP876eRdNZMC+mIda4VyGHXHa/LJLziXc2mAG8dv+ OU9TdokHKZU/AMH4gsBxfGjwWRiE7BzBLqC4Yy7XYye1OhqzIbu/MwBJq2YXtQsamhwM 08k6DpSs8lfEXmuRp45ZbQiBYXDhhY1R6kmbflTBsxGAFeBIlVSK7QSIlD09rpLeIH6N +Kvw== X-Gm-Message-State: AOJu0YxPrHKHZQHYldN7ic4KuAyw8fwK08yxwzXywBXG01IkMQMvZR2W fpPSbVWVtWezmm4/1oStdlh0A9lBKtKbvNx97S+WPIzZ8nihUQ6hcwyAGHf1zdteYBXNcm9hvwF xA2wUtmamd8HbdA3qKk/E41jwe1s3Ly7lMW3H2342wTW918b02ojGRWNdJtmJzLJZOLHRd1qB9r Wwfev7pV1h5/BvYnUKcaXNuOXE1xRKiDw2dDLsCPegG+8tbkvHAA== X-Received: by 2002:adf:a407:0:b0:368:74a8:6c34 with SMTP id ffacd0b85a97d-373118651b4mr6817926f8f.36.1724681706596; Mon, 26 Aug 2024 07:15:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPZ22x1tJP7+QyyGQa7IkasI1L4+YCowNqSGkYUZliiedR3iJQ8CSof2e4JDVLTaSKXZNhRQ== X-Received: by 2002:adf:a407:0:b0:368:74a8:6c34 with SMTP id ffacd0b85a97d-373118651b4mr6817891f8f.36.1724681705863; Mon, 26 Aug 2024 07:15:05 -0700 (PDT) Received: from localhost (net-188-216-76-117.cust.vodafonedsl.it. [188.216.76.117]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3730826ecf9sm10824241f8f.117.2024.08.26.07.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 07:15:05 -0700 (PDT) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Mon, 26 Aug 2024 16:14:49 +0200 Message-ID: <268e17461dbb73f96e02105e356a4212ab6afcb9.1724680233.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v3 ovn 1/3] Revert "ofctrl: Introduce ecmp_nexthop_monitor.". X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dceara@redhat.com Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" This reverts commit 090ca4ecaa9200850ae37c1c126a6ff85651d3f0. Revert current implementation of ECMP_Nexthop monitor feature since it can trigger over-flush of CT entries committed by incoming traffic. In particular, at the moment there is no way to link the next-hop IP address (so the ct-entry ID) to the incoming traffic identified by the ethernet source mac address and so to the ct_lablel committed by the following logical flow: table=10(lr_in_ecmp_stateful), priority=100 , match=(inport == "R1_ext" && ip4.dst == 10.0.0.0/24 && (ct.new || ct.est)), action=(ct_commit { ct_label.ecmp_reply_eth = eth.src; ct_mark.ecmp_reply_port = 2; ct_label.label = 1; }; next;) Remove the feature while working on an improved approach. Reported-at: https://issues.redhat.com/browse/FDP-750 Signed-off-by: Lorenzo Bianconi --- controller/ofctrl.c | 54 ------------------------------------- controller/ofctrl.h | 2 -- controller/ovn-controller.c | 2 -- tests/system-ovn.at | 8 ------ 4 files changed, 66 deletions(-) diff --git a/controller/ofctrl.c b/controller/ofctrl.c index e023cab9b..f9387d375 100644 --- a/controller/ofctrl.c +++ b/controller/ofctrl.c @@ -45,7 +45,6 @@ #include "ovn/actions.h" #include "lib/extend-table.h" #include "lib/lb.h" -#include "lib/ovn-util.h" #include "openvswitch/poll-loop.h" #include "physical.h" #include "openvswitch/rconn.h" @@ -390,16 +389,9 @@ struct meter_band_entry { static struct shash meter_bands; -static unsigned long *ecmp_nexthop_ids; - static void ofctrl_meter_bands_destroy(void); static void ofctrl_meter_bands_clear(void); -static void ecmp_nexthop_monitor_run( - const struct sbrec_ecmp_nexthop_table *enh_table, - struct ovs_list *msgs); - - /* MFF_* field ID for our Geneve option. In S_TLV_TABLE_MOD_SENT, this is * the option we requested (we don't know whether we obtained it yet). In * S_CLEAR_FLOWS or S_UPDATE_FLOWS, this is really the option we have. */ @@ -438,7 +430,6 @@ ofctrl_init(struct ovn_extend_table *group_table, groups = group_table; meters = meter_table; shash_init(&meter_bands); - ecmp_nexthop_ids = bitmap_allocate(ECMP_NEXTHOP_IDS_LEN); } /* S_NEW, for a new connection. @@ -886,7 +877,6 @@ ofctrl_destroy(void) expr_symtab_destroy(&symtab); shash_destroy(&symtab); ofctrl_meter_bands_destroy(); - bitmap_free(ecmp_nexthop_ids); } uint64_t @@ -2316,47 +2306,6 @@ add_meter(struct ovn_extend_table_info *m_desired, ofctrl_meter_bands_alloc(sb_meter, m_desired, msgs); } -static void -ecmp_nexthop_monitor_flush_ct_entry(uint64_t id, struct ovs_list *msgs) -{ - ovs_u128 mask = { - /* ct_labels.label BITS[96-127] */ - .u64.hi = 0xffffffff00000000, - }; - ovs_u128 nexthop = { - .u64.hi = id << 32, - }; - struct ofp_ct_match match = { - .labels = nexthop, - .labels_mask = mask, - }; - struct ofpbuf *msg = ofp_ct_match_encode(&match, NULL, - rconn_get_version(swconn)); - ovs_list_push_back(msgs, &msg->list_node); -} - -static void -ecmp_nexthop_monitor_run(const struct sbrec_ecmp_nexthop_table *enh_table, - struct ovs_list *msgs) -{ - unsigned long *ids = bitmap_allocate(ECMP_NEXTHOP_IDS_LEN); - - const struct sbrec_ecmp_nexthop *sbrec_ecmp_nexthop; - SBREC_ECMP_NEXTHOP_TABLE_FOR_EACH (sbrec_ecmp_nexthop, enh_table) { - bitmap_set1(ids, sbrec_ecmp_nexthop->id); - } - - int id; - BITMAP_FOR_EACH_1 (id, ECMP_NEXTHOP_IDS_LEN, ecmp_nexthop_ids) { - if (!bitmap_is_set(ids, id)) { - ecmp_nexthop_monitor_flush_ct_entry(id, msgs); - } - } - - bitmap_free(ecmp_nexthop_ids); - ecmp_nexthop_ids = ids; -} - static void installed_flow_add(struct ovn_flow *d, struct ofputil_bundle_ctrl_msg *bc, @@ -2715,7 +2664,6 @@ ofctrl_put(struct ovn_desired_flow_table *lflow_table, struct shash *pending_ct_zones, struct hmap *pending_lb_tuples, struct ovsdb_idl_index *sbrec_meter_by_name, - const struct sbrec_ecmp_nexthop_table *enh_table, uint64_t req_cfg, bool lflows_changed, bool pflows_changed) @@ -2756,8 +2704,6 @@ ofctrl_put(struct ovn_desired_flow_table *lflow_table, /* OpenFlow messages to send to the switch to bring it up-to-date. */ struct ovs_list msgs = OVS_LIST_INITIALIZER(&msgs); - ecmp_nexthop_monitor_run(enh_table, &msgs); - /* Iterate through ct zones that need to be flushed. */ struct shash_node *iter; SHASH_FOR_EACH(iter, pending_ct_zones) { diff --git a/controller/ofctrl.h b/controller/ofctrl.h index 33953a8a4..129e3b6ad 100644 --- a/controller/ofctrl.h +++ b/controller/ofctrl.h @@ -31,7 +31,6 @@ struct ofpbuf; struct ovsrec_bridge; struct ovsrec_open_vswitch_table; struct sbrec_meter_table; -struct sbrec_ecmp_nexthop_table; struct shash; struct ovn_desired_flow_table { @@ -60,7 +59,6 @@ void ofctrl_put(struct ovn_desired_flow_table *lflow_table, struct shash *pending_ct_zones, struct hmap *pending_lb_tuples, struct ovsdb_idl_index *sbrec_meter_by_name, - const struct sbrec_ecmp_nexthop_table *enh_table, uint64_t nb_cfg, bool lflow_changed, bool pflow_changed); diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c index 854d80bdf..c48667887 100644 --- a/controller/ovn-controller.c +++ b/controller/ovn-controller.c @@ -5722,8 +5722,6 @@ main(int argc, char *argv[]) &ct_zones_data->ctx.pending, &lb_data->removed_tuples, sbrec_meter_by_name, - sbrec_ecmp_nexthop_table_get( - ovnsb_idl_loop.idl), ofctrl_seqno_get_req_cfg(), engine_node_changed(&en_lflow_output), engine_node_changed(&en_pflow_output)); diff --git a/tests/system-ovn.at b/tests/system-ovn.at index 6e4ec4247..c2e35a74c 100644 --- a/tests/system-ovn.at +++ b/tests/system-ovn.at @@ -6248,10 +6248,6 @@ sed -e 's/labels=0x[[0-9]]/labels=0x?/' | sort], [0], [dnl tcp,orig=(src=172.16.0.1,dst=10.0.0.2,sport=,dport=),reply=(src=10.0.0.2,dst=172.16.0.1,sport=,dport=),zone=,mark=,labels=0x?000000000401020500000000,protoinfo=(state=) ]) -# Flush connection tracking entries -ovn-nbctl --wait=hv lr-route-del R1 -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(172.16.0.1)]) - OVS_APP_EXIT_AND_WAIT([ovn-controller]) as ovn-sb @@ -6474,10 +6470,6 @@ sed -e 's/labels=0x[[0-9]]/labels=0x?/' | sort], [0], [dnl tcp,orig=(src=fd07::1,dst=fd01::2,sport=,dport=),reply=(src=fd01::2,dst=fd07::1,sport=,dport=),zone=,mark=,labels=0x?000000001001020400000000,protoinfo=(state=) ]) -# Flush connection tracking entries -check ovn-nbctl --wait=hv lr-route-del R1 -AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(fd01::2)]) - OVS_APP_EXIT_AND_WAIT([ovn-controller]) as ovn-sb