From patchwork Mon Feb 26 13:11:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammad Heib X-Patchwork-Id: 1904361 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=TcII+Ogx; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tk1GQ6gP7z23qD for ; Tue, 27 Feb 2024 00:11:26 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D50F8407E7; Mon, 26 Feb 2024 13:11:24 +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 4BETK7k6Xcgw; Mon, 26 Feb 2024 13:11:23 +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 smtp4.osuosl.org 846C54064D Authentication-Results: smtp4.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=TcII+Ogx Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 846C54064D; Mon, 26 Feb 2024 13:11:23 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5D094C0077; Mon, 26 Feb 2024 13:11:23 +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 7C8F1C0037 for ; Mon, 26 Feb 2024 13:11:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5F4658122D for ; Mon, 26 Feb 2024 13:11:22 +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 24avmmrLMKLp for ; Mon, 26 Feb 2024 13:11:21 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=mheib@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 45B89812FE Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 45B89812FE Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TcII+Ogx Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 45B89812FE for ; Mon, 26 Feb 2024 13:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708953079; 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=uZcGiHzrGWxPoq5uA0BVV/0UGprhbg/AXsb0X+NyTxI=; b=TcII+Ogx+zrXJ47R2pUtqRsPPZLohfrumbZeSC6N2Ds+e1gAObjpDC9IGmtfh59BYYAaWv X7bjivUka7LFh+cZ+ssvsv1rGxrSVf8BnFYQBU0Io8H5QCB6EGC/QUqg1qBA2Jd0yZadMt XUplziiJzWieCK1J5yYDkmjZ1pNel+0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-84-FIXLX3XoPpmdg4HHlV_lpg-1; Mon, 26 Feb 2024 08:11:18 -0500 X-MC-Unique: FIXLX3XoPpmdg4HHlV_lpg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 33FA182DFE2 for ; Mon, 26 Feb 2024 13:11:18 +0000 (UTC) Received: from mheiblap.localdomain.com (unknown [10.47.238.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59E3C1C06710; Mon, 26 Feb 2024 13:11:17 +0000 (UTC) From: Mohammad Heib To: dev@openvswitch.org Date: Mon, 26 Feb 2024 15:11:08 +0200 Message-Id: <20240226131108.106005-1-mheib@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v3] OVN-SB: Exposes igmp group protocol version through IGMP table. 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" Expose the igmp/mld group protocol version through the IGMP_GROUP table in SBDB. This patch can be used by ovn consumer for debuggability purposes, user now can match between the protocol version used in the OVN logical switches and the uplink ports. Rreported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2160476 Signed-off-by: Mohammad Heib Acked-by: Ales Musil --- v3: Address Ales comments in v2 and rebase over main. --- NEWS | 2 ++ controller/ip-mcast.c | 11 +++++++++-- controller/ip-mcast.h | 11 ++++++----- controller/pinctrl.c | 16 ++++++++++++++-- northd/ovn-northd.c | 2 +- ovn-sb.ovsschema | 5 +++-- ovn-sb.xml | 4 ++++ tests/ovn.at | 3 +++ 8 files changed, 42 insertions(+), 12 deletions(-) diff --git a/NEWS b/NEWS index c0131ceee..784fedfa0 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ Post v24.03.0 cloned to all unknown ports connected to the same Logical Switch. - Added a new logical switch port option "disable_arp_nd_rsp" to disable adding the ARP responder flows if set to true. + - IGMP_Group has new "protocol" column that displays the the group + protocol version. OVN v24.03.0 - xx xxx xxxx -------------------------- diff --git a/controller/ip-mcast.c b/controller/ip-mcast.c index b457c7e69..0969cc07f 100644 --- a/controller/ip-mcast.c +++ b/controller/ip-mcast.c @@ -111,11 +111,12 @@ igmp_mrouter_create(struct ovsdb_idl_txn *idl_txn, } void -igmp_group_update_ports(const struct sbrec_igmp_group *g, +igmp_group_update(const struct sbrec_igmp_group *g, struct ovsdb_idl_index *datapaths, struct ovsdb_idl_index *port_bindings, const struct mcast_snooping *ms OVS_UNUSED, - const struct mcast_group *mc_group) + const struct mcast_group *mc_group, + const bool igmp_support_protocol) OVS_REQ_RDLOCK(ms->rwlock) { struct igmp_group_port *old_ports_storage = @@ -155,6 +156,12 @@ igmp_group_update_ports(const struct sbrec_igmp_group *g, sbrec_igmp_group_update_ports_delvalue(g, igmp_port->port); } + /* set Group protocol */ + if (igmp_support_protocol) { + sbrec_igmp_group_set_protocol(g, mcast_snooping_group_protocol_str( + mc_group->protocol_version)); + } + free(old_ports_storage); hmap_destroy(&old_ports); } diff --git a/controller/ip-mcast.h b/controller/ip-mcast.h index eebada968..026503139 100644 --- a/controller/ip-mcast.h +++ b/controller/ip-mcast.h @@ -47,11 +47,12 @@ struct sbrec_igmp_group *igmp_mrouter_create( const struct sbrec_chassis *chassis, bool igmp_group_has_chassis_name); -void igmp_group_update_ports(const struct sbrec_igmp_group *g, - struct ovsdb_idl_index *datapaths, - struct ovsdb_idl_index *port_bindings, - const struct mcast_snooping *ms, - const struct mcast_group *mc_group) +void igmp_group_update(const struct sbrec_igmp_group *g, + struct ovsdb_idl_index *datapaths, + struct ovsdb_idl_index *port_bindings, + const struct mcast_snooping *ms, + const struct mcast_group *mc_group, + const bool igmp_support_protocol) OVS_REQ_RDLOCK(ms->rwlock); void igmp_mrouter_update_ports(const struct sbrec_igmp_group *g, diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 98b29de9f..66e390e80 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -181,6 +181,7 @@ struct pinctrl { bool fdb_can_timestamp; bool dns_supports_ovn_owned; bool igmp_group_has_chassis_name; + bool igmp_support_protocol; }; static struct pinctrl pinctrl; @@ -3599,6 +3600,17 @@ pinctrl_update(const struct ovsdb_idl *idl, const char *br_int_name) notify_pinctrl_handler(); } + bool igmp_support_proto = + sbrec_server_has_igmp_group_table_col_protocol(idl); + if (igmp_support_proto != pinctrl.igmp_support_protocol) { + pinctrl.igmp_support_protocol = igmp_support_proto; + + /* Notify pinctrl_handler that igmp protocol column + * availability has changed. */ + notify_pinctrl_handler(); + } + + ovs_mutex_unlock(&pinctrl_mutex); } @@ -5409,9 +5421,9 @@ ip_mcast_sync(struct ovsdb_idl_txn *ovnsb_idl_txn, chassis, pinctrl.igmp_group_has_chassis_name); } - igmp_group_update_ports(sbrec_igmp, sbrec_datapath_binding_by_key, + igmp_group_update(sbrec_igmp, sbrec_datapath_binding_by_key, sbrec_port_binding_by_key, ip_ms->ms, - mc_group); + mc_group, pinctrl.igmp_support_protocol); } /* Mrouters. */ diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index b1be73cb2..3a5544b0c 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -120,7 +120,7 @@ static const char *rbac_svc_monitor_auth_update[] = static const char *rbac_igmp_group_auth[] = {"chassis_name"}; static const char *rbac_igmp_group_update[] = - {"address", "chassis", "datapath", "ports"}; + {"address", "protocol", "chassis", "datapath", "ports"}; static const char *rbac_bfd_auth[] = {"chassis_name"}; static const char *rbac_bfd_update[] = diff --git a/ovn-sb.ovsschema b/ovn-sb.ovsschema index 84ae09515..b6c051ae6 100644 --- a/ovn-sb.ovsschema +++ b/ovn-sb.ovsschema @@ -1,7 +1,7 @@ { "name": "OVN_Southbound", - "version": "20.33.0", - "cksum": "4076371179 31328", + "version": "20.34.0", + "cksum": "2786607656 31376", "tables": { "SB_Global": { "columns": { @@ -480,6 +480,7 @@ "IGMP_Group": { "columns": { "address": {"type": "string"}, + "protocol": {"type": "string"}, "datapath": {"type": {"key": {"type": "uuid", "refTable": "Datapath_Binding", "refType": "weak"}, diff --git a/ovn-sb.xml b/ovn-sb.xml index ac4e585f2..4c26c6714 100644 --- a/ovn-sb.xml +++ b/ovn-sb.xml @@ -4756,6 +4756,10 @@ tcp.flags = RST; Destination IPv4 address for the IGMP group. + + Group protocol version either IGMPv1,v2,v3 or MLDv1,v2. + + Datapath to which this IGMP group belongs. diff --git a/tests/ovn.at b/tests/ovn.at index d26c95054..2c71370f1 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -22706,6 +22706,7 @@ send_igmp_v3_report hv2-vif1 hv2 000000000002 $(ip_to_hex 10 0 0 2) f9f9 \ # Check that the IGMP Group is learned on both hv. wait_row_count IGMP_Group 2 address=239.0.1.68 +wait_row_count IGMP_Group 2 protocol=IGMPv3 check ovn-nbctl --wait=hv sync AT_CAPTURE_FILE([sbflows3]) @@ -22783,6 +22784,7 @@ send_igmp_v3_report hv1-vif1 hv1 \ # Check that the IGMP Group is learned. wait_row_count IGMP_Group 1 address=224.0.0.42 +wait_row_count IGMP_Group 1 protocol=IGMPv3 AS_BOX([IGMP traffic test 3]) # Send traffic and make sure it gets flooded to all ports. @@ -23444,6 +23446,7 @@ send_mld_v2_report hv2-vif1 hv2 \ # Check that the IP multicast group is learned on both hv. wait_row_count IGMP_Group 2 address='"ff0a:dead:beef::1"' +wait_row_count IGMP_Group 2 protocol=MLDv2 # This gives the ovn-controller nodes a chance to see the new IGMP_Group. check ovn-nbctl --wait=hv sync