[vnetorch]: Bitmap VNet implementation#773
Conversation
527e18e to
049c01d
Compare
Signed-off-by: Marian Pritsak <marianp@mellanox.com>
049c01d to
6fffec5
Compare
Signed-off-by: Marian Pritsak <marianp@mellanox.com>
Conflicts: orchagent/intfsorch.cpp orchagent/vnetorch.cpp orchagent/vnetorch.h
|
retest this please |
orchagent/vnetorch.h
Outdated
| static map<tuple<MacAddress, sai_object_id_t>, sai_neighbor_entry_t> neighMap_; | ||
|
|
||
| uint32_t vnet_id_; | ||
| uint32_t vni_; |
There was a problem hiding this comment.
vni_ is already in VnetObject. Can we use that?
orchagent/vnetorch.h
Outdated
| }; | ||
|
|
||
| typedef map<IpAddress, sai_object_id_t> NextHopMap; | ||
| typedef map<string, NextHopMap> NextHopTunnels; |
There was a problem hiding this comment.
I don't see these being used anywhere. Please delete if not required
There was a problem hiding this comment.
Bad merge
Done
orchagent/vnetorch.cpp
Outdated
| } | ||
| else | ||
| { | ||
| if (!isVnetExists(name)) |
There was a problem hiding this comment.
Should we move this outside the if for both cases?
orchagent/vnetorch.cpp
Outdated
|
|
||
| uint32_t VNetBitmapObject::getFreeNeighbor(void) | ||
| { | ||
| const uint32_t neighborRangeStart = 0xa9fe0000; |
There was a problem hiding this comment.
What is the magic number? Typically we avoid using hardcoded values
There was a problem hiding this comment.
Obsolete. Removed
orchagent/vnetorch.cpp
Outdated
|
|
||
| for (uint32_t i = 0; i < 256; i++) | ||
| { | ||
| if (tunnelOffsets_.count(i) == 0) |
There was a problem hiding this comment.
My preference would be to use a simple Boolean array of 256/512 for this logic. Just a suggestion.
|
|
||
| if (bridgeInfoMap_.find(vni) != bridgeInfoMap_.end()) | ||
| { | ||
| return std::move(bridgeInfoMap_.at(vni)); |
There was a problem hiding this comment.
Do we need to use move here?
There was a problem hiding this comment.
Because struct is returned
orchagent/vnetorch.cpp
Outdated
| throw std::runtime_error("vni creation failed"); | ||
| } | ||
|
|
||
| SWSS_LOG_NOTICE("Created RIF"); |
There was a problem hiding this comment.
Since it is notice, please add more info like vni, tunnel name. If not relevant, suggest to move to INFO.
There was a problem hiding this comment.
Just a debug comment. Removed
orchagent/vnetorch.cpp
Outdated
| const uint32_t neighborRangeStart = 0xa9fe0000; | ||
| static set<uint32_t> neighbors; | ||
|
|
||
| for (uint32_t i = 0; i < 0xffff; i++) |
There was a problem hiding this comment.
Same here for the magic number
Signed-off-by: Marian Pritsak <marianp@mellanox.com>
Signed-off-by: Marian Pritsak <marianp@mellanox.com>
It it hard to checkout code to non-case sensitive system.
* [vnetorch]: Bitmap VNet implementation * Adress review comments Signed-off-by: Marian Pritsak <marianp@mellanox.com>
Signed-off-by: Marian Pritsak marianp@mellanox.com