Skip to content

Commit

Permalink
Mclag enhacements (sonic-net#1349)
Browse files Browse the repository at this point in the history
* mclagsyncd enhancements as per HLD at sonic-net/SONiC#596

* mclagsyncd enhancements as per HLD at sonic-net/SONiC#596

* mclagsyncd enhancements as per HLD at sonic-net/SONiC#596

* mclagsyncd enhancements as per HLD at sonic-net/SONiC#596

* updated mclag port isolate platform check function

* MCLAG Unique IP Changes.

* updated mclagsyncd

* resolved compilation issues with master branch

* updated mclagsyncd merge issue

* addressed review comments

* addressed review comments

* fixed build issues with armhf platform

* fixed build issues with armhf platform

* fixed build issue

* fixed build issue

* addressed review comments

* addressed review comments

* removed unused code

Co-authored-by: Tapash Das <tapash.das@broadcom.com>
  • Loading branch information
2 people authored and raphaelt-nvidia committed Oct 5, 2021
1 parent bd46401 commit b4440a1
Show file tree
Hide file tree
Showing 4 changed files with 1,979 additions and 502 deletions.
51 changes: 45 additions & 6 deletions mclagsyncd/mclag.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,31 @@
#define MCLAG_DEFAULT_IP 0x7f000006

enum MCLAG_FDB_OP_TYPE {
MCLAG_FDB_OPER_ADD =1,
MCLAG_FDB_OPER_ADD = 1,
MCLAG_FDB_OPER_DEL = 2,
};

enum MCLAG_FDB_TYPE {
MCLAG_FDB_TYPE_STATIC = 1,
MCLAG_FDB_TYPE_STATIC = 1,
MCLAG_FDB_TYPE_DYNAMIC = 2,
MCLAG_FDB_TYPE_DYNAMIC_LOCAL = 3, /* Used while sending MAC to Syncd to program with aging enabled. */
};

enum MCLAG_DOMAIN_CFG_OP_TYPE {
MCLAG_CFG_OPER_NONE = 0, //NOP
MCLAG_CFG_OPER_ADD = 1, //Add domain
MCLAG_CFG_OPER_DEL = 2, //Delete domain
MCLAG_CFG_OPER_UPDATE = 3, //update domain
MCLAG_CFG_OPER_ATTR_DEL = 4 //Attribute del
};

enum MCLAG_DOMAIN_CFG_ATTR_BMAP_FLAGS {
MCLAG_CFG_ATTR_NONE = 0x0,
MCLAG_CFG_ATTR_SRC_ADDR = 0x1,
MCLAG_CFG_ATTR_PEER_ADDR = 0x2,
MCLAG_CFG_ATTR_PEER_LINK = 0x4,
MCLAG_CFG_ATTR_KEEPALIVE_INTERVAL = 0x8,
MCLAG_CFG_ATTR_SESSION_TIMEOUT = 0x10
};

/*
Expand Down Expand Up @@ -66,7 +84,11 @@ typedef struct mclag_msg_hdr_t_ {
/*syncd send msg type to iccpd*/
typedef enum mclag_syncd_msg_type_e_ {
MCLAG_SYNCD_MSG_TYPE_NONE = 0,
MCLAG_SYNCD_MSG_TYPE_FDB_OPERATION = 1
MCLAG_SYNCD_MSG_TYPE_FDB_OPERATION = 1,
MCLAG_SYNCD_MSG_TYPE_CFG_MCLAG_DOMAIN = 2,
MCLAG_SYNCD_MSG_TYPE_CFG_MCLAG_IFACE = 3,
MCLAG_SYNCD_MSG_TYPE_VLAN_MBR_UPDATES = 4,
MCLAG_SYNCD_MSG_TYPE_CFG_MCLAG_UNIQUE_IP = 5
}mclag_syncd_msg_type_e;

/*iccpd send msg type to syncd*/
Expand All @@ -77,8 +99,16 @@ typedef enum mclag_msg_type_e_ {
MCLAG_MSG_TYPE_FLUSH_FDB = 3,
MCLAG_MSG_TYPE_SET_INTF_MAC = 4,
MCLAG_MSG_TYPE_SET_FDB = 5,
MCLAG_MSG_TYPE_FLUSH_FDB_BY_PORT = 6,
MCLAG_MSG_TYPE_GET_FDB_CHANGES = 20
MCLAG_MSG_TYPE_SET_TRAFFIC_DIST_ENABLE = 6,
MCLAG_MSG_TYPE_SET_TRAFFIC_DIST_DISABLE = 7,
MCLAG_MSG_TYPE_SET_ICCP_STATE = 8,
MCLAG_MSG_TYPE_SET_ICCP_ROLE = 9,
MCLAG_MSG_TYPE_SET_ICCP_SYSTEM_ID = 10,
MCLAG_MSG_TYPE_DEL_ICCP_INFO = 11,
MCLAG_MSG_TYPE_SET_REMOTE_IF_STATE = 12,
MCLAG_MSG_TYPE_DEL_REMOTE_IF_INFO = 13,
MCLAG_MSG_TYPE_SET_PEER_LINK_ISOLATION = 14,
MCLAG_MSG_TYPE_SET_ICCP_PEER_SYSTEM_ID = 15
}mclag_msg_type_e;

typedef struct mclag_sub_option_hdr_t_ {
Expand All @@ -88,6 +118,7 @@ typedef struct mclag_sub_option_hdr_t_ {
* Length of option value, not including the header.
*/
uint16_t op_len;
uint8_t data[];
}mclag_sub_option_hdr_t;

#define MCLAG_SUB_OPTION_HDR_LEN (sizeof (mclag_sub_option_hdr_t))
Expand All @@ -99,7 +130,14 @@ typedef enum mclag_sub_option_type_e_ {
MCLAG_SUB_OPTION_TYPE_MAC_LEARN_ENABLE = 3,
MCLAG_SUB_OPTION_TYPE_MAC_LEARN_DISABLE = 4,
MCLAG_SUB_OPTION_TYPE_SET_MAC_SRC = 5,
MCLAG_SUB_OPTION_TYPE_SET_MAC_DST = 6
MCLAG_SUB_OPTION_TYPE_SET_MAC_DST = 6,
MCLAG_SUB_OPTION_TYPE_MCLAG_INTF_NAME = 7,
MCLAG_SUB_OPTION_TYPE_MCLAG_ID = 8,
MCLAG_SUB_OPTION_TYPE_ICCP_ROLE = 9,
MCLAG_SUB_OPTION_TYPE_SYSTEM_ID = 10,
MCLAG_SUB_OPTION_TYPE_OPER_STATUS = 11,
MCLAG_SUB_OPTION_TYPE_ISOLATION_STATE = 12,
MCLAG_SUB_OPTION_TYPE_PEER_SYSTEM_ID = 13
} mclag_sub_option_type_e;

static inline size_t
Expand Down Expand Up @@ -162,3 +200,4 @@ mclag_msg_ok (const mclag_msg_hdr_t *hdr, size_t len)


#endif

Loading

0 comments on commit b4440a1

Please sign in to comment.