Skip to content

Commit 72892e4

Browse files
gitsabaritapashdas
andauthored
Mclag enhacements (#1349)
* 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 <[email protected]>
1 parent 6c4c9ad commit 72892e4

4 files changed

Lines changed: 1979 additions & 502 deletions

File tree

mclagsyncd/mclag.h

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,31 @@
2323
#define MCLAG_DEFAULT_IP 0x7f000006
2424

2525
enum MCLAG_FDB_OP_TYPE {
26-
MCLAG_FDB_OPER_ADD =1,
26+
MCLAG_FDB_OPER_ADD = 1,
2727
MCLAG_FDB_OPER_DEL = 2,
2828
};
2929

3030
enum MCLAG_FDB_TYPE {
31-
MCLAG_FDB_TYPE_STATIC = 1,
31+
MCLAG_FDB_TYPE_STATIC = 1,
3232
MCLAG_FDB_TYPE_DYNAMIC = 2,
33+
MCLAG_FDB_TYPE_DYNAMIC_LOCAL = 3, /* Used while sending MAC to Syncd to program with aging enabled. */
34+
};
35+
36+
enum MCLAG_DOMAIN_CFG_OP_TYPE {
37+
MCLAG_CFG_OPER_NONE = 0, //NOP
38+
MCLAG_CFG_OPER_ADD = 1, //Add domain
39+
MCLAG_CFG_OPER_DEL = 2, //Delete domain
40+
MCLAG_CFG_OPER_UPDATE = 3, //update domain
41+
MCLAG_CFG_OPER_ATTR_DEL = 4 //Attribute del
42+
};
43+
44+
enum MCLAG_DOMAIN_CFG_ATTR_BMAP_FLAGS {
45+
MCLAG_CFG_ATTR_NONE = 0x0,
46+
MCLAG_CFG_ATTR_SRC_ADDR = 0x1,
47+
MCLAG_CFG_ATTR_PEER_ADDR = 0x2,
48+
MCLAG_CFG_ATTR_PEER_LINK = 0x4,
49+
MCLAG_CFG_ATTR_KEEPALIVE_INTERVAL = 0x8,
50+
MCLAG_CFG_ATTR_SESSION_TIMEOUT = 0x10
3351
};
3452

3553
/*
@@ -66,7 +84,11 @@ typedef struct mclag_msg_hdr_t_ {
6684
/*syncd send msg type to iccpd*/
6785
typedef enum mclag_syncd_msg_type_e_ {
6886
MCLAG_SYNCD_MSG_TYPE_NONE = 0,
69-
MCLAG_SYNCD_MSG_TYPE_FDB_OPERATION = 1
87+
MCLAG_SYNCD_MSG_TYPE_FDB_OPERATION = 1,
88+
MCLAG_SYNCD_MSG_TYPE_CFG_MCLAG_DOMAIN = 2,
89+
MCLAG_SYNCD_MSG_TYPE_CFG_MCLAG_IFACE = 3,
90+
MCLAG_SYNCD_MSG_TYPE_VLAN_MBR_UPDATES = 4,
91+
MCLAG_SYNCD_MSG_TYPE_CFG_MCLAG_UNIQUE_IP = 5
7092
}mclag_syncd_msg_type_e;
7193

7294
/*iccpd send msg type to syncd*/
@@ -77,8 +99,16 @@ typedef enum mclag_msg_type_e_ {
7799
MCLAG_MSG_TYPE_FLUSH_FDB = 3,
78100
MCLAG_MSG_TYPE_SET_INTF_MAC = 4,
79101
MCLAG_MSG_TYPE_SET_FDB = 5,
80-
MCLAG_MSG_TYPE_FLUSH_FDB_BY_PORT = 6,
81-
MCLAG_MSG_TYPE_GET_FDB_CHANGES = 20
102+
MCLAG_MSG_TYPE_SET_TRAFFIC_DIST_ENABLE = 6,
103+
MCLAG_MSG_TYPE_SET_TRAFFIC_DIST_DISABLE = 7,
104+
MCLAG_MSG_TYPE_SET_ICCP_STATE = 8,
105+
MCLAG_MSG_TYPE_SET_ICCP_ROLE = 9,
106+
MCLAG_MSG_TYPE_SET_ICCP_SYSTEM_ID = 10,
107+
MCLAG_MSG_TYPE_DEL_ICCP_INFO = 11,
108+
MCLAG_MSG_TYPE_SET_REMOTE_IF_STATE = 12,
109+
MCLAG_MSG_TYPE_DEL_REMOTE_IF_INFO = 13,
110+
MCLAG_MSG_TYPE_SET_PEER_LINK_ISOLATION = 14,
111+
MCLAG_MSG_TYPE_SET_ICCP_PEER_SYSTEM_ID = 15
82112
}mclag_msg_type_e;
83113

84114
typedef struct mclag_sub_option_hdr_t_ {
@@ -88,6 +118,7 @@ typedef struct mclag_sub_option_hdr_t_ {
88118
* Length of option value, not including the header.
89119
*/
90120
uint16_t op_len;
121+
uint8_t data[];
91122
}mclag_sub_option_hdr_t;
92123

93124
#define MCLAG_SUB_OPTION_HDR_LEN (sizeof (mclag_sub_option_hdr_t))
@@ -99,7 +130,14 @@ typedef enum mclag_sub_option_type_e_ {
99130
MCLAG_SUB_OPTION_TYPE_MAC_LEARN_ENABLE = 3,
100131
MCLAG_SUB_OPTION_TYPE_MAC_LEARN_DISABLE = 4,
101132
MCLAG_SUB_OPTION_TYPE_SET_MAC_SRC = 5,
102-
MCLAG_SUB_OPTION_TYPE_SET_MAC_DST = 6
133+
MCLAG_SUB_OPTION_TYPE_SET_MAC_DST = 6,
134+
MCLAG_SUB_OPTION_TYPE_MCLAG_INTF_NAME = 7,
135+
MCLAG_SUB_OPTION_TYPE_MCLAG_ID = 8,
136+
MCLAG_SUB_OPTION_TYPE_ICCP_ROLE = 9,
137+
MCLAG_SUB_OPTION_TYPE_SYSTEM_ID = 10,
138+
MCLAG_SUB_OPTION_TYPE_OPER_STATUS = 11,
139+
MCLAG_SUB_OPTION_TYPE_ISOLATION_STATE = 12,
140+
MCLAG_SUB_OPTION_TYPE_PEER_SYSTEM_ID = 13
103141
} mclag_sub_option_type_e;
104142

105143
static inline size_t
@@ -162,3 +200,4 @@ mclag_msg_ok (const mclag_msg_hdr_t *hdr, size_t len)
162200

163201

164202
#endif
203+

0 commit comments

Comments
 (0)