@@ -289,17 +289,19 @@ def update_appdb_port_mux_cable_response_table(logical_port_name, asic_index, ap
289
289
if y_cable_wrapper_get_presence (physical_port ):
290
290
291
291
port_instance = y_cable_port_instances .get (physical_port )
292
- if port_instance is None :
292
+ if port_instance is None or port_instance == - 1 :
293
+ status = 'unknown'
294
+ update_table_mux_status_for_response_tbl (y_cable_response_tbl [asic_index ], status , logical_port_name )
293
295
helper_logger .log_error (
294
- "Error: Could not get port instance for read side for Y cable port {}" .format (logical_port_name ))
296
+ "Error: Could not get port instance to perform update appdb for read side for Y cable port {}" .format (logical_port_name ))
295
297
return
296
298
297
299
if read_side is None :
298
300
299
301
status = 'unknown'
300
302
update_table_mux_status_for_response_tbl (y_cable_response_tbl [asic_index ], status , logical_port_name )
301
303
helper_logger .log_warning (
302
- "Error: Could not get read side for mux cable port probe command logical port {} and physical port {}" .format (logical_port_name , physical_port ))
304
+ "Error: Could not get read side to perform update appdb for mux cable port probe command logical port {} and physical port {}" .format (logical_port_name , physical_port ))
303
305
return
304
306
305
307
active_side = None
@@ -311,7 +313,7 @@ def update_appdb_port_mux_cable_response_table(logical_port_name, asic_index, ap
311
313
status = 'unknown'
312
314
update_table_mux_status_for_response_tbl (y_cable_response_tbl [asic_index ], status , logical_port_name )
313
315
helper_logger .log_warning (
314
- "Error: Could not get active side for mux cable port probe command logical port {} and physical port {}" .format (logical_port_name , physical_port ))
316
+ "Error: Could not get active side to perform update appdb for mux cable port probe command logical port {} and physical port {}" .format (logical_port_name , physical_port ))
315
317
return
316
318
317
319
if read_side == active_side and (active_side == 1 or active_side == 2 ):
@@ -321,7 +323,7 @@ def update_appdb_port_mux_cable_response_table(logical_port_name, asic_index, ap
321
323
else :
322
324
status = 'unknown'
323
325
helper_logger .log_warning (
324
- "Error: Could not get state for mux cable port probe command logical port {} and physical port {}" .format (logical_port_name , physical_port ))
326
+ "Error: Could not get state to perform update appdb for mux cable port probe command logical port {} and physical port {}" .format (logical_port_name , physical_port ))
325
327
326
328
helper_logger .log_debug ("Y_CABLE_DEBUG: notifying a probe for port status {} {}" .format (logical_port_name , status ))
327
329
@@ -357,9 +359,9 @@ def read_y_cable_and_update_statedb_port_tbl(logical_port_name, mux_config_tbl):
357
359
if y_cable_wrapper_get_presence (physical_port ):
358
360
359
361
port_instance = y_cable_port_instances .get (physical_port )
360
- if port_instance is None :
362
+ if port_instance is None or port_instance == - 1 :
361
363
helper_logger .log_error (
362
- "Error: Could not get port instance for read side for Y cable port {}" .format (logical_port_name ))
364
+ "Error: Could not get port instance to perform read_y_cable update state db for read side for Y cable port {}" .format (logical_port_name ))
363
365
return
364
366
365
367
with y_cable_port_locks [physical_port ]:
@@ -370,7 +372,7 @@ def read_y_cable_and_update_statedb_port_tbl(logical_port_name, mux_config_tbl):
370
372
update_table_mux_status_for_statedb_port_tbl (
371
373
mux_config_tbl , "unknown" , read_side , active_side , logical_port_name )
372
374
helper_logger .log_error (
373
- "Error: Could not establish the read side for Y cable port {}" .format (logical_port_name ))
375
+ "Error: Could not establish the read side for Y cable port {} to perform read_y_cable update state db " .format (logical_port_name ))
374
376
return
375
377
376
378
with y_cable_port_locks [physical_port ]:
@@ -381,7 +383,7 @@ def read_y_cable_and_update_statedb_port_tbl(logical_port_name, mux_config_tbl):
381
383
update_table_mux_status_for_statedb_port_tbl (
382
384
mux_config_tbl , "unknown" , read_side , active_side , logical_port_name )
383
385
helper_logger .log_error (
384
- "Error: Could not establish the active side for Y cable port {}" .format (logical_port_name ))
386
+ "Error: Could not establish the active side for Y cable port {} to perform read_y_cable update state db " .format (logical_port_name ))
385
387
return
386
388
387
389
if read_side == active_side and (active_side == 1 or active_side == 2 ):
@@ -391,7 +393,7 @@ def read_y_cable_and_update_statedb_port_tbl(logical_port_name, mux_config_tbl):
391
393
else :
392
394
status = 'unknown'
393
395
helper_logger .log_warning (
394
- "Error: Could not establish the active status for Y cable port {}" .format (logical_port_name ))
396
+ "Error: Could not establish the active status for Y cable port {} to perform read_y_cable update state db " .format (logical_port_name ))
395
397
396
398
update_table_mux_status_for_statedb_port_tbl (
397
399
mux_config_tbl , status , read_side , active_side , logical_port_name )
@@ -402,7 +404,7 @@ def read_y_cable_and_update_statedb_port_tbl(logical_port_name, mux_config_tbl):
402
404
update_table_mux_status_for_statedb_port_tbl (
403
405
mux_config_tbl , "unknown" , read_side , active_side , logical_port_name )
404
406
helper_logger .log_warning (
405
- "Error: Could not establish presence for Y cable port {}" .format (logical_port_name ))
407
+ "Error: Could not establish presence for Y cable port {} to perform read_y_cable update state db " .format (logical_port_name ))
406
408
else :
407
409
# Y cable ports should always have
408
410
# one to one mapping of physical-to-logical
@@ -411,7 +413,7 @@ def read_y_cable_and_update_statedb_port_tbl(logical_port_name, mux_config_tbl):
411
413
update_table_mux_status_for_statedb_port_tbl (
412
414
mux_config_tbl , "unknown" , read_side , active_side , logical_port_name )
413
415
helper_logger .log_warning (
414
- "Error: Retreived multiple ports for a Y cable port {}" .format (logical_port_name ))
416
+ "Error: Retreived multiple ports for a Y cable port {} to perform read_y_cable update state db " .format (logical_port_name ))
415
417
416
418
417
419
def check_identifier_presence_and_update_mux_table_entry (state_db , port_tbl , y_cable_tbl , static_tbl , mux_tbl , asic_index , logical_port_name , y_cable_presence ):
@@ -421,7 +423,7 @@ def check_identifier_presence_and_update_mux_table_entry(state_db, port_tbl, y_c
421
423
(status , fvs ) = port_tbl [asic_index ].get (logical_port_name )
422
424
if status is False :
423
425
helper_logger .log_warning (
424
- "Could not retreive fieldvalue pairs for {}, inside config_db" .format (logical_port_name ))
426
+ "Could not retreive fieldvalue pairs for {}, inside config_db table {} " .format (logical_port_name ), port_tbl [ asic_index ]. getTableName ( ))
425
427
return
426
428
427
429
else :
@@ -528,6 +530,9 @@ def check_identifier_presence_and_update_mux_table_entry(state_db, port_tbl, y_c
528
530
logical_port_name , mux_tbl [asic_index ])
529
531
post_port_mux_static_info_to_db (
530
532
logical_port_name , static_tbl [asic_index ])
533
+ else :
534
+ helper_logger .log_warning (
535
+ "Error: Could not get transceiver info dict Y cable port {} while inserting entries" .format (logical_port_name ))
531
536
else :
532
537
helper_logger .log_warning (
533
538
"Error: Could not establish transceiver presence for a Y cable port {} while inserting entries" .format (logical_port_name ))
@@ -537,6 +542,9 @@ def check_identifier_presence_and_update_mux_table_entry(state_db, port_tbl, y_c
537
542
else :
538
543
helper_logger .log_warning (
539
544
"Could not retreive active or auto value for state kvp for {}, inside MUX_CABLE table" .format (logical_port_name ))
545
+ else :
546
+ helper_logger .log_warning (
547
+ "Could not retreive state value inside mux_info_dict for {}, inside MUX_CABLE table" .format (logical_port_name ))
540
548
541
549
542
550
def check_identifier_presence_and_delete_mux_table_entry (state_db , port_tbl , asic_index , logical_port_name , y_cable_presence , delete_change_event ):
@@ -551,7 +559,7 @@ def check_identifier_presence_and_delete_mux_table_entry(state_db, port_tbl, asi
551
559
(status , fvs ) = port_tbl [asic_index ].get (logical_port_name )
552
560
if status is False :
553
561
helper_logger .log_warning (
554
- "Could not retreive fieldvalue pairs for {}, inside config_db" .format (logical_port_name ))
562
+ "Could not retreive fieldvalue pairs for {}, inside config_db table {} " .format (logical_port_name , port_tbl [ asic_index ]. getTableName () ))
555
563
return
556
564
557
565
else :
@@ -598,7 +606,7 @@ def init_ports_status_for_y_cable(platform_sfp, platform_chassis, y_cable_presen
598
606
y_cable_platform_sfputil = platform_sfp
599
607
y_cable_platform_chassis = platform_chassis
600
608
601
- fvs_updated = swsscommon .FieldValuePairs ([('log_verbosity' , 'debug ' )])
609
+ fvs_updated = swsscommon .FieldValuePairs ([('log_verbosity' , 'notice ' )])
602
610
# Get the namespaces in the platform
603
611
namespaces = multi_asic .get_front_end_namespaces ()
604
612
for namespace in namespaces :
@@ -631,7 +639,7 @@ def init_ports_status_for_y_cable(platform_sfp, platform_chassis, y_cable_presen
631
639
# logical_ports after loading the port_mappings from port_config_file
632
640
# This should not happen
633
641
helper_logger .log_warning (
634
- "Could not retreive port inside config_db PORT table {}" .format (logical_port_name ))
642
+ "Could not retreive port inside config_db PORT table {} for Y-Cable initiation " .format (logical_port_name ))
635
643
636
644
637
645
def change_ports_status_for_y_cable_change_event (port_dict , y_cable_presence , stop_event = threading .Event ()):
@@ -758,12 +766,12 @@ def check_identifier_presence_and_update_mux_info_entry(state_db, mux_tbl, asic_
758
766
for namespace in namespaces :
759
767
asic_id = multi_asic .get_asic_index_from_namespace (namespace )
760
768
config_db [asic_id ] = daemon_base .db_connect ("CONFIG_DB" , namespace )
761
- port_tbl [asic_id ] = swsscommon .Table (config_db [asic_id ], "PORT " )
769
+ port_tbl [asic_id ] = swsscommon .Table (config_db [asic_id ], "MUX_CABLE " )
762
770
763
771
(status , fvs ) = port_tbl [asic_index ].get (logical_port_name )
764
772
765
773
if status is False :
766
- helper_logger .log_warning ("Could not retreive fieldvalue pairs for {}, inside config_db" .format (logical_port_name ))
774
+ helper_logger .log_debug ("Could not retreive fieldvalue pairs for {}, inside config_db table {} " .format (logical_port_name , port_tbl [ asic_index ]. getTableName () ))
767
775
return
768
776
769
777
else :
@@ -831,7 +839,7 @@ def get_muxcable_info(physical_port, logical_port_name):
831
839
832
840
(status , fvs ) = y_cable_tbl [asic_index ].get (logical_port_name )
833
841
if status is False :
834
- helper_logger .log_warning ("Could not retreive fieldvalue pairs for {}, inside state_db table {}" .format (logical_port_name , y_cable_tbl [asic_index ]))
842
+ helper_logger .log_warning ("Could not retreive fieldvalue pairs for {}, inside state_db table {}" .format (logical_port_name , y_cable_tbl [asic_index ]. getTableName () ))
835
843
return - 1
836
844
837
845
mux_port_dict = dict (fvs )
@@ -1019,7 +1027,7 @@ def get_muxcable_static_info(physical_port, logical_port_name):
1019
1027
(status , fvs ) = y_cable_tbl [asic_index ].get (logical_port_name )
1020
1028
if status is False :
1021
1029
helper_logger .log_warning ("Could not retreive fieldvalue pairs for {}, inside state_db table {}" .format (
1022
- logical_port_name , y_cable_tbl [asic_index ]))
1030
+ logical_port_name , y_cable_tbl [asic_index ]. getTableName () ))
1023
1031
return - 1
1024
1032
mux_port_dict = dict (fvs )
1025
1033
read_side = int (mux_port_dict .get ("read_side" ))
@@ -1358,7 +1366,7 @@ def task_worker(self):
1358
1366
(status , fvs ) = y_cable_tbl [asic_index ].get (port )
1359
1367
if status is False :
1360
1368
helper_logger .log_warning ("Could not retreive fieldvalue pairs for {}, inside state_db table {}" .format (
1361
- port , y_cable_tbl [asic_index ]))
1369
+ port , y_cable_tbl [asic_index ]. getTableName () ))
1362
1370
continue
1363
1371
mux_port_dict = dict (fvs )
1364
1372
old_status = mux_port_dict .get ("state" )
@@ -1408,7 +1416,7 @@ def task_worker(self):
1408
1416
(status , fv ) = y_cable_tbl [asic_index ].get (port_m )
1409
1417
if status is False :
1410
1418
helper_logger .log_warning ("Could not retreive fieldvalue pairs for {}, inside state_db table {}" .format (
1411
- port_m , y_cable_tbl [asic_index ]))
1419
+ port_m , y_cable_tbl [asic_index ]. getTableName () ))
1412
1420
continue
1413
1421
mux_port_dict = dict (fv )
1414
1422
read_side = mux_port_dict .get ("read_side" )
0 commit comments