From eae729e22864ba31a412efcaa575fc0d61a2b25c Mon Sep 17 00:00:00 2001 From: Brad House Date: Thu, 19 Dec 2024 12:23:55 -0500 Subject: [PATCH] [orchagent] fix "parsePortConfig: Unknown field(mode)" (#3405) 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. --- orchagent/port/porthlpr.cpp | 6 ++++++ orchagent/port/portschema.h | 1 + 2 files changed, 7 insertions(+) diff --git a/orchagent/port/porthlpr.cpp b/orchagent/port/porthlpr.cpp index 181fef9f69..3adb7ba9e9 100644 --- a/orchagent/port/porthlpr.cpp +++ b/orchagent/port/porthlpr.cpp @@ -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()); diff --git a/orchagent/port/portschema.h b/orchagent/port/portschema.h index 8dd7f79200..3e48b16d8c 100644 --- a/orchagent/port/portschema.h +++ b/orchagent/port/portschema.h @@ -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"