From 66b50715c892f4f1ed13e3f73548a616e6bb17b9 Mon Sep 17 00:00:00 2001 From: William Tsai Date: Thu, 21 May 2026 19:25:20 +0000 Subject: [PATCH] [Mellanox] Preserve explicit buffer_model=dynamic in buffer migrator Guard the traditional-fallback in mlnx_flush_new_buffer_configuration() so it no longer overwrites buffer_model to "traditional" when the device has already declared buffer_model=dynamic. Signed-off-by: William Tsai --- scripts/mellanox_buffer_migrator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/mellanox_buffer_migrator.py b/scripts/mellanox_buffer_migrator.py index e37716b35e6..2c651d6ec4a 100755 --- a/scripts/mellanox_buffer_migrator.py +++ b/scripts/mellanox_buffer_migrator.py @@ -821,9 +821,11 @@ def mlnx_flush_new_buffer_configuration(self): if not self.ready: return True - if not self.is_buffer_config_default and not self.is_buffer_config_empty or self.is_default_traditional_model: + metadata = self.configDB.get_entry('DEVICE_METADATA', 'localhost') + already_dynamic = metadata.get('buffer_model') == 'dynamic' and not self.is_default_traditional_model + + if (not self.is_buffer_config_default and not self.is_buffer_config_empty or self.is_default_traditional_model) and not already_dynamic: log.log_notice("No item pending to be updated") - metadata = self.configDB.get_entry('DEVICE_METADATA', 'localhost') metadata['buffer_model'] = 'traditional' self.configDB.set_entry('DEVICE_METADATA', 'localhost', metadata) log.log_notice("Set buffer_model as traditional")