From 830be93f7abdf50b3718bba0e628781fc8b18c02 Mon Sep 17 00:00:00 2001 From: mint570 Date: Thu, 28 May 2026 12:20:39 +0000 Subject: [PATCH] Copy BCM sairouterinterface extensions to SAI repository. Signed-off-by: SRAVANI KANASANI --- experimental/saiextensions.h | 1 + experimental/sairouterinterfaceextensions.h | 83 +++++++++++++++++++++ inc/sainexthopgroup.h | 11 +++ 3 files changed, 95 insertions(+) create mode 100644 experimental/sairouterinterfaceextensions.h diff --git a/experimental/saiextensions.h b/experimental/saiextensions.h index f43ee480a..c6a09a145 100644 --- a/experimental/saiextensions.h +++ b/experimental/saiextensions.h @@ -32,6 +32,7 @@ #include "saitypesextensions.h" #include "saiswitchextensions.h" #include "saiportextensions.h" +#include "sairouterinterfaceextensions.h" /* new experimental object type includes */ #include "saiexperimentaldashtrustedvni.h" diff --git a/experimental/sairouterinterfaceextensions.h b/experimental/sairouterinterfaceextensions.h new file mode 100644 index 000000000..694f00b71 --- /dev/null +++ b/experimental/sairouterinterfaceextensions.h @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2026 Microsoft Open Technologies, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT + * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS + * FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. + * + * See the Apache Version 2.0 License for specific language governing + * permissions and limitations under the License. + * + * Microsoft would like to thank the following companies for their review and + * assistance with these files: Intel Corporation, Mellanox Technologies Ltd, + * Dell Products, L.P., Facebook, Inc., Marvell International Ltd. + * + * @file sairouterinterfaceextensions.h + * + * @brief This module defines router interface extensions of the Switch Abstraction Interface (SAI) + */ + +#ifndef __SAIROUTERINTERFACEEXTENSIONS_H_ +#define __SAIROUTERINTERFACEEXTENSIONS_H_ + +#include +#include + +/** + * @brief SAI router interface attribute extensions. + * + * @flags free + */ +typedef enum _sai_router_interface_attr_extensions_t +{ + /** + * @brief SAG support + * + * @type bool + * @flags CREATE_AND_SET + * @default false + */ + SAI_ROUTER_INTERFACE_ATTR_ANYCAST_MAC_SUPPORT = SAI_ROUTER_INTERFACE_ATTR_END, + + /** + * @brief MAC Address + * + * valid when SAI_ROUTER_INTERFACE_ATTR_TYPE != SAI_ROUTER_INTERFACE_TYPE_LOOPBACK + * + * @type sai_mac_t + * @flags CREATE_AND_SET + * @default attrvalue SAI_VIRTUAL_ROUTER_ATTR_SRC_MAC_ADDRESS + */ + SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS_RIF_UPDATE, + + /** + * @brief MAC Address + * + * valid when SAI_ROUTER_INTERFACE_ATTR_TYPE != SAI_ROUTER_INTERFACE_TYPE_LOOPBACK + * + * @type sai_mac_t + * @flags CREATE_AND_SET + * @default attrvalue SAI_VIRTUAL_ROUTER_ATTR_SRC_MAC_ADDRESS + */ + SAI_ROUTER_INTERFACE_ATTR_PEER_SRC_MAC_ADDRESS, + + /** + * @brief Disable VLAN and port-VLAN membership programming + * + * valid when SAI_ROUTER_INTERFACE_ATTR_TYPE == SAI_ROUTER_INTERFACE_TYPE_SUB_PORT + * + * @type bool + * @flags CREATE_ONLY + * @default false + */ + SAI_ROUTER_INTERFACE_ATTR_DISABLE_SUB_PORT_VLAN_CONFIG + +} sai_router_interface_attr_extensions_t; + +#endif /* __SAIROUTERINTERFACEEXTENSIONS_H_ */ + diff --git a/inc/sainexthopgroup.h b/inc/sainexthopgroup.h index a34e9fdf6..4d57ac00f 100644 --- a/inc/sainexthopgroup.h +++ b/inc/sainexthopgroup.h @@ -359,6 +359,17 @@ typedef enum _sai_next_hop_group_attr_t */ SAI_NEXT_HOP_GROUP_ATTR_ADMIN_ROLE, + /** + * @brief Weighted multi path configuration mode. + * false: Nexthop group is programmed with repeated member entries proportional to their weight + * true: Nexthop group is programmed with switch native configuration + * + * @type bool + * @flags CREATE_AND_SET + * @default false + */ + SAI_NEXT_HOP_GROUP_ATTR_NATIVE_WCMP, + /** * @brief End of attributes */