Skip to content

Commit

Permalink
[orchagent] fix "parsePortConfig: Unknown field(mode)"
Browse files Browse the repository at this point in the history
When using "mode" as defined in
https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/yang-models/sonic-port.yang
this warning is emitted for each interface:
```
WARNING swss#orchagent: :- parsePortConfig: Unknown field(mode): skipping ...
```

It appears this field is not needed in orchagent at all, so we need to
at least recognize it as valid then skip processing.

Warnings harm debugging and can cause wasted cycles when debugging
real issues.

Signed-off-by: Brad House (@bradh352)
  • Loading branch information
bradh352 committed Dec 1, 2024
1 parent c190c3d commit 010a92b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions orchagent/port/porthlpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,12 @@ bool PortHelper::parsePortConfig(PortConfig &port) const
return false;
}
}
else if (field == PORT_MODE)
{
/* Placeholder to prevent warning. Not needed to be parsed here.
* Setting exists in sonic-port.yang with possible values: routed|access|trunk
*/
}
else
{
SWSS_LOG_WARN("Unknown field(%s): skipping ...", field.c_str());
Expand Down
1 change: 1 addition & 0 deletions orchagent/port/portschema.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@
#define PORT_SUPPRESS_THRESHOLD "suppress_threshold"
#define PORT_REUSE_THRESHOLD "reuse_threshold"
#define PORT_FLAP_PENALTY "flap_penalty"
#define PORT_MODE "mode"

0 comments on commit 010a92b

Please sign in to comment.