• Mike Marciniszyn's avatar
    IB/hfi1: Fix handling of FECN marked multicast packet · f59fb9e0
    Mike Marciniszyn authored
    The code for handling a marked UD packet unconditionally returns the
    dlid in the header of the FECN marked packet.  This is not correct
    for multicast packets where the DLID is in the multicast range.
    
    The subsequent attempt to send the CNP with the multicast lid will
    cause the chip to halt the ack send context because the source
    lid doesn't match the chip programming.   The send context will
    be halted and flush any other pending packets in the pio ring causing
    the CNP to not be sent.
    
    A part of investigating the fix, it was determined that the 16B work
    broke the FECN routine badly with inconsistent use of 16 bit and 32 bits
    types for lids and pkeys.  Since the port's source lid was correctly 32
    bits the type mixmatches need to be dealt with at the same time as
    fixing the CNP header issue.
    
    Fix these issues by:
    - Using the ports lid for as the SLID for responding to FECN marked UD
      packets
    - Insure pkey is always 16 bit in this and subordinate routines
    - Insure lids are 32 bits in this and subordinate routines
    
    Cc: <stable@vger.kernel.org> # 4.14.x
    Fixes: 88733e3b ("IB/hfi1: Add 16B UD support")
    Reviewed-by: default avatarDon Hiatt <don.hiatt@intel.com>
    Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
    Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
    Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    f59fb9e0
ud.c 29.7 KB