Tool/software:
In our tests, we tried to add 2047 MAC addresses to the FDB via IOCTL. This worked successfully for a large number of entries. However, some MAC addresses are rejected.
I.e. Icssg_IoctlCmdResp.status = 0x10 (ERROR). Is there an explanation for this ?
Attached is the test algorithm.
"AddHwAddr()" does the addition via IOCTL and evaluates the response structure.
// Number of Loop Passes
uword loop_cnt = 2047;
// Number of successfully added multicast MAC addresses
uword mac_addr_cnt = 0;
// Results
Result res[4000];
for(uword idx = 1; idx < (loop_cnt+ 1); ++idx) {
ubyte high_byte= static_cast<ubyte>(idx>> 8);
ubyte low_byte= static_cast<ubyte>(idx);
IN::ETHAddr mac_addr(0x01, 0x22, 0x22, high_byte, low_byte, 0x11);
dword res_idx= gEth1Dev.AddHwAddr(mac_addr);
res[idx- 1].nr = idx;
res[idx- 1].mac[0] = mac_addr.mU.mAddr[0];
res[idx- 1].mac[1] = mac_addr.mU.mAddr[1];
res[idx- 1].mac[2] = mac_addr.mU.mAddr[2];
res[idx- 1].mac[3] = mac_addr.mU.mAddr[3];
res[idx- 1].mac[4] = mac_addr.mU.mAddr[4];
res[idx- 1].mac[5] = mac_addr.mU.mAddr[5];
if(res_idx == ENET_SOK) {
res[idx- 1].res = true;
++mac_addr_cnt;
} else{
res[idx - 1].res = false;
++loop_cnt;
}
}
In the example above, first 2030 MAC addresses ( [0x01, 0x22, 0x22, 0x00, 0x01, 0x11] - [0x01, 0x22, 0x22, 0x07, 0xEE, 0x11] ) are successfully added.
MAC address no. 2031 [0x01, 0x22, 0x22, 0x07, 0xEF, 0x11] is rejected.
After that, 16 MAC addresses ( [0x01, 0x22, 0x22, 0x07, 0xF0, 0x11] - [0x01, 0x22, 0x22, 0x07, 0xFF, 0x11] ) are successfully added.
The MAC addresses with idx = 2048 ... 2216 ( [0x01, 0x22, 0x22, 0x08, 0x00, 0x11] - [0x01, 0x22, 0x22, 0x08, 0xA8, 0x11] ) are rejected.
The MAC address with idx = 2217 [0x01, 0x22, 0x22, 0x08, 0xA9, 0x11] is successfully added.
This is also the last one.
If a rejected MAC address (e.g. [0x01, 0x22, 0x22, 0x07, 0xEF, 0x11] ) is added first, this will also work.
The program behavior does not depend on a specific MAC address itself, but on the previously added MAC addresses.