Skip to content
  • Jack Morgenstein's avatar
    514f3ddf
    IB/core: Fix mgid key handling in SA agent multicast data-base · 514f3ddf
    Jack Morgenstein authored
    
    
    Applications can request that the SM assign an MGID by passing a mcast
    member request containing MGID = 0. When the SM responds by sending
    the allocated MGID, this MGID replaces the 0-MGID in the multicast group.
    
    However, the MGID field in the group is also the key field in the IB
    core multicast code rbtree containing the multicast groups for the
    port.
    
    Since this is a key field, correct handling requires that the group
    entry be deleted from the rbtree and then re-inserted with the new
    key, so that the table structure is properly maintained.
    
    The current code does not do this correctly.  Correct operation
    requires that if the key-field gid has changed at all, it should be
    deleted and re-inserted.
    
    Note that when inserting, if the new MGID is zero (not the case here
    but the code should handle this correctly), we allow duplicate entries
    for 0-MGIDs.
    
    Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
    Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
    Acked-by: default avatarSean Hefty <sean.hefty@intel.com>
    Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    514f3ddf
    IB/core: Fix mgid key handling in SA agent multicast data-base
    Jack Morgenstein authored
    
    
    Applications can request that the SM assign an MGID by passing a mcast
    member request containing MGID = 0. When the SM responds by sending
    the allocated MGID, this MGID replaces the 0-MGID in the multicast group.
    
    However, the MGID field in the group is also the key field in the IB
    core multicast code rbtree containing the multicast groups for the
    port.
    
    Since this is a key field, correct handling requires that the group
    entry be deleted from the rbtree and then re-inserted with the new
    key, so that the table structure is properly maintained.
    
    The current code does not do this correctly.  Correct operation
    requires that if the key-field gid has changed at all, it should be
    deleted and re-inserted.
    
    Note that when inserting, if the new MGID is zero (not the case here
    but the code should handle this correctly), we allow duplicate entries
    for 0-MGIDs.
    
    Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
    Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
    Acked-by: default avatarSean Hefty <sean.hefty@intel.com>
    Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
Loading