• Brett Creeley's avatar
    ionic: Query FW when getting VF info via ndo_get_vf_config · f16f5be3
    Brett Creeley authored
    Currently when an administrator configures a VF via ndo_set_vf*,
    the driver will send the set command to FW and then update the
    cached value.  The cached value is then used when reporting
    VF info via ndo_get_vf_config.
    
    A problem is that the VF info may have been updated between
    the last ndo_set_vf* and ndo_get_vf_info commands via some
    other method, i.e. a VF changes its MAC address (assuming it's
    allowed to do so) and since this is all managed by the FW,
    this new value won't be reflected in the PF's cache of values.
    
    To fix this, update the driver to always get the latest VF
    information by making use of the IONIC_CMD_VF_GETATTR dev
    command. The FW may not support getting all the attributes for
    IONIC_CMD_VF_GETATTR, so the driver will only update the cached
    VF config members if their associated IONIC_CMD_VF_GETATTR
    was successful. Otherwise the cached VF config members will
    remain the same as what was set in ndo_set_vf*.
    
    Fixes: fbb39807 ("ionic: support sr-iov operations")
    Signed-off-by: default avatarBrett Creeley <brett@pensando.io>
    Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f16f5be3
ionic_main.c 17.2 KB