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

[pfcwdorch]: Add alert mode #342

Merged
merged 1 commit into from
Oct 12, 2017
Merged

Conversation

marian-pritsak
Copy link
Collaborator

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

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>
Copy link
Contributor

@stcheng stcheng left a 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 },
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

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?

Copy link
Contributor

@qiluo-msft qiluo-msft Oct 12, 2017

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:

  1. time cost: each function call will call the instructor once
  2. space cost: each template instantiate will create a local map instance

Copy link
Contributor

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.

@sihuihan88
Copy link
Contributor

sihuihan88 commented Oct 11, 2017

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.

@lguohan lguohan merged commit 41925f6 into sonic-net:master Oct 12, 2017
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
* 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>
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
lukasstockner pushed a commit to genesiscloud/sonic-swss that referenced this pull request Apr 2, 2023
* Change get_tx_bias return type to list

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants