• Jack Morgenstein's avatar
    IB/mlx4: Fix QP1 P_Key processing in the Primary Physical Function (PPF) · 2c75d2cc
    Jack Morgenstein authored
    In the MAD paravirtualization code, one of the checks performed when
    forwarding QP1 (GSI) packets from wire to slave was a P_Key check: the
    P_Key received in the MAD must be present in the guest's paravirtualized
    P_Key table, and at least one of the (packet P_Key, guest P_Key) must
    be a full-membership P_Key.
    
    However, if everyone involved has only limited membership in the
    default P_Key, then packets sent by full-member remote hosts arrive at
    the PPF but are not passed on to the VFs with the current P_Key1 check.
    
    Fix this as follows:
    
    1. Don't care if P_Key received over wire is full or not. If it
       successfully passed HW checks on the real QP1, then simply pass it
       to guest regardless of whether the guest has full or limited
       membership in its P_Key table.
    
    2. If the guest (including paravirtualized master) has both full and
       limited P_Key forms in its table, preferentially pass the
       paravirtualized P_Key index of the full P_Key form in the tunnel
       header.
    
    3. In the multicast join flow (mlx4/mcg.c), use the index for the
       default P_Key (wherever it is located) in replies generated from
       within the mcg module (previously, P_Key index 0 was used in all
       cases).
    Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
    Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    2c75d2cc
mad.c 56.8 KB