From 8d6aac035a04af5156ff5a6217c7b27b54598a2c Mon Sep 17 00:00:00 2001 From: Nikola Dancejic <26731235+Ndancejic@users.noreply.github.com> Date: Tue, 27 Feb 2024 12:46:24 -0800 Subject: [PATCH] [intfsorch] Enable ipv6 proxy ndp along with proxy arp (#3045) * [intfsorch] Enable ipv6 proxy ndp along with proxy arp setting SAI_VLAN_ATTR_UNKNOWN_MULTICAST_FLOOD_CONTROL_TYPE to SAI_VLAN_FLOOD_CONTROL_TYPE_NONE when proxy arp is enabled. This fixes a bug where ipv6 NS packets were flooding ports with duplicate packets. We now set multicast flood type to none. --- orchagent/intfsorch.cpp | 15 +++++++++++++++ tests/test_vnet.py | 3 +++ 2 files changed, 18 insertions(+) diff --git a/orchagent/intfsorch.cpp b/orchagent/intfsorch.cpp index 4363beb9ea..2a5e34ff93 100644 --- a/orchagent/intfsorch.cpp +++ b/orchagent/intfsorch.cpp @@ -368,6 +368,21 @@ bool IntfsOrch::setIntfVlanFloodType(const Port &port, sai_vlan_flood_control_ty } } + // Also set ipv6 multicast flood type + attr.id = SAI_VLAN_ATTR_UNKNOWN_MULTICAST_FLOOD_CONTROL_TYPE; + attr.value.s32 = vlan_flood_type; + + status = sai_vlan_api->set_vlan_attribute(port.m_vlan_info.vlan_oid, &attr); + if (status != SAI_STATUS_SUCCESS) + { + SWSS_LOG_ERROR("Failed to set multicast flood type for VLAN %u, rv:%d", port.m_vlan_info.vlan_id, status); + task_process_status handle_status = handleSaiSetStatus(SAI_API_VLAN, status); + if (handle_status != task_success) + { + return parseHandleSaiStatusFailure(handle_status); + } + } + return true; } diff --git a/tests/test_vnet.py b/tests/test_vnet.py index 3b1ef6efd9..5d853e5f85 100644 --- a/tests/test_vnet.py +++ b/tests/test_vnet.py @@ -779,6 +779,9 @@ def check_router_interface(self, dvs, intf_name, name, vlan_oid=0): expected_attr = { 'SAI_VLAN_ATTR_BROADCAST_FLOOD_CONTROL_TYPE': 'SAI_VLAN_FLOOD_CONTROL_TYPE_NONE' } check_object(asic_db, self.ASIC_VLAN_TABLE, vlan_oid, expected_attr) + expected_attr = { 'SAI_VLAN_ATTR_UNKNOWN_MULTICAST_FLOOD_CONTROL_TYPE': 'SAI_VLAN_FLOOD_CONTROL_TYPE_NONE' } + check_object(asic_db, self.ASIC_VLAN_TABLE, vlan_oid, expected_attr) + check_linux_intf_arp_proxy(dvs, intf_name) self.rifs.add(new_rif)