open-nic-driver icon indicating copy to clipboard operation
open-nic-driver copied to clipboard

One of MAC is not enabled in Dual MAC case

Open zhiyisun opened this issue 2 years ago • 2 comments

https://github.com/Xilinx/open-nic-driver/blob/2fa96685de279a60a4257c3ac36625275e91ff37/onic_hardware.c#L219

If OpenNIC configures two ports, use a cable to connect both ports together as a loopback test case. MAC0 won't be enabled. The reason is when MAC0 is enabling, RX lane won't be aligned. The reason is MAC1 is not enabled yet.

Or if OpenNIC connects to another NIC, whether OpenNIC MAC enables or not, it will depend on the remote NIC. That will be a logical deadlock.

I would suggest to remove this rx lane alignment check here.

Please refer qep driver.

https://github.com/Xilinx/qep-drivers/blob/eba9eb7a6880a20e797303aa747f191170e98209/linux-kernel/driver/cmac/xcmac.c#L263

zhiyisun avatar May 11 '22 23:05 zhiyisun

Thanks, I'll plan to remove that rx_lane_aligned check in a future update.

cneely-amd avatar May 17 '22 21:05 cneely-amd

I met this problem when I do loopback test with one MAC.

In line 227, TX_SEND_RFI is set to 1, https://github.com/Xilinx/open-nic-driver/blob/33552cf8ca86b788bfa9c5f2ec83e12ccbbbd30f/onic_hardware.c#L227 and in line 193 it assert STAT_RX_STATUS_REG is 0x3, this means the stat_rx_remote_fault is 0. https://github.com/Xilinx/open-nic-driver/blob/33552cf8ca86b788bfa9c5f2ec83e12ccbbbd30f/onic_hardware.c#L193

But in loopback mode the RX will receive the RFI sent by TX. So the test will fail and L236 will never be executed. https://github.com/Xilinx/open-nic-driver/blob/33552cf8ca86b788bfa9c5f2ec83e12ccbbbd30f/onic_hardware.c#L236

yrpang avatar Feb 11 '23 12:02 yrpang