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

Broadcast Unknown-multicast and Unknown-unicast Storm-control #1306

Merged
merged 86 commits into from
May 24, 2022

Conversation

mohan-selvaraj
Copy link
Contributor

@mohan-selvaraj mohan-selvaraj commented Jun 1, 2020

Handle BUM Storm-control CONFIG_DB update.
Segregate POLICER table and PORT_STORM_CONTROL table handling

Broadcast, Unknown-multicast and Unknown-unicast storm-control on Ethernet interfaces.

configuration commands

config interface storm-control broadcast add Ethernet0 10000
config interface storm-control unknown-multicast add Ethernet0 10000
config interface storm-control unknown-unicast add Ethernet0 10000

config interface storm-control broadcast del Ethernet0
config interface storm-control unknown-multicast del Ethernet0
config interface storm-control unknown-unicast del Ethernet0

show commands

show storm-control all
show storm-control interface Ethernet0

Sample output

show storm-control interface Ethernet0
+------------------+-------------------+---------------+
| Interface Name   | Storm Type        |   Rate (kbps) |
+==================+===================+===============+
| Ethernet0        | broadcast         |         10000 |
+------------------+-------------------+---------------+
| Ethernet0        | unknown-unicast   |         10000 |
+------------------+-------------------+---------------+
| Ethernet0        | unknown-multicast |         10000 |
+------------------+-------------------+---------------+

What I did

Why I did it

How I verified it

Details if related

@lguohan lguohan requested a review from neethajohn June 4, 2020 19:40
orchagent/policerorch.cpp Outdated Show resolved Hide resolved
orchagent/policerorch.cpp Outdated Show resolved Hide resolved
orchagent/policerorch.cpp Outdated Show resolved Hide resolved
orchagent/policerorch.cpp Outdated Show resolved Hide resolved
orchagent/policerorch.h Outdated Show resolved Hide resolved
tests/test_storm_control.py Outdated Show resolved Hide resolved
tests/test_storm_control.py Outdated Show resolved Hide resolved
tests/test_storm_control.py Outdated Show resolved Hide resolved
tests/test_storm_control.py Outdated Show resolved Hide resolved
tests/test_storm_control.py Outdated Show resolved Hide resolved
@neethajohn
Copy link
Contributor

Please link the associated HLD and all other PR's in the various repositories here

@neethajohn
Copy link
Contributor

@mohan-selvaraj, could you please clarify on the design? Why do we need to create policers for every interface and storm type vs creating different policers for different cir rates and then binding them to the port based on the storm type?

@mohan-selvaraj
Copy link
Contributor Author

mohan-selvaraj commented Jul 10, 2020

HLD - sonic-net/SONiC#441
sonic-utilities (CLICK CLI config and show commands) - sonic-net/sonic-utilities#928

- update key value to index the policer map in case of policer update.
- use tokenize to split interface and storm-type.
- updated pytest script to use common api for storm-control configuration and validation
orchagent/policerorch.cpp Outdated Show resolved Hide resolved
orchagent/policerorch.cpp Outdated Show resolved Hide resolved
Comment on lines 579 to 582
SWSS_LOG_ERROR("Failed to remove policer %s, rv:%d",
storm_policer_name.c_str(), status);
/*TODO: Just doing a syslog. */
}
Copy link
Contributor

Choose a reason for hiding this comment

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

use 'continue' to move on to the next set?. In the current flow, it proceeds to print 'policer removal success' as well

Copy link
Contributor Author

@mohan-selvaraj mohan-selvaraj Nov 3, 2021

Choose a reason for hiding this comment

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

continue can result in stale policer information which remains in m_syncdPolicers. Hence not using continue.

Comment on lines 683 to 685
SWSS_LOG_NOTICE("Failed to delete policer %s created for port %s",
storm_policer_name.c_str(), port.m_alias.c_str());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

use 'continue' after the error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

continue can result in stale policer information which remains in m_syncdPolicers. Hence not using continue.

orchagent/policerorch.cpp Outdated Show resolved Hide resolved
attr.value.u64 = (stoul(value)*1000/8);
cir = true;
attrs.push_back(attr);
SWSS_LOG_INFO("CIR %s",value.c_str());
}
else
{
Copy link
Contributor

Choose a reason for hiding this comment

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

The HLD also mentions 'enabled' field used in the STORM_CONTROL_TABLE for each interface, storm type. Didn't see that field handled in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since the default behavior is "enabled" didn't implement the field here. Can be introduced in a scenario where the CONFIG_DB table contains the configuration but it isn't programmed in the hardware possibly because of hardware limitation.

tests/test_storm_control.py Show resolved Hide resolved
self.add_storm_control_on_interface(dvs,if_name,storm_type,kbps_value)

def test_del_bcast_storm(self,dvs,testlog):
#Proceeding with assumption that storm-control is already enabled on interface
Copy link
Contributor

Choose a reason for hiding this comment

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

Each test should run independently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update the test code.

@neethajohn
Copy link
Contributor

@mohan-selvaraj, can you address the review comments?

orchagent/orchdaemon.cpp Outdated Show resolved Hide resolved
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mohan-selvaraj
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny
Copy link
Collaborator

prsunny commented May 16, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

prsunny
prsunny previously approved these changes May 16, 2022
@mohan-selvaraj
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 1306 in repo Azure/sonic-swss

@mohan-selvaraj
Copy link
Contributor Author

/AzurePipelines run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 1306 in repo Azure/sonic-swss

@prsunny
Copy link
Collaborator

prsunny commented May 22, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny
Copy link
Collaborator

prsunny commented May 24, 2022

@neethajohn , could you please sign-off?

@prsunny prsunny merged commit 40316f7 into sonic-net:master May 24, 2022
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
…net#1306)

* Handle BUM Storm-control CONFIG_DB update.
* Segregate POLICER table and PORT_STORM_CONTROL table handling
* Broadcast, Unknown-multicast and Unknown-unicast storm-control on Ethernet interfaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants