• Or Gerlitz's avatar
    IB/mlx4: Convert slave port before building address-handle · 031bd08d
    Or Gerlitz authored
    commit 430910b1 upstream.
    
    When multiplexling a MAD sent from VF, we should convert the port used
    by the guest to send the packet to the actual physical port which will be
    used to transmit the packet, before building the relevant address-handle (AH).
    
    This is needed under VPI for single ported VFs, since the code that builds
    the AH (mlx4_ib_query_ah()) makes decisions based on the input port. If we
    use the port number provided by the guest, it might have different protocol
    vs. the one this packat has to go from, and hence the result could be wrong.
    
    So far, the conversion was done after the AH was built and it worked for
    single ported Eth VFs which were not enabled under VPI. When adding support
    for single ported IB VFs and VPI, we hit that.
    
    Fixes: 449fc488 ('net/mlx4: Adapt code for N-Port VF')
    Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
    031bd08d
mad.c 60.4 KB