Skip to content

Commit

Permalink
Fix review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchao-Mellanox committed Apr 7, 2022
1 parent ef23e3f commit 19420a5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
20 changes: 20 additions & 0 deletions orchagent/flex_counter/flowcounterrouteorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,16 @@ void FlowCounterRouteOrch::getRouteFlowCounterNameMapKey(sai_object_id_t vrf_id,

void FlowCounterRouteOrch::handleRouteAdd(sai_object_id_t vrf_id, const IpPrefix& ip_prefix)
{
if (!mRouteFlowCounterSupported)
{
return;
}

if (!isRouteFlowCounterEnabled())
{
return;
}

for (const auto &route_pattern : mRoutePatternSet)
{
if (route_pattern.is_match(vrf_id, ip_prefix))
Expand All @@ -860,6 +870,16 @@ void FlowCounterRouteOrch::handleRouteAdd(sai_object_id_t vrf_id, const IpPrefix

void FlowCounterRouteOrch::handleRouteRemove(sai_object_id_t vrf_id, const IpPrefix& ip_prefix)
{
if (!mRouteFlowCounterSupported)
{
return;
}

if (!isRouteFlowCounterEnabled())
{
return;
}

for (const auto &route_pattern : mRoutePatternSet)
{
if (route_pattern.is_match(vrf_id, ip_prefix))
Expand Down
6 changes: 0 additions & 6 deletions orchagent/muxorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@
#include "portsorch.h"
#include "aclorch.h"
#include "routeorch.h"
#include "flowcounterrouteorch.h"
#include "fdborch.h"

/* Global variables */
extern Directory<Orch*> gDirectory;
extern CrmOrch *gCrmOrch;
extern NeighOrch *gNeighOrch;
extern RouteOrch *gRouteOrch;
extern FlowCounterRouteOrch *gFlowCounterRouteOrch;
extern AclOrch *gAclOrch;
extern PortsOrch *gPortsOrch;
extern FdbOrch *gFdbOrch;
Expand Down Expand Up @@ -131,8 +129,6 @@ static sai_status_t create_route(IpPrefix &pfx, sai_object_id_t nh)
gCrmOrch->incCrmResUsedCounter(CrmResourceType::CRM_IPV6_ROUTE);
}

gFlowCounterRouteOrch->onAddMiscRouteEntry(gVirtualRouterId, pfx.getSubnet());

SWSS_LOG_NOTICE("Created tunnel route to %s ", pfx.to_string().c_str());
return status;
}
Expand Down Expand Up @@ -162,8 +158,6 @@ static sai_status_t remove_route(IpPrefix &pfx)
gCrmOrch->decCrmResUsedCounter(CrmResourceType::CRM_IPV6_ROUTE);
}

gFlowCounterRouteOrch->onRemoveMiscRouteEntry(gVirtualRouterId, pfx.getSubnet());

SWSS_LOG_NOTICE("Removed tunnel route to %s ", pfx.to_string().c_str());
return status;
}
Expand Down
5 changes: 2 additions & 3 deletions orchagent/routeorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "swssnet.h"
#include "crmorch.h"
#include "directory.h"
#include "sai_serialize.h"
#include "timer.h"

extern sai_object_id_t gVirtualRouterId;
Expand All @@ -33,8 +32,8 @@ extern FlowCounterRouteOrch *gFlowCounterRouteOrch;
extern size_t gMaxBulkSize;

/* Default maximum number of next hop groups */
#define DEFAULT_NUMBER_OF_ECMP_GROUPS 128
#define DEFAULT_MAX_ECMP_GROUP_SIZE 32
#define DEFAULT_NUMBER_OF_ECMP_GROUPS 128
#define DEFAULT_MAX_ECMP_GROUP_SIZE 32

RouteOrch::RouteOrch(DBConnector *db, vector<table_name_with_pri_t> &tableNames, SwitchOrch *switchOrch, NeighOrch *neighOrch, IntfsOrch *intfsOrch, VRFOrch *vrfOrch, FgNhgOrch *fgNhgOrch, Srv6Orch *srv6Orch) :
gRouteBulker(sai_route_api, gMaxBulkSize),
Expand Down

0 comments on commit 19420a5

Please sign in to comment.