 |
» |
|
|
 |
Ask the Wizard Questions
Multicast hash algorithm
The Question is:
How exactly does the SGEC ethernet controller handle more
than 15 multicasts? DSN indicates that it uses a hash
table in "all multicast" mode to reduce the chances of a
CPU interrupt, but how is this hashing performed? Without
this knowledge it is impossible to determine which
addresses are likely to coincide in the hash table and
cause unwanted interrupts. This information would be very
useful for all current Digital ethernet controllers.
The Answer is:
Here is the code in DE422.MAR which determines the hash filter
bit for the LANCE chip:
MOVL #LAN$C_ADDR_SIZE,R1 ; Pass length of mcast address
MOVL R8,R2 ; Pass address of mcast address
BSBW LAN$CALCULATE_CRC ; >> Calc CRC-32 on supplied buffer
; >> Input R1 = Length of buffer
; >> R2 = Buffer address
; >> Output R0 = CRC generated
; >> Destroyed = R0
ROTL #6,R0,R0 ; Get high order 6 bits into low bits
BICW3 #^XFFC0,R0,6(R8) ; Get LADRF bit number
The hash filter is 64 bits long.
For the SGEC/TGEC/Tulip, the filter is 512 bits long and is taken from the
CRC of the address but from the low bits instead of the high bits:
MOVL #LAN$C_ADDR_SIZE,R1 ; Pass length of mcast address
MOVL R6,R2 ; Pass address of mcast address
BSBW LAN$CALCULATE_CRC ; >> Calc CRC-32 on supplied buffer
; >> Input R1 = Length of buffer
; >> R2 = Buffer address
; >> Output R0 = CRC generated
; >> Destroyed = R0
BICW3 #-EZ_C_HASH_BITS,- ; Store HASH bit # in table
R0,6(R8)
And for these chips there is less conflict - here is a table of common
multicast addresses and what bit they are mapped to (extracted from the
EZDRIVER source):
; Hash filter performance (* denotes conflict):
; Bit Address Bit Address
; 255 FF-FF-FF-FF-FF-FF BROADCAST 17 09-00-2B-00-00-03 LTM
; 61 CF-00-00-00-00-00 LOOPBACK 158 09-00-2B-00-00-06 Encryption
; 326 AB-00-00-01-00-00 MOP-DL 11 09-00-2B-02-01-05 RingPurge
; 287 AB-00-00-02-00-00 MOP-RC 433 09-00-2B-02-01-06 TANDU
; 296 AB-00-00-03-00-00 DNA-Routing 486 01-80-C2-00-00-00 802.1d Bridge
; 429 AB-00-00-04-00-00 DNA-EndRouting 248 01-80-C2-00-00-0x 802.1d Rsvd
; 453 09-00-2B-02-00-00 DNA-Routing 386 01-80-C2-00-00-10 802.1d Bridge
; 132 09-00-2B-02-01-00 DNA-Naming 276 01-80-C2-00-00-11 802.1e Load..
; 18 09-00-2B-02-01-01 DNA-Naming 174 01-80-C2-00-00-12 802.1e Load..
; 424 09-00-2B-02-01-02 DNA-Time 411 01-80-C2-00-00-14 ISO IS
; 58 09-00-2B-00-00-0F LAT 269 01-80-C2-00-00-15 ISO IS
; 157 09-00-2B-02-01-04 LAT 183 01-80-C2-00-00-16 ISO 10030
; 295 09-00-2B-02-01-07 LAT 33 01-80-C2-00-00-17 ISO 10030
; 317 09-00-2B-00-00-01 DSM/DTP 167 01-80-C2-00-01-00 ANSI FDDI SMT
; 412 09-00-2B-01-00-00 Bridge 195 01-80-C2-00-01-10 ANSI FDDI SMT
; 266 09-00-2B-01-00-01 Bridge-Local 111 01-80-C2-00-01-20 ANSI FDDI SMT
; 8 09-00-2B-00-00-07 NetBios 434 09-00-2B-00-00-04 ISO 9542
; 427 09-00-2B-00-00-00 MUMPS 292 09-00-2B-00-00-05 ISO 9542
; 135 09-00-2B-00-00-02 VAXELN
;
; AB-00-04-00-XX-XX CUSTOMER has 60800 of 65536 addresses which do not
; map to the same bit as another of these 37 addresses.
;
; AB-00-04-01-XX-XX CLUSTER has 60800 of 65536 addresses which do not
; map to the same bit as another of these 37 addresses.
;
; 09-00-2B-04-XX-XX LAST has 948 of 1024 addresses which do not conflict
; map to the same bit as another of these 37 addresses.
There aren't any other hash filtering schemes used
by supported LAN controllers. And FDDI controllers have larger filter
capability so they don't need hash filtering.
|