• Kaike Wan's avatar
    IB/hfi1: Fix the allocation of RSM table · d0294344
    Kaike Wan authored
    The receive side mapping (RSM) on hfi1 hardware is a special
    matching mechanism to direct an incoming packet to a given
    hardware receive context. It has 4 instances of matching capabilities
    (RSM0 - RSM3) that share the same RSM table (RMT). The RMT has a total of
    256 entries, each of which points to a receive context.
    
    Currently, three instances of RSM have been used:
    1. RSM0 by QOS;
    2. RSM1 by PSM FECN;
    3. RSM2 by VNIC.
    
    Each RSM instance should reserve enough entries in RMT to function
    properly. Since both PSM and VNIC could allocate any receive context
    between dd->first_dyn_alloc_ctxt and dd->num_rcv_contexts, PSM FECN must
    reserve enough RMT entries to cover the entire receive context index
    range (dd->num_rcv_contexts - dd->first_dyn_alloc_ctxt) instead of only
    the user receive contexts allocated for PSM
    (dd->num_user_contexts). Consequently, the sizing of
    dd->num_user_contexts in set_up_context_variables is incorrect.
    
    Fixes: 2280740f ("IB/hfi1: Virtual Network Interface Controller (VNIC) HW support")
    Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
    Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
    Signed-off-by: default avatarKaike Wan <kaike.wan@intel.com>
    Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
    d0294344
chip.c 446 KB