Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flex Counters] Reset flex counters delay flag on config DB when enable_counters script is called #8500

Merged
merged 6 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dockers/docker-orchagent/enable_counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def enable_counter_group(db, name):
info = {}
info['FLEX_COUNTER_STATUS'] = 'enable'
db.mod_entry("FLEX_COUNTER_TABLE", name, info)
else:
entry_info.update({"FLEX_COUNTER_DELAY_STATUS":"false"})
db.mod_entry("FLEX_COUNTER_TABLE", name, entry_info)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the disabling of delay status happen regardless of entry_info exists or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason too, if the entry not exist on the DB so we push it without the delay indicator and orchagent will start the flow normally.
Please check:
https://github.com/Azure/sonic-swss/blob/0febef7d167bc7ef77bf1c8b03ee91b88cb3e213/orchagent/flexcounterorch.cpp#L89


def enable_rates():
# set the default interval for rates
Expand Down
43 changes: 43 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-flex_counter.yang
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ module sonic-flex_counter {
}
}

typedef flex_delay_status {
type boolean {
boolean true;
boolean false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just type boolean should be enough. Can you confirm?

Suggested change
typedef flex_delay_status {
type boolean {
boolean true;
boolean false;
}
}
typedef flex_delay_status {
type boolean;
}


description "FLEX_COUNTER_TABLE part of config_db.json";

/* below are in alphabetical order */
Expand All @@ -32,83 +39,119 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container DEBUG_COUNTER {
/* DEBUG_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container PFCWD {
/* PFC_WD_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container PG_DROP {
/* PG_DROP_STAT_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container PG_WATERMARK {
/* PG_WATERMARK_STAT_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container PORT {
/* PORT_STAT_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container PORT_RATES {
/* PORT_BUFFER_DROP_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container PORT_BUFFER_DROP {
/* PORT_BUFFER_DROP_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container QUEUE {
/* QUEUE_STAT_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container QUEUE_WATERMARK {
/* QUEUE_WATERMARK_STAT_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container RIF {
/* RIF_STAT_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

container RIF_RATES {
/* RIF_RATE_COUNTER_FLEX_COUNTER_GROUP */
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}

}
Expand Down