Skip to content
Merged
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions portsyncd/portsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "producerstatetable.h"
#include "portsyncd/linksync.h"
#include "subscriberstatetable.h"
#include "exec.h"

#define DEFAULT_PORT_CONFIG_FILE "port_config.ini"

Expand Down Expand Up @@ -250,6 +251,19 @@ void handlePortConfig(ProducerStateTable &p, map<string, KeyOpFieldsValuesTuple>
if (op == SET_COMMAND)
{
p.set(key, values);
for (auto fv : values)
{
string field = fvField(fv);
string value = fvValue(fv);

/* Update the mtu field on host interface */
if (field == "mtu")
{
string cmd, res;
cmd = "ip link set " + key + " mtu " + value;
swss::exec(cmd, res);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to check for return value?.

Copy link
Copy Markdown
Contributor Author

@hzheng5 hzheng5 Nov 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Sunny @prsunny ,

The return value will be checked inside swss::exec, if failed swss::exec will throw an error.
And most places calling swss::exec don't check the res except those show cmd.

some test log for the failure case.

Nov 9 02:45:07.294323 sonic-1 ERR portsyncd: :- exec: ip link set Ethernet8 mtu 9800: Success

Thanks,
Haiyang

}
}
}

it = port_cfg_map.erase(it);
Expand Down