Tool/software:
Continuing the earlier related thread...
...I see that the Linux driver provided with the current AM65x Platform SDK (09.01.00.01) now implements multicast address filtering using the FDB. However, reviewing the code in that driver has not answered (all) the questions outstanding from the previous thread.
Please would you clarify the following:
1: The driver defines (in icssg_switch_map.h) NUMBER_OF_FDB_BUCKET_ENTRIES as 4. Am I right to assume that this must match the configuration of the FDB_BUCKET_SIZE field in the ICSSG_FDB_GEN_CFG1 register, which is 4 (field value 0b10) by default? If not, how is the correct value of NUMBER_OF_FDB_BUCKET_ENTRIES chosen?
2: The driver also defines PRUETH_SWITCH_FDB_MASK as ((SIZE_OF_FDB / NUMBER_OF_FDB_BUCKET_ENTRIES) - 1) with SIZE_OF_FDB fixed to 2048. This mask selects values in the range [0..512). Is this mask required to correspond with the configuration of FDB_HASH_SIZE field in the FDB CFG1 register? By default it looks to me as though it does not, since the FDB_HASH_SIZE field is 0b100 by default, selecting a hash size of 1024 rather than 512. Is this a defect or are the two configurations unrelated?
3: From my previous thread:
Please would you also explain exactly the meaning of the following fields in the MII G RT FDB CFG1 register:
- FDB_HASH_SIZE - is this related to the number of broadside slot entries? does it have to match the mask (e.g. 0x1ff) used to convert the CRC over the multicast address and filter ID to a broadside slot index? otherwise, what does it refer to?
- FDB_BUCKET_SIZE - does this refer to the number of FDB entries which can be "attached" to the same hash value/broadside slot index? otherwise, what does it refer to?
In the case where two different combinations of multicast address and filter ID hash to the same value (broadside slot index), how does FDB manage this collision? Is the same FDB entry applied to all such combinations which hash to the same value?
4: The driver function emac_ndo_set_rx_mode_work() defined in icssg_prueth.c appears to erase all FDB entries. As far as I can see this means that changing the receive configuration of one EMAC interface will obliterate the current multicast address filter configuration for the other EMAC interface on the same ICSSG - is that correct? If so it seems to be a defect in the driver. Is the proper way to do this to read-modify-write each FDB entry to reset the FID_C2 bit corresponding to the port being initialised, while leaving the bit corresponding to the other port unchanged?
5: From my previous thread:
- In my experiments it seems that when peer ports on the same ICSSG are directly connected, inbound multicast frames are filtered differently to what happens if ports on different ICSSGs are directly connected. In particular it seems that both port 0 and port 1 bits in the FDB entry need to be set in the first case. Is that correct? Please can you explain why this is so.
Thanks in advance for your help.
Ian