File tree 2 files changed +19
-3
lines changed
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,9 @@ class Port
174
174
sai_object_id_t m_switch_id = 0 ;
175
175
sai_object_id_t m_line_side_id = 0 ;
176
176
177
+ /* pre-emphasis */
178
+ std::map<sai_port_serdes_attr_t , std::vector<uint32_t >> m_preemphasis;
179
+
177
180
bool m_fec_cfg = false ;
178
181
bool m_an_cfg = false ;
179
182
bool m_port_cap_lt = false ; /* Port Capability - LinkTraining */
Original file line number Diff line number Diff line change @@ -3100,6 +3100,12 @@ void PortsOrch::doPortTask(Consumer &consumer)
3100
3100
p.m_link_training = lt;
3101
3101
m_portList[alias] = p;
3102
3102
updatePortStatePoll (p, PORT_STATE_POLL_LT, (lt > 0 ));
3103
+
3104
+ // Restore pre-emphasis when LT is transitioned from ON to OFF
3105
+ if ((p.m_link_training < 1 ) && (serdes_attr.size () == 0 ))
3106
+ {
3107
+ serdes_attr = p.m_preemphasis ;
3108
+ }
3103
3109
}
3104
3110
}
3105
3111
@@ -3440,17 +3446,24 @@ void PortsOrch::doPortTask(Consumer &consumer)
3440
3446
3441
3447
if (serdes_attr.size () != 0 )
3442
3448
{
3443
- if (setPortSerdesAttribute (p.m_port_id , serdes_attr))
3449
+ if (p.m_link_training > 0 )
3450
+ {
3451
+ SWSS_LOG_NOTICE (" Save port %s preemphasis for LT" , alias.c_str ());
3452
+ p.m_preemphasis = serdes_attr;
3453
+ m_portList[alias] = p;
3454
+ }
3455
+ else if (setPortSerdesAttribute (p.m_port_id , serdes_attr))
3444
3456
{
3445
- SWSS_LOG_NOTICE (" Set port %s preemphasis is success" , alias.c_str ());
3457
+ SWSS_LOG_NOTICE (" Set port %s preemphasis is success" , alias.c_str ());
3458
+ p.m_preemphasis = serdes_attr;
3459
+ m_portList[alias] = p;
3446
3460
}
3447
3461
else
3448
3462
{
3449
3463
SWSS_LOG_ERROR (" Failed to set port %s pre-emphasis" , alias.c_str ());
3450
3464
it++;
3451
3465
continue ;
3452
3466
}
3453
-
3454
3467
}
3455
3468
3456
3469
/* Last step set port admin status */
You can’t perform that action at this time.
0 commit comments