Xilinx/open-nic-driver

One of MAC is not enabled in Dual MAC case

zhiyisun opened this issue · 2 comments

if (!onic_rx_lane_aligned(hw, cmac_id)) {

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

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

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

In line 227, TX_SEND_RFI is set to 1,

onic_write_reg(hw, CMAC_OFFSET_CONF_TX_1(cmac_id), 0x10);

and in line 193 it assert STAT_RX_STATUS_REG is 0x3, this means the stat_rx_remote_fault is 0.
return (val == 0x3);

But in loopback mode the RX will receive the RFI sent by TX. So the test will fail and L236 will never be executed.

onic_write_reg(hw, CMAC_OFFSET_CONF_TX_1(cmac_id), 0x1);