summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorAmeya Dharkar <adharkar@vmware.com>2019-05-16 13:28:25 -0700
committerAmeya Dharkar <adharkar@vmware.com>2019-06-17 12:05:38 -0700
commite5218ec873949bea27a116a48372e04c6b70291f (patch)
treeee3242457c5eab89c2f09a2a3675954ec7946af9 /lib/command.c
parent53c2c3c37800435d4d1b8b5301b54a2eb15a6877 (diff)
Zebra: Data structures for RMAC processing in FPM
- FPM MAC structure: This data structure will contain all the information required for FPM message generation for an RMAC. struct fpm_mac_info_t { struct ethaddr macaddr; uint32_t zebra_flags; /* Could be used to build FPM messages */ vni_t vni; ifindex_t vxlan_if; ifindex_t svi_if; /* L2 or L3 Bridge interface */ struct in_addr r_vtep_ip; /* Remote VTEP IP */ /* Linkage to put MAC on the FPM processing queue. */ TAILQ_ENTRY(fpm_mac_info_t) fpm_mac_q_entries; uint8_t fpm_flags; }; - Queue structure for FPM processing: For FPM processing, we build a queue of "fpm_mac_info_t". When RMAC is added or deleted from zebra, fpm_mac_info_t node is enqueued in this queue for the corresponding operation. FPM thread will dequeue these nodes one by one to generate a netlink message. TAILQ_HEAD(zfpm_mac_q, fpm_mac_info_t) mac_q; - Hash table for "fpm_mac_info_t" When zebra tries to enqueue fpm_mac_info_t for a new RMAC add/delete operation, it is possible that this RMAC is already present in the queue. So, to avoid multiple messages for duplicate RMAC nodes, insert fpm_mac_info_t into a hash table. struct hash *fpm_mac_info_table; - Before enqueueing any MAC, try to fetch the fpm_mac_info_t from the hash table first. - Entry is deleted from the hash table when the node is dequeued. - For hash table key generation, parameters used are "mac adress" and "vni" This will provide a fairly unique key for a MAC(fpm_mac_info_hash_keymake). - Compare function uses "mac address", "RVTEP address" and "VNI" as the key which is sufficient to distinguish any two RMACs. This compare function is used for fpm_mac_info_t lookup (zfpm_mac_info_cmp). Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
Diffstat (limited to 'lib/command.c')
0 files changed, 0 insertions, 0 deletions