Skip to content

[featured]: Add database services for DPU #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/featured
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class Feature(object):
self.delayed = safe_eval(feature_cfg.get('delayed', 'False'))
self.has_global_scope = safe_eval(feature_cfg.get('has_global_scope', 'True'))
self.has_per_asic_scope = safe_eval(self._get_feature_table_key_render_value(feature_cfg.get('has_per_asic_scope', 'False'), device_config or {}, ['True', 'False']))
self.has_per_dpu_scope = safe_eval(feature_cfg.get('has_per_dpu_scope', 'False'))

def _get_feature_table_key_render_value(self, configuration, device_config, expected_values):
""" Returns the target value for the feature by rendering the configuration as J2 template.
Expand Down Expand Up @@ -131,6 +132,7 @@ class FeatureHandler(object):
self._device_running_config = device_info.get_device_runtime_metadata()
self.ns_cfg_db = {}
self.ns_feature_state_tbl = {}
self.num_dpus = device_info.get_num_dpus()

# Initlaize Global config that loads all database*.json
if self.is_multi_npu:
Expand Down Expand Up @@ -351,7 +353,9 @@ class FeatureHandler(object):
feature_names = (
([feature.name] if feature.has_global_scope or not self.is_multi_npu else []) +
([(feature.name + '@' + str(asic_inst)) for asic_inst in range(device_info.get_num_npus())
if self.is_multi_npu and (all_instance or feature.has_per_asic_scope)])
if self.is_multi_npu and (all_instance or feature.has_per_asic_scope)]) +
([(feature.name + '@' + device_info.DPU_NAME_PREFIX + str(dpu_inst)) for dpu_inst in range(self.num_dpus)
if all_instance or feature.has_per_dpu_scope])
)

if not feature_names:
Expand Down