Skip to content

Commit

Permalink
[orchagent] fix "parsePortConfig: Unknown field(mode)" (#3405)
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.
  • Loading branch information
bradh352 authored Dec 19, 2024
1 parent fef1543 commit eae729e
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 eae729e

Please sign in to comment.