From 3a80323c9fdc5c9aae148e56deab20685075c4ef Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 4 Dec 2024 06:17:47 +0800 Subject: [PATCH] [buffer] indicate shared pool by putting a very small shared buffer pool size (#3387) What I did Put a very small shared buffer pool size when shared pool is detected enabling. Why I did it Avoid a timing issue like following: the buffer pool sizes, xoff have initialized to 0, which means the shared headroom pool is disabled but the buffer profiles already indicate the shared headroom pool is enabled later on the buffer pool sizes are updated with xoff being non-zero In case the orchagent starts handling buffer configuration between 2 and 3, it is inconsistent between buffer pools and profiles, which fails Mellanox SAI sanity check and causes orchagent abort --- cfgmgr/buffer_pool_mellanox.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cfgmgr/buffer_pool_mellanox.lua b/cfgmgr/buffer_pool_mellanox.lua index f811a1c50d1..56bbaa2fad9 100644 --- a/cfgmgr/buffer_pool_mellanox.lua +++ b/cfgmgr/buffer_pool_mellanox.lua @@ -166,7 +166,11 @@ local function fetch_buffer_pool_size_from_appldb(shp_enabled) -- In case the orchagent starts handling buffer configuration between 2 and 3, -- It is inconsistent between buffer pools and profiles, which fails Mellanox SAI sanity check -- To avoid it, it indicates the shared headroom pool is enabled by setting a very small buffer pool and shared headroom pool sizes - table.insert(result, buffer_pools[i] .. ':2048:1024') + if size == "0" then + table.insert(result, buffer_pools[i] .. ':2048:1024') + else + table.insert(result, buffer_pools[i] .. ":" .. size .. ':1024') + end else table.insert(result, buffer_pools[i] .. ':' .. size) end