-
Notifications
You must be signed in to change notification settings - Fork 558
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
[pfcwdorch]: Add alert mode #342
Conversation
Alert mode tells watchdog that whenever it detects PFC storm, it should only write message to the log. It is implemented as a separate action along with drop and forward. Signed-off-by: marian-pritsak <marianp@mellanox.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check comment
@@ -97,6 +97,7 @@ PfcWdAction PfcWdOrch<DropHandler, ForwardHandler>::deserializeAction(const stri | |||
{ | |||
{ "forward", PfcWdAction::PFC_WD_ACTION_FORWARD }, | |||
{ "drop", PfcWdAction::PFC_WD_ACTION_DROP }, | |||
{ "alert", PfcWdAction::PFC_WD_ACTION_ALERT }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it better to move this const into the header file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not intended to be used by anyone else. Enum is in header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then a const static is better? do you know if the compiler will optimize here to only initialize the variable once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const static will be better here. Move out of this function, and make it a cpp global is even better.
There are several cost here:
- time cost: each function call will call the instructor once
- space cost: each template instantiate will create a local map instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qiluo-msft thanks for the explanation.
In this pr, in alert mode, it will run restore plugins for stormed queues, which is not correct. Instead, we need to use detect plugin to check stormed queues in alert mode. #343 includes the enhancement. |
* require root privilege for all pfcwd configuration commands (sonic-net#330) Signed-off-by: Guohan Lu <gulv@microsoft.com> * pfcwd start: 1) default restoration time to 2 times detection time if not defined; 2) check if options are prefixed with "--"; Signed-off-by: Wenda <wenni@microsoft.com> * Check if ports list has invalid string element; Correct typo restoration-time Signed-off-by: Wenda <wenni@microsoft.com>
* Change get_tx_bias return type to list Signed-off-by: Mihir Patel <patelmi@microsoft.com>
Alert mode tells watchdog that whenever it detects PFC storm, it should
only write message to the log. It is implemented as a separate action
along with drop and forward.
Signed-off-by: marian-pritsak marianp@mellanox.com