• Jack Morgenstein's avatar
    IB/mthca: Fix IB_QP_ACCESS_FLAGS handling. · d1646f86
    Jack Morgenstein authored
    This patch corrects some corner cases in managing the RAE/RRE bits in
    the mthca qp context.  These bits need to be zero if the user requests
    max_dest_rd_atomic of zero.  The bits need to be restored to the value
    implied by the qp access flags attribute in a previous (or the
    current) modify-qp command if the dest_rd_atomic variable is changed
    to non-zero.
    
    In the current implementation, the following scenario will not work:
    RESET-to-INIT 	set QP access flags to all disabled (zeroes)
    INIT-to-RTR     set max_dest_rd_atomic=10, AND
    		set qp_access_flags = IB_ACCESS_REMOTE_READ | IB_ACCESS_REMOTE_ATOMIC
    
    The current code will incorrectly take the access-flags value set in
    the RESET-to-INIT transition.
    
    We can simplify, and correct, this IB_QP_ACCESS_FLAGS handling: it is
    always safe to set qp access flags in the firmware command if either
    of IB_QP_MAX_DEST_RD_ATOMIC or IB_QP_ACCESS_FLAGS is set, so let's
    just set it to the correct value, always.
    Signed-off-by: default avatarJack Morgenstein <jackm@mellanox.co.il>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@mellanox.co.il>
    Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
    d1646f86
mthca_qp.c 59.4 KB