This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6421: MCU+ SDK V8 / ENET: Adding multicast MAC addresses to the FDB is sometimes unsuccessful, even though the maximum number of 2048 entries has not been exceeded

Part Number: AM6421

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.

  • Hi Gerd,

    Yes, this is possible, if multiple MAC addresses get hashed to the same FDB slot.

    Elaborating further,
    ICSSG_SIZE_OF_FDB = 2048 
    ICSSG_NUM_FDB_BUCKET_ENTRIES = 4
    ICSSG_NUM_OF_SLOTS = 512

    This means there are 512 hash values (slots) and each slot can contain 4 FDB entries (buckets). Thus, max FDB entries supported is 512 * 4 = 2048.

    Thus, when a collision occurs, then upto 4 unique FDB entries can be hashed to the same hash value. If there are greater than 4 FDB entries that have the same hash value (or slot index), then there will be a replacement of last FDB entry if that entry was non-static (ageable / learnt entry). However, if the FDB entry already present is static ( in case of multicast addresses) ,as in your case, then it will not be replaced and the new entry is not added.

    You can verify this by monitoring the broadSideSlot value returned by the IcssgUtils_FdbHelper() in the Icssg_ioctlFdbAddEntry() for each of the MAC addresses. If any slot has reached a occurrence of 4, then it can no longer accommodate any further entries.
    broadSideSlot value ranges from 0-511.

    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.

    Yes that is right, this would be an expected behaviour as per the design mentioned above. 


    Thanks and Regards,
    Miriam