Skip to content

Commit 3161eaa

Browse files
authored
portsorch: initial support for link-training (sonic-net#2359)
* Squashed commit of the following: commit 18632a3e84de380ad29a671a6496018cfd1cd540 Author: Dante Su <dante.su@broadcom.com> Date: Mon May 23 12:22:49 2022 +0000 optimize port state refresh logic Signed-off-by: Dante Su <dante.su@broadcom.com> commit 081d491c9bc3cda80343d1476b76c457bdeacb8e Author: ds952811 <ds952811@broadcom.com> Date: Mon May 23 02:33:56 2022 +0000 address review comments Signed-off-by: ds952811 <ds952811@broadcom.com> commit 84bdde4913cae37dc96ceb110cb2503633922847 Author: Dante Su <dante.su@broadcom.com> Date: Fri May 20 02:15:59 2022 +0000 update the default LT capability upon get failures Signed-off-by: Dante Su <dante.su@broadcom.com> commit 0f73666ba3b13af2116e55b0238e96c6e9c49270 Author: Dante Su <dante.su@broadcom.com> Date: Thu May 19 11:28:38 2022 +0000 Rename updatePortStatesXX as refreshPortStatesXX Signed-off-by: Dante Su <dante.su@broadcom.com> commit ddd57fe08f78f4463ee39a2075b0b0b0d56e9117 Author: Dante Su <dante.su@broadcom.com> Date: Thu May 19 04:03:13 2022 +0000 Have AN cap defaults to 1, and use AN attr for LT cap query Signed-off-by: Dante Su <dante.su@broadcom.com> commit 876e605b8462c4318f09af86767453907d055e5b Author: Dante Su <dante.su@broadcom.com> Date: Fri May 13 11:15:12 2022 +0000 drop LT capability query Signed-off-by: Dante Su <dante.su@broadcom.com> commit 55ced7db0155d161d5637f889453e7d53cdbbf10 Author: Dante Su <dante.su@broadcom.com> Date: Fri Apr 29 13:53:17 2022 +0000 incorporate autoneg support from PR#2215 Signed-off-by: Dante Su <dante.su@broadcom.com> commit a04594e6efee7d5f5e3b86f45c413196affc89a8 Author: Dante Su <dante.su@broadcom.com> Date: Thu Apr 28 16:33:14 2022 +0000 address review comments Signed-off-by: Dante Su <dante.su@broadcom.com> commit e9eeb9a87f27740ee692e0a1e86e4a10dd9e943f Author: Dante Su <dante.su@broadcom.com> Date: Thu Apr 28 15:00:04 2022 +0000 address review comments Signed-off-by: Dante Su <dante.su@broadcom.com> commit 4ff604da578b3fa2a40544c6f800c68cef4b9622 Author: Dante Su <dante.su@broadcom.com> Date: Fri Apr 22 03:51:56 2022 +0000 Stop the port state poll by default Signed-off-by: Dante Su <dante.su@broadcom.com> commit bdfb8d847fc81bc4771592d18e8e0747114688b3 Author: Dante Su <dante.su@broadcom.com> Date: Fri Apr 22 03:48:07 2022 +0000 address review comments Signed-off-by: Dante Su <dante.su@broadcom.com> commit 1c6bda8279bcdcce564bdf83c59dc6a3ac7e3f97 Author: Dante Su <dante.su@broadcom.com> Date: Mon Apr 18 08:46:21 2022 +0000 Restore pre-emphasis when LT is transitioned from ON to OFF Signed-off-by: Dante Su <dante.su@broadcom.com> commit 09a9b334f8f4b06d399e4b3af73443f4b16d5640 Author: Dante Su <dante.su@broadcom.com> Date: Mon Apr 18 02:33:11 2022 +0000 fix build failure due to SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE Signed-off-by: Dante Su <dante.su@broadcom.com> commit b0bee3ec7bd1c00c976e812eae27f0e88d41f630 Author: Dante Su <dante.su@broadcom.com> Date: Thu Apr 14 07:54:14 2022 +0000 address review comments Signed-off-by: Dante Su <dante.su@broadcom.com> commit c4345efbafd1881ab6b80e878e2ecb9d7e637b3b Author: Dante Su <dante.su@broadcom.com> Date: Fri Mar 25 02:26:05 2022 +0000 portsorch: initial support for link-training - What I did Add Link-Training support to portsorch, while Gearbox is not in the scope - Why I did it In the case of DAC, static pre-calibrated pre-emphasis is rarely available on SONIC, as most of the ODM are expecting this to be done dynamically at runtime via link-training, hence we'll need this feature to improve the link quality - How I verified it Manual test Ran the Unit-tests to the corresponding changes Signed-off-by: Dante Su <dante.su@broadcom.com> * Add support for selected multiple tests Signed-off-by: Dante Su <dante.su@broadcom.com> * Revert "Add support for selected multiple tests" This reverts commit 8e2f7a4334278589581b2110e76f4252bbec03f0. * fix the comment for 'autoneg is not supported' Signed-off-by: Dante Su <dante.su@broadcom.com> * address review comments Signed-off-by: Dante Su <dante.su@broadcom.com> * validate AN cap only when there is an update to AN config Signed-off-by: Dante Su <dante.su@broadcom.com> * drop the changes to tests/conftest.py Signed-off-by: Dante Su <dante.su@broadcom.com> * fix link failure in p4orch_tests-fake_portorch.o Signed-off-by: Dante Su <dante.su@broadcom.com>
1 parent 525a57f commit 3161eaa

File tree

6 files changed

+569
-6
lines changed

6 files changed

+569
-6
lines changed

orchagent/p4orch/tests/fake_portorch.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -689,4 +689,8 @@ void PortsOrch::voqSyncDelLagMember(Port &lag, Port &port)
689689
std::unordered_set<std::string> PortsOrch::generateCounterStats(const string &type, bool gearbox)
690690
{
691691
return {};
692-
}
692+
}
693+
694+
void PortsOrch::doTask(swss::SelectableTimer &timer)
695+
{
696+
}

orchagent/port.h

+7
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class Port
119119
uint32_t m_speed = 0; // Mbps
120120
std::string m_learn_mode = "hardware";
121121
AutoNegMode m_autoneg = Port::AutoNegMode::AUTONEG_NOT_SET;
122+
int m_link_training = -1; // -1 means not set, 0 = disabled, 1 = enabled
122123
bool m_admin_state_up = false;
123124
bool m_init = false;
124125
bool m_l3_vni = false;
@@ -177,8 +178,14 @@ class Port
177178
sai_object_id_t m_system_side_id = 0;
178179
sai_object_id_t m_line_side_id = 0;
179180

181+
/* pre-emphasis */
182+
std::map<sai_port_serdes_attr_t, std::vector<uint32_t>> m_preemphasis;
183+
180184
bool m_fec_cfg = false;
181185
bool m_an_cfg = false;
186+
187+
int m_cap_an = -1; /* Capability - AutoNeg, -1 means not set */
188+
int m_cap_lt = -1; /* Capability - LinkTraining, -1 means not set */
182189
};
183190

184191
}

0 commit comments

Comments
 (0)