Tool/software:
Hello,
I am running tests with a custom project based on enet-layer2-icssg example on the AM243x EVM (MCU+ SDK).
Setup:
-
Setting port to BLOCKING dor test 1 and one BLOCKING the other FORWARD for test 2
-
Both ICSSG ports are connected to the same external switch (network loop scenario).
Test 1 – Both Ports BLOCKED:
I set both ports to ICSSG_PORT_STATE_BLOCKING
.
As expected, no network loop is observed.
Test 2 – One Port FORWARD, One Port BLOCKED:
I then change one of the two ports to ICSSG_PORT_STATE_FORWARD
.
At this point, I get a network loop.
This is not the expected behavior, as only one port should be forwarding traffic, and the other is supposed to remain blocking.
Analysis:
I compared the R30 messages sent to the PRU under Linux vs. MCU+ SDK:
Linux (kernel driver):
static const struct icssg_r30_cmd emac_r32_bitmask[] = { {{0xffff0004, 0xffff0100, 0xffff0004, EMAC_NONE}}, /* EMAC_PORT_DISABLE */ {{0xfffb0040, 0xfeff0200, 0xfeff0200, EMAC_NONE}}, /* EMAC_PORT_BLOCK */ {{0xffbb0000, 0xfcff0000, 0xdcfb0000, EMAC_NONE}}, /* EMAC_PORT_FORWARD */ };
MCU+ SDK:
[ICSSG_UTILS_R30_CMD_DISABLE] = { { 0xffff0004, 0xffff0100, 0xffff0104, ICSSG_UTILS_CMD_NONE } }, [ICSSG_UTILS_R30_CMD_BLOCK] = { { 0xfffb0040, 0xfeff0200, 0xfffb0008, 0xffff0200 } }, [ICSSG_UTILS_R30_CMD_FORWARD] = { { 0xffbb0000, 0xfcff0000, 0xdcf30000, ICSSG_UTILS_CMD_NONE } },
I noticed that the bitmasks are different between Linux and MCU+ SDK. If I apply bitmask from linux to mcu sdk, the result is not better
Then I tried to manually tweak the MCU+ SDK values and the best results came with the following values:
[ICSSG_UTILS_R30_CMD_BLOCK] = { { 0xfffb0040, 0xfeff0200, 0xfffb0008, 0xfeff0200 } }, [ICSSG_UTILS_R30_CMD_FORWARD] = { { 0xffbb0000, 0xfcff0000, 0xdff30000, 0xFCFF0000 } },
This improves the situation, but the result is still not fully correct : sometimes, if i set both ports in forward, packets are not forwarded correctly.
Questions:
-
Are the RXPRU/TXPRU/RTU firmwares the same between Linux and MCU+ SDK?
-
Are my tests makes sense to test the BLOCKING and FORWARDING packets ? Note : I am able to send special packet in BLOCKING mode !
-
Are the R30 bitmasks correct ?
Thanks in advance for your help!