Skip to content

Commit 68fdf02

Browse files
authored
Merge pull request sonic-net#1 from vasant17/PORT_ACL_ATTR_WORKAROUND
Do NOT set SAI_OBJECT_NULL_ID as a value to SAI_PORT_ATTR_INGRESS_ACL
2 parents 9851730 + 77419f5 commit 68fdf02

1 file changed

Lines changed: 32 additions & 4 deletions

File tree

meta/sai_meta.cpp

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6044,15 +6044,43 @@ sai_status_t meta_sai_set_oid(
60446044
return SAI_STATUS_FAILURE;
60456045
}
60466046

6047-
status = set(object_type, object_id, attr);
6047+
// Temporary code start
6048+
// Remove this code once SAI_NULL_OBJECT_ID
6049+
// as value to SAI_PORT_ATTR_INGRESS_ACL is handled in Broadcom
6050+
// SAI SDK
6051+
//
6052+
auto mdp = sai_metadata_get_attr_metadata(meta_key.objecttype, attr->id);
60486053

6049-
if (status == SAI_STATUS_SUCCESS)
6054+
if (mdp == NULL)
60506055
{
6051-
SWSS_LOG_DEBUG("set status: %s", sai_serialize_status(status).c_str());
6056+
SWSS_LOG_ERROR("unable to find attribute metadata %d:%d", meta_key.objecttype, attr->id);
6057+
6058+
return SAI_STATUS_FAILURE;
60526059
}
6060+
6061+
const sai_attribute_value_t& value = attr->value;
6062+
6063+
const sai_attr_metadata_t& md = *mdp;
6064+
6065+
if (SAI_PORT_ATTR_INGRESS_ACL == md.attrid &&
6066+
SAI_NULL_OBJECT_ID == value.oid)
6067+
{
6068+
// Do nothing.
6069+
SWSS_LOG_NOTICE("Ignoring %s attribute set with NULL object ID", md->attridname);
6070+
}
6071+
// Temporary code end.
60536072
else
60546073
{
6055-
SWSS_LOG_ERROR("set status: %s", sai_serialize_status(status).c_str());
6074+
status = set(object_type, object_id, attr);
6075+
6076+
if (status == SAI_STATUS_SUCCESS)
6077+
{
6078+
SWSS_LOG_DEBUG("set status: %s", sai_serialize_status(status).c_str());
6079+
}
6080+
else
6081+
{
6082+
SWSS_LOG_ERROR("set status: %s", sai_serialize_status(status).c_str());
6083+
}
60566084
}
60576085

60586086
if (status == SAI_STATUS_SUCCESS)

0 commit comments

Comments
 (0)