From patchwork Thu Oct 8 13:48:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1378584 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.133; helo=hemlock.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=eQCLD9yO; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C6Xbj0tfWz9sTK for ; Fri, 9 Oct 2020 00:48:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 55A5B87495; Thu, 8 Oct 2020 13:48:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZqISDD4So4W4; Thu, 8 Oct 2020 13:48:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 2894F87472; Thu, 8 Oct 2020 13:48:30 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 06625C016F; Thu, 8 Oct 2020 13:48:30 +0000 (UTC) X-Original-To: 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 730E2C0051 for ; Thu, 8 Oct 2020 13:48:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 48CB620440 for ; Thu, 8 Oct 2020 13:48:29 +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 4f2Ry6ck0Nea for ; Thu, 8 Oct 2020 13:48:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by silver.osuosl.org (Postfix) with ESMTPS id 23ED820360 for ; Thu, 8 Oct 2020 13:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602164904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:content-type:content-type; bh=as2NRzstJgST32w1S17ybIW4sKNug9tEAvyXwAzSj3U=; b=eQCLD9yOWYpNJTkWLU+MOhztOkSXvXeMXMO1fEMnrPfXwCEx+sZZfymLzBHPoioPo5bGQU B2sn/jeB/U4lwXR90/PjipHr5WkqbgDwziQbxhCUlX0B2emPKmATvDFintNeAwTzb1mWzC 3RlMPyyI3q2+oHwForMy+w+DjLY229U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-6-Fr8X2mOSPeqpmbtcGjZrBA-1; Thu, 08 Oct 2020 09:48:19 -0400 X-MC-Unique: Fr8X2mOSPeqpmbtcGjZrBA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 74BB8100E061 for ; Thu, 8 Oct 2020 13:48:18 +0000 (UTC) Received: from dceara.remote.csb (ovpn-113-137.ams2.redhat.com [10.36.113.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85DA575122 for ; Thu, 8 Oct 2020 13:48:17 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Thu, 8 Oct 2020 15:48:07 +0200 Message-Id: <1602164887-24755-1-git-send-email-dceara@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] ovn-northd: Add localnet ports to Multicast_Groups created by IGMP_Group. 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" In case a logical switch is a "bridged logical switch", i.e., it has a localnet port, add the localnet port to all multicast groups generated from IGMP_Groups. This is needed because multicast packets are never tunneled between hypervisors. Note: There still exists an issue regarding IP Multicast Relay (routing) when traffic is received on bridged logical switches connected to logical routers with mcast_relay=true. That issue is not addressed yet but an item is added to TODO.rst to track it. Reported-at: https://bugzilla.redhat.com/1886103 Fixes: 5d1527b11e94 ("ovn-northd: Add IGMP Relay support") Signed-off-by: Dumitru Ceara --- TODO.rst | 8 ++++++++ northd/ovn-northd.c | 7 +++++++ tests/ovn.at | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/TODO.rst b/TODO.rst index 4321630..c158155 100644 --- a/TODO.rst +++ b/TODO.rst @@ -152,3 +152,11 @@ OVN To-do List . This causes an additional hashtable lookup in parse_port_group() which can be avoided when we are sure that the Southbound DB uses the new format. + +* IP Multicast Relay + + * When connecting bridged logical switches (localnet) to logical routers + with IP Multicast Relay enabled packets might get duplicated. We need + to find a way of determining if routing has already been executed (on a + different hypervisor) for the IP multicast packet being processed locally + in the router pipeline. diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index afc9b4e..8bab9b0 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -4134,6 +4134,13 @@ 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 diff --git a/tests/ovn.at b/tests/ovn.at index 08395fd..e3f3153 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -16668,6 +16668,7 @@ ovn_start # - subnet 30.0.0.0/8 # - 1 port bound on hv1 (sw3-p1) # - 1 port bound on hv2 (sw3-p2) +# - 1 localnet port (sw3-ln) reset_pcap_file() { local iface=$1 @@ -16794,6 +16795,9 @@ ovn-nbctl lsp-add sw2 sw2-p1 ovn-nbctl lsp-add sw2 sw2-p2 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 ovn-nbctl lr-add rtr ovn-nbctl lrp-add rtr rtr-sw1 00:00:00:00:01:00 10.0.0.254/24 @@ -16838,6 +16842,7 @@ ovs-vsctl -- add-port br-int hv1-vif4 -- \ options:tx_pcap=hv1/vif4-tx.pcap \ options:rxq_pcap=hv1/vif4-rx.pcap \ ofport-request=1 +ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys sim_add hv2 as hv2 @@ -16863,6 +16868,7 @@ ovs-vsctl -- add-port br-int hv2-vif4 -- \ options:tx_pcap=hv2/vif4-tx.pcap \ options:rxq_pcap=hv2/vif4-rx.pcap \ ofport-request=1 +ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys OVN_POPULATE_ARP @@ -17146,6 +17152,18 @@ 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 + OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [expected_routed_sw1]) OVN_CHECK_PACKETS([hv2/vif3-tx.pcap], [expected_routed_sw2]) OVN_CHECK_PACKETS([hv1/vif4-tx.pcap], [expected_switched]) @@ -17293,6 +17311,7 @@ ovn_start # - subnet 30::/64 # - 1 port bound on hv1 (sw3-p1) # - 1 port bound on hv2 (sw3-p2) +# - 1 localnet port (sw3-ln) reset_pcap_file() { local iface=$1 @@ -17418,6 +17437,9 @@ ovn-nbctl lsp-add sw2 sw2-p1 ovn-nbctl lsp-add sw2 sw2-p2 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 ovn-nbctl lr-add rtr ovn-nbctl lrp-add rtr rtr-sw1 00:00:00:00:01:00 10::fe/64 @@ -17477,6 +17499,7 @@ ovs-vsctl -- add-port br-int hv1-vif4 -- \ options:tx_pcap=hv1/vif4-tx.pcap \ options:rxq_pcap=hv1/vif4-rx.pcap \ ofport-request=1 +ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys sim_add hv2 as hv2 @@ -17502,6 +17525,7 @@ ovs-vsctl -- add-port br-int hv2-vif4 -- \ options:tx_pcap=hv2/vif4-tx.pcap \ options:rxq_pcap=hv2/vif4-rx.pcap \ ofport-request=1 +ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys OVN_POPULATE_ARP @@ -17812,6 +17836,22 @@ store_ip_multicast_pkt \ 93407a69000e1b5e61736461640a \ expected_switched +# TODO: MLD 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 333300000001 \ + 10000000000000000000000000000042 ff0adeadbeef00000000000000000001 \ + 000e 01 11 \ + 93407a69000e1b5e61736461640a \ + expected_routed_sw1 +store_ip_multicast_pkt \ + 000000000200 333300000001 \ + 10000000000000000000000000000042 ff0adeadbeef00000000000000000001 \ + 000e 01 11 \ + 93407a69000e1b5e61736461640a \ + expected_routed_sw2 + OVN_CHECK_PACKETS([hv1/vif1-tx.pcap], [expected_routed_sw1]) OVN_CHECK_PACKETS([hv2/vif3-tx.pcap], [expected_routed_sw2]) OVN_CHECK_PACKETS([hv1/vif4-tx.pcap], [expected_switched])