-
Notifications
You must be signed in to change notification settings - Fork 192
[Port-breakout] Fix Unable to find key NPU_SI_SETTINGS_SYNC_STATUS ERR #622
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1929,6 +1929,16 @@ def on_add_logical_port(self, port_change_event): | |||||||||||||||
# 3. SFP is not present. Only update TRANSCEIVER_STATUS_INFO table. | ||||||||||||||||
status_sw_tbl = self.xcvr_table_helper.get_status_sw_tbl(port_change_event.asic_id) | ||||||||||||||||
int_tbl = self.xcvr_table_helper.get_intf_tbl(port_change_event.asic_id) | ||||||||||||||||
# Initialize the NPU_SI_SETTINGS_SYNC_STATUS to default value | ||||||||||||||||
state_port_table = self.xcvr_table_helper.get_state_port_tbl(port_change_event.asic_id) | ||||||||||||||||
found, state_port_table_fvs = state_port_table.get(port_change_event.port_name) | ||||||||||||||||
if not found: | ||||||||||||||||
helper_logger.log_notice("Add logical port: Creating STATE_DB PORT_TABLE as unable to find for lport {}".format(port_change_event.port_name)) | ||||||||||||||||
state_port_table_fvs = [] | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider verifying the conversion of state_port_table_fvs to a dictionary when it may be an empty list. Adding a clarifying comment on the expected structure of state_port_table_fvs could improve maintainability.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||
if NPU_SI_SETTINGS_SYNC_STATUS_KEY not in dict(state_port_table_fvs): | ||||||||||||||||
state_port_table.set(port_change_event.port_name, [(NPU_SI_SETTINGS_SYNC_STATUS_KEY, | ||||||||||||||||
NPU_SI_SETTINGS_DEFAULT_VALUE)]) | ||||||||||||||||
helper_logger.log_notice("Add logical port: Initialized NPU_SI_SETTINGS_SYNC_STATUS for lport {}".format(port_change_event.port_name)) | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Keshavg-marvell debug instaed of notice log? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @prgeor for the review. Same log level is there in normal port add during xcvrd init at below place. Do we change there as well to be consistent for both the cases? sonic-platform-daemons/sonic-xcvrd/xcvrd/xcvrd.py Line 2085 in 700ccd4
|
||||||||||||||||
|
||||||||||||||||
error_description = 'N/A' | ||||||||||||||||
status = None | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Keshavg-marvell can we make it debug log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @prgeor for the review. Same log level is there in normal port add during xcvrd init at below place. Do we change there as well to be consistent for both the cases?
sonic-platform-daemons/sonic-xcvrd/xcvrd/xcvrd.py
Line 2079 in 700ccd4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Keshavg-marvell @mihirpat1 can we call
initialize_port_init_control_fields_in_port_table()
inon_add_logical_port()
instead of calling it in daemoninit()
function? This way we dont have to handle breakout scenario differently?