Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix the type for SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE (sonic-net#1942)
Fixing the type for SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE It is incorrectly set to u32 and is not clearing the higher 32 bits in the union Sample code: attr.id = SAI_BUFFER_PROFILE_ATTR_POOL_ID; attr.value.oid = getPool(ingress); <<<<-- the higher order 32 bits were retrieved for BUFFER_PROFILE_ATTR_BUFFER_SIZE attribs.push_back(attr); attr.id = SAI_BUFFER_PROFILE_ATTR_THRESHOLD_MODE; attr.value.u32 = SAI_BUFFER_PROFILE_THRESHOLD_MODE_DYNAMIC; attribs.push_back(attr); attr.id = SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE; attr.value.u64 = 0; <<<<-------------------------------- This was u32 earlier attribs.push_back(attr); Signed-off-by: Alpesh S Patel alpesh@cisco.com What I did Change the attribute value type from u32 to u64 as in SAI header file - https://github.com/opencomputeproject/SAI/blob/v1.7/inc/saibuffer.h /** * @brief Reserved buffer size in bytes * * @type sai_uint64_t * @flags MANDATORY_ON_CREATE | CREATE_AND_SET */ SAI_BUFFER_PROFILE_ATTR_RESERVED_BUFFER_SIZE, /** @ignore - for backward compatibility */ SAI_BUFFER_PROFILE_ATTR_BUFFER_SIZE = SAI_BUFFER_PROFILE_ATTR_RESERVED_BUFFER_SIZE, Why I did it since u32 was getting set and the actual data type is u64, at SAI layer, when the value is retrieved as u64, the upper 32 bits are read from the previously written attribute value (pool oid) How I verified it Made this change in sonic and verified it on the hardware platform via debug and correct operation
- Loading branch information