-
Notifications
You must be signed in to change notification settings - Fork 520
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
SwSS Changes for DHCP DoS Mitigation Feature #3130
base: master
Are you sure you want to change the base?
Changes from all commits
5a8b39f
0fb822a
dc20bf1
903a89d
132a6e0
312356d
eb52c01
4d10719
6ec063c
703e8a5
79fea07
5279d61
c89f3d4
d167ade
b761b27
d22882a
893c800
462c777
768e1c9
01331df
19cdea5
4c2135a
d5cf62b
11f2592
5b850db
d079550
f71c0a7
e242495
3c7139a
774eccd
264efe0
14b0a66
7e2c5b2
04c723f
5a74163
9337839
6a70578
ef712b5
e9881aa
b7c1fc4
c640432
4ead285
a14dad0
7036b0f
246d96a
3381caf
07a72f4
f3a94c5
0c51f71
1b1cc19
d2d94c9
efa1b55
05ea555
68dadc9
fc7fff5
18e0f71
1690ddc
400c702
18fb715
fb0e7e1
aaa4f73
3e3fa50
5e68783
0a42fe6
58fd4b3
0a30441
855217a
b7ad4d8
1980e65
67d31c9
710e6aa
9d65c51
062ca41
a189347
45c0287
50a5d01
f892368
566cf98
c1dbc9c
e53e05c
e00d1d1
ef7d365
ed8c0c1
c31c19c
03e41ae
b974eee
19f8424
dae8b75
a19e91a
90cd544
eaf0c2e
d5f4f1a
9d61b92
9d40e2b
6d7ddff
d4b5f75
4e03068
adf5682
8903a1a
8434878
7ab9069
2089cbe
17b8e3c
08afacc
0facc0a
ea59664
74d19c1
4649e15
a01f989
0b22bfb
0d0353b
54aab00
548d4c9
a69d1e4
0d35b35
993ced8
4978f89
b3beb1f
9114f52
6a59c15
24d943a
7cf982f
6f6f5b1
029201e
3552d82
6011d06
531f590
71ac850
60eef36
934b537
27deb39
6b9fae7
fd88d5c
c8d2a23
2590581
4159740
9d3bf33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,7 @@ def _verify_db_contents(): | |
return (True, None) | ||
|
||
# Verify that ASIC DB has been fully initialized | ||
init_polling_config = PollingConfig(2, 30, strict=True) | ||
init_polling_config = PollingConfig(2, 60, strict=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why we change this value from 30 to 60? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The timeout duration was increased after analyzing the failures and identifying that the issue might be related to initialization timing. Adding a delay helped resolve the problem, and the build was successful. However, when these delays were removed, the dvs_test failed again, indicating that the delays are necessary for the DVS to be ready. |
||
wait_for_result(_verify_db_contents, init_polling_config) | ||
|
||
def _generate_oid_to_interface_mapping(self) -> None: | ||
|
@@ -1136,6 +1136,13 @@ def set_mtu(self, interface, mtu): | |
fvs = swsscommon.FieldValuePairs([("mtu", mtu)]) | ||
tbl.set(interface, fvs) | ||
time.sleep(1) | ||
|
||
def set_dhcp_rate_limit(self, interface, dhcp_rate_limit): | ||
tbl_name = "PORT" | ||
tbl = swsscommon.Table(self.cdb, tbl_name) | ||
fvs = swsscommon.FieldValuePairs([("dhcp_rate_limit", dhcp_rate_limit)]) | ||
tbl.set(interface, fvs) | ||
time.sleep(20) | ||
|
||
# deps: acl, mirror_port_erspan | ||
def add_neighbor(self, interface, ip, mac): | ||
|
@@ -1848,6 +1855,7 @@ def update_dvs(log_path, new_dvs_env=[]): | |
dvs.destroy_servers() | ||
dvs.create_servers() | ||
dvs.restart() | ||
time.sleep(60) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need sleep here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a delay here to ensure that once the DVS switch starts, there is a pause before it performs any further actions, allowing sufficient time for the ports to initialize properly. |
||
|
||
return dvs | ||
|
||
|
@@ -1859,10 +1867,11 @@ def update_dvs(log_path, new_dvs_env=[]): | |
|
||
dvs.get_logs() | ||
dvs.destroy() | ||
|
||
if dvs.persistent: | ||
dvs.runcmd("mv /etc/sonic/config_db.json.orig /etc/sonic/config_db.json") | ||
dvs.ctn_restart() | ||
time.sleep(60) | ||
|
||
@pytest.fixture(scope="module") | ||
def dvs(request, manage_dvs) -> DockerVirtualSwitch: | ||
|
@@ -2023,4 +2032,4 @@ def dpb_setup_fixture(dvs): | |
else: | ||
dvs.vct.restart() | ||
yield | ||
remove_dpb_config_file(dvs) | ||
remove_dpb_config_file(dvs) |
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.
Why is this log warn? Seems it doesn't mean unexpected situation?
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.
the log SWSS_LOG_WARN("ret Value in setPortDHCPMitigationRate is ret:%d,", ret); was added temporarily for debugging purposes to track failures and will be removed.