• Jack Morgenstein's avatar
    IB/mlx4: Preparation for VFs to issue/receive SMI (QP0) requests/responses · 97982f5a
    Jack Morgenstein authored
    Currently, VFs in SRIOV VFs are denied QP0 access.  The main reason
    for this decision is security, since Subnet Management Datagrams
    (SMPs) are not restricted by network partitioning and may affect the
    physical network topology.  Moreover, even the SM may be denied access
    from portions of the network by setting management keys unknown to the
    SM.
    
    However, it is desirable to grant SMI access to certain privileged
    VFs, so that certain network management activities may be conducted
    within virtual machines instead of the hypervisor.
    
    This commit does the following:
    
    1. Create QP0 tunnel QPs for all VFs.
    
    2. Discard SMI mads sent-from/received-for non-privileged VFs in the
       hypervisor MAD multiplex/demultiplex logic.  SMI mads from/for
       privileged VFs are allowed to pass.
    
    3. MAD_IFC wrapper changes/fixes.  For non-privileged VFs, only
       host-view MAD_IFC commands are allowed, and only for SMI LID-Routed
       GET mads.  For privileged VFs, there are no restrictions.
    
    This commit does not allow privileged VFs as yet.  To determine if a VF
    is privileged, it calls function mlx4_vf_smi_enabled().  This function
    returns 0 unconditionally for now.
    
    The next two commits allow defining and activating privileged VFs.
    Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
    Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    97982f5a
cmd.c 66 KB