From 55a5459212c14baee741955e49b6cfa352854a90 Mon Sep 17 00:00:00 2001 From: iris Date: Mon, 19 Dec 2022 16:40:05 +0800 Subject: [PATCH 1/3] Fix neighbor doesn't update all attribute --- orchagent/neighorch.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/orchagent/neighorch.cpp b/orchagent/neighorch.cpp index 562793b5f7..e94d302426 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -912,15 +912,18 @@ bool NeighOrch::addNeighbor(const NeighborEntry &neighborEntry, const MacAddress } else if (isHwConfigured(neighborEntry)) { - status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbor_entry, &neighbor_attr); - if (status != SAI_STATUS_SUCCESS) + for(auto itr : neighbor_attrs) { - SWSS_LOG_ERROR("Failed to update neighbor %s on %s, rv:%d", - macAddress.to_string().c_str(), alias.c_str(), status); - task_process_status handle_status = handleSaiSetStatus(SAI_API_NEIGHBOR, status); - if (handle_status != task_success) + status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbor_entry, &itr); + if (status != SAI_STATUS_SUCCESS) { - return parseHandleSaiStatusFailure(handle_status); + SWSS_LOG_ERROR("Failed to update neighbor %s on %s, rv:%d", + macAddress.to_string().c_str(), alias.c_str(), status); + task_process_status handle_status = handleSaiSetStatus(SAI_API_NEIGHBOR, status); + if (handle_status != task_success) + { + return parseHandleSaiStatusFailure(handle_status); + } } } SWSS_LOG_NOTICE("Updated neighbor %s on %s", macAddress.to_string().c_str(), alias.c_str()); From 82da57e2a08bcd9750acd341ff21550d36027253 Mon Sep 17 00:00:00 2001 From: iris Date: Tue, 20 Dec 2022 11:06:52 +0800 Subject: [PATCH 2/3] add space --- orchagent/neighorch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchagent/neighorch.cpp b/orchagent/neighorch.cpp index e94d302426..c9e0c54e5c 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -912,7 +912,7 @@ bool NeighOrch::addNeighbor(const NeighborEntry &neighborEntry, const MacAddress } else if (isHwConfigured(neighborEntry)) { - for(auto itr : neighbor_attrs) + for (auto itr : neighbor_attrs) { status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbor_entry, &itr); if (status != SAI_STATUS_SUCCESS) From f671aad760f91b5e9bfac98129b69358f757caaa Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 21 Dec 2022 10:27:39 +0800 Subject: [PATCH 3/3] log which attribute failed --- orchagent/neighorch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orchagent/neighorch.cpp b/orchagent/neighorch.cpp index c9e0c54e5c..d431fa02c0 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -917,8 +917,8 @@ bool NeighOrch::addNeighbor(const NeighborEntry &neighborEntry, const MacAddress status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbor_entry, &itr); if (status != SAI_STATUS_SUCCESS) { - SWSS_LOG_ERROR("Failed to update neighbor %s on %s, rv:%d", - macAddress.to_string().c_str(), alias.c_str(), status); + SWSS_LOG_ERROR("Failed to update neighbor %s on %s, attr.id=0x%x, rv:%d", + macAddress.to_string().c_str(), alias.c_str(), itr.id, status); task_process_status handle_status = handleSaiSetStatus(SAI_API_NEIGHBOR, status); if (handle_status != task_success) {