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

Prevent Profile Creation for Invalid Cable Length #2

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0abfe00
[SWSS:portsorch] fix child_ports checking in addLagMember and removeL…
baorliu Feb 24, 2025
82632ea
Added Change to Skip Route Programming if NH is link/oper down (#3520)
abdosi Feb 24, 2025
3a80d64
Set Port UPDATE_DSCP attribute when TC_TO_DSCP map is attached (#3517)
kperumalbfn Feb 24, 2025
887e3a5
Add appliance entry validation (#3494)
mukeshmv Feb 27, 2025
8c778bf
[smartswitch] Add support for ENI Based Forwarding (#3398)
vivekrnv Feb 27, 2025
a0fcac9
Initialize Port oper error map only once (#3538)
prgeor Mar 3, 2025
1b2a8e6
[copp]: Use non-zero trap priority for default trap group (#3502)
prabhataravind Mar 3, 2025
7a965ca
Optimize counter initialization by reducing the number of bulk counte…
stephenxs Mar 4, 2025
74e9e63
Prevent lossless profile creation for 0m cable
jianyuewu Feb 24, 2025
3494eae
Keep PGs, remove losslesss profiles when 0m cable
jianyuewu Mar 5, 2025
439ac82
Remove unnecessary prints and refactor UT
jianyuewu Mar 5, 2025
6a93999
Update log level to info
jianyuewu Mar 7, 2025
4b0bb1c
Merge branch 'master' into skip_0m_profile
jianyuewu Mar 7, 2025
8447919
Update test_macsec.py (#3549)
Pterosaur Mar 10, 2025
da18966
[MCLAG] Fix a race condition when moving MAC addresses to MCLAG peer …
puffc Mar 10, 2025
8398865
Update gitignore for fabricmgrd, stpmgrd, and the p4orch_tests binari…
theasianpianist Mar 11, 2025
ae4789c
Use software_bfd instead of switch_type. (#3525)
dypet Mar 11, 2025
92be63e
Merge branch 'master' into skip_0m_profile
jianyuewu Mar 12, 2025
a07838d
[orchagent] Do not restore port admin if port admin is configured (#3…
PJHsieh Mar 12, 2025
f763d20
Merge branch 'master' into skip_0m_profile
jianyuewu Mar 13, 2025
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
2 changes: 1 addition & 1 deletion orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
@@ -4897,7 +4897,7 @@ void PortsOrch::doPortTask(Consumer &consumer)
initializePortOperErrors(p);

// Restore admin status if the port was brought down
if (admin_status != p.m_admin_state_up)
if (admin_status != p.m_admin_state_up && pCfg.admin_status.is_set == false)
{
pCfg.admin_status.is_set = true;
pCfg.admin_status.value = admin_status;
53 changes: 53 additions & 0 deletions tests/test_port.py
Original file line number Diff line number Diff line change
@@ -480,6 +480,59 @@ def test_PortLinkEventDamping(self, dvs, testlog):
if fv[0] == "link_event_damping_algorithm":
assert fv[1] == "disabled"

def test_PortAdminRestore(self, dvs, testlog):
appdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
asicdb = swsscommon.DBConnector(1, dvs.redis_sock, 0)

ptbl = swsscommon.ProducerStateTable(appdb, "PORT_TABLE")
atbl = swsscommon.Table(asicdb, "ASIC_STATE:SAI_OBJECT_TYPE_PORT")

# Initialize Ethernet0 (admin_status, fec) = (up, rs)
fvs = swsscommon.FieldValuePairs([("admin_status", "up"),
("fec", "rs")])
ptbl.set("Ethernet0", fvs)

time.sleep(1)

(status, fvs) = atbl.get(dvs.asicdb.portnamemap["Ethernet0"])
assert status == True

for fv in fvs:
if fv[0] == "SAI_PORT_ATTR_FEC_MODE":
assert fv[1] == "SAI_PORT_FEC_MODE_RS"
if fv[0] == "SAI_PORT_ATTR_ADMIN_STATE":
assert fv[1] == "true"

# Verify pCfg.admin_status.is_set false by (fec) = (none)
fvs = swsscommon.FieldValuePairs([("fec", "none")])
ptbl.set("Ethernet0", fvs)

time.sleep(1)

(status, fvs) = atbl.get(dvs.asicdb.portnamemap["Ethernet0"])
assert status == True

for fv in fvs:
if fv[0] == "SAI_PORT_ATTR_FEC_MODE":
assert fv[1] == "SAI_PORT_FEC_MODE_NONE"
if fv[0] == "SAI_PORT_ATTR_ADMIN_STATE":
assert fv[1] == "true"

# Verify pCfg.admin_status.is_set true by (admin_status, fec) = (down, rs)
fvs = swsscommon.FieldValuePairs([("admin_status", "down"),
("fec", "rs")])
ptbl.set("Ethernet0", fvs)

time.sleep(1)

(status, fvs) = atbl.get(dvs.asicdb.portnamemap["Ethernet0"])
assert status == True

for fv in fvs:
if fv[0] == "SAI_PORT_ATTR_FEC_MODE":
assert fv[1] == "SAI_PORT_FEC_MODE_RS"
if fv[0] == "SAI_PORT_ATTR_ADMIN_STATE":
assert fv[1] == "false"

# Add Dummy always-pass test at end as workaroud
# for issue when Flaky fail on final test it invokes module tear-down before retrying