From patchwork Tue May 3 15:15:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin-Gabriel Serdean X-Patchwork-Id: 1625601 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.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kt3S61MT0z9sG0 for ; Wed, 4 May 2022 01:15:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F3DE560FF5; Tue, 3 May 2022 15:15:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xNGmT1B1hbyb; Tue, 3 May 2022 15:15:29 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 37A1160BCD; Tue, 3 May 2022 15:15:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0923BC0039; Tue, 3 May 2022 15:15:28 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8D18CC002D for ; Tue, 3 May 2022 15:15:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 83A9660BB5 for ; Tue, 3 May 2022 15:15:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3mC-N3w-tQn1 for ; Tue, 3 May 2022 15:15:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by smtp3.osuosl.org (Postfix) with ESMTPS id 50FBA607EC for ; Tue, 3 May 2022 15:15:25 +0000 (UTC) Received: (Authenticated sender: aserdean@ovn.org) by mail.gandi.net (Postfix) with ESMTPSA id 31AD324000A; Tue, 3 May 2022 15:15:20 +0000 (UTC) From: Alin-Gabriel Serdean To: dev@openvswitch.org Date: Tue, 3 May 2022 18:15:07 +0300 Message-Id: <20220503151507.1782-1-aserdean@ovn.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Cc: Diko Parvanov , Dumitru Ceara Subject: [ovs-dev] [PATCH] [RFC] [ovn] northd: Fix IGMP external subscriber subscribing to internal feed 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" Add localnet ports to their corresponding southbound multicast group. Update unit tests. Reported-at: https://github.com/ovn-org/ovn/issues/125 Reported-by: Diko Parvanov Suggested-by: Dumitru Ceara Signed-off-by: Alin-Gabriel Serdean --- northd/northd.c | 17 ++++++++++------- tests/ovn.at | 15 ++------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index a56666297..4441ef631 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -4591,13 +4591,6 @@ ovn_igmp_group_aggregate_ports(struct ovn_igmp_group *igmp_group, ovn_igmp_group_destroy_entry(entry); free(entry); } - - if (igmp_group->datapath->n_localnet_ports) { - ovn_multicast_add_ports(mcast_groups, igmp_group->datapath, - &igmp_group->mcgroup, - igmp_group->datapath->localnet_ports, - igmp_group->datapath->n_localnet_ports); - } } static void @@ -15066,6 +15059,16 @@ build_mcast_groups(struct lflow_input *input_data, /* Add the extracted ports to the IGMP group. */ ovn_igmp_group_add_entry(igmp_group, igmp_ports, n_igmp_ports); + if (!ovn_igmp_group_allocate_id(igmp_group)) { + ovn_igmp_group_destroy(igmp_groups, igmp_group); + continue; + } + if (igmp_group->datapath->n_localnet_ports) { + ovn_multicast_add_ports(mcast_groups, igmp_group->datapath, + &igmp_group->mcgroup, + igmp_group->datapath->localnet_ports, + igmp_group->datapath->n_localnet_ports); + } } /* Build IGMP groups for multicast routers with relay enabled. The router diff --git a/tests/ovn.at b/tests/ovn.at index 34b6abfc0..5440639a8 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -19570,7 +19570,8 @@ ovn-nbctl lsp-add sw3 sw3-p1 ovn-nbctl lsp-add sw3 sw3-p2 ovn-nbctl lsp-add sw3 sw3-ln \ -- lsp-set-type sw3-ln localnet \ - -- lsp-set-options sw3-ln network_name=phys + -- lsp-set-options sw3-ln network_name=phys \ + -- lsp-set-options sw3-ln mcast_flood=true ovn-nbctl lr-add rtr ovn-nbctl lrp-add rtr rtr-sw1 00:00:00:00:01:00 10.0.0.254/24 @@ -19985,18 +19986,6 @@ store_ip_multicast_pkt \ $(ip_to_hex 10 0 0 42) $(ip_to_hex 239 0 1 68) 1e 20 ca70 11 \ e518e518000a3b3a0000 expected_switched -# TODO: IGMP Relay duplicates IP multicast packets in some conditions, for -# more details see TODO.rst, section "IP Multicast Relay". Once that issue is -# fixed the duplicated packets should not appear anymore. -store_ip_multicast_pkt \ - 000000000100 01005e000144 \ - $(ip_to_hex 10 0 0 42) $(ip_to_hex 239 0 1 68) 1e 1f cb70 11 \ - e518e518000a3b3a0000 expected_routed_sw1 -store_ip_multicast_pkt \ - 000000000200 01005e000144 \ - $(ip_to_hex 10 0 0 42) $(ip_to_hex 239 0 1 68) 1e 1f cb70 11 \ - e518e518000a3b3a0000 expected_routed_sw2 - OVS_WAIT_UNTIL( [check_packets 'hv1/vif1-tx.pcap expected_routed_sw1' \ 'hv2/vif3-tx.pcap expected_routed_sw2' \